SlideShare a Scribd company logo
Batch Data
Communication
• BDC’s are interface are used to upload the data from legacy system
to SAP System.
• 2 Methods.
1. Call Transaction method.
2. Session method.
• Steps :
1. Get the flat file from the customer. Flat file might be excel or text
file.
2. Get a sample recording with the help of SHDB .
3. Create a program with the help of recording.
4. Create a structure according to flat file fields.
5. Upload the flat file data into internal table using GUI_UPLOAD.
6. Loop at internal table to work area to create to repeat the
operation.
• Sample record using SHDB.
• Click on new recording .
• Enter recoding name ex: zmaterial.
• Transaction code . Ex : MM01.
• Update mode .
• And click on start recording.
Call Transaction Method
TYPES : BEGIN OF T_MARA,
MATNR(18) TYPE C ,
MBRSH TYPE C,
MTART(4) TYPE C,
MAKTX(40) TYPE C,
MEINS(2) TYPE C,
END OF T_MARA.
DATA : IT_MARA TYPE TABLE OF T_MARA,
WA_MARA TYPE T_MARA.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
* messages of call transaction
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
*include bdcrecx1.
PARAMETERS : FILE(120) TYPE C.
• AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
PERFORM SEARCH_FILE.
start-of-selection.
PERFORM UPLOAD_DATA.
PERFORM BDC_DATA.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
* IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
* ENDIF.
ENDFORM.
• form SEARCH_FILE .
DATA : FILE_NAME TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SY-REPID
DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = FILE_NAME.
.
FILE = FILE_NAME.
endform. " SEARCH_FILE
• form UPLOAD_DATA .
DATA : FILENAME TYPE STRING.
FILENAME = FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = IT_MARA[]
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
endform. " UPLOAD_DATA
• form BDC_DATA .
* perform open_group.
LOOP AT IT_MARA INTO WA_MARA.
REFRESH BDCDATA[].
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MTART'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
WA_MARA-MATNR.
perform bdc_field using 'RMMG1-MBRSH'
WA_MARA-MBRSH.
perform bdc_field using 'RMMG1-MTART'
WA_MARA-MTART.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
WA_MARA-MAKTX.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
WA_MARA-MEINS.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*perform bdc_transaction using 'MM01'.
*
*perform close_group.
• CALL TRANSACTION 'MM01' USING BDCDATA[] UPDATE 'S'
MODE 'A'
MESSAGES INTO MESSTAB.
PERFORM PRINT_MESSAGE.
ENDLOOP.
endform. " BDC_DATA
• form PRINT_MESSAGE .
DATA : MES(120) TYPE C.
LOOP AT MESSTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = MESSTAB-MSGID
LANG = SY-LANGU
NO = MESSTAB-MSGNR
V1 = MESSTAB-MSGV1
V2 = MESSTAB-MSGV2
V3 = MESSTAB-MSGV3
V4 = MESSTAB-MSGV4
IMPORTING
MSG = MES
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
WRITE : / MES.
ENDLOOP.
REFRESH MESSTAB.
endform. " PRINT_MESSAGE
Session Method
•
TYPES : BEGIN OF T_MARA,
MATNR(18) TYPE C,
MBRSH TYPE C,
MTART(4) TYPE C,
MAKTX(40) TYPE C,
MEINS(2) TYPE C,
END OF T_MARA.
DATA : IT_MARA TYPE TABLE OF T_MARA,
WA_MARA TYPE T_MARA.
PARAMETERS: FILE(120) TYPE C.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
PERFORM SEARCH_FILE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
PERFORM SEARCH_FILE.
form SEARCH_FILE .
DATA : FILE_NAME TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SY-REPID
DYNPRO_NUMBER = '1000'
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = FILE_NAME
.
FILE = FILE_NAME.
endform. " SEARCH_FILE
start-of-selection.
PERFORM UPLOAD_DATA.
form UPLOAD_DATA .
DATA : FILENAME TYPE STRING.
FILENAME = FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = IT_MARA[]
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
endform. " UPLOAD_DATA
• CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
* DEST = FILLER8
GROUP = 'MAT'
* HOLDDATE = SY-datum
KEEP = 'X'
USER = SY-UNAME
* RECORD = FILLER1
* PROG = SY-CPROG
* DCPFM = '%'
* DATFM = '%'
* IMPORTING
* QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
LOOP AT IT_MARA INTO WA_MARA.
CLEAR BDCDATA[].
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MTART'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
WA_MARA-MATNR.
perform bdc_field using 'RMMG1-MBRSH'
WA_MARA-MBRSH.
perform bdc_field using 'RMMG1-MTART'
WA_MARA-MTART.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
WA_MARA-MAKTX.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
WA_MARA-MEINS.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*perform bdc_transaction using 'MM01'.
*
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MM01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
dynprotab = BDCDATA[]
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDLOOP.
• CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
• FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
* IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
* ENDIF.
ENDFORM.
• ------------------------------------------------------------------------------
• Go to Transaction ‘SM35’ and click on process.
LSMW
• Legacy System migration workbench.
• Use to upload the data from legacy system to SAP system.
• Steps :
1. Transaction code ‘LSMW’.
2. Enter Project name , Subproject name and object name.
3. Click on create.
4. Enter the description for project , Subproject and object .
5. Click on Execute.
• Maintain Object Attributes :
1. Get the recording .
2. Go to -> recording overview -> create.
3. Enter recording name and short description.
4. Enter the Transaction code ex : ‘XD01’.
5. Create the recording.
• Click on default all , value entered fields in XDO1 transaction
are automatically appears.
• Save and click on back.
• Click on Batch Input Recording.
1. Check f4 help for recording. Recording name automatically
pull’s up.
• Click on back button.
• Save and click on back button.
Maintain source structure .
1. Create a structure according to flat file.
• Click on execute.
• Click on change and create.
• Enter structure name and short description.
• Click on Save.
Maintain Source fields .
1. To define the fields in the structure.
 Click on execute.
 Click on Edit and change.
 Click on structure name and click table maintenance.
 Enter the field name , type , length and description.
