<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: give a simple BDC example for CALL TRANSACTION METHOD.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954058#M696751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the common method you can find eample code in the below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;the BDC program should be in this format&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transaction Recorder (SHDB) &lt;/P&gt;&lt;P&gt;How to Upload Presentation Server Flat file to SAP R/3 system???&lt;/P&gt;&lt;P&gt;How to upload application server file to R/3 system?&lt;/P&gt;&lt;P&gt;Definition&lt;/P&gt;&lt;P&gt;Example - Call Transaction Method &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Transaction Recorder (SHDB)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before you work with the Batch Input methods, you should know the purpose of the tool&lt;/P&gt;&lt;P&gt;Transaction Recorder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use:&lt;/P&gt;&lt;P&gt;You can use the transaction recorder to record a series of transactions and their screens.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Features&amp;lt;/b&amp;gt;:&lt;/P&gt;&lt;P&gt;You can use the recording to create&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data transfer programs that use batch input or CALL TRANSACTION &lt;/P&gt;&lt;P&gt;Batch input sessions &lt;/P&gt;&lt;P&gt;Test data &lt;/P&gt;&lt;P&gt;Function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: It doesn&amp;#146;t record F1, F4 and Scrollbar movements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Upload Flat file from Presentation Server to SAP R/3&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CODEPAGE = &amp;#145;IBM'&lt;/P&gt;&lt;P&gt;FILENAME = P_UFILE&lt;/P&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = INT_TAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR = 2&lt;/P&gt;&lt;P&gt;FILE_READ_ERROR = 3&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 4&lt;/P&gt;&lt;P&gt;NO_BATCH = 5&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 6&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 7&lt;/P&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;P&gt;CUSTOMER_ERROR = 9&lt;/P&gt;&lt;P&gt;OTHERS = 10 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;MESSAGE E999(FR) WITH 'ERROR IN FILE UPLOAD'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Upload file from application server to SAP R/3&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open the the application server file &lt;/P&gt;&lt;P&gt;OPEN DATASET &amp;lt;dsn&amp;gt; FOR INPUT &amp;lt;mode&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the data from application server file&lt;/P&gt;&lt;P&gt;READ DATASET &amp;lt;dsn&amp;gt; INTO &amp;lt;wa&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then close the application server file&lt;/P&gt;&lt;P&gt;CLOSE DATASET &amp;lt;dsn&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Definition- Declaring BDC Table&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BDC_TAB LIKE STANDARD TABLE OF &lt;/P&gt;&lt;P&gt;BDCDATA INITIAL SIZE 6 &lt;/P&gt;&lt;P&gt;WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table used to collect the transaction&amp;#146;s information must be declared &amp;#147;LIKE BDCDATA&amp;#148;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Filling BDC Table &amp;#150; Method #1&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-PROGRAM = &amp;#145;SAPMF02K&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNPRO = &amp;#145;01016&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;RF02K-LIFNR&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;TEST1&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;RF02K-D0010&amp;#146;. &lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-PROGRAM = &amp;#145;SAPMF02K&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNPRO = &amp;#145;0110&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;LFA1-STRAS&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;123 Main St.&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;BDC_OKCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;/11&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Filling BDC Table &amp;#150; Method #2&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM POPULATE_BDC_TAB&lt;/P&gt;&lt;P&gt;USING:&lt;/P&gt;&lt;P&gt;&amp;#145;1&amp;#146; &amp;#145;SAPMF02K&amp;#146; &amp;#145;0106&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;RF02K-LIFNR&amp;#146; &amp;#145;TEST1&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;RF02K-D0010&amp;#146; &amp;#145;X&amp;#146;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#145;1&amp;#146; &amp;#145;SAPMF02K&amp;#146; &amp;#145;0110&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;LFA1-STRAS&amp;#146;, &amp;#145;123 Main St.&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;BDC_OKCODE&amp;#146;, &amp;#145;/11&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;IF FLAG = &amp;#145;1&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-PROGRAM = VAR1.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNPRO = VAR2..&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = VAR1.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = VAR2.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This two subroutine method to fill the BDC table is preferable because the &amp;#147;POPULATE_BDC_TABLE&amp;#148; subroutine is reusable throughout all batch input programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example #1 - Change Vendor (Call Transaction Method)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example #1- Declaration Section&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Y180DM10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BDC_TAB LIKE STANDARD TABLE OF&lt;/P&gt;&lt;P&gt;BDCDATA INITIAL SIZE 6 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;INFILE(20) VALUE &amp;#145;/tmp/bc180_file4&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF INREC.&lt;/P&gt;&lt;P&gt;VENDNUM LIKE LFA1-LIFNR.&lt;/P&gt;&lt;P&gt;STREET LIKE LFA1-STRAS.&lt;/P&gt;&lt;P&gt;END OF INREC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: DISPMODE DEFAULT &amp;#145;A&amp;#146;,&lt;/P&gt;&lt;P&gt;UPDAMODE DEFAULT &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;OPEN DATASET INFILE&lt;/P&gt;&lt;P&gt;FOR INPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;READ DATASET INFILE INTO INREC.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;PERFORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146;&lt;/P&gt;&lt;P&gt;USING BDC_TAB&lt;/P&gt;&lt;P&gt;MODE DISPMODE&lt;/P&gt;&lt;P&gt;UPDATE UPDAMODE.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0.&lt;/P&gt;&lt;P&gt;WRITE: /&amp;#145;ERROR&amp;#146;. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;CLOSE DATASET INFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;synchronous updating&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;&amp;#133;&amp;#133;&amp;#133;&lt;/P&gt;&lt;P&gt;PERFORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146;&lt;/P&gt;&lt;P&gt;USING BDC_TAB&lt;/P&gt;&lt;P&gt;MODE &amp;#145;N&amp;#146;&lt;/P&gt;&lt;P&gt;UPDATE &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0.&lt;/P&gt;&lt;P&gt;WRITE: /&amp;#145;ERROR&amp;#146;. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With synchronous updating, we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;asynchronous updating&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;&amp;#133;&amp;#133;&amp;#133;&lt;/P&gt;&lt;P&gt;PERFORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146;&lt;/P&gt;&lt;P&gt;USING BDC_TAB&lt;/P&gt;&lt;P&gt;MODE &amp;#145;N&amp;#146;&lt;/P&gt;&lt;P&gt;UPDATE &amp;#145;A&amp;#146;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0.&lt;/P&gt;&lt;P&gt;WRITE: /&amp;#145;ERROR&amp;#146;. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With asynchronous updating, we can check SY-SUBRC to determine the success of the transaction only, not the actual update to the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Error Handling&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Write an error report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Send the record(s) in error to an error file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a batch input session with the record(s) in error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To store error messages ( CALL TRANSACTION )&lt;/P&gt;&lt;P&gt;data: begin of Tab_Mess occurs 0.&lt;/P&gt;&lt;P&gt;include structure bdcmsgcoll.&lt;/P&gt;&lt;P&gt;data : end of Tab_Mess,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146; USING BDC_TAB MODE &amp;#145;N&amp;#146; UPDATE &amp;#145;S&amp;#146; &lt;/P&gt;&lt;P&gt;MESSAGES INTO TAB_MESS.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;WRITE: / Tab_MESS-TCODE, Tab_MESS-DYNUMB, Tab_MESS-MSGTYP , &lt;/P&gt;&lt;P&gt;Tab_MESS-MSGID.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;i am giving you example for Change Vendor you practice for ur tcode&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For our example, we will use the &amp;#147;Change Vendor&amp;#148; transaction (&amp;#147;FK02&amp;#148;) to add a street address to an already existing vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step #1&lt;/P&gt;&lt;P&gt;Use &amp;#147;System&amp;amp;#61664;Status&amp;#148; menu path to determine online program name (SAPMF02K), screen number (0110)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step #2&lt;/P&gt;&lt;P&gt;Use &amp;#147;F1&amp;#148; key and &amp;#147;Technical Info&amp;#148; pushbutton in each screen field to be filled to determine the field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step #3 &lt;/P&gt;&lt;P&gt;Determine how to proceed in the transaction&lt;/P&gt;&lt;P&gt;(save the record by clicking on the &amp;#145;Save&amp;#146; pushbutton or pressing the &amp;#145;F11&amp;#146; key).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BDC Table Contents&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;After researching the transaction we can determine the contents of the BDC table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM DYNPRO DYNBEGIN FNAM FVAL&lt;/P&gt;&lt;P&gt;SAMPF02K 0106 X &lt;/P&gt;&lt;P&gt;RF02K-LIFNR TEST1&lt;/P&gt;&lt;P&gt;RF02K-D0110 X&lt;/P&gt;&lt;P&gt;SAMPF02K 0110 X &lt;/P&gt;&lt;P&gt;LFA1-STRAS 123 Main St.&lt;/P&gt;&lt;P&gt;BDC_OKCODE /11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Batch Input Methods&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#147;CALL TRANSACTION USING&amp;#148;&lt;/P&gt;&lt;P&gt;STATEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Call transaction - for data transfer&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Processing batch input data with CALL TRANSACTION USING is the faster of the two recommended data transfer methods. In this method, legacy data is processed inline in your data transfer program. &lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;lt;tcode&amp;gt;&lt;/P&gt;&lt;P&gt;USING &amp;lt;bdc_tab&amp;gt;&lt;/P&gt;&lt;P&gt;MODE &amp;lt;mode&amp;gt;&lt;/P&gt;&lt;P&gt;UPDATE &amp;lt;update&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A Display all&lt;/P&gt;&lt;P&gt;E Display errors only&lt;/P&gt;&lt;P&gt;N No display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S Synchronous&lt;/P&gt;&lt;P&gt;A Asynchronous&lt;/P&gt;&lt;P&gt;L Local update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The process flow of CALL TRANSACTION&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:&lt;/P&gt;&lt;P&gt;Prepare a BDCDATA structure for the transaction that you wish to run. &lt;/P&gt;&lt;P&gt;Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.&lt;/P&gt;&lt;P&gt;With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;lt;Error_handling&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Overview of Batch Input Session&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZRK1CALLTRANS .&lt;/P&gt;&lt;P&gt;TABLES:MARA,MAKT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;MATNR LIKE RMMG1-MATNR,&lt;/P&gt;&lt;P&gt;MBRSH LIKE RMMG1-MBRSH,&lt;/P&gt;&lt;P&gt;MTART LIKE RMMG1-MTART,&lt;/P&gt;&lt;P&gt;MAKTX LIKE MAKT-MAKTX,&lt;/P&gt;&lt;P&gt;MEINS LIKE MARA-MEINS,&lt;/P&gt;&lt;P&gt;MATKL LIKE MARA-MATKL,&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;DATA : ITAB2 LIKE BDCDATA OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CODEPAGE = 'IBM '&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\SUMAN.TXT '&lt;/P&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HEADLEN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LINE_EXIT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TRUNCLEN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USER_FORM = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USER_PROG = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DAT_D_FORMAT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILELENGTH =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILE_OPEN_ERROR = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILE_READ_ERROR = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TYPE = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_BATCH = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNKNOWN_ERROR = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CUSTOMER_ERROR = 9&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_AUTHORITY = 10&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 11&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;WRITE : / ITAB-MATNR,ITAB-MBRSH,ITAB-MTART,ITAB-MAKTX,ITAB-MEINS,&lt;/P&gt;&lt;P&gt;ITAB-MATKL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-PROGRAM = 'SAPLMGMM'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNPRO = '0060'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MATNR.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'RMMG1-MBRSH'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MBRSH.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'RMMG1-MTART'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MTART.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'BDC_OKCODE'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = '/00'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-PROGRAM = 'SAPLMGMM'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNPRO = '0070'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MSICHTAUSW-KZSEL(01)'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'BDC_OKCODE'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = '=ENTR'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-PROGRAM = 'SAPLMGMM'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = '4004'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MAKTX.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MARA-MEINS'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MEINS.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MARA-MATKL'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MATKL.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'BDC_OKCODE'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = '=BU'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'MM01' USING ITAB2 MODE 'A' UPDATE 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BATCH DATA COMMUNICATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About Data Transfer In R/3 System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the process of replacing current applications and transferring application data, two situations might occur:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; The first is when application data to be replaced is transferred at once, and only once.&lt;/P&gt;&lt;P&gt;&amp;#149; The second situation is to transfer data periodically from external systems to SAP and vice versa.&lt;/P&gt;&lt;P&gt;&amp;#149; There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called &amp;#147;batch input&amp;#148; or &amp;#147;batch data communication&amp;#148;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. SESSION METHOD&lt;/P&gt;&lt;P&gt;2. CALL TRANSACTION&lt;/P&gt;&lt;P&gt;3. DIRECT INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advantages offered by BATCH INPUT method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Can process large data volumes in batch.&lt;/P&gt;&lt;P&gt;2. Can be planned and submitted in the background.&lt;/P&gt;&lt;P&gt;3. No manual interaction is required when data is transferred.&lt;/P&gt;&lt;P&gt;4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a &amp;#147;data transfer&amp;#148; program must map the data from the external system into the data structure required by the SAP batch input program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The batch input program must build all of the input to execute the SAP transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two main steps are required: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.&lt;/P&gt;&lt;P&gt;&amp;#149; To pass the table to SAP for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisite for Data Transfer Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing a Data Transfer Program involves following prerequisites:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyzing data from local file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyzing transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyzing transaction involves following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; The transaction code, if you do not already know it.&lt;/P&gt;&lt;P&gt;&amp;#149; Which fields require input i.e., mandatory.&lt;/P&gt;&lt;P&gt;&amp;#149; Which fields can you allow to default to standard values.&lt;/P&gt;&lt;P&gt;&amp;#149; The names, types, and lengths of the fields that are used by a transaction.&lt;/P&gt;&lt;P&gt;&amp;#149; Screen number and Name of module pool program behind a particular transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To analyze a transaction::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Start the transaction by menu or by entering the transaction code in the command box.&lt;/P&gt;&lt;P&gt;(You can determine the transaction name by choosing System &amp;#150; Status.)&lt;/P&gt;&lt;P&gt;&amp;#149; Step through the transaction, entering the data will be required for processing your batch input data.&lt;/P&gt;&lt;P&gt;&amp;#149; On each screen, note the program name and screen (dynpro) number.&lt;/P&gt;&lt;P&gt;(dynpro = dyn + pro. Dyn = screen, pro = number)&lt;/P&gt;&lt;P&gt;&amp;#149; Display these by choosing System &amp;#150; Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.&lt;/P&gt;&lt;P&gt;The technical info pop-up shows not only the field information but also the program and screen.&lt;/P&gt;&lt;P&gt;&amp;#149; For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the following information:&lt;/P&gt;&lt;P&gt;- The field name for batch input, which you&amp;#146;ll find in its own box.&lt;/P&gt;&lt;P&gt;- The length and data type of the field. You can display this information by double clicking on the Data Element field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.&lt;/P&gt;&lt;P&gt;In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.&lt;/P&gt;&lt;P&gt;You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have program name, screen number, field name (screen field name), you can start writing.&lt;/P&gt;&lt;P&gt;DATA TRANSFER program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Integral Table similar to structure like local file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring internal table like BDCDATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:&lt;/P&gt;&lt;P&gt;&amp;#149; Create a BDCDATA structure&lt;/P&gt;&lt;P&gt;&amp;#149; Write the structure out to a session or process it with CALL TRANSACTION USING; and then&lt;/P&gt;&lt;P&gt;&amp;#149; Create a BDCDATA structure for the next transaction that is to be processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Data that is entered into screen fields.&lt;/P&gt;&lt;P&gt;&amp;#149; Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BDCDATA structure contains the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.&lt;/P&gt;&lt;P&gt;&amp;#149; DYNPRO: Screen Number. Set this field only in the first record for the screen.&lt;/P&gt;&lt;P&gt;&amp;#149; DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to &amp;#145; &amp;#145; (blank) for all other records.)&lt;/P&gt;&lt;P&gt;&amp;#149; FNAM: Field Name. The FNAM field is not case-sensitive.&lt;/P&gt;&lt;P&gt;&amp;#149; FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transferring data from local file to internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Population of BDCDATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All these five initial steps are necessary for any type of BDC interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SESSION METHOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About Session method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this method you transfer data from internal table to database table through sessions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless session is processed, the data is not transferred to database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_OPEN_GROUP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You create the session through program by BDC_OPEN_GROUP function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters to this function are: &lt;/P&gt;&lt;P&gt;&amp;#149; User Name: User name &lt;/P&gt;&lt;P&gt;&amp;#149; Group: Name of the session&lt;/P&gt;&lt;P&gt;&amp;#149; Lock Date: The date on which you want to process the session.&lt;/P&gt;&lt;P&gt;&amp;#149; Keep: This parameter is passed as &amp;#145;X&amp;#146; when you want to retain session after&lt;/P&gt;&lt;P&gt;processing it or &amp;#145; &amp;#145; to delete it after processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_INSERT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function creates the session &amp;amp; data is transferred to Session.&lt;/P&gt;&lt;P&gt;Parameters to this function are:&lt;/P&gt;&lt;P&gt;&amp;#149; Tcode: Transaction Name &lt;/P&gt;&lt;P&gt;&amp;#149; Dynprotab: BDC Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_CLOSE_GROUP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function closes the BDC Group. No Parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some additional information for session processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transaction &amp;lt;tcode&amp;gt; using &amp;lt;BDCTAB&amp;gt;&lt;/P&gt;&lt;P&gt;Mode &amp;lt;A/N/E&amp;gt;&lt;/P&gt;&lt;P&gt;Update &amp;lt;S/A&amp;gt;&lt;/P&gt;&lt;P&gt;Messages into &amp;lt;MSGTAB&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 1 is transaction code.&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 2 is name of BDCTAB table.&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 3 here you are specifying mode in which you execute transaction&lt;/P&gt;&lt;P&gt;A is all screen mode. All the screen of transaction are displayed.&lt;/P&gt;&lt;P&gt;N is no screen mode. No screen is displayed when you execute the transaction.&lt;/P&gt;&lt;P&gt;E is error screen. Only those screens are displayed wherein you have error record.&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 4 here you are specifying update type by which database table is updated.&lt;/P&gt;&lt;P&gt;S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.&lt;/P&gt;&lt;P&gt;A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Tcode: Transaction code&lt;/P&gt;&lt;P&gt;2. Dyname: Batch point module name&lt;/P&gt;&lt;P&gt;3. Dynumb: Batch input Dyn number&lt;/P&gt;&lt;P&gt;4. Msgtyp: Batch input message type (A/E/W/I/S)&lt;/P&gt;&lt;P&gt;5. Msgspra: Batch input Lang, id of message&lt;/P&gt;&lt;P&gt;6. Msgid: Message id&lt;/P&gt;&lt;P&gt;7. MsgvN: Message variables (N = 1 - 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps for CALL TRANSACTION method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Internal table for the data (structure similar to your local file)&lt;/P&gt;&lt;P&gt;2. BDCTAB like BDCDATA&lt;/P&gt;&lt;P&gt;3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)&lt;/P&gt;&lt;P&gt;4. Loop at itab.&lt;/P&gt;&lt;P&gt;Populate BDCTAB table.&lt;/P&gt;&lt;P&gt;Call transaction &amp;lt;tcode&amp;gt; using &amp;lt;BDCTAB&amp;gt;&lt;/P&gt;&lt;P&gt;Mode &amp;lt;A/N/E&amp;gt;&lt;/P&gt;&lt;P&gt;Update &amp;lt;S/A&amp;gt;.&lt;/P&gt;&lt;P&gt;Refresh BDCTAB.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(To populate BDCTAB, You need to transfer each and every field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The major differences between Session method and Call transaction are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SESSION METHOD CALL TRANSACTION&lt;/P&gt;&lt;P&gt;1. Data is not updated in database table unless Session is processed. Immediate updation in database table.&lt;/P&gt;&lt;P&gt;2. No sy-subrc is returned. Sy-subrc is returned.&lt;/P&gt;&lt;P&gt;3. Error log is created for error records. Errors need to be handled explicitly &lt;/P&gt;&lt;P&gt;4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Handling in CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps for the error handling in CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Internal table for the data (structure similar to your local file)&lt;/P&gt;&lt;P&gt;2. BDCTAB like BDCDATA&lt;/P&gt;&lt;P&gt;3. Internal table BDCMSG like BDCMSGCOLL&lt;/P&gt;&lt;P&gt;4. Internal table similar to Ist internal table&lt;/P&gt;&lt;P&gt;(Third and fourth steps are for error handling)&lt;/P&gt;&lt;P&gt;5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)&lt;/P&gt;&lt;P&gt;6. Loop at itab.&lt;/P&gt;&lt;P&gt;Populate BDCTAB table.&lt;/P&gt;&lt;P&gt;Call transaction &amp;lt;tr.code&amp;gt; using &amp;lt;Bdctab&amp;gt;&lt;/P&gt;&lt;P&gt;Mode &amp;lt;A/N/E&amp;gt;&lt;/P&gt;&lt;P&gt;Update &amp;lt;S/A&amp;gt;&lt;/P&gt;&lt;P&gt;Messages &amp;lt;BDCMSG&amp;gt;.&lt;/P&gt;&lt;P&gt;Perform check.&lt;/P&gt;&lt;P&gt;Refresh BDCTAB.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;7 Form check.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0. (Call transaction returns the sy-subrc if updating is not successful).&lt;/P&gt;&lt;P&gt;Call function Format_message.&lt;/P&gt;&lt;P&gt;(This function is called to store the message given by system and to display it along with record)&lt;/P&gt;&lt;P&gt;Append itab2.&lt;/P&gt;&lt;P&gt;Display the record and message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DIRECT INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About Direct Input&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. Direct input checks the data thoroughly and then updates the database directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can start a Direct Input program in two ways;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start the program directly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting the program via the DI administration transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Create variant&lt;/P&gt;&lt;P&gt;- Define job&lt;/P&gt;&lt;P&gt;- Start job&lt;/P&gt;&lt;P&gt;- Restart job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Common batch input errors&lt;/P&gt;&lt;P&gt;- The batch input BDCDATA structure tries to assign values to fields which do not exist in the current transaction screen.&lt;/P&gt;&lt;P&gt;- The screen in the BDCDATA structure does not match the right sequence, or an intermediate screen is missing.&lt;/P&gt;&lt;P&gt;- On exceptional occasions, the logic flow of batch input session does not exactly match that of manual online processing. Testing the sessions online can discover by this.&lt;/P&gt;&lt;P&gt;- The BDCDATA structure contains fields, which are longer than the actual definition.&lt;/P&gt;&lt;P&gt;- Authorization problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECORDING A BATCH INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A B recording allows you to record a R/3 transaction and generate a program that contains all screens and field information in the required BDC-DATA format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can either use SHDB transaction for recording or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT&amp;amp;#61614; BATCH INPUT &amp;amp;#61614; SERVICES &amp;amp;#61614;SYSTEM &lt;/P&gt;&lt;P&gt;And from here click recording.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enter name for the recording.&lt;/P&gt;&lt;P&gt;(Dates are optional)&lt;/P&gt;&lt;P&gt;Click recording.&lt;/P&gt;&lt;P&gt;Enter transaction code.&lt;/P&gt;&lt;P&gt;Enter.&lt;/P&gt;&lt;P&gt;Click Save button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You finally come to a screen where, you have all the information for each screen including BDC_OKCODE.&lt;/P&gt;&lt;P&gt;&amp;#149; Click Get Transaction.&lt;/P&gt;&lt;P&gt;&amp;#149; Return to BI.&lt;/P&gt;&lt;P&gt;&amp;#149; Click overview.&lt;/P&gt;&lt;P&gt;&amp;#149; Position the cursor on the just recorded entry and click generate program.&lt;/P&gt;&lt;P&gt;&amp;#149; Enter program name.&lt;/P&gt;&lt;P&gt;&amp;#149; Click enter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program is generated for the particular transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BACKGROUND PROCESSING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need for Background processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a large volume of data is involved, usually all batch inputs are done in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The R/3 system includes functions that allow users to work non-interactively or offline. The background processing systems handle these functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Non-interactively means that instead of executing the ABAP/4 programs and waiting for an answer, user can submit those programs for execution at a more convenient planned time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several reasons to submit programs for background execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; The maximum time allowed for online execution should not exceed 300 seconds. User gets TIMEOUT error and an aborted transaction, if time for execution exceeds 300 seconds. To avoid these types of error, you can submit jobs for background processing.&lt;/P&gt;&lt;P&gt;&amp;#149; You can use the system while your program is executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not mean that interactive or online work is not useful. Both type of processing have their own purposes. Online work is the most common one entering business data, displaying information, printing small reports, managing the system and so on. Background jobs are mainly used for the following tasks; to process large amount of data, to execute periodic jobs without human intervention, to run program at a more convenient, planned time other than during normal working hours i.e., Nights or weekends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transaction for background processing is SM36.&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;Define jobs&amp;amp;#61614; Jobs &amp;amp;#61614; Administration &amp;amp;#61614;Tools &lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;Jobs&amp;amp;#61614; services &amp;amp;#61614;System &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Components of the background jobs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A job in Background processing is a series of steps that can be scheduled and step is a program for background processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Job name. Define the name of assigned to the job. It identifies the job. You can specify up to 32 characters for the name.&lt;/P&gt;&lt;P&gt;&amp;#149; Job class. Indicates the type of background processing priority assigned to the job.&lt;/P&gt;&lt;P&gt;The job class determines the priority of a job. The background system admits three types of job classes: A B &amp;amp; C, which correspond to job priority.&lt;/P&gt;&lt;P&gt;&amp;#149; Job steps. Parameters to be passed for this screen are as follows:&lt;/P&gt;&lt;P&gt;Program name.&lt;/P&gt;&lt;P&gt;Variant if it is report program&lt;/P&gt;&lt;P&gt;Start criteria for the job: Option available for this are as follows:&lt;/P&gt;&lt;P&gt;Immediate - allows you to start a job immediately.&lt;/P&gt;&lt;P&gt;Date/Time - allows you to start a job at a specific name.&lt;/P&gt;&lt;P&gt;After job - you can start a job after a particular job.&lt;/P&gt;&lt;P&gt;After event - allows you to start a job after a particular event.&lt;/P&gt;&lt;P&gt;At operation mode - allows you to start a job when the system switches to a particular operation mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Background jobs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is two step process: Firstly, you define the job and then release it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When users define a job and save it, they are actually scheduling the report i.e., specifying the job components, the steps, the start time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When users schedule program for background processing, they are instructing the system to execute an ABAP/4 report or an external program in the background. Scheduled jobs are not executed until they are released. When jobs are released, they are sent for execution to the background processing system at the specified start time. Both scheduling and releasing of jobs require authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HANDLING OF POP UP SCREEN IN BDC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many times in transaction pop up screen appears and for this screen you don&amp;#146;t pass any record but some indication to system telling it to proceed further. For example: The following screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To handle such screen, system has provided a variable called BDC_CURSOR. You pass this variable to BDCDATA and process the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually such screen appears in many transactions, in this case you are just passing information, that YES you want to save the information, that means YES should be clicked. So you are transferring this information to BDCDATA i.e., field name of YES which is usually SPOT_OPTION. Instead of BDC_OKCODE, you are passing BDC_CURSOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_CURSOR is also used to place cursor on particular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN EXAMPLE WITH SESSION METHOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following program demonstrates how data is passed from flat file to SAP transaction and further to database table by using SESSION method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transaction is TFBA (to change customer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple transaction where you are entering customer number on first screen and on next screen data is displayed for the particular customer number. Field, which we are changing here, are name and city. When you click on save, the changed record gets saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisite to write this BDC interface as indicated earlier is:&lt;/P&gt;&lt;P&gt;1. To find screen number&lt;/P&gt;&lt;P&gt;2. To find screen field names, type of the field and length of the field.&lt;/P&gt;&lt;P&gt;3. To find BDC_OKCODE for each screen&lt;/P&gt;&lt;P&gt;4. Create flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flat file can be created in your hard disk as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 Vinod Krishna Hyderabad&lt;/P&gt;&lt;P&gt;2 Kavitha Secunderabad&lt;/P&gt;&lt;P&gt;3 Kishore Hyderabad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Where 1st character field is Customer number, 2nd field is Customer name and 3rd field is City.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To transfer this data to database table SCUSTOM following interface can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT DEMO1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Following internal table is to upload flat file.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;ID(10),&lt;/P&gt;&lt;P&gt;NAME(25),&lt;/P&gt;&lt;P&gt;CITY(25),&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;*Following internal table BDCDATA is to pass date from internal table to session.&lt;/P&gt;&lt;P&gt;DATA: BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: DATE1 LIKE SY-DATUM. DATE1 = SY-DATUM - 1. &amp;#147; This is for Hold Date&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To upload flat file to internal table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION UPLOAD&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILE NAME = &amp;#145;C:\FF.TXT&amp;#146;&lt;/P&gt;&lt;P&gt;FILE TYPE = &amp;#145;ASC&amp;#148;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 2&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 3&lt;/P&gt;&lt;P&gt;NO_BATCH = 4&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 5&lt;/P&gt;&lt;P&gt;OTHERS = 6.&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calling Function to Create a Session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION &amp;#145;BDC_OPEN_GROUP&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CLIENT = SY-MANDT&lt;/P&gt;&lt;P&gt;GROUP = &amp;#145;POTHURI&amp;#146;&lt;/P&gt;&lt;P&gt;HOLDDATE = DATE1&lt;/P&gt;&lt;P&gt;KEEP = &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;USER = SY-UNAME&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CLIENT_INVALID = 1&lt;/P&gt;&lt;P&gt;DESTINATION_INVALID = 2&lt;/P&gt;&lt;P&gt;GROUP_INVALID = 3&lt;/P&gt;&lt;P&gt;GROUP_IS_LOCKED = 4&lt;/P&gt;&lt;P&gt;HOLDDATE_INVALID = 5&lt;/P&gt;&lt;P&gt;INTERNAL_ERROR = 6&lt;/P&gt;&lt;P&gt;QUEUE_ERROR = 7&lt;/P&gt;&lt;P&gt;RUNNING = 8&lt;/P&gt;&lt;P&gt;SYSTEM_LOCK_ERROR = 9&lt;/P&gt;&lt;P&gt;USER_INVALID = 10&lt;/P&gt;&lt;P&gt;OTHERS = 11.&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt; MAIN Logic--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------" /&gt;&lt;P&gt;LOOP AT ITAB&lt;/P&gt;&lt;P&gt;PERFORM GENERATE_DATA. &amp;#147; Populating BDCDATA Table&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;BDC_INSERT&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;TCODE = &amp;#145;TFBA&amp;#146;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DYNPROTAB = BDCTAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;INTERNAL_ERROR = 1&lt;/P&gt;&lt;P&gt;NOT_OPEN = 2&lt;/P&gt;&lt;P&gt;QUEUE_ERROR = 3&lt;/P&gt;&lt;P&gt;TCODE_INVALID = 4&lt;/P&gt;&lt;P&gt;PRINTING_INVALID = 5&lt;/P&gt;&lt;P&gt;POSTING_INVALID = 6&lt;/P&gt;&lt;P&gt;OTHERS = 7.&lt;/P&gt;&lt;P&gt;REFRESH BDCTAB&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calling function to close the session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION &amp;#145;BDC_CLOSE_GROUP&amp;#146;&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_OPEN = 1&lt;/P&gt;&lt;P&gt;QUEUE_ERROR = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form GENERATE_DATA&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create BDC Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GENERATE_DATA&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing information for 1st screen on BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-PROGRAM = &amp;#145;SAPMTFBA&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAX-DYNPRO = 100.&lt;/P&gt;&lt;P&gt;BDCTAP-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BCDTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing field information to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;SCUSTOM-ID&amp;#146;&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = ITAB-ID.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing BDC_OKCODE to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;BDC_OKCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = &amp;#145;/5&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing screen information for next screen to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-PROGRAM = &amp;#145;SAPMTFBA&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-DYNPRO = 200.&lt;/P&gt;&lt;P&gt;BDCTAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing screen information to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;SCUSTOM-NAME&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = ITAB-NAME.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing screen information to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;SCUSTOM-CITY&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = ITAB-CITY.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing BDC_OKCODE to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;BDC_OKCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = &amp;#145;SAVE&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;P&gt;ENDFORM. &amp;#147;GENERATE_DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN EXAMPLE WITH CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same steps to be repeated for CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only difference between the two types of interface is in Session method, you create session and store information about screen and data into session. When session is processed the data is transferred to database. While in CALL TRANSACTION, data is transferred directly to database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT DEMO1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Follow above Code till MAIN Logic. Even the Subroutine should be copied&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT ITAB&lt;/P&gt;&lt;P&gt;PERFORM GENERATE_DATA, &amp;#147;Populating BDCDATA Table&lt;/P&gt;&lt;P&gt;Call transaction &amp;#145;TFBA&amp;#146; using BCDDATA Mode &amp;#145;A&amp;#146; Update &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;REFRESH BDCTAB&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2007 08:29:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-15T08:29:21Z</dc:date>
    <item>
      <title>give a simple BDC example for CALL TRANSACTION METHOD..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954055#M696748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GIVE AN EXAMPLE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 08:10:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954055#M696748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T08:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: give a simple BDC example for CALL TRANSACTION METHOD..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954056#M696749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*Code used to create BDC&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZBDC_EXAMPLE                                                *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Example BDC program, which updates net price of item 00010 of a     *&lt;/P&gt;&lt;P&gt;*&amp;amp; particular Purchase order(EBELN).                                   *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZBDC_EXAMPLE  NO STANDARD PAGE HEADING&lt;/P&gt;&lt;P&gt;                      LINE-SIZE 132.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES: ekko, ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_ekko,&lt;/P&gt;&lt;P&gt;    ebeln TYPE ekko-ebeln,&lt;/P&gt;&lt;P&gt;    waers TYPE ekko-waers,&lt;/P&gt;&lt;P&gt;    netpr TYPE ekpo-netpr,&lt;/P&gt;&lt;P&gt;    err_msg(73) TYPE c,&lt;/P&gt;&lt;P&gt; END OF t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_ekko  TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_ekko  TYPE t_ekko,&lt;/P&gt;&lt;P&gt;      it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_error TYPE t_ekko,&lt;/P&gt;&lt;P&gt;      it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_success TYPE t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_textout            LIKE t100-text.&lt;/P&gt;&lt;P&gt;DATA: gd_update TYPE i,&lt;/P&gt;&lt;P&gt;      gd_lines TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Used to store BDC data&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF bdc_tab OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bdcdata.&lt;/P&gt;&lt;P&gt;DATA: END OF bdc_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Used to stores error information from CALL TRANSACTION Function Module&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF messtab OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bdcmsgcoll.&lt;/P&gt;&lt;P&gt;DATA: END OF messtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------------" /&gt;&lt;P&gt;*Screen declaration&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME&lt;/P&gt;&lt;P&gt;                                    TITLE text-001. "Purchase order Num&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK block1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME&lt;/P&gt;&lt;P&gt;                                    TITLE text-002. "New NETPR value&lt;/P&gt;&lt;P&gt;PARAMETERS:  p_newpr(14)   TYPE c obligatory.  "LIKE ekpo-netpr.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK block2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Retrieve data from Purchase order table(EKKO)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SELECT ekko&lt;SUB&gt;ebeln ekko&lt;/SUB&gt;waers ekpo~netpr&lt;/P&gt;&lt;P&gt;    INTO TABLE it_ekko&lt;/P&gt;&lt;P&gt;    FROM ekko AS ekko INNER JOIN ekpo AS ekpo&lt;/P&gt;&lt;P&gt;      ON ekpo&lt;SUB&gt;ebeln EQ ekko&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;   WHERE ekko~ebeln IN so_ebeln AND&lt;/P&gt;&lt;P&gt;         ekpo~ebelp EQ '10'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*END-OF-SELECTION&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check data has been retrieved ready for processing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DESCRIBE TABLE it_ekko LINES gd_lines.&lt;/P&gt;&lt;P&gt;  IF gd_lines LE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display message if no data has been retrieved&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    MESSAGE i003(zp) WITH 'No Records Found'(001).&lt;/P&gt;&lt;P&gt;    LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Update Customer master data (instalment text)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT it_ekko INTO wa_ekko.&lt;/P&gt;&lt;P&gt;      PERFORM bdc_update.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display message confirming number of records updated&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF gd_update GT 1.&lt;/P&gt;&lt;P&gt;      MESSAGE i003(zp) WITH gd_update 'Records updated'(002).&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      MESSAGE i003(zp) WITH gd_update 'Record updated'(003).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display Success Report&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;**********************&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Check Success table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DESCRIBE TABLE it_success LINES gd_lines.&lt;/P&gt;&lt;P&gt;    IF gd_lines GT 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Display result report column headings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM display_column_headings.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Display result report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM display_report.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display Error Report&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;********************&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Check errors table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DESCRIBE TABLE it_error LINES gd_lines.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  If errors exist then display errors report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF gd_lines GT 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Display errors report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM display_error_headings.&lt;/P&gt;&lt;P&gt;      PERFORM display_error_report.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_COLUMN_HEADINGS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display column headings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_column_headings.&lt;/P&gt;&lt;P&gt;  WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.&lt;/P&gt;&lt;P&gt;  SKIP.&lt;/P&gt;&lt;P&gt;  WRITE:2 'The following records updated successfully:'(013).&lt;/P&gt;&lt;P&gt;  WRITE:/ sy-uline(42).&lt;/P&gt;&lt;P&gt;  FORMAT COLOR COL_HEADING.&lt;/P&gt;&lt;P&gt;  WRITE:/      sy-vline,&lt;/P&gt;&lt;P&gt;          (10) 'Purchase Order'(004), sy-vline,&lt;/P&gt;&lt;P&gt;          (11) 'Old Netpr'(005), sy-vline,&lt;/P&gt;&lt;P&gt;          (11) 'New Netpr'(006), sy-vline.&lt;/P&gt;&lt;P&gt;  WRITE:/ sy-uline(42).&lt;/P&gt;&lt;P&gt;ENDFORM.                    " DISPLAY_COLUMN_HEADINGS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BDC_UPDATE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Populate BDC table and call transaction ME22&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM bdc_update.&lt;/P&gt;&lt;P&gt;  PERFORM dynpro USING:&lt;/P&gt;&lt;P&gt;      'X'   'SAPMM06E'        '0105',&lt;/P&gt;&lt;P&gt;      ' '   'BDC_CURSOR'      'RM06E-BSTNR',&lt;/P&gt;&lt;P&gt;      ' '   'RM06E-BSTNR'     wa_ekko-ebeln,&lt;/P&gt;&lt;P&gt;      ' '   'BDC_OKCODE'      '/00',                      "OK code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      'X'   'SAPMM06E'        '0120',&lt;/P&gt;&lt;P&gt;      ' '   'BDC_CURSOR'      'EKPO-NETPR(01)',&lt;/P&gt;&lt;P&gt;      ' '   'EKPO-NETPR(01)'  p_newpr,&lt;/P&gt;&lt;P&gt;      ' '   'BDC_OKCODE'      '=BU'.                      "OK code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call transaction to update customer instalment text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'&lt;/P&gt;&lt;P&gt;         MESSAGES INTO messtab.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if update was succesful&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;    ADD 1 TO gd_update.&lt;/P&gt;&lt;P&gt;    APPEND wa_ekko TO it_success.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Retrieve error messages displayed during BDC update&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT messtab WHERE msgtyp = 'E'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Builds actual message based on info returned from Call transaction&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL FUNCTION 'MESSAGE_TEXT_BUILD'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;                msgid               = messtab-msgid&lt;/P&gt;&lt;P&gt;                msgnr               = messtab-msgnr&lt;/P&gt;&lt;P&gt;                msgv1               = messtab-msgv1&lt;/P&gt;&lt;P&gt;                msgv2               = messtab-msgv2&lt;/P&gt;&lt;P&gt;                msgv3               = messtab-msgv3&lt;/P&gt;&lt;P&gt;                msgv4               = messtab-msgv4&lt;/P&gt;&lt;P&gt;           IMPORTING&lt;/P&gt;&lt;P&gt;                message_text_output = w_textout.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Build error table ready for output&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_error = wa_ekko.&lt;/P&gt;&lt;P&gt;    wa_error-err_msg = w_textout.&lt;/P&gt;&lt;P&gt;    APPEND wa_error TO it_error.&lt;/P&gt;&lt;P&gt;    CLEAR: wa_error.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Clear bdc date table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR: bdc_tab.&lt;/P&gt;&lt;P&gt;  REFRESH: bdc_tab.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " BDC_UPDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      FORM DYNPRO                                                   *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      stores values to bdc table                                    *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  DYNBEGIN                                                      *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  NAME                                                          *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  VALUE                                                         *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM dynpro USING    dynbegin name value.&lt;/P&gt;&lt;P&gt;  IF dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;    CLEAR bdc_tab.&lt;/P&gt;&lt;P&gt;    MOVE:  name TO bdc_tab-program,&lt;/P&gt;&lt;P&gt;           value TO bdc_tab-dynpro,&lt;/P&gt;&lt;P&gt;           'X'  TO bdc_tab-dynbegin.&lt;/P&gt;&lt;P&gt;    APPEND bdc_tab.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    CLEAR bdc_tab.&lt;/P&gt;&lt;P&gt;    MOVE:  name TO bdc_tab-fnam,&lt;/P&gt;&lt;P&gt;           value TO bdc_tab-fval.&lt;/P&gt;&lt;P&gt;    APPEND bdc_tab.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                               " DYNPRO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_REPORT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_report.&lt;/P&gt;&lt;P&gt;  FORMAT COLOR COL_NORMAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Loop at data table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_success INTO wa_success.&lt;/P&gt;&lt;P&gt;    WRITE:/      sy-vline,&lt;/P&gt;&lt;P&gt;            (10) wa_success-ebeln, sy-vline,&lt;/P&gt;&lt;P&gt;            (11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,&lt;/P&gt;&lt;P&gt;            (11) p_newpr, sy-vline.&lt;/P&gt;&lt;P&gt;    CLEAR: wa_success.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  WRITE:/ sy-uline(42).&lt;/P&gt;&lt;P&gt;  REFRESH: it_success.&lt;/P&gt;&lt;P&gt;  FORMAT COLOR COL_BACKGROUND.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " DISPLAY_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_ERROR_REPORT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display error report data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_error_report.&lt;/P&gt;&lt;P&gt;  LOOP AT it_error INTO wa_error.&lt;/P&gt;&lt;P&gt;    WRITE:/      sy-vline,&lt;/P&gt;&lt;P&gt;            (10) wa_error-ebeln, sy-vline,&lt;/P&gt;&lt;P&gt;            (11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,&lt;/P&gt;&lt;P&gt;            (73) wa_error-err_msg, sy-vline.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  WRITE:/ sy-uline(104).&lt;/P&gt;&lt;P&gt;  REFRESH: it_error.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " DISPLAY_ERROR_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_ERROR_HEADINGS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display error report headings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_error_headings.&lt;/P&gt;&lt;P&gt;  SKIP.&lt;/P&gt;&lt;P&gt;  WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.&lt;/P&gt;&lt;P&gt;  SKIP.&lt;/P&gt;&lt;P&gt;  WRITE:2 'The following records failed during update:'(008).&lt;/P&gt;&lt;P&gt;  WRITE:/ sy-uline(104).&lt;/P&gt;&lt;P&gt;  FORMAT COLOR COL_HEADING.&lt;/P&gt;&lt;P&gt;  WRITE:/      sy-vline,&lt;/P&gt;&lt;P&gt;          (10) 'Purchase Order'(009), sy-vline,&lt;/P&gt;&lt;P&gt;          (11) 'Netpr'(010), sy-vline,&lt;/P&gt;&lt;P&gt;          (73) 'Error Message'(012), sy-vline.&lt;/P&gt;&lt;P&gt;  WRITE:/ sy-uline(104).&lt;/P&gt;&lt;P&gt;  FORMAT COLOR COL_NORMAL.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " DISPLAY_ERROR_HEADINGS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points,&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Gangula Vikram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 08:12:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954056#M696749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T08:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: give a simple BDC example for CALL TRANSACTION METHOD..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954057#M696750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balaji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it is..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form call_md61.&lt;/P&gt;&lt;P&gt;loop at imain into imain_wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MD74 BDCData Preparation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'RM60RR20' '1000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'WERKS-LOW'&lt;/P&gt;&lt;P&gt;                                   imain_wa-werks.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MATNR-LOW'&lt;/P&gt;&lt;P&gt;                                   imain_wa-matnr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'DATE1'&lt;/P&gt;&lt;P&gt;                                   ws-dateto.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'HISTFLAG'&lt;/P&gt;&lt;P&gt;                                  ' '.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'INACFLAG'&lt;/P&gt;&lt;P&gt;                                   ' '.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'TESTFLAG'&lt;/P&gt;&lt;P&gt;                                    ' '.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'LISTFLAG'&lt;/P&gt;&lt;P&gt;                                    ' '.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=ONLI'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call transaction 'MD74' using bdcdata mode 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPMM60X' '0100'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'AM60X-MATNR'&lt;/P&gt;&lt;P&gt;                                   imain_wa-matnr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'AM60X-WERKS'&lt;/P&gt;&lt;P&gt;                                   imain_wa-werks.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-VERSB'&lt;/P&gt;&lt;P&gt;                                   '00'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-DATVE'&lt;/P&gt;&lt;P&gt;                                   ws-datefrom.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-DATBE'&lt;/P&gt;&lt;P&gt;                                   ws-dateto.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-ENTLU'&lt;/P&gt;&lt;P&gt;                                    'M'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '/00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLM60E' '0200'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-PLN01(01)'&lt;/P&gt;&lt;P&gt;                                   imain_wa-qty01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-PLN02(01)'&lt;/P&gt;&lt;P&gt;                                   imain_wa-qty02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-PLN03(01)'&lt;/P&gt;&lt;P&gt;                                    imain_wa-qty03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-PLN04(01)'&lt;/P&gt;&lt;P&gt;                                    imain_wa-qty04.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RM60X-PLN05(01)'&lt;/P&gt;&lt;P&gt;                                    imain_wa-qty05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_field      using 'RM60X-PLN06(01)'&lt;/P&gt;&lt;P&gt;                                    imain_wa-qty06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_field      using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SICH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call transaction 'MD61' using bdcdata mode 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      To add Screen Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form bdc_dynpro using program dynpro.&lt;/P&gt;&lt;P&gt;  clear bdcdata.&lt;/P&gt;&lt;P&gt;  bdcdata-program  = program.&lt;/P&gt;&lt;P&gt;  bdcdata-dynpro   = dynpro.&lt;/P&gt;&lt;P&gt;  bdcdata-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;  append bdcdata.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      To Insert field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form bdc_field using fnam fval.&lt;/P&gt;&lt;P&gt;  clear bdcdata.&lt;/P&gt;&lt;P&gt;  bdcdata-fnam = fnam.&lt;/P&gt;&lt;P&gt;  bdcdata-fval = fval.&lt;/P&gt;&lt;P&gt;  append bdcdata.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 08:14:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954057#M696750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T08:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: give a simple BDC example for CALL TRANSACTION METHOD..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954058#M696751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the common method you can find eample code in the below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;the BDC program should be in this format&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transaction Recorder (SHDB) &lt;/P&gt;&lt;P&gt;How to Upload Presentation Server Flat file to SAP R/3 system???&lt;/P&gt;&lt;P&gt;How to upload application server file to R/3 system?&lt;/P&gt;&lt;P&gt;Definition&lt;/P&gt;&lt;P&gt;Example - Call Transaction Method &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Transaction Recorder (SHDB)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before you work with the Batch Input methods, you should know the purpose of the tool&lt;/P&gt;&lt;P&gt;Transaction Recorder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use:&lt;/P&gt;&lt;P&gt;You can use the transaction recorder to record a series of transactions and their screens.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Features&amp;lt;/b&amp;gt;:&lt;/P&gt;&lt;P&gt;You can use the recording to create&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data transfer programs that use batch input or CALL TRANSACTION &lt;/P&gt;&lt;P&gt;Batch input sessions &lt;/P&gt;&lt;P&gt;Test data &lt;/P&gt;&lt;P&gt;Function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: It doesn&amp;#146;t record F1, F4 and Scrollbar movements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Upload Flat file from Presentation Server to SAP R/3&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CODEPAGE = &amp;#145;IBM'&lt;/P&gt;&lt;P&gt;FILENAME = P_UFILE&lt;/P&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = INT_TAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR = 2&lt;/P&gt;&lt;P&gt;FILE_READ_ERROR = 3&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 4&lt;/P&gt;&lt;P&gt;NO_BATCH = 5&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 6&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 7&lt;/P&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;P&gt;CUSTOMER_ERROR = 9&lt;/P&gt;&lt;P&gt;OTHERS = 10 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;MESSAGE E999(FR) WITH 'ERROR IN FILE UPLOAD'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Upload file from application server to SAP R/3&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open the the application server file &lt;/P&gt;&lt;P&gt;OPEN DATASET &amp;lt;dsn&amp;gt; FOR INPUT &amp;lt;mode&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the data from application server file&lt;/P&gt;&lt;P&gt;READ DATASET &amp;lt;dsn&amp;gt; INTO &amp;lt;wa&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then close the application server file&lt;/P&gt;&lt;P&gt;CLOSE DATASET &amp;lt;dsn&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Definition- Declaring BDC Table&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BDC_TAB LIKE STANDARD TABLE OF &lt;/P&gt;&lt;P&gt;BDCDATA INITIAL SIZE 6 &lt;/P&gt;&lt;P&gt;WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table used to collect the transaction&amp;#146;s information must be declared &amp;#147;LIKE BDCDATA&amp;#148;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Filling BDC Table &amp;#150; Method #1&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-PROGRAM = &amp;#145;SAPMF02K&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNPRO = &amp;#145;01016&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;RF02K-LIFNR&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;TEST1&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;RF02K-D0010&amp;#146;. &lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-PROGRAM = &amp;#145;SAPMF02K&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNPRO = &amp;#145;0110&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;LFA1-STRAS&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;123 Main St.&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = &amp;#145;BDC_OKCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = &amp;#145;/11&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Filling BDC Table &amp;#150; Method #2&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM POPULATE_BDC_TAB&lt;/P&gt;&lt;P&gt;USING:&lt;/P&gt;&lt;P&gt;&amp;#145;1&amp;#146; &amp;#145;SAPMF02K&amp;#146; &amp;#145;0106&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;RF02K-LIFNR&amp;#146; &amp;#145;TEST1&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;RF02K-D0010&amp;#146; &amp;#145;X&amp;#146;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#145;1&amp;#146; &amp;#145;SAPMF02K&amp;#146; &amp;#145;0110&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;LFA1-STRAS&amp;#146;, &amp;#145;123 Main St.&amp;#146;,&lt;/P&gt;&lt;P&gt;&amp;#145; &amp;#145; &amp;#145;BDC_OKCODE&amp;#146;, &amp;#145;/11&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR BDC_TAB.&lt;/P&gt;&lt;P&gt;IF FLAG = &amp;#145;1&amp;#146;.&lt;/P&gt;&lt;P&gt;BDC_TAB-PROGRAM = VAR1.&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNPRO = VAR2..&lt;/P&gt;&lt;P&gt;BDC_TAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;BDC_TAB-FNAM = VAR1.&lt;/P&gt;&lt;P&gt;BDC_TAB-FVAL = VAR2.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND BDC_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This two subroutine method to fill the BDC table is preferable because the &amp;#147;POPULATE_BDC_TABLE&amp;#148; subroutine is reusable throughout all batch input programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example #1 - Change Vendor (Call Transaction Method)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example #1- Declaration Section&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Y180DM10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BDC_TAB LIKE STANDARD TABLE OF&lt;/P&gt;&lt;P&gt;BDCDATA INITIAL SIZE 6 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;INFILE(20) VALUE &amp;#145;/tmp/bc180_file4&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF INREC.&lt;/P&gt;&lt;P&gt;VENDNUM LIKE LFA1-LIFNR.&lt;/P&gt;&lt;P&gt;STREET LIKE LFA1-STRAS.&lt;/P&gt;&lt;P&gt;END OF INREC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: DISPMODE DEFAULT &amp;#145;A&amp;#146;,&lt;/P&gt;&lt;P&gt;UPDAMODE DEFAULT &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;OPEN DATASET INFILE&lt;/P&gt;&lt;P&gt;FOR INPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;READ DATASET INFILE INTO INREC.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;PERFORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146;&lt;/P&gt;&lt;P&gt;USING BDC_TAB&lt;/P&gt;&lt;P&gt;MODE DISPMODE&lt;/P&gt;&lt;P&gt;UPDATE UPDAMODE.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0.&lt;/P&gt;&lt;P&gt;WRITE: /&amp;#145;ERROR&amp;#146;. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;CLOSE DATASET INFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;synchronous updating&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;&amp;#133;&amp;#133;&amp;#133;&lt;/P&gt;&lt;P&gt;PERFORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146;&lt;/P&gt;&lt;P&gt;USING BDC_TAB&lt;/P&gt;&lt;P&gt;MODE &amp;#145;N&amp;#146;&lt;/P&gt;&lt;P&gt;UPDATE &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0.&lt;/P&gt;&lt;P&gt;WRITE: /&amp;#145;ERROR&amp;#146;. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With synchronous updating, we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;asynchronous updating&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;&amp;#133;&amp;#133;&amp;#133;&lt;/P&gt;&lt;P&gt;PERFORM FILL_BDC_TAB.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146;&lt;/P&gt;&lt;P&gt;USING BDC_TAB&lt;/P&gt;&lt;P&gt;MODE &amp;#145;N&amp;#146;&lt;/P&gt;&lt;P&gt;UPDATE &amp;#145;A&amp;#146;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt; &amp;gt; 0.&lt;/P&gt;&lt;P&gt;WRITE: /&amp;#145;ERROR&amp;#146;. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With asynchronous updating, we can check SY-SUBRC to determine the success of the transaction only, not the actual update to the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Error Handling&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Write an error report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Send the record(s) in error to an error file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a batch input session with the record(s) in error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To store error messages ( CALL TRANSACTION )&lt;/P&gt;&lt;P&gt;data: begin of Tab_Mess occurs 0.&lt;/P&gt;&lt;P&gt;include structure bdcmsgcoll.&lt;/P&gt;&lt;P&gt;data : end of Tab_Mess,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;FK02&amp;#146; USING BDC_TAB MODE &amp;#145;N&amp;#146; UPDATE &amp;#145;S&amp;#146; &lt;/P&gt;&lt;P&gt;MESSAGES INTO TAB_MESS.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;WRITE: / Tab_MESS-TCODE, Tab_MESS-DYNUMB, Tab_MESS-MSGTYP , &lt;/P&gt;&lt;P&gt;Tab_MESS-MSGID.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;i am giving you example for Change Vendor you practice for ur tcode&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For our example, we will use the &amp;#147;Change Vendor&amp;#148; transaction (&amp;#147;FK02&amp;#148;) to add a street address to an already existing vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step #1&lt;/P&gt;&lt;P&gt;Use &amp;#147;System&amp;amp;#61664;Status&amp;#148; menu path to determine online program name (SAPMF02K), screen number (0110)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step #2&lt;/P&gt;&lt;P&gt;Use &amp;#147;F1&amp;#148; key and &amp;#147;Technical Info&amp;#148; pushbutton in each screen field to be filled to determine the field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step #3 &lt;/P&gt;&lt;P&gt;Determine how to proceed in the transaction&lt;/P&gt;&lt;P&gt;(save the record by clicking on the &amp;#145;Save&amp;#146; pushbutton or pressing the &amp;#145;F11&amp;#146; key).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BDC Table Contents&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;After researching the transaction we can determine the contents of the BDC table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM DYNPRO DYNBEGIN FNAM FVAL&lt;/P&gt;&lt;P&gt;SAMPF02K 0106 X &lt;/P&gt;&lt;P&gt;RF02K-LIFNR TEST1&lt;/P&gt;&lt;P&gt;RF02K-D0110 X&lt;/P&gt;&lt;P&gt;SAMPF02K 0110 X &lt;/P&gt;&lt;P&gt;LFA1-STRAS 123 Main St.&lt;/P&gt;&lt;P&gt;BDC_OKCODE /11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Batch Input Methods&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#147;CALL TRANSACTION USING&amp;#148;&lt;/P&gt;&lt;P&gt;STATEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Call transaction - for data transfer&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Processing batch input data with CALL TRANSACTION USING is the faster of the two recommended data transfer methods. In this method, legacy data is processed inline in your data transfer program. &lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;lt;tcode&amp;gt;&lt;/P&gt;&lt;P&gt;USING &amp;lt;bdc_tab&amp;gt;&lt;/P&gt;&lt;P&gt;MODE &amp;lt;mode&amp;gt;&lt;/P&gt;&lt;P&gt;UPDATE &amp;lt;update&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A Display all&lt;/P&gt;&lt;P&gt;E Display errors only&lt;/P&gt;&lt;P&gt;N No display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S Synchronous&lt;/P&gt;&lt;P&gt;A Asynchronous&lt;/P&gt;&lt;P&gt;L Local update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The process flow of CALL TRANSACTION&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:&lt;/P&gt;&lt;P&gt;Prepare a BDCDATA structure for the transaction that you wish to run. &lt;/P&gt;&lt;P&gt;Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.&lt;/P&gt;&lt;P&gt;With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION &amp;#145;MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;lt;Error_handling&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Overview of Batch Input Session&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZRK1CALLTRANS .&lt;/P&gt;&lt;P&gt;TABLES:MARA,MAKT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;MATNR LIKE RMMG1-MATNR,&lt;/P&gt;&lt;P&gt;MBRSH LIKE RMMG1-MBRSH,&lt;/P&gt;&lt;P&gt;MTART LIKE RMMG1-MTART,&lt;/P&gt;&lt;P&gt;MAKTX LIKE MAKT-MAKTX,&lt;/P&gt;&lt;P&gt;MEINS LIKE MARA-MEINS,&lt;/P&gt;&lt;P&gt;MATKL LIKE MARA-MATKL,&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;DATA : ITAB2 LIKE BDCDATA OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CODEPAGE = 'IBM '&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\SUMAN.TXT '&lt;/P&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HEADLEN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LINE_EXIT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TRUNCLEN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USER_FORM = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;USER_PROG = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DAT_D_FORMAT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILELENGTH =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILE_OPEN_ERROR = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILE_READ_ERROR = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TYPE = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_BATCH = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNKNOWN_ERROR = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 8&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CUSTOMER_ERROR = 9&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_AUTHORITY = 10&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 11&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;WRITE : / ITAB-MATNR,ITAB-MBRSH,ITAB-MTART,ITAB-MAKTX,ITAB-MEINS,&lt;/P&gt;&lt;P&gt;ITAB-MATKL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-PROGRAM = 'SAPLMGMM'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNPRO = '0060'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MATNR.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'RMMG1-MBRSH'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MBRSH.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'RMMG1-MTART'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MTART.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'BDC_OKCODE'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = '/00'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-PROGRAM = 'SAPLMGMM'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNPRO = '0070'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MSICHTAUSW-KZSEL(01)'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'BDC_OKCODE'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = '=ENTR'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-PROGRAM = 'SAPLMGMM'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = '4004'.&lt;/P&gt;&lt;P&gt;ITAB2-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MAKTX.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MARA-MEINS'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MEINS.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'MARA-MATKL'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = ITAB-MATKL.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2-FNAM = 'BDC_OKCODE'.&lt;/P&gt;&lt;P&gt;ITAB2-FVAL = '=BU'.&lt;/P&gt;&lt;P&gt;APPEND ITAB2.&lt;/P&gt;&lt;P&gt;CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'MM01' USING ITAB2 MODE 'A' UPDATE 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BATCH DATA COMMUNICATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About Data Transfer In R/3 System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the process of replacing current applications and transferring application data, two situations might occur:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; The first is when application data to be replaced is transferred at once, and only once.&lt;/P&gt;&lt;P&gt;&amp;#149; The second situation is to transfer data periodically from external systems to SAP and vice versa.&lt;/P&gt;&lt;P&gt;&amp;#149; There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called &amp;#147;batch input&amp;#148; or &amp;#147;batch data communication&amp;#148;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. SESSION METHOD&lt;/P&gt;&lt;P&gt;2. CALL TRANSACTION&lt;/P&gt;&lt;P&gt;3. DIRECT INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advantages offered by BATCH INPUT method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Can process large data volumes in batch.&lt;/P&gt;&lt;P&gt;2. Can be planned and submitted in the background.&lt;/P&gt;&lt;P&gt;3. No manual interaction is required when data is transferred.&lt;/P&gt;&lt;P&gt;4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a &amp;#147;data transfer&amp;#148; program must map the data from the external system into the data structure required by the SAP batch input program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The batch input program must build all of the input to execute the SAP transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two main steps are required: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.&lt;/P&gt;&lt;P&gt;&amp;#149; To pass the table to SAP for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisite for Data Transfer Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing a Data Transfer Program involves following prerequisites:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyzing data from local file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyzing transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyzing transaction involves following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; The transaction code, if you do not already know it.&lt;/P&gt;&lt;P&gt;&amp;#149; Which fields require input i.e., mandatory.&lt;/P&gt;&lt;P&gt;&amp;#149; Which fields can you allow to default to standard values.&lt;/P&gt;&lt;P&gt;&amp;#149; The names, types, and lengths of the fields that are used by a transaction.&lt;/P&gt;&lt;P&gt;&amp;#149; Screen number and Name of module pool program behind a particular transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To analyze a transaction::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Start the transaction by menu or by entering the transaction code in the command box.&lt;/P&gt;&lt;P&gt;(You can determine the transaction name by choosing System &amp;#150; Status.)&lt;/P&gt;&lt;P&gt;&amp;#149; Step through the transaction, entering the data will be required for processing your batch input data.&lt;/P&gt;&lt;P&gt;&amp;#149; On each screen, note the program name and screen (dynpro) number.&lt;/P&gt;&lt;P&gt;(dynpro = dyn + pro. Dyn = screen, pro = number)&lt;/P&gt;&lt;P&gt;&amp;#149; Display these by choosing System &amp;#150; Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.&lt;/P&gt;&lt;P&gt;The technical info pop-up shows not only the field information but also the program and screen.&lt;/P&gt;&lt;P&gt;&amp;#149; For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the following information:&lt;/P&gt;&lt;P&gt;- The field name for batch input, which you&amp;#146;ll find in its own box.&lt;/P&gt;&lt;P&gt;- The length and data type of the field. You can display this information by double clicking on the Data Element field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.&lt;/P&gt;&lt;P&gt;In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.&lt;/P&gt;&lt;P&gt;You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have program name, screen number, field name (screen field name), you can start writing.&lt;/P&gt;&lt;P&gt;DATA TRANSFER program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Integral Table similar to structure like local file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring internal table like BDCDATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:&lt;/P&gt;&lt;P&gt;&amp;#149; Create a BDCDATA structure&lt;/P&gt;&lt;P&gt;&amp;#149; Write the structure out to a session or process it with CALL TRANSACTION USING; and then&lt;/P&gt;&lt;P&gt;&amp;#149; Create a BDCDATA structure for the next transaction that is to be processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Data that is entered into screen fields.&lt;/P&gt;&lt;P&gt;&amp;#149; Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BDCDATA structure contains the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.&lt;/P&gt;&lt;P&gt;&amp;#149; DYNPRO: Screen Number. Set this field only in the first record for the screen.&lt;/P&gt;&lt;P&gt;&amp;#149; DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to &amp;#145; &amp;#145; (blank) for all other records.)&lt;/P&gt;&lt;P&gt;&amp;#149; FNAM: Field Name. The FNAM field is not case-sensitive.&lt;/P&gt;&lt;P&gt;&amp;#149; FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transferring data from local file to internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Population of BDCDATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All these five initial steps are necessary for any type of BDC interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SESSION METHOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About Session method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this method you transfer data from internal table to database table through sessions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless session is processed, the data is not transferred to database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_OPEN_GROUP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You create the session through program by BDC_OPEN_GROUP function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters to this function are: &lt;/P&gt;&lt;P&gt;&amp;#149; User Name: User name &lt;/P&gt;&lt;P&gt;&amp;#149; Group: Name of the session&lt;/P&gt;&lt;P&gt;&amp;#149; Lock Date: The date on which you want to process the session.&lt;/P&gt;&lt;P&gt;&amp;#149; Keep: This parameter is passed as &amp;#145;X&amp;#146; when you want to retain session after&lt;/P&gt;&lt;P&gt;processing it or &amp;#145; &amp;#145; to delete it after processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_INSERT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function creates the session &amp;amp; data is transferred to Session.&lt;/P&gt;&lt;P&gt;Parameters to this function are:&lt;/P&gt;&lt;P&gt;&amp;#149; Tcode: Transaction Name &lt;/P&gt;&lt;P&gt;&amp;#149; Dynprotab: BDC Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_CLOSE_GROUP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function closes the BDC Group. No Parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some additional information for session processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call transaction &amp;lt;tcode&amp;gt; using &amp;lt;BDCTAB&amp;gt;&lt;/P&gt;&lt;P&gt;Mode &amp;lt;A/N/E&amp;gt;&lt;/P&gt;&lt;P&gt;Update &amp;lt;S/A&amp;gt;&lt;/P&gt;&lt;P&gt;Messages into &amp;lt;MSGTAB&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 1 is transaction code.&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 2 is name of BDCTAB table.&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 3 here you are specifying mode in which you execute transaction&lt;/P&gt;&lt;P&gt;A is all screen mode. All the screen of transaction are displayed.&lt;/P&gt;&lt;P&gt;N is no screen mode. No screen is displayed when you execute the transaction.&lt;/P&gt;&lt;P&gt;E is error screen. Only those screens are displayed wherein you have error record.&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 4 here you are specifying update type by which database table is updated.&lt;/P&gt;&lt;P&gt;S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.&lt;/P&gt;&lt;P&gt;A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter &amp;#150; 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Tcode: Transaction code&lt;/P&gt;&lt;P&gt;2. Dyname: Batch point module name&lt;/P&gt;&lt;P&gt;3. Dynumb: Batch input Dyn number&lt;/P&gt;&lt;P&gt;4. Msgtyp: Batch input message type (A/E/W/I/S)&lt;/P&gt;&lt;P&gt;5. Msgspra: Batch input Lang, id of message&lt;/P&gt;&lt;P&gt;6. Msgid: Message id&lt;/P&gt;&lt;P&gt;7. MsgvN: Message variables (N = 1 - 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps for CALL TRANSACTION method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Internal table for the data (structure similar to your local file)&lt;/P&gt;&lt;P&gt;2. BDCTAB like BDCDATA&lt;/P&gt;&lt;P&gt;3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)&lt;/P&gt;&lt;P&gt;4. Loop at itab.&lt;/P&gt;&lt;P&gt;Populate BDCTAB table.&lt;/P&gt;&lt;P&gt;Call transaction &amp;lt;tcode&amp;gt; using &amp;lt;BDCTAB&amp;gt;&lt;/P&gt;&lt;P&gt;Mode &amp;lt;A/N/E&amp;gt;&lt;/P&gt;&lt;P&gt;Update &amp;lt;S/A&amp;gt;.&lt;/P&gt;&lt;P&gt;Refresh BDCTAB.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(To populate BDCTAB, You need to transfer each and every field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The major differences between Session method and Call transaction are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SESSION METHOD CALL TRANSACTION&lt;/P&gt;&lt;P&gt;1. Data is not updated in database table unless Session is processed. Immediate updation in database table.&lt;/P&gt;&lt;P&gt;2. No sy-subrc is returned. Sy-subrc is returned.&lt;/P&gt;&lt;P&gt;3. Error log is created for error records. Errors need to be handled explicitly &lt;/P&gt;&lt;P&gt;4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Handling in CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps for the error handling in CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Internal table for the data (structure similar to your local file)&lt;/P&gt;&lt;P&gt;2. BDCTAB like BDCDATA&lt;/P&gt;&lt;P&gt;3. Internal table BDCMSG like BDCMSGCOLL&lt;/P&gt;&lt;P&gt;4. Internal table similar to Ist internal table&lt;/P&gt;&lt;P&gt;(Third and fourth steps are for error handling)&lt;/P&gt;&lt;P&gt;5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)&lt;/P&gt;&lt;P&gt;6. Loop at itab.&lt;/P&gt;&lt;P&gt;Populate BDCTAB table.&lt;/P&gt;&lt;P&gt;Call transaction &amp;lt;tr.code&amp;gt; using &amp;lt;Bdctab&amp;gt;&lt;/P&gt;&lt;P&gt;Mode &amp;lt;A/N/E&amp;gt;&lt;/P&gt;&lt;P&gt;Update &amp;lt;S/A&amp;gt;&lt;/P&gt;&lt;P&gt;Messages &amp;lt;BDCMSG&amp;gt;.&lt;/P&gt;&lt;P&gt;Perform check.&lt;/P&gt;&lt;P&gt;Refresh BDCTAB.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;7 Form check.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0. (Call transaction returns the sy-subrc if updating is not successful).&lt;/P&gt;&lt;P&gt;Call function Format_message.&lt;/P&gt;&lt;P&gt;(This function is called to store the message given by system and to display it along with record)&lt;/P&gt;&lt;P&gt;Append itab2.&lt;/P&gt;&lt;P&gt;Display the record and message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DIRECT INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About Direct Input&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. Direct input checks the data thoroughly and then updates the database directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can start a Direct Input program in two ways;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start the program directly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting the program via the DI administration transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Create variant&lt;/P&gt;&lt;P&gt;- Define job&lt;/P&gt;&lt;P&gt;- Start job&lt;/P&gt;&lt;P&gt;- Restart job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Common batch input errors&lt;/P&gt;&lt;P&gt;- The batch input BDCDATA structure tries to assign values to fields which do not exist in the current transaction screen.&lt;/P&gt;&lt;P&gt;- The screen in the BDCDATA structure does not match the right sequence, or an intermediate screen is missing.&lt;/P&gt;&lt;P&gt;- On exceptional occasions, the logic flow of batch input session does not exactly match that of manual online processing. Testing the sessions online can discover by this.&lt;/P&gt;&lt;P&gt;- The BDCDATA structure contains fields, which are longer than the actual definition.&lt;/P&gt;&lt;P&gt;- Authorization problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECORDING A BATCH INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A B recording allows you to record a R/3 transaction and generate a program that contains all screens and field information in the required BDC-DATA format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can either use SHDB transaction for recording or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT&amp;amp;#61614; BATCH INPUT &amp;amp;#61614; SERVICES &amp;amp;#61614;SYSTEM &lt;/P&gt;&lt;P&gt;And from here click recording.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enter name for the recording.&lt;/P&gt;&lt;P&gt;(Dates are optional)&lt;/P&gt;&lt;P&gt;Click recording.&lt;/P&gt;&lt;P&gt;Enter transaction code.&lt;/P&gt;&lt;P&gt;Enter.&lt;/P&gt;&lt;P&gt;Click Save button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You finally come to a screen where, you have all the information for each screen including BDC_OKCODE.&lt;/P&gt;&lt;P&gt;&amp;#149; Click Get Transaction.&lt;/P&gt;&lt;P&gt;&amp;#149; Return to BI.&lt;/P&gt;&lt;P&gt;&amp;#149; Click overview.&lt;/P&gt;&lt;P&gt;&amp;#149; Position the cursor on the just recorded entry and click generate program.&lt;/P&gt;&lt;P&gt;&amp;#149; Enter program name.&lt;/P&gt;&lt;P&gt;&amp;#149; Click enter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program is generated for the particular transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BACKGROUND PROCESSING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need for Background processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a large volume of data is involved, usually all batch inputs are done in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The R/3 system includes functions that allow users to work non-interactively or offline. The background processing systems handle these functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Non-interactively means that instead of executing the ABAP/4 programs and waiting for an answer, user can submit those programs for execution at a more convenient planned time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several reasons to submit programs for background execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; The maximum time allowed for online execution should not exceed 300 seconds. User gets TIMEOUT error and an aborted transaction, if time for execution exceeds 300 seconds. To avoid these types of error, you can submit jobs for background processing.&lt;/P&gt;&lt;P&gt;&amp;#149; You can use the system while your program is executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not mean that interactive or online work is not useful. Both type of processing have their own purposes. Online work is the most common one entering business data, displaying information, printing small reports, managing the system and so on. Background jobs are mainly used for the following tasks; to process large amount of data, to execute periodic jobs without human intervention, to run program at a more convenient, planned time other than during normal working hours i.e., Nights or weekends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transaction for background processing is SM36.&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;Define jobs&amp;amp;#61614; Jobs &amp;amp;#61614; Administration &amp;amp;#61614;Tools &lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;Jobs&amp;amp;#61614; services &amp;amp;#61614;System &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Components of the background jobs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A job in Background processing is a series of steps that can be scheduled and step is a program for background processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Job name. Define the name of assigned to the job. It identifies the job. You can specify up to 32 characters for the name.&lt;/P&gt;&lt;P&gt;&amp;#149; Job class. Indicates the type of background processing priority assigned to the job.&lt;/P&gt;&lt;P&gt;The job class determines the priority of a job. The background system admits three types of job classes: A B &amp;amp; C, which correspond to job priority.&lt;/P&gt;&lt;P&gt;&amp;#149; Job steps. Parameters to be passed for this screen are as follows:&lt;/P&gt;&lt;P&gt;Program name.&lt;/P&gt;&lt;P&gt;Variant if it is report program&lt;/P&gt;&lt;P&gt;Start criteria for the job: Option available for this are as follows:&lt;/P&gt;&lt;P&gt;Immediate - allows you to start a job immediately.&lt;/P&gt;&lt;P&gt;Date/Time - allows you to start a job at a specific name.&lt;/P&gt;&lt;P&gt;After job - you can start a job after a particular job.&lt;/P&gt;&lt;P&gt;After event - allows you to start a job after a particular event.&lt;/P&gt;&lt;P&gt;At operation mode - allows you to start a job when the system switches to a particular operation mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining Background jobs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is two step process: Firstly, you define the job and then release it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When users define a job and save it, they are actually scheduling the report i.e., specifying the job components, the steps, the start time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When users schedule program for background processing, they are instructing the system to execute an ABAP/4 report or an external program in the background. Scheduled jobs are not executed until they are released. When jobs are released, they are sent for execution to the background processing system at the specified start time. Both scheduling and releasing of jobs require authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HANDLING OF POP UP SCREEN IN BDC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many times in transaction pop up screen appears and for this screen you don&amp;#146;t pass any record but some indication to system telling it to proceed further. For example: The following screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To handle such screen, system has provided a variable called BDC_CURSOR. You pass this variable to BDCDATA and process the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually such screen appears in many transactions, in this case you are just passing information, that YES you want to save the information, that means YES should be clicked. So you are transferring this information to BDCDATA i.e., field name of YES which is usually SPOT_OPTION. Instead of BDC_OKCODE, you are passing BDC_CURSOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC_CURSOR is also used to place cursor on particular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN EXAMPLE WITH SESSION METHOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following program demonstrates how data is passed from flat file to SAP transaction and further to database table by using SESSION method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transaction is TFBA (to change customer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple transaction where you are entering customer number on first screen and on next screen data is displayed for the particular customer number. Field, which we are changing here, are name and city. When you click on save, the changed record gets saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisite to write this BDC interface as indicated earlier is:&lt;/P&gt;&lt;P&gt;1. To find screen number&lt;/P&gt;&lt;P&gt;2. To find screen field names, type of the field and length of the field.&lt;/P&gt;&lt;P&gt;3. To find BDC_OKCODE for each screen&lt;/P&gt;&lt;P&gt;4. Create flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flat file can be created in your hard disk as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 Vinod Krishna Hyderabad&lt;/P&gt;&lt;P&gt;2 Kavitha Secunderabad&lt;/P&gt;&lt;P&gt;3 Kishore Hyderabad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Where 1st character field is Customer number, 2nd field is Customer name and 3rd field is City.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To transfer this data to database table SCUSTOM following interface can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT DEMO1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Following internal table is to upload flat file.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;ID(10),&lt;/P&gt;&lt;P&gt;NAME(25),&lt;/P&gt;&lt;P&gt;CITY(25),&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;*Following internal table BDCDATA is to pass date from internal table to session.&lt;/P&gt;&lt;P&gt;DATA: BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: DATE1 LIKE SY-DATUM. DATE1 = SY-DATUM - 1. &amp;#147; This is for Hold Date&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To upload flat file to internal table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION UPLOAD&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILE NAME = &amp;#145;C:\FF.TXT&amp;#146;&lt;/P&gt;&lt;P&gt;FILE TYPE = &amp;#145;ASC&amp;#148;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_ERROR = 1&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 2&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 3&lt;/P&gt;&lt;P&gt;NO_BATCH = 4&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 5&lt;/P&gt;&lt;P&gt;OTHERS = 6.&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calling Function to Create a Session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION &amp;#145;BDC_OPEN_GROUP&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;CLIENT = SY-MANDT&lt;/P&gt;&lt;P&gt;GROUP = &amp;#145;POTHURI&amp;#146;&lt;/P&gt;&lt;P&gt;HOLDDATE = DATE1&lt;/P&gt;&lt;P&gt;KEEP = &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;USER = SY-UNAME&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CLIENT_INVALID = 1&lt;/P&gt;&lt;P&gt;DESTINATION_INVALID = 2&lt;/P&gt;&lt;P&gt;GROUP_INVALID = 3&lt;/P&gt;&lt;P&gt;GROUP_IS_LOCKED = 4&lt;/P&gt;&lt;P&gt;HOLDDATE_INVALID = 5&lt;/P&gt;&lt;P&gt;INTERNAL_ERROR = 6&lt;/P&gt;&lt;P&gt;QUEUE_ERROR = 7&lt;/P&gt;&lt;P&gt;RUNNING = 8&lt;/P&gt;&lt;P&gt;SYSTEM_LOCK_ERROR = 9&lt;/P&gt;&lt;P&gt;USER_INVALID = 10&lt;/P&gt;&lt;P&gt;OTHERS = 11.&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt; MAIN Logic--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------" /&gt;&lt;P&gt;LOOP AT ITAB&lt;/P&gt;&lt;P&gt;PERFORM GENERATE_DATA. &amp;#147; Populating BDCDATA Table&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;BDC_INSERT&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;TCODE = &amp;#145;TFBA&amp;#146;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DYNPROTAB = BDCTAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;INTERNAL_ERROR = 1&lt;/P&gt;&lt;P&gt;NOT_OPEN = 2&lt;/P&gt;&lt;P&gt;QUEUE_ERROR = 3&lt;/P&gt;&lt;P&gt;TCODE_INVALID = 4&lt;/P&gt;&lt;P&gt;PRINTING_INVALID = 5&lt;/P&gt;&lt;P&gt;POSTING_INVALID = 6&lt;/P&gt;&lt;P&gt;OTHERS = 7.&lt;/P&gt;&lt;P&gt;REFRESH BDCTAB&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calling function to close the session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION &amp;#145;BDC_CLOSE_GROUP&amp;#146;&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_OPEN = 1&lt;/P&gt;&lt;P&gt;QUEUE_ERROR = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form GENERATE_DATA&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create BDC Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GENERATE_DATA&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing information for 1st screen on BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-PROGRAM = &amp;#145;SAPMTFBA&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAX-DYNPRO = 100.&lt;/P&gt;&lt;P&gt;BDCTAP-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BCDTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing field information to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;SCUSTOM-ID&amp;#146;&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = ITAB-ID.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing BDC_OKCODE to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;BDC_OKCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = &amp;#145;/5&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing screen information for next screen to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-PROGRAM = &amp;#145;SAPMTFBA&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-DYNPRO = 200.&lt;/P&gt;&lt;P&gt;BDCTAB-DYNBEGIN = &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing screen information to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;SCUSTOM-NAME&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = ITAB-NAME.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing screen information to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;SCUSTOM-CITY&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = ITAB-CITY.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Passing BDC_OKCODE to BDCDATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BDCTAB-FNAM = &amp;#145;BDC_OKCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;BDCTAB-FVAL = &amp;#145;SAVE&amp;#146;.&lt;/P&gt;&lt;P&gt;APPEND BDCTAB.CLEAR BDCTAB.&lt;/P&gt;&lt;P&gt;ENDFORM. &amp;#147;GENERATE_DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN EXAMPLE WITH CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same steps to be repeated for CALL TRANSACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only difference between the two types of interface is in Session method, you create session and store information about screen and data into session. When session is processed the data is transferred to database. While in CALL TRANSACTION, data is transferred directly to database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT DEMO1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Follow above Code till MAIN Logic. Even the Subroutine should be copied&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT ITAB&lt;/P&gt;&lt;P&gt;PERFORM GENERATE_DATA, &amp;#147;Populating BDCDATA Table&lt;/P&gt;&lt;P&gt;Call transaction &amp;#145;TFBA&amp;#146; using BCDDATA Mode &amp;#145;A&amp;#146; Update &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;REFRESH BDCTAB&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 08:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/give-a-simple-bdc-example-for-call-transaction-method/m-p/2954058#M696751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T08:29:21Z</dc:date>
    </item>
  </channel>
</rss>

