SlideShare a Scribd company logo
1 of 38
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

Viewers also liked

Arm modes
Arm modesArm modes
Arm modesabhi165
 
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 selectionRanjan Amit
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONHitesh 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.0Argos
 
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.infosapdocs. info
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam 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 TrainingsGaruda Trainings
 
MAHESH SAP FI NOTES
MAHESH SAP FI NOTESMAHESH SAP FI NOTES
MAHESH SAP FI NOTESgarry1890
 

Viewers also liked (10)

Arm modes
Arm modesArm modes
Arm modes
 
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
 
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 Smart forms
SAP Smart formsSAP Smart forms
SAP Smart forms
 
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
 
Module pool programming
Module pool programmingModule pool programming
Module pool programming
 
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

As400 session or device error
As400   session or device errorAs400   session or device error
As400 session or device erroraminem_mp
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statementsapdocs. 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 2012Connor 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++.pdfssuser28de9e
 
EBS R12 Concurrent program tracing
EBS R12 Concurrent program tracingEBS R12 Concurrent program tracing
EBS R12 Concurrent program tracingSachin 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
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptxssuserb4d806
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLRonald Bradford
 
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
 
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 lineCyrille Coeurjoly
 
2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...
2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...
2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...Rainer Schuettengruber
 
Networking lab
Networking labNetworking lab
Networking labRagu Ram
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docxAustinaGRPaigey
 
The Ring programming language version 1.5.3 book - Part 19 of 194
The Ring programming language version 1.5.3 book - Part 19 of 194The Ring programming language version 1.5.3 book - Part 19 of 194
The Ring programming language version 1.5.3 book - Part 19 of 194Mahmoud Samir Fayed
 

Similar to SAP Batch data communication (20)

Stored procedure
Stored procedureStored procedure
Stored procedure
 
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
 
lecture56.ppt
lecture56.pptlecture56.ppt
lecture56.ppt
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQL
 
Capturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLCapturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQL
 
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
 
2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...
2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...
2018 db-rainer schuettengruber-beating-oracles_optimizer_at_its_own_game-pres...
 
Networking lab
Networking labNetworking lab
Networking lab
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
 
The Ring programming language version 1.5.3 book - Part 19 of 194
The Ring programming language version 1.5.3 book - Part 19 of 194The Ring programming language version 1.5.3 book - Part 19 of 194
The Ring programming language version 1.5.3 book - Part 19 of 194
 

More from Jugul Crasta

More from Jugul Crasta (6)

SAP Adobe forms
SAP Adobe formsSAP Adobe forms
SAP Adobe forms
 
SAP ALE Idoc
SAP ALE IdocSAP ALE Idoc
SAP ALE Idoc
 
Reports
ReportsReports
Reports
 
Sap abap
Sap abapSap abap
Sap abap
 
Sap architecture
Sap architectureSap architecture
Sap architecture
 
Sap erp introduction
Sap erp introductionSap erp introduction
Sap erp introduction
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 

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.