• Save and click on back button.
Maintain Structure Relation.
• Click on execute .
• Click on display change and save.
• Suppose If a project having different flat files, then structure
of different flat files we need to define here.
Maintain Field Mapping and conversion Rules .
1. To map the flat file fields with SAP fields.
• Click on execute.
• Click on change display.
• Click on SAP structure filed.
• Click on Source and map the fields SAP fields with Source
fields.
Fixed Values, Translations, User Defined Routines :
 We Can define some fixed values and translation rules in this
step.
Specify Files : To mention flat file location.
• Enter flat file location and give name.
• Delimiter : Select as per flat file.
• And check field names at start of file.
• Save and click on back button.
Assign Files :
 Execute .
 Change and save.
Read Data :
 Execute.
 Actual data uploaded from flat file into SAP LSMW.
Display Read Data .
 Display’s read data from flat file.
Convert Data :
1. Converts flat file data into SAP screen related data.
 Execute.
Display Converted Data :
 Its shows which transaction we are using .
Create Batch Input Session :
 Execute.
 Check Keep batch input folders?
 Execute.
Run Batch Input Session.
 Execute.
 SM35 transaction screen will appear .
 Select object name and click on process.
SAP Batch data communication

More Related Content

What's hot

SAP Smart forms
SAP Smart formsSAP Smart forms
SAP Smart forms
Jugul Crasta
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniques
Jugul Crasta
 
Reports
ReportsReports
Reports
Jugul Crasta
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
sapdocs. info
 
SAP-ABAP/4@e_max
SAP-ABAP/4@e_maxSAP-ABAP/4@e_max
SAP-ABAP/4@e_max
Bhuvnesh Gupta
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exitsKranthi Kumar
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
Pradipta Mohanty
 
Create schedule monitor batch jobs with dynamic selection
Create schedule monitor batch jobs with dynamic selectionCreate schedule monitor batch jobs with dynamic selection
Create schedule monitor batch jobs with dynamic selection
Ranjan Amit
 
Abap Questions
Abap QuestionsAbap Questions
Abap Questions
Kaustav Pyne
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part II
Ashish Saxena
 
