<?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: hi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3346462#M802472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for both these u have different methods..&lt;/P&gt;&lt;P&gt;for transferring data from SAP to legacy u can use BAPI&lt;/P&gt;&lt;P&gt;and for transferring data from legacy to SAP u can use BDC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in respect of BDC i can give u some details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC or Batch Input Program Tips and Tricks &lt;/P&gt;&lt;P&gt;What is BDC? &lt;/P&gt;&lt;P&gt;Batch Data Communication or BDC is a batch interfacing technique that SAP developed.  It is mainly used for uploading data into the SAP R/3 system.   BDC works by simulating the user input from transactional screen via an ABAP program. &lt;/P&gt;&lt;P&gt;The data input data file will come in the form of a flat file which the user save as file type txt file or prn file from the Microsoft Excel program.  An Abaper will create a program to read the text file and upload into the SAP system. &lt;/P&gt;&lt;P&gt;Normally, the tcode SHDB will be used to record the transaction code the user used.  After, the simulation, the Abaper can generate a sample program and modify from there.  It makes the programming easier and faster.  &lt;/P&gt;&lt;P&gt;Learning BDC Programming &lt;/P&gt;&lt;P&gt;I want to learn how to upload data using BDC. If I have a excel data file how will upload it using BDC. I don't know the full process of doing it, if someone help me in this. I want it using BDC session process and processing that session. I was trying to upload material master other day. But could not follow the process of uploading using BDC though I know LSMW.  Please explain me the BDC process in details with examples. &lt;/P&gt;&lt;P&gt;For a BDC upload you need to write a program which created BDC sessions. &lt;/P&gt;&lt;P&gt;Steps: &lt;/P&gt;&lt;P&gt;1. Work out the transaction you would use to create the data manually. &lt;/P&gt;&lt;P&gt;2. Use transaction SHDB to record the creation of one material master data. &lt;/P&gt;&lt;P&gt;    Click the New recording button or the Menu - Recording - Create &lt;/P&gt;&lt;P&gt;3. Save the recording, and then go back a screen and go to the overview. &lt;/P&gt;&lt;P&gt;4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording. &lt;/P&gt;&lt;P&gt;5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes: &lt;/P&gt;&lt;P&gt;5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated). &lt;/P&gt;&lt;P&gt;5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data. &lt;/P&gt;&lt;P&gt;5.3. After perform bdc_transaction, add the endloop. &lt;/P&gt;&lt;P&gt;Execute the program. It will have options to create a batch session or to process directly. &lt;/P&gt;&lt;P&gt;These are all my finds . Might be it will be useful to you. &lt;/P&gt;&lt;P&gt;Direct call of transactions, session handling: &lt;/P&gt;&lt;P&gt;/nxxxx This terminates the current transaction, and starts transaction xxxx &lt;/P&gt;&lt;P&gt;/n This terminates the transaction. This generally corresponds to pressing F15 to go back. &lt;/P&gt;&lt;P&gt;/nend This termiantes all separate sessions and logs off (corresponds to System - Logoff). &lt;/P&gt;&lt;P&gt;/nex This terminates all separate sessions and logs off immediately (without any warning!). &lt;/P&gt;&lt;P&gt;/oxxxx This opens a new session and starts transaction xxxx in This session. &lt;/P&gt;&lt;P&gt;/o This lists existing sessions and allows deletion or opening of a new session. &lt;/P&gt;&lt;P&gt;/i This terminates the current session (corresponds to System End &lt;/P&gt;&lt;P&gt;/i1, /i2,... This terminates the session with the number given. &lt;/P&gt;&lt;P&gt;.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse). &lt;/P&gt;&lt;P&gt;Batch &lt;/P&gt;&lt;P&gt;The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session: &lt;/P&gt;&lt;P&gt;/n This terminates the current batch input transaction and characterizes it as &lt;/P&gt;&lt;P&gt;/bdel This deletes the current batch input transaction. &lt;/P&gt;&lt;P&gt;/bend This terminates batch input processing and sets the session to Failed &lt;/P&gt;&lt;P&gt;/bda This switches from Display errors only to Process in foreground &lt;/P&gt;&lt;P&gt;/bde This switches from Process in foreground to Display errors only &lt;/P&gt;&lt;P&gt;ABAP/4 &lt;/P&gt;&lt;P&gt;/h This switches into debugging mode. &lt;/P&gt;&lt;P&gt;/hs This switches into debugging mode and activates the debugging of system functions. &lt;/P&gt;&lt;P&gt;Buffer &lt;/P&gt;&lt;P&gt;WARNING: Resetting buffers can significantly change the performance of the entire system for a long time. &lt;/P&gt;&lt;P&gt;It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log. &lt;/P&gt;&lt;P&gt;/$SYNC This resets all buffers of the application server &lt;/P&gt;&lt;P&gt;/$CUA This resets the CUA buffer of the application server &lt;/P&gt;&lt;P&gt;/$TAB This resets the TABLE buffers of the application server &lt;/P&gt;&lt;P&gt;/$NAM This resets the nametab buffer of the application server &lt;/P&gt;&lt;P&gt;/$DYNP This resets the screen buffer of the application server &lt;/P&gt;&lt;P&gt;What is recording? &lt;/P&gt;&lt;P&gt;As the word record implies, it mean recording the keystroke of the user input of a SAP transaction screen. &lt;/P&gt;&lt;P&gt;Why it is used? &lt;/P&gt;&lt;P&gt;It is normally used for mass update or uploading of data to the system. &lt;/P&gt;&lt;P&gt;What is its need? &lt;/P&gt;&lt;P&gt;It help to save time for the users who need to mass change the system data.  For e.g. tax rate change announce by the country government. &lt;/P&gt;&lt;P&gt;How it is related with bdc? &lt;/P&gt;&lt;P&gt;It is related to bdc because bdc programming allows recording of user inputs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference Between Batch Input and Call Transaction in BDC &lt;/P&gt;&lt;P&gt;What is the difference between batch input and call transaction in BDC? &lt;/P&gt;&lt;P&gt;Session method. &lt;/P&gt;&lt;P&gt;1) synchronous processing. &lt;/P&gt;&lt;P&gt;2) can tranfer large amount of data. &lt;/P&gt;&lt;P&gt;3) processing is slower. &lt;/P&gt;&lt;P&gt;4) error log is created &lt;/P&gt;&lt;P&gt;5) data is not updated until session is processed. &lt;/P&gt;&lt;P&gt;Call transaction. &lt;/P&gt;&lt;P&gt;1) asynchronous processing &lt;/P&gt;&lt;P&gt;2) can transfer small amount of data &lt;/P&gt;&lt;P&gt;3) processing is faster. &lt;/P&gt;&lt;P&gt;4) errors need to be handled explicitly &lt;/P&gt;&lt;P&gt;5) data is updated automatically &lt;/P&gt;&lt;P&gt;Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3.   BDC is not a typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is &lt;/P&gt;&lt;P&gt;not bi-directional.  &lt;/P&gt;&lt;P&gt;BDC works on the principle of simulating user input for transactional screen, via an ABAP program. &lt;/P&gt;&lt;P&gt;Typically the input comes in the form of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The transaction is then started using this internal table as the input and executed in the background.  &lt;/P&gt;&lt;P&gt;In &amp;#145;Call Transaction&amp;#146;, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.  It can also be used for real-time interfaces and custom error handling &amp;amp; logging features. Whereas in &lt;/P&gt;&lt;P&gt;Batch Input Sessions, the ABAP program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too.  &lt;/P&gt;&lt;P&gt;Batch Input (BI) programs still use the classical BDC approach but doesn&amp;#146;t require an ABAP program to be written to format the BDCDATA. The user has to format the data using predefined structures and store it in a flat file. The BI program then reads this and invokes the transaction mentioned in the header record of the file.  &lt;/P&gt;&lt;P&gt;Direct Input (DI) programs work exactly similar to BI programs. But the only difference is, instead of processing screens they validate fields and directly load the data into tables using standard function modules. For this reason, DI programs are much faster (RMDATIND - Material Master DI program works at least 5 times faster) than the BDC counterpart and so ideally suited for loading large volume data. DI programs are not available for all application areas.  &lt;/P&gt;&lt;P&gt;ABAP Tips by :  Anshu Kumar &lt;/P&gt;&lt;P&gt;Differences between bdc session method and call transaction method. &lt;/P&gt;&lt;P&gt;The most important aspects of the batch session interface are: - Asynchronous processing - Transfers data for multiple transactions - Synchronous database update During processing, no transaction is started until the previous transaction has been written to the database. - A batch input processing log is generated for each session - Sessions cannot be generated in parallel  &lt;/P&gt;&lt;P&gt;The most important aspects of the CALL TRANSACTION USING interface are: - Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. - Separate LUW for the transaction The system performs a database commit immediately before and after the Batch Input Session: &lt;/P&gt;&lt;P&gt;- It is a sequence of transactions, which is generated when user run a particular program.  &lt;/P&gt;&lt;P&gt;- It contains the accounting documents that are to be created. The SAP system stores these transactions until you decide to process them online.  &lt;/P&gt;&lt;P&gt;- It does not update transaction figures until the session has been processed.  Using this technique, you can transfer large amounts of data to the SAP system in a short time. &lt;/P&gt;&lt;P&gt;Three processing modes of executing Batch Input Session :- &lt;/P&gt;&lt;P&gt;(1) Run Visibly : You can correct faulty transactions online &amp;amp; work step-by-step through  the transactions not yet executed.  &lt;/P&gt;&lt;P&gt;(2) Display Errors only : You can correct faulty transactions online.   Transactions not yet executed, but without error, run in the background. &lt;/P&gt;&lt;P&gt;(3) Run in Background : Recommended by SAP.                                     *-- Pradnya &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION USING statement.  - No batch input processing log is generated. &lt;/P&gt;&lt;P&gt;Explain in detail with example what is batch input session? &lt;/P&gt;&lt;P&gt;BDC program for Purchase Info Records &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 ZMM0069                                                    *&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; Module : MM                                                         |&lt;/P&gt;&lt;P&gt;*&amp;amp; Application : The program loads the Purchasing Inforecords          |&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     |&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;P&gt;*| Modification Log                                                    |&lt;/P&gt;&lt;P&gt;*| -&lt;/P&gt;&lt;HR originaltext="---------------" /&gt;&lt;P&gt;                                                    |&lt;/P&gt;&lt;P&gt;*| Programmer      Date       CC#    Chg.Ref        Description of&lt;/P&gt;&lt;P&gt;*|                                                       Change        |&lt;/P&gt;&lt;P&gt;*| -&lt;/P&gt;&lt;HR originaltext="------------" /&gt;&lt;P&gt; -&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt;|&lt;/P&gt;&lt;P&gt;*| Rajesh Singh  23-AUG-2005                        Initial&lt;/P&gt;&lt;P&gt;*|                                                  development.       |&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;P&gt;&lt;/P&gt;&lt;P&gt;  REPORT zmm0069 NO STANDARD PAGE HEADING&lt;/P&gt;&lt;P&gt;                                  MESSAGE-ID z0&lt;/P&gt;&lt;P&gt;                                  LINE-SIZE  132&lt;/P&gt;&lt;P&gt;                                  LINE-COUNT 65(2).&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;                     Internal Tables                                 *&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;&lt;/P&gt;&lt;P&gt;*Internal table for the purchasing info records fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF i_inforecord OCCURS 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        matnr(18),&lt;/P&gt;&lt;P&gt;        lifnr(10),&lt;/P&gt;&lt;P&gt;        uom(3),&lt;/P&gt;&lt;P&gt;        ekgrp(3),&lt;/P&gt;&lt;P&gt;        planned_time(3),&lt;/P&gt;&lt;P&gt;        under_tol(3),&lt;/P&gt;&lt;P&gt;        over_tol(3),&lt;/P&gt;&lt;P&gt;        qty(10),&lt;/P&gt;&lt;P&gt;        price_cat(5),&lt;/P&gt;&lt;P&gt;        inco(3),&lt;/P&gt;&lt;P&gt;        designation(28),&lt;/P&gt;&lt;P&gt;        netpr(13),&lt;/P&gt;&lt;P&gt;        scale_qty1(10),&lt;/P&gt;&lt;P&gt;        scale_pr1(13),&lt;/P&gt;&lt;P&gt;        scale_qty2(10),&lt;/P&gt;&lt;P&gt;        scale_pr2(13),&lt;/P&gt;&lt;P&gt;        scale_qty3(13),&lt;/P&gt;&lt;P&gt;        scale_pr3(10),&lt;/P&gt;&lt;P&gt;        scale_qty4(13),&lt;/P&gt;&lt;P&gt;        scale_pr4(10),&lt;/P&gt;&lt;P&gt;        scale_qty5(13),&lt;/P&gt;&lt;P&gt;        scale_pr5(10),&lt;/P&gt;&lt;P&gt;        scale_qty6(13),&lt;/P&gt;&lt;P&gt;        scale_pr6(10),&lt;/P&gt;&lt;P&gt;        scale_qty7(13),&lt;/P&gt;&lt;P&gt;        scale_pr7(10),&lt;/P&gt;&lt;P&gt;        scale_qty8(13),&lt;/P&gt;&lt;P&gt;        scale_pr8(10),&lt;/P&gt;&lt;P&gt;        scale_qty9(13),&lt;/P&gt;&lt;P&gt;        scale_pr9(10),&lt;/P&gt;&lt;P&gt;        scale_qty10(13),&lt;/P&gt;&lt;P&gt;        scale_pr10(10),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        END OF i_inforecord.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Internal table for Old and New Vendor number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  DATA : BEGIN OF i_lfb1 OCCURS 1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         lifnr(10),&lt;/P&gt;&lt;P&gt;         altkn(10),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         END   OF i_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Declare internal table for Call Transaction and BDC Session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.&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;                     Global Variables                                *&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;&lt;/P&gt;&lt;P&gt;  DATA: g_counter(2) TYPE n,&lt;/P&gt;&lt;P&gt;        g_field_name(18) TYPE c,&lt;/P&gt;&lt;P&gt;        zc_yes  TYPE syftype VALUE 'X'.&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;                     Selection Screen                                *&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;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PARAMETERS: p_fname1 TYPE localfile .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN SKIP 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.&lt;/P&gt;&lt;P&gt;  PARAMETERS: p_rloc1 AS CHECKBOX  DEFAULT 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.&lt;/P&gt;&lt;P&gt;  PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZPURCHINFO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK c.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK b.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**WRITE the report header&lt;/P&gt;&lt;P&gt;  TOP-OF-PAGE.&lt;/P&gt;&lt;P&gt;    INCLUDE zheading.&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;                     Start of selection                              *&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;&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;Load Input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM f_load_input_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create BDC records.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM create_bdc_records .&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  Create_BDC_records&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;      Perform the BDC for the records in the internal 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;P&gt;&lt;/P&gt;&lt;P&gt;  FORM create_bdc_records .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT i_inforecord[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Open BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM open_bdc_session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT lifnr altkn FROM lfb1 INTO TABLE i_lfb1&lt;/P&gt;&lt;P&gt;                          FOR ALL ENTRIES IN i_inforecord&lt;/P&gt;&lt;P&gt;                          WHERE altkn = i_inforecord-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sorting the Internal table for better performance&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SORT i_lfb1 BY altkn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT i_inforecord.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Mapping Old Vendor number to the new Vendor number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        READ TABLE i_lfb1 WITH KEY altkn = i_inforecord-lifnr BINARY&lt;/P&gt;&lt;P&gt;                                                              SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;          i_inforecord-lifnr = i_lfb1-lifnr.&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;        CLEAR i_bdc_table[].&lt;/P&gt;&lt;P&gt;        PERFORM insert_screen_header.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     call transaction 'ME11' using i_bdc_table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                   mode 'A'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CLEAR i_bdc_table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;      CLEAR i_inforecord[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM close_bdc_session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Release the BDC sessions created&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM release_bdc.&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;  ENDFORM.                    " open_group&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_dynpro_start&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;      Start the screen for the transfer of fields&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;&lt;/P&gt;&lt;P&gt;  FORM bdc_dynpro_start  USING    p_g_program_1&lt;/P&gt;&lt;P&gt;                                  p_g_screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR i_bdc_table.&lt;/P&gt;&lt;P&gt;    i_bdc_table-program  = p_g_program_1.&lt;/P&gt;&lt;P&gt;    i_bdc_table-dynpro   = p_g_screen.&lt;/P&gt;&lt;P&gt;    i_bdc_table-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;    APPEND i_bdc_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " bdc_dynpro_start_start&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_insert_field&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;       Insert field                                                  *&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_insert_field USING f_name f_value.&lt;/P&gt;&lt;P&gt;    IF f_value &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;      CLEAR i_bdc_table.&lt;/P&gt;&lt;P&gt;      i_bdc_table-fnam = f_name.&lt;/P&gt;&lt;P&gt;      i_bdc_table-fval = f_value.&lt;/P&gt;&lt;P&gt;      APPEND i_bdc_table.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    "bdc_insert_field&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;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  open_bdc_session&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;      Open a BDC session&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 open_bdc_session .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Open BDC session and create and update records&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BDC_OPEN_GROUP'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        client                    = sy-mandt&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      DEST                      = FILLER8&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        group                     = p_group&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      HOLDDATE                  = FILLER8&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        keep                      = 'X'&lt;/P&gt;&lt;P&gt;        user                      = sy-uname&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      RECORD                    = FILLER1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      PROG                      = SY-CPROG&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;      QID                       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;              .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " create_bdc_session&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  insert_screen_header&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;      Screen flow for the transfer of fields&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;&lt;/P&gt;&lt;P&gt;  FORM insert_screen_header .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First Screen 100&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_dynpro_start USING 'SAPMM06I' '0100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING:'BDC_CURSOR' 'EINA-LIFNR',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'BDC_OKCODE' '/00',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINA-LIFNR' i_inforecord-lifnr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINA-MATNR' i_inforecord-matnr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-EKORG' '1000',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'RM06I-NORMB' zc_yes.&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;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Next Screen 101&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_dynpro_start USING 'SAPMM06I' '0101'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINA-MAHN1',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                     'BDC_OKCODE' '/00',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                     'EINA-MEINS' i_inforecord-uom.&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;P&gt;*Next Screen 102&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_dynpro_start USING 'SAPMM06I' '0102'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINE-INCO2',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 'EINE-APLFZ' i_inforecord-planned_time,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 'EINE-EKGRP' i_inforecord-ekgrp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 'EINE-NORBM' i_inforecord-qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert USING  'EINE-UEBTK' ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING:'EINE-PEINH' i_inforecord-scale_qty1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-BPRME' i_inforecord-uom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-UNTTO' '5',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-UEBTO' '25',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-MEPRF' i_inforecord-price_cat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-NETPR' i_inforecord-netpr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-INCO1' i_inforecord-inco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                  'EINE-INCO2' i_inforecord-designation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Checking for Scale quantities&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF i_inforecord-scale_qty2 = space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field  USING 'BDC_OKCODE' '=BU'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM insert_bdc_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field  USING 'BDC_OKCODE' '=KO'.&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;Next Screen 201&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'RV13A-DATAB',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                        'BDC_OKCODE' '=PSTF'.&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;Next Screen 201&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONP-KSCHL(01)',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                       'BDC_OKCODE' '=PSTF',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                       'RV130-SELKZ(01)' zc_yes.&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;LAST SCREEN 303&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_dynpro_start USING 'SAPMV13A' '0303'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONM-KBETR(03)',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                       'BDC_OKCODE' '=SICH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Counter to Loop the Item level entry&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      g_counter = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty2&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty3&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty4&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty5&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty6&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty7&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty8&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty9&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING  i_inforecord-scale_qty10&lt;/P&gt;&lt;P&gt;                                 i_inforecord-scale_pr10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM insert_bdc_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " insert_screen_header&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  insert_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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Insert BDC&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;&lt;/P&gt;&lt;P&gt;  FORM insert_bdc_new .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BDC_INSERT'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;         tcode                  = 'ME11'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      POST_LOCAL             = NOVBLOCAL&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      PRINTING               = NOPRINT&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      SIMUBATCH              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CTUPARAMS              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;         dynprotab              = i_bdc_table&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;               .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR i_bdc_table[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " insert_bdc&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  close_bdc_session&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;     Close the BDC session&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;&lt;/P&gt;&lt;P&gt;  FORM close_bdc_session .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BDC_CLOSE_GROUP'&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;&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " close_bdc_session&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  f_load_input_file&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;      Upload the file&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;&lt;/P&gt;&lt;P&gt;  FORM f_load_input_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check always Local file for upload&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF p_rloc1 = zc_yes.&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;                filename                = p_fname1&lt;/P&gt;&lt;P&gt;                filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;           TABLES&lt;/P&gt;&lt;P&gt;                data_tab                = i_inforecord&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 &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        STOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " f_load_input_file&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  release_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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Release the session&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;&lt;/P&gt;&lt;P&gt;  FORM release_bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SUBMIT rsbdcsub WITH mappe EQ p_group&lt;/P&gt;&lt;P&gt;                    WITH von EQ sy-datum&lt;/P&gt;&lt;P&gt;                    WITH bis EQ sy-datum&lt;/P&gt;&lt;P&gt;                    WITH fehler EQ '.'&lt;/P&gt;&lt;P&gt;                    EXPORTING LIST TO MEMORY&lt;/P&gt;&lt;P&gt;                    AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " release_bdc&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  scale_entry&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 the Scale quantities&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;P_SCALE_QTY&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_SCALE_PRICE&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 scale_entry USING    p_scale_qty&lt;/P&gt;&lt;P&gt;                            p_scale_price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Increment the Counter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    g_counter = g_counter + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF p_scale_qty &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CONCATENATE 'KONM-KSTBM('  g_counter  ')' INTO g_field_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING g_field_name p_scale_qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CONCATENATE 'KONM-KBETR('  g_counter  ')' INTO g_field_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING g_field_name p_scale_price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.&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_insert&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;      To uncheck the Unlimited (UEBTK)&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;&lt;/P&gt;&lt;P&gt;  FORM bdc_insert USING  f_name f_value.&lt;/P&gt;&lt;P&gt;    CLEAR i_bdc_table.&lt;/P&gt;&lt;P&gt;    i_bdc_table-fnam = f_name.&lt;/P&gt;&lt;P&gt;    i_bdc_table-fval = f_value.&lt;/P&gt;&lt;P&gt;    APPEND i_bdc_table.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " bdc_insert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2008 09:59:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-29T09:59:32Z</dc:date>
    <item>
      <title>hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3346461#M802471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you send files to the legacy systems from SAP and vice versa? How does one know that the legacy files have come on to the SAP server you are working on?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 08:44:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3346461#M802471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T08:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: hi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3346462#M802472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for both these u have different methods..&lt;/P&gt;&lt;P&gt;for transferring data from SAP to legacy u can use BAPI&lt;/P&gt;&lt;P&gt;and for transferring data from legacy to SAP u can use BDC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in respect of BDC i can give u some details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC or Batch Input Program Tips and Tricks &lt;/P&gt;&lt;P&gt;What is BDC? &lt;/P&gt;&lt;P&gt;Batch Data Communication or BDC is a batch interfacing technique that SAP developed.  It is mainly used for uploading data into the SAP R/3 system.   BDC works by simulating the user input from transactional screen via an ABAP program. &lt;/P&gt;&lt;P&gt;The data input data file will come in the form of a flat file which the user save as file type txt file or prn file from the Microsoft Excel program.  An Abaper will create a program to read the text file and upload into the SAP system. &lt;/P&gt;&lt;P&gt;Normally, the tcode SHDB will be used to record the transaction code the user used.  After, the simulation, the Abaper can generate a sample program and modify from there.  It makes the programming easier and faster.  &lt;/P&gt;&lt;P&gt;Learning BDC Programming &lt;/P&gt;&lt;P&gt;I want to learn how to upload data using BDC. If I have a excel data file how will upload it using BDC. I don't know the full process of doing it, if someone help me in this. I want it using BDC session process and processing that session. I was trying to upload material master other day. But could not follow the process of uploading using BDC though I know LSMW.  Please explain me the BDC process in details with examples. &lt;/P&gt;&lt;P&gt;For a BDC upload you need to write a program which created BDC sessions. &lt;/P&gt;&lt;P&gt;Steps: &lt;/P&gt;&lt;P&gt;1. Work out the transaction you would use to create the data manually. &lt;/P&gt;&lt;P&gt;2. Use transaction SHDB to record the creation of one material master data. &lt;/P&gt;&lt;P&gt;    Click the New recording button or the Menu - Recording - Create &lt;/P&gt;&lt;P&gt;3. Save the recording, and then go back a screen and go to the overview. &lt;/P&gt;&lt;P&gt;4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording. &lt;/P&gt;&lt;P&gt;5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes: &lt;/P&gt;&lt;P&gt;5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated). &lt;/P&gt;&lt;P&gt;5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data. &lt;/P&gt;&lt;P&gt;5.3. After perform bdc_transaction, add the endloop. &lt;/P&gt;&lt;P&gt;Execute the program. It will have options to create a batch session or to process directly. &lt;/P&gt;&lt;P&gt;These are all my finds . Might be it will be useful to you. &lt;/P&gt;&lt;P&gt;Direct call of transactions, session handling: &lt;/P&gt;&lt;P&gt;/nxxxx This terminates the current transaction, and starts transaction xxxx &lt;/P&gt;&lt;P&gt;/n This terminates the transaction. This generally corresponds to pressing F15 to go back. &lt;/P&gt;&lt;P&gt;/nend This termiantes all separate sessions and logs off (corresponds to System - Logoff). &lt;/P&gt;&lt;P&gt;/nex This terminates all separate sessions and logs off immediately (without any warning!). &lt;/P&gt;&lt;P&gt;/oxxxx This opens a new session and starts transaction xxxx in This session. &lt;/P&gt;&lt;P&gt;/o This lists existing sessions and allows deletion or opening of a new session. &lt;/P&gt;&lt;P&gt;/i This terminates the current session (corresponds to System End &lt;/P&gt;&lt;P&gt;/i1, /i2,... This terminates the session with the number given. &lt;/P&gt;&lt;P&gt;.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse). &lt;/P&gt;&lt;P&gt;Batch &lt;/P&gt;&lt;P&gt;The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session: &lt;/P&gt;&lt;P&gt;/n This terminates the current batch input transaction and characterizes it as &lt;/P&gt;&lt;P&gt;/bdel This deletes the current batch input transaction. &lt;/P&gt;&lt;P&gt;/bend This terminates batch input processing and sets the session to Failed &lt;/P&gt;&lt;P&gt;/bda This switches from Display errors only to Process in foreground &lt;/P&gt;&lt;P&gt;/bde This switches from Process in foreground to Display errors only &lt;/P&gt;&lt;P&gt;ABAP/4 &lt;/P&gt;&lt;P&gt;/h This switches into debugging mode. &lt;/P&gt;&lt;P&gt;/hs This switches into debugging mode and activates the debugging of system functions. &lt;/P&gt;&lt;P&gt;Buffer &lt;/P&gt;&lt;P&gt;WARNING: Resetting buffers can significantly change the performance of the entire system for a long time. &lt;/P&gt;&lt;P&gt;It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log. &lt;/P&gt;&lt;P&gt;/$SYNC This resets all buffers of the application server &lt;/P&gt;&lt;P&gt;/$CUA This resets the CUA buffer of the application server &lt;/P&gt;&lt;P&gt;/$TAB This resets the TABLE buffers of the application server &lt;/P&gt;&lt;P&gt;/$NAM This resets the nametab buffer of the application server &lt;/P&gt;&lt;P&gt;/$DYNP This resets the screen buffer of the application server &lt;/P&gt;&lt;P&gt;What is recording? &lt;/P&gt;&lt;P&gt;As the word record implies, it mean recording the keystroke of the user input of a SAP transaction screen. &lt;/P&gt;&lt;P&gt;Why it is used? &lt;/P&gt;&lt;P&gt;It is normally used for mass update or uploading of data to the system. &lt;/P&gt;&lt;P&gt;What is its need? &lt;/P&gt;&lt;P&gt;It help to save time for the users who need to mass change the system data.  For e.g. tax rate change announce by the country government. &lt;/P&gt;&lt;P&gt;How it is related with bdc? &lt;/P&gt;&lt;P&gt;It is related to bdc because bdc programming allows recording of user inputs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference Between Batch Input and Call Transaction in BDC &lt;/P&gt;&lt;P&gt;What is the difference between batch input and call transaction in BDC? &lt;/P&gt;&lt;P&gt;Session method. &lt;/P&gt;&lt;P&gt;1) synchronous processing. &lt;/P&gt;&lt;P&gt;2) can tranfer large amount of data. &lt;/P&gt;&lt;P&gt;3) processing is slower. &lt;/P&gt;&lt;P&gt;4) error log is created &lt;/P&gt;&lt;P&gt;5) data is not updated until session is processed. &lt;/P&gt;&lt;P&gt;Call transaction. &lt;/P&gt;&lt;P&gt;1) asynchronous processing &lt;/P&gt;&lt;P&gt;2) can transfer small amount of data &lt;/P&gt;&lt;P&gt;3) processing is faster. &lt;/P&gt;&lt;P&gt;4) errors need to be handled explicitly &lt;/P&gt;&lt;P&gt;5) data is updated automatically &lt;/P&gt;&lt;P&gt;Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3.   BDC is not a typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is &lt;/P&gt;&lt;P&gt;not bi-directional.  &lt;/P&gt;&lt;P&gt;BDC works on the principle of simulating user input for transactional screen, via an ABAP program. &lt;/P&gt;&lt;P&gt;Typically the input comes in the form of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The transaction is then started using this internal table as the input and executed in the background.  &lt;/P&gt;&lt;P&gt;In &amp;#145;Call Transaction&amp;#146;, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.  It can also be used for real-time interfaces and custom error handling &amp;amp; logging features. Whereas in &lt;/P&gt;&lt;P&gt;Batch Input Sessions, the ABAP program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too.  &lt;/P&gt;&lt;P&gt;Batch Input (BI) programs still use the classical BDC approach but doesn&amp;#146;t require an ABAP program to be written to format the BDCDATA. The user has to format the data using predefined structures and store it in a flat file. The BI program then reads this and invokes the transaction mentioned in the header record of the file.  &lt;/P&gt;&lt;P&gt;Direct Input (DI) programs work exactly similar to BI programs. But the only difference is, instead of processing screens they validate fields and directly load the data into tables using standard function modules. For this reason, DI programs are much faster (RMDATIND - Material Master DI program works at least 5 times faster) than the BDC counterpart and so ideally suited for loading large volume data. DI programs are not available for all application areas.  &lt;/P&gt;&lt;P&gt;ABAP Tips by :  Anshu Kumar &lt;/P&gt;&lt;P&gt;Differences between bdc session method and call transaction method. &lt;/P&gt;&lt;P&gt;The most important aspects of the batch session interface are: - Asynchronous processing - Transfers data for multiple transactions - Synchronous database update During processing, no transaction is started until the previous transaction has been written to the database. - A batch input processing log is generated for each session - Sessions cannot be generated in parallel  &lt;/P&gt;&lt;P&gt;The most important aspects of the CALL TRANSACTION USING interface are: - Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. - Separate LUW for the transaction The system performs a database commit immediately before and after the Batch Input Session: &lt;/P&gt;&lt;P&gt;- It is a sequence of transactions, which is generated when user run a particular program.  &lt;/P&gt;&lt;P&gt;- It contains the accounting documents that are to be created. The SAP system stores these transactions until you decide to process them online.  &lt;/P&gt;&lt;P&gt;- It does not update transaction figures until the session has been processed.  Using this technique, you can transfer large amounts of data to the SAP system in a short time. &lt;/P&gt;&lt;P&gt;Three processing modes of executing Batch Input Session :- &lt;/P&gt;&lt;P&gt;(1) Run Visibly : You can correct faulty transactions online &amp;amp; work step-by-step through  the transactions not yet executed.  &lt;/P&gt;&lt;P&gt;(2) Display Errors only : You can correct faulty transactions online.   Transactions not yet executed, but without error, run in the background. &lt;/P&gt;&lt;P&gt;(3) Run in Background : Recommended by SAP.                                     *-- Pradnya &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION USING statement.  - No batch input processing log is generated. &lt;/P&gt;&lt;P&gt;Explain in detail with example what is batch input session? &lt;/P&gt;&lt;P&gt;BDC program for Purchase Info Records &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 ZMM0069                                                    *&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; Module : MM                                                         |&lt;/P&gt;&lt;P&gt;*&amp;amp; Application : The program loads the Purchasing Inforecords          |&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     |&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;P&gt;*| Modification Log                                                    |&lt;/P&gt;&lt;P&gt;*| -&lt;/P&gt;&lt;HR originaltext="---------------" /&gt;&lt;P&gt;                                                    |&lt;/P&gt;&lt;P&gt;*| Programmer      Date       CC#    Chg.Ref        Description of&lt;/P&gt;&lt;P&gt;*|                                                       Change        |&lt;/P&gt;&lt;P&gt;*| -&lt;/P&gt;&lt;HR originaltext="------------" /&gt;&lt;P&gt; -&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt;|&lt;/P&gt;&lt;P&gt;*| Rajesh Singh  23-AUG-2005                        Initial&lt;/P&gt;&lt;P&gt;*|                                                  development.       |&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;P&gt;&lt;/P&gt;&lt;P&gt;  REPORT zmm0069 NO STANDARD PAGE HEADING&lt;/P&gt;&lt;P&gt;                                  MESSAGE-ID z0&lt;/P&gt;&lt;P&gt;                                  LINE-SIZE  132&lt;/P&gt;&lt;P&gt;                                  LINE-COUNT 65(2).&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;                     Internal Tables                                 *&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;&lt;/P&gt;&lt;P&gt;*Internal table for the purchasing info records fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF i_inforecord OCCURS 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        matnr(18),&lt;/P&gt;&lt;P&gt;        lifnr(10),&lt;/P&gt;&lt;P&gt;        uom(3),&lt;/P&gt;&lt;P&gt;        ekgrp(3),&lt;/P&gt;&lt;P&gt;        planned_time(3),&lt;/P&gt;&lt;P&gt;        under_tol(3),&lt;/P&gt;&lt;P&gt;        over_tol(3),&lt;/P&gt;&lt;P&gt;        qty(10),&lt;/P&gt;&lt;P&gt;        price_cat(5),&lt;/P&gt;&lt;P&gt;        inco(3),&lt;/P&gt;&lt;P&gt;        designation(28),&lt;/P&gt;&lt;P&gt;        netpr(13),&lt;/P&gt;&lt;P&gt;        scale_qty1(10),&lt;/P&gt;&lt;P&gt;        scale_pr1(13),&lt;/P&gt;&lt;P&gt;        scale_qty2(10),&lt;/P&gt;&lt;P&gt;        scale_pr2(13),&lt;/P&gt;&lt;P&gt;        scale_qty3(13),&lt;/P&gt;&lt;P&gt;        scale_pr3(10),&lt;/P&gt;&lt;P&gt;        scale_qty4(13),&lt;/P&gt;&lt;P&gt;        scale_pr4(10),&lt;/P&gt;&lt;P&gt;        scale_qty5(13),&lt;/P&gt;&lt;P&gt;        scale_pr5(10),&lt;/P&gt;&lt;P&gt;        scale_qty6(13),&lt;/P&gt;&lt;P&gt;        scale_pr6(10),&lt;/P&gt;&lt;P&gt;        scale_qty7(13),&lt;/P&gt;&lt;P&gt;        scale_pr7(10),&lt;/P&gt;&lt;P&gt;        scale_qty8(13),&lt;/P&gt;&lt;P&gt;        scale_pr8(10),&lt;/P&gt;&lt;P&gt;        scale_qty9(13),&lt;/P&gt;&lt;P&gt;        scale_pr9(10),&lt;/P&gt;&lt;P&gt;        scale_qty10(13),&lt;/P&gt;&lt;P&gt;        scale_pr10(10),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        END OF i_inforecord.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Internal table for Old and New Vendor number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  DATA : BEGIN OF i_lfb1 OCCURS 1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         lifnr(10),&lt;/P&gt;&lt;P&gt;         altkn(10),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         END   OF i_lfb1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Declare internal table for Call Transaction and BDC Session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.&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;                     Global Variables                                *&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;&lt;/P&gt;&lt;P&gt;  DATA: g_counter(2) TYPE n,&lt;/P&gt;&lt;P&gt;        g_field_name(18) TYPE c,&lt;/P&gt;&lt;P&gt;        zc_yes  TYPE syftype VALUE 'X'.&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;                     Selection Screen                                *&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;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PARAMETERS: p_fname1 TYPE localfile .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN SKIP 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.&lt;/P&gt;&lt;P&gt;  PARAMETERS: p_rloc1 AS CHECKBOX  DEFAULT 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.&lt;/P&gt;&lt;P&gt;  PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZPURCHINFO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK c.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK b.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**WRITE the report header&lt;/P&gt;&lt;P&gt;  TOP-OF-PAGE.&lt;/P&gt;&lt;P&gt;    INCLUDE zheading.&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;                     Start of selection                              *&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;&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;Load Input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM f_load_input_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create BDC records.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM create_bdc_records .&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  Create_BDC_records&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;      Perform the BDC for the records in the internal 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;P&gt;&lt;/P&gt;&lt;P&gt;  FORM create_bdc_records .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT i_inforecord[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Open BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM open_bdc_session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT lifnr altkn FROM lfb1 INTO TABLE i_lfb1&lt;/P&gt;&lt;P&gt;                          FOR ALL ENTRIES IN i_inforecord&lt;/P&gt;&lt;P&gt;                          WHERE altkn = i_inforecord-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sorting the Internal table for better performance&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SORT i_lfb1 BY altkn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT i_inforecord.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Mapping Old Vendor number to the new Vendor number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        READ TABLE i_lfb1 WITH KEY altkn = i_inforecord-lifnr BINARY&lt;/P&gt;&lt;P&gt;                                                              SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;          i_inforecord-lifnr = i_lfb1-lifnr.&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;        CLEAR i_bdc_table[].&lt;/P&gt;&lt;P&gt;        PERFORM insert_screen_header.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     call transaction 'ME11' using i_bdc_table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                   mode 'A'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CLEAR i_bdc_table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;      CLEAR i_inforecord[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM close_bdc_session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Release the BDC sessions created&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM release_bdc.&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;  ENDFORM.                    " open_group&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_dynpro_start&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;      Start the screen for the transfer of fields&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;&lt;/P&gt;&lt;P&gt;  FORM bdc_dynpro_start  USING    p_g_program_1&lt;/P&gt;&lt;P&gt;                                  p_g_screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR i_bdc_table.&lt;/P&gt;&lt;P&gt;    i_bdc_table-program  = p_g_program_1.&lt;/P&gt;&lt;P&gt;    i_bdc_table-dynpro   = p_g_screen.&lt;/P&gt;&lt;P&gt;    i_bdc_table-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;    APPEND i_bdc_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " bdc_dynpro_start_start&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_insert_field&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;       Insert field                                                  *&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_insert_field USING f_name f_value.&lt;/P&gt;&lt;P&gt;    IF f_value &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;      CLEAR i_bdc_table.&lt;/P&gt;&lt;P&gt;      i_bdc_table-fnam = f_name.&lt;/P&gt;&lt;P&gt;      i_bdc_table-fval = f_value.&lt;/P&gt;&lt;P&gt;      APPEND i_bdc_table.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    "bdc_insert_field&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;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  open_bdc_session&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;      Open a BDC session&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 open_bdc_session .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Open BDC session and create and update records&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BDC_OPEN_GROUP'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        client                    = sy-mandt&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      DEST                      = FILLER8&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        group                     = p_group&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      HOLDDATE                  = FILLER8&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        keep                      = 'X'&lt;/P&gt;&lt;P&gt;        user                      = sy-uname&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      RECORD                    = FILLER1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      PROG                      = SY-CPROG&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;      QID                       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;              .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " create_bdc_session&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  insert_screen_header&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;      Screen flow for the transfer of fields&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;&lt;/P&gt;&lt;P&gt;  FORM insert_screen_header .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First Screen 100&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_dynpro_start USING 'SAPMM06I' '0100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING:'BDC_CURSOR' 'EINA-LIFNR',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'BDC_OKCODE' '/00',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINA-LIFNR' i_inforecord-lifnr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINA-MATNR' i_inforecord-matnr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-EKORG' '1000',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'RM06I-NORMB' zc_yes.&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;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Next Screen 101&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_dynpro_start USING 'SAPMM06I' '0101'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINA-MAHN1',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                     'BDC_OKCODE' '/00',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                     'EINA-MEINS' i_inforecord-uom.&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;P&gt;*Next Screen 102&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_dynpro_start USING 'SAPMM06I' '0102'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINE-INCO2',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 'EINE-APLFZ' i_inforecord-planned_time,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 'EINE-EKGRP' i_inforecord-ekgrp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 'EINE-NORBM' i_inforecord-qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert USING  'EINE-UEBTK' ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM bdc_insert_field USING:'EINE-PEINH' i_inforecord-scale_qty1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-BPRME' i_inforecord-uom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-UNTTO' '5',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-UEBTO' '25',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-MEPRF' i_inforecord-price_cat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-NETPR' i_inforecord-netpr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   'EINE-INCO1' i_inforecord-inco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                  'EINE-INCO2' i_inforecord-designation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Checking for Scale quantities&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF i_inforecord-scale_qty2 = space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field  USING 'BDC_OKCODE' '=BU'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM insert_bdc_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field  USING 'BDC_OKCODE' '=KO'.&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;Next Screen 201&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'RV13A-DATAB',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                        'BDC_OKCODE' '=PSTF'.&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;Next Screen 201&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONP-KSCHL(01)',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                       'BDC_OKCODE' '=PSTF',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                       'RV130-SELKZ(01)' zc_yes.&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;LAST SCREEN 303&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_dynpro_start USING 'SAPMV13A' '0303'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONM-KBETR(03)',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                       'BDC_OKCODE' '=SICH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Counter to Loop the Item level entry&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      g_counter = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty2&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty3&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty4&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty5&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty6&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty7&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty8&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING i_inforecord-scale_qty9&lt;/P&gt;&lt;P&gt;                                i_inforecord-scale_pr9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM scale_entry USING  i_inforecord-scale_qty10&lt;/P&gt;&lt;P&gt;                                 i_inforecord-scale_pr10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM insert_bdc_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " insert_screen_header&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  insert_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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Insert BDC&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;&lt;/P&gt;&lt;P&gt;  FORM insert_bdc_new .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BDC_INSERT'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;         tcode                  = 'ME11'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      POST_LOCAL             = NOVBLOCAL&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      PRINTING               = NOPRINT&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      SIMUBATCH              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CTUPARAMS              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;         dynprotab              = i_bdc_table&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;               .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR i_bdc_table[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " insert_bdc&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  close_bdc_session&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;     Close the BDC session&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;&lt;/P&gt;&lt;P&gt;  FORM close_bdc_session .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BDC_CLOSE_GROUP'&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;&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " close_bdc_session&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  f_load_input_file&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;      Upload the file&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;&lt;/P&gt;&lt;P&gt;  FORM f_load_input_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check always Local file for upload&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF p_rloc1 = zc_yes.&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;                filename                = p_fname1&lt;/P&gt;&lt;P&gt;                filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;           TABLES&lt;/P&gt;&lt;P&gt;                data_tab                = i_inforecord&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 &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        STOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " f_load_input_file&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  release_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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Release the session&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;&lt;/P&gt;&lt;P&gt;  FORM release_bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SUBMIT rsbdcsub WITH mappe EQ p_group&lt;/P&gt;&lt;P&gt;                    WITH von EQ sy-datum&lt;/P&gt;&lt;P&gt;                    WITH bis EQ sy-datum&lt;/P&gt;&lt;P&gt;                    WITH fehler EQ '.'&lt;/P&gt;&lt;P&gt;                    EXPORTING LIST TO MEMORY&lt;/P&gt;&lt;P&gt;                    AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " release_bdc&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  scale_entry&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 the Scale quantities&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;P_SCALE_QTY&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_SCALE_PRICE&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 scale_entry USING    p_scale_qty&lt;/P&gt;&lt;P&gt;                            p_scale_price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Increment the Counter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    g_counter = g_counter + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF p_scale_qty &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CONCATENATE 'KONM-KSTBM('  g_counter  ')' INTO g_field_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING g_field_name p_scale_qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CONCATENATE 'KONM-KBETR('  g_counter  ')' INTO g_field_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM bdc_insert_field USING g_field_name p_scale_price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.&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_insert&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;      To uncheck the Unlimited (UEBTK)&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;&lt;/P&gt;&lt;P&gt;  FORM bdc_insert USING  f_name f_value.&lt;/P&gt;&lt;P&gt;    CLEAR i_bdc_table.&lt;/P&gt;&lt;P&gt;    i_bdc_table-fnam = f_name.&lt;/P&gt;&lt;P&gt;    i_bdc_table-fval = f_value.&lt;/P&gt;&lt;P&gt;    APPEND i_bdc_table.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    " bdc_insert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 09:59:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi/m-p/3346462#M802472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T09:59:32Z</dc:date>
    </item>
  </channel>
</rss>