Badis
Badis Badis
Badis
Rajesh Kumar
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
Noman Mohamed Hanif
 
User exits
User exitsUser exits
User exits
anilkv29
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
Ankit Sharma
 
0106 debugging
0106 debugging0106 debugging
0106 debuggingvkyecc1
 
Internal tables
Internal tables Internal tables
Internal tables
Jibu Jose
 
Chapter 02 sap script forms
Chapter 02 sap script formsChapter 02 sap script forms
Chapter 02 sap script formsKranthi Kumar
 
Top 35-interview-questions-on-sap-abap
Top 35-interview-questions-on-sap-abapTop 35-interview-questions-on-sap-abap
Top 35-interview-questions-on-sap-abap
prathamesh4865
 

What's hot (20)

SAP Smart forms
SAP Smart formsSAP Smart forms
SAP Smart forms
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniques
 
Reports
ReportsReports
Reports
 
Abap reports
Abap reportsAbap reports
Abap reports
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
 
SAP-ABAP/4@e_max
SAP-ABAP/4@e_maxSAP-ABAP/4@e_max
SAP-ABAP/4@e_max
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
 
Create schedule monitor batch jobs with dynamic selection
Create schedule monitor batch jobs with dynamic selectionCreate schedule monitor batch jobs with dynamic selection
Create schedule monitor batch jobs with dynamic selection
 
Alv theory
Alv theoryAlv theory
Alv theory
 
Abap Questions
Abap QuestionsAbap Questions
Abap Questions
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part II
 
Badis
Badis Badis
Badis
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
User exits
User exitsUser exits
User exits
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
 
0106 debugging
0106 debugging0106 debugging
0106 debugging
 
Internal tables
Internal tables Internal tables
Internal tables
 
Chapter 02 sap script forms
Chapter 02 sap script formsChapter 02 sap script forms
Chapter 02 sap script forms
 
Top 35-interview-questions-on-sap-abap
Top 35-interview-questions-on-sap-abapTop 35-interview-questions-on-sap-abap
Top 35-interview-questions-on-sap-abap
 

Viewers also liked

Arm modes
Arm modesArm modes
Arm modes
abhi165
 
Call transaction method
Call transaction methodCall transaction method
Call transaction methodKranthi Kumar
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
Hitesh Gulani
 
SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0
Argos
 
SAP HR Time Management User Guide | www.sapdocs.info
SAP HR Time Management User Guide | www.sapdocs.infoSAP HR Time Management User Guide | www.sapdocs.info
SAP HR Time Management User Guide | www.sapdocs.info
sapdocs. info
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
Uttam Agrawal
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsSAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
Garuda Trainings
 
MAHESH SAP FI NOTES
MAHESH SAP FI NOTESMAHESH SAP FI NOTES
MAHESH SAP FI NOTESgarry1890
 

Viewers also liked (8)

Arm modes
Arm modesArm modes
Arm modes
 
Call transaction method
Call transaction methodCall transaction method
Call transaction method
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
 
SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0
 
SAP HR Time Management User Guide | www.sapdocs.info
SAP HR Time Management User Guide | www.sapdocs.infoSAP HR Time Management User Guide | www.sapdocs.info
SAP HR Time Management User Guide | www.sapdocs.info
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsSAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
 
MAHESH SAP FI NOTES
MAHESH SAP FI NOTESMAHESH SAP FI NOTES
MAHESH SAP FI NOTES
 

Similar to SAP Batch data communication

3 modularisation and bdc
3 modularisation and bdc3 modularisation and bdc
3 modularisation and bdc
Siva Kumar
 
As400 session or device error
As400   session or device errorAs400   session or device error
As400 session or device error
aminem_mp
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
sapdocs. info
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012
Connor McDonald
 
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
GangSeok Lee
 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
ssuser28de9e
 
EBS R12 Concurrent program tracing
EBS R12 Concurrent program tracingEBS R12 Concurrent program tracing
EBS R12 Concurrent program tracing
Sachin Srivastava
 
Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?
Precisely
 
Library Project
Library ProjectLibrary Project
Library Project
Holly Sanders
 
Call session Method of BDC
Call session Method of BDCCall session Method of BDC
Call session Method of BDC
Ravi Kanudawala
 
Message, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type GroupMessage, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type Group
sapdocs. info
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
ssuserb4d806
 
Capturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLCapturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLPadraig O'Sullivan
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLRonald Bradford
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command line
Cyrille Coeurjoly
 

Similar to SAP Batch data communication (20)

Stored procedure
Stored procedureStored procedure
Stored procedure
 
Batch input session
Batch input sessionBatch input session
Batch input session
 
3 modularisation and bdc
3 modularisation and bdc3 modularisation and bdc
3 modularisation and bdc
 
As400 session or device error
As400   session or device errorAs400   session or device error
As400 session or device error
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012
 
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
 
Pl sql using_xml
Pl sql using_xmlPl sql using_xml
Pl sql using_xml
 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
 
EBS R12 Concurrent program tracing
EBS R12 Concurrent program tracingEBS R12 Concurrent program tracing
EBS R12 Concurrent program tracing
 
Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?
 
Library Project
Library ProjectLibrary Project
Library Project
 
Call session Method of BDC
Call session Method of BDCCall session Method of BDC
Call session Method of BDC
 
lecture56.ppt
lecture56.pptlecture56.ppt
lecture56.ppt
 
Message, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type GroupMessage, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type Group
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Capturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLCapturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQL
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQL
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command line
 
CGI.ppt
CGI.pptCGI.ppt
CGI.ppt
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 

SAP Batch data communication

  • 2. • BDC’s are interface are used to upload the data from legacy system to SAP System. • 2 Methods. 1. Call Transaction method. 2. Session method. • Steps : 1. Get the flat file from the customer. Flat file might be excel or text file. 2. Get a sample recording with the help of SHDB . 3. Create a program with the help of recording. 4. Create a structure according to flat file fields. 5. Upload the flat file data into internal table using GUI_UPLOAD. 6. Loop at internal table to work area to create to repeat the operation.
  • 3. • Sample record using SHDB.
  • 4. • Click on new recording . • Enter recoding name ex: zmaterial. • Transaction code . Ex : MM01. • Update mode . • And click on start recording.
  • 5.
  • 6.
  • 7. Call Transaction Method TYPES : BEGIN OF T_MARA, MATNR(18) TYPE C , MBRSH TYPE C, MTART(4) TYPE C, MAKTX(40) TYPE C, MEINS(2) TYPE C, END OF T_MARA. DATA : IT_MARA TYPE TABLE OF T_MARA, WA_MARA TYPE T_MARA. DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE. * messages of call transaction DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE. *include bdcrecx1. PARAMETERS : FILE(120) TYPE C.
  • 8. • AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE. PERFORM SEARCH_FILE. start-of-selection. PERFORM UPLOAD_DATA. PERFORM BDC_DATA. FORM BDC_DYNPRO USING PROGRAM DYNPRO. CLEAR BDCDATA. BDCDATA-PROGRAM = PROGRAM. BDCDATA-DYNPRO = DYNPRO. BDCDATA-DYNBEGIN = 'X'. APPEND BDCDATA. ENDFORM. *----------------------------------------------------------------------* * Insert field * *----------------------------------------------------------------------* FORM BDC_FIELD USING FNAM FVAL. * IF FVAL <> NODATA. CLEAR BDCDATA. BDCDATA-FNAM = FNAM. BDCDATA-FVAL = FVAL. APPEND BDCDATA. * ENDIF. ENDFORM.
  • 9. • form SEARCH_FILE . DATA : FILE_NAME TYPE IBIPPARMS-PATH. CALL FUNCTION 'F4_FILENAME' EXPORTING PROGRAM_NAME = SY-REPID DYNPRO_NUMBER = SYST-DYNNR * FIELD_NAME = ' ' IMPORTING FILE_NAME = FILE_NAME. . FILE = FILE_NAME. endform. " SEARCH_FILE
  • 10. • form UPLOAD_DATA . DATA : FILENAME TYPE STRING. FILENAME = FILE. CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename = FILENAME FILETYPE = 'ASC' HAS_FIELD_SEPARATOR = 'X' * HEADER_LENGTH = 0 * READ_BY_LINE = 'X' * DAT_MODE = ' ' * CODEPAGE = ' ' * IGNORE_CERR = ABAP_TRUE * REPLACEMENT = '#' * CHECK_BOM = ' ' * VIRUS_SCAN_PROFILE = * NO_AUTH_CHECK = ' ' * IMPORTING * FILELENGTH = * HEADER = tables data_tab = IT_MARA[] EXCEPTIONS FILE_OPEN_ERROR = 1 FILE_READ_ERROR = 2 NO_BATCH = 3 GUI_REFUSE_FILETRANSFER = 4 INVALID_TYPE = 5 NO_AUTHORITY = 6 UNKNOWN_ERROR = 7 BAD_DATA_FORMAT = 8 HEADER_NOT_ALLOWED = 9 SEPARATOR_NOT_ALLOWED = 10 HEADER_TOO_LONG = 11 UNKNOWN_DP_ERROR = 12 ACCESS_DENIED = 13 DP_OUT_OF_MEMORY = 14 DISK_FULL = 15 DP_TIMEOUT = 16 OTHERS = 17 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. endform. " UPLOAD_DATA
  • 11. • form BDC_DATA . * perform open_group. LOOP AT IT_MARA INTO WA_MARA. REFRESH BDCDATA[]. perform bdc_dynpro using 'SAPLMGMM' '0060'. perform bdc_field using 'BDC_CURSOR' 'RMMG1-MTART'. perform bdc_field using 'BDC_OKCODE' '=ENTR'. perform bdc_field using 'RMMG1-MATNR' WA_MARA-MATNR. perform bdc_field using 'RMMG1-MBRSH' WA_MARA-MBRSH. perform bdc_field using 'RMMG1-MTART' WA_MARA-MTART. perform bdc_dynpro using 'SAPLMGMM' '0070'. perform bdc_field using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'. perform bdc_field using 'BDC_OKCODE' '=ENTR'. perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'. perform bdc_dynpro using 'SAPLMGMM' '4004'. perform bdc_field using 'BDC_OKCODE' '/00'. perform bdc_field using 'MAKT-MAKTX' WA_MARA-MAKTX. perform bdc_field using 'BDC_CURSOR' 'MARA-MEINS'. perform bdc_field using 'MARA-MEINS' WA_MARA-MEINS. perform bdc_field using 'MARA-MTPOS_MARA' 'NORM'. perform bdc_dynpro using 'SAPLSPO1' '0300'. perform bdc_field using 'BDC_OKCODE' '=YES'. *perform bdc_transaction using 'MM01'. * *perform close_group.
  • 12. • CALL TRANSACTION 'MM01' USING BDCDATA[] UPDATE 'S' MODE 'A' MESSAGES INTO MESSTAB. PERFORM PRINT_MESSAGE. ENDLOOP. endform. " BDC_DATA
  • 13. • form PRINT_MESSAGE . DATA : MES(120) TYPE C. LOOP AT MESSTAB. CALL FUNCTION 'FORMAT_MESSAGE' EXPORTING ID = MESSTAB-MSGID LANG = SY-LANGU NO = MESSTAB-MSGNR V1 = MESSTAB-MSGV1 V2 = MESSTAB-MSGV2 V3 = MESSTAB-MSGV3 V4 = MESSTAB-MSGV4 IMPORTING MSG = MES EXCEPTIONS NOT_FOUND = 1 OTHERS = 2 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. WRITE : / MES. ENDLOOP. REFRESH MESSTAB. endform. " PRINT_MESSAGE
  • 14. Session Method • TYPES : BEGIN OF T_MARA, MATNR(18) TYPE C, MBRSH TYPE C, MTART(4) TYPE C, MAKTX(40) TYPE C, MEINS(2) TYPE C, END OF T_MARA. DATA : IT_MARA TYPE TABLE OF T_MARA, WA_MARA TYPE T_MARA. PARAMETERS: FILE(120) TYPE C. DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE. AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE. PERFORM SEARCH_FILE
  • 15. AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE. PERFORM SEARCH_FILE. form SEARCH_FILE . DATA : FILE_NAME TYPE IBIPPARMS-PATH. CALL FUNCTION 'F4_FILENAME' EXPORTING PROGRAM_NAME = SY-REPID DYNPRO_NUMBER = '1000' * FIELD_NAME = ' ' IMPORTING FILE_NAME = FILE_NAME . FILE = FILE_NAME. endform. " SEARCH_FILE
  • 16. start-of-selection. PERFORM UPLOAD_DATA. form UPLOAD_DATA . DATA : FILENAME TYPE STRING. FILENAME = FILE. CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename = FILENAME FILETYPE = 'ASC' HAS_FIELD_SEPARATOR = 'X' * HEADER_LENGTH = 0 * READ_BY_LINE = 'X' * DAT_MODE = ' ' * CODEPAGE = ' ' * IGNORE_CERR = ABAP_TRUE * REPLACEMENT = '#' * CHECK_BOM = ' ' * VIRUS_SCAN_PROFILE = * NO_AUTH_CHECK = ' ' * IMPORTING * FILELENGTH = * HEADER = tables data_tab = IT_MARA[] EXCEPTIONS FILE_OPEN_ERROR = 1 FILE_READ_ERROR = 2 NO_BATCH = 3 GUI_REFUSE_FILETRANSFER = 4 INVALID_TYPE = 5 NO_AUTHORITY = 6 UNKNOWN_ERROR = 7 BAD_DATA_FORMAT = 8 HEADER_NOT_ALLOWED = 9 SEPARATOR_NOT_ALLOWED = 10 HEADER_TOO_LONG = 11 UNKNOWN_DP_ERROR = 12 ACCESS_DENIED = 13 DP_OUT_OF_MEMORY = 14 DISK_FULL = 15 DP_TIMEOUT = 16 OTHERS = 17 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. endform. " UPLOAD_DATA
  • 17. • CALL FUNCTION 'BDC_OPEN_GROUP' EXPORTING CLIENT = SY-MANDT * DEST = FILLER8 GROUP = 'MAT' * HOLDDATE = SY-datum KEEP = 'X' USER = SY-UNAME * RECORD = FILLER1 * PROG = SY-CPROG * DCPFM = '%' * DATFM = '%' * IMPORTING * QID = EXCEPTIONS CLIENT_INVALID = 1 DESTINATION_INVALID = 2 GROUP_INVALID = 3 GROUP_IS_LOCKED = 4 HOLDDATE_INVALID = 5 INTERNAL_ERROR = 6 QUEUE_ERROR = 7 RUNNING = 8 SYSTEM_LOCK_ERROR = 9 USER_INVALID = 10 OTHERS = 11 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF.
  • 18. LOOP AT IT_MARA INTO WA_MARA. CLEAR BDCDATA[]. perform bdc_dynpro using 'SAPLMGMM' '0060'. perform bdc_field using 'BDC_CURSOR' 'RMMG1-MTART'. perform bdc_field using 'BDC_OKCODE' '=ENTR'. perform bdc_field using 'RMMG1-MATNR' WA_MARA-MATNR. perform bdc_field using 'RMMG1-MBRSH' WA_MARA-MBRSH. perform bdc_field using 'RMMG1-MTART' WA_MARA-MTART. perform bdc_dynpro using 'SAPLMGMM' '0070'. perform bdc_field using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'. perform bdc_field using 'BDC_OKCODE' '=ENTR'. perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'. perform bdc_dynpro using 'SAPLMGMM' '4004'. perform bdc_field using 'BDC_OKCODE' '/00'. perform bdc_field using 'MAKT-MAKTX' WA_MARA-MAKTX. perform bdc_field using 'BDC_CURSOR' 'MARA-MEINS'. perform bdc_field using 'MARA-MEINS' WA_MARA-MEINS. perform bdc_field using 'MARA-MTPOS_MARA' 'NORM'. perform bdc_dynpro using 'SAPLSPO1' '0300'. perform bdc_field using 'BDC_OKCODE' '=YES'. *perform bdc_transaction using 'MM01'. *
  • 19. CALL FUNCTION 'BDC_INSERT' EXPORTING TCODE = 'MM01' * POST_LOCAL = NOVBLOCAL * PRINTING = NOPRINT * SIMUBATCH = ' ' * CTUPARAMS = ' ' TABLES dynprotab = BDCDATA[] EXCEPTIONS INTERNAL_ERROR = 1 NOT_OPEN = 2 QUEUE_ERROR = 3 TCODE_INVALID = 4 PRINTING_INVALID = 5 POSTING_INVALID = 6 OTHERS = 7 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. ENDLOOP.
  • 20. • CALL FUNCTION 'BDC_CLOSE_GROUP' EXCEPTIONS NOT_OPEN = 1 QUEUE_ERROR = 2 OTHERS = 3 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF.
  • 21. • FORM BDC_DYNPRO USING PROGRAM DYNPRO. CLEAR BDCDATA. BDCDATA-PROGRAM = PROGRAM. BDCDATA-DYNPRO = DYNPRO. BDCDATA-DYNBEGIN = 'X'. APPEND BDCDATA. ENDFORM. *----------------------------------------------------------------------* * Insert field * *----------------------------------------------------------------------* FORM BDC_FIELD USING FNAM FVAL. * IF FVAL <> NODATA. CLEAR BDCDATA. BDCDATA-FNAM = FNAM. BDCDATA-FVAL = FVAL. APPEND BDCDATA. * ENDIF. ENDFORM. • ------------------------------------------------------------------------------ • Go to Transaction ‘SM35’ and click on process.
  • 22. LSMW • Legacy System migration workbench. • Use to upload the data from legacy system to SAP system. • Steps : 1. Transaction code ‘LSMW’. 2. Enter Project name , Subproject name and object name. 3. Click on create. 4. Enter the description for project , Subproject and object . 5. Click on Execute.
  • 23.
  • 24. • Maintain Object Attributes : 1. Get the recording . 2. Go to -> recording overview -> create. 3. Enter recording name and short description. 4. Enter the Transaction code ex : ‘XD01’. 5. Create the recording.
  • 25.
  • 26. • Click on default all , value entered fields in XDO1 transaction are automatically appears. • Save and click on back. • Click on Batch Input Recording. 1. Check f4 help for recording. Recording name automatically pull’s up. • Click on back button. • Save and click on back button.
  • 27. Maintain source structure . 1. Create a structure according to flat file. • Click on execute. • Click on change and create. • Enter structure name and short description. • Click on Save. Maintain Source fields . 1. To define the fields in the structure.  Click on execute.  Click on Edit and change.  Click on structure name and click table maintenance.  Enter the field name , type , length and description.
  • 28.
  • 29. • Save and click on back button.
  • 30. Maintain Structure Relation. • Click on execute . • Click on display change and save. • Suppose If a project having different flat files, then structure of different flat files we need to define here.
  • 31. Maintain Field Mapping and conversion Rules . 1. To map the flat file fields with SAP fields. • Click on execute. • Click on change display.
  • 32. • Click on SAP structure filed. • Click on Source and map the fields SAP fields with Source fields.
  • 33.
  • 34.
  • 35. Fixed Values, Translations, User Defined Routines :  We Can define some fixed values and translation rules in this step. Specify Files : To mention flat file location.
  • 36. • Enter flat file location and give name. • Delimiter : Select as per flat file. • And check field names at start of file. • Save and click on back button. Assign Files :  Execute .  Change and save. Read Data :  Execute.  Actual data uploaded from flat file into SAP LSMW. Display Read Data .  Display’s read data from flat file.
  • 37. Convert Data : 1. Converts flat file data into SAP screen related data.  Execute. Display Converted Data :  Its shows which transaction we are using . Create Batch Input Session :  Execute.  Check Keep batch input folders?  Execute. Run Batch Input Session.  Execute.  SM35 transaction screen will appear .  Select object name and click on process.