<?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: coding for maintain the multip[le sessions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376509#M527007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;               Read the documenetaion you will able to undresatand clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Batch input sessions enter data non-interactively into an R/3 System. Batch input is typically used to transfer data from non-R/3 Systems to R/3 Systems or to transfer data between R/3 Systems. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section describes how to manage batch input sessions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To reach the main menu of the batch input system, select System ® Services ® Batch input. Alternatively, enter transaction SM35. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For information on the Recording function in the batch input manager (transaction SHDB), please see the online guide  Basis Programming Interfaces. You can use the recording function to create a batch input session without having to write or run a program to generate a session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing Sessions Automatically &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In most cases, batch input sessions can be processed automatically. It is not necessary for a session to wait until a system administrator explicitly starts the processing of the session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section explains how to have sessions started automatically soon after the session has been generated in an R/3 System. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisites&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ABAP program RSBDCSUB must be scheduled as a periodic job in the R/3 background processing system. RSBDCSUB checks for and starts any batch input sessions that have not yet been run. It schedules such sessions for immediate execution in the background processing system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Schedule RSBDCSUB to run periodically in one or more background jobs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have regularly scheduled batch input runs, you can schedule separate jobs for each of the scheduled data transfers. The start time for the RSBDCSUB job can be set according to the batch input schedule. And you can use a variant to restrict RSBDCSUB only to the batch input sessions that you expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With RSBDCSUB, you can use all of the selection criteria offered on the batch input main menu to select sessions to run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;session name&lt;/P&gt;&lt;P&gt;date and time of generation&lt;/P&gt;&lt;P&gt;status: ready to run or held in the queue because of errors&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Batch input sessions are started automatically rather than by hand. The RSBDCSUB program can be set up to start all sessions that arrive in an R/3 System, or it can be fine-tuned to start only batch input sessions that you expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Starting Sessions Explicitly: Run Modes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running a batch input session executes the transactions in the session and enters data into an R/3 System. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually, the system will run batch input sessions automatically. However, you can also start batch input sessions by hand. You may wish to do this for these and other reasons:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To correct transactions that had errors &lt;/P&gt;&lt;P&gt;To check that the transactions in a session have been generated correctly by running the first several transactions&lt;/P&gt;&lt;P&gt;To start a session on special request (the session would not be started automatically or must be started right away). &lt;/P&gt;&lt;P&gt;Prerequisites&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start the batch input management tool: Select System ® Service ® Batch input ® Sessions. Alternate: Enter transaction SM35. Both paths take you to the session overview of the batch input system. transaction SM35. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To start a session, mark the session and choose Process from the tool bar. You can then choose how to run a session and with what logging and display options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can start any session in new status that is not locked. With Process/foreground or Display errors only mode, you can also re-start transactions that have the status Incorrect. Sessions with the status Processed cannot be run again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run Modes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three ways to run a session:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process/foreground: You can interactively correct transactions that contained errors and step through transactions that have not yet been executed. &lt;/P&gt;&lt;P&gt;Display errors only: This mode is like Process/foreground except that transactions that have not yet been run and which do not contain errors are run non-interactively. &lt;/P&gt;&lt;P&gt;If an error occurs, processing stops and the screen upon which the error occurred is displayed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Background: Use this mode to schedule a session for immediate processing in the background processing facility.&lt;/P&gt;&lt;P&gt;You receive control of your terminal again as soon as the session has been passed to the background processing system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that your session is automatically released for processing in the background processing system. You need not explicitly release the session for processing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A completed session is handled in one of three ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system deletes a session from the queue when it has been successfully completed. You can check on the outcome of the session by displaying the session log file. &lt;/P&gt;&lt;P&gt;If the KEEP option was set when the session was generated, then the system leaves a session in the queue, even if it was run successfully. The status is changed to Processed. &lt;/P&gt;&lt;P&gt;You cannot run a processed session a second time. You must manually delete it when you no longer need it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a transaction in the session contained an error, the incorrect transaction is aborted. All other transactions are completed. The session remains in the queue and is held in the Errors section of the list. You can correct the session in one of the interactive modes and run it to completion. &lt;/P&gt;&lt;P&gt;A transaction contains an error if it issues a message of type E (error) or type A (abnormal termination). Other messages are ignored and do not affect the execution of a session..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A session also is held in the queue in the Errors list if the session was ended with the /bend OK code. Please see Correcting a Session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2007 10:44:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-13T10:44:56Z</dc:date>
    <item>
      <title>coding for maintain the multip[le sessions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376508#M527006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have 1,00,000 records in a flat file how to maintain  the multiple sessions&lt;/P&gt;&lt;P&gt;each session having 10000 records i want coding for how these multiple sessions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 09:53:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376508#M527006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T09:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: coding for maintain the multip[le sessions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376509#M527007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;               Read the documenetaion you will able to undresatand clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Batch input sessions enter data non-interactively into an R/3 System. Batch input is typically used to transfer data from non-R/3 Systems to R/3 Systems or to transfer data between R/3 Systems. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section describes how to manage batch input sessions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To reach the main menu of the batch input system, select System ® Services ® Batch input. Alternatively, enter transaction SM35. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For information on the Recording function in the batch input manager (transaction SHDB), please see the online guide  Basis Programming Interfaces. You can use the recording function to create a batch input session without having to write or run a program to generate a session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing Sessions Automatically &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In most cases, batch input sessions can be processed automatically. It is not necessary for a session to wait until a system administrator explicitly starts the processing of the session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section explains how to have sessions started automatically soon after the session has been generated in an R/3 System. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisites&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ABAP program RSBDCSUB must be scheduled as a periodic job in the R/3 background processing system. RSBDCSUB checks for and starts any batch input sessions that have not yet been run. It schedules such sessions for immediate execution in the background processing system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Schedule RSBDCSUB to run periodically in one or more background jobs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have regularly scheduled batch input runs, you can schedule separate jobs for each of the scheduled data transfers. The start time for the RSBDCSUB job can be set according to the batch input schedule. And you can use a variant to restrict RSBDCSUB only to the batch input sessions that you expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With RSBDCSUB, you can use all of the selection criteria offered on the batch input main menu to select sessions to run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;session name&lt;/P&gt;&lt;P&gt;date and time of generation&lt;/P&gt;&lt;P&gt;status: ready to run or held in the queue because of errors&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Batch input sessions are started automatically rather than by hand. The RSBDCSUB program can be set up to start all sessions that arrive in an R/3 System, or it can be fine-tuned to start only batch input sessions that you expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Starting Sessions Explicitly: Run Modes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running a batch input session executes the transactions in the session and enters data into an R/3 System. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually, the system will run batch input sessions automatically. However, you can also start batch input sessions by hand. You may wish to do this for these and other reasons:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To correct transactions that had errors &lt;/P&gt;&lt;P&gt;To check that the transactions in a session have been generated correctly by running the first several transactions&lt;/P&gt;&lt;P&gt;To start a session on special request (the session would not be started automatically or must be started right away). &lt;/P&gt;&lt;P&gt;Prerequisites&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start the batch input management tool: Select System ® Service ® Batch input ® Sessions. Alternate: Enter transaction SM35. Both paths take you to the session overview of the batch input system. transaction SM35. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To start a session, mark the session and choose Process from the tool bar. You can then choose how to run a session and with what logging and display options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can start any session in new status that is not locked. With Process/foreground or Display errors only mode, you can also re-start transactions that have the status Incorrect. Sessions with the status Processed cannot be run again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run Modes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three ways to run a session:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process/foreground: You can interactively correct transactions that contained errors and step through transactions that have not yet been executed. &lt;/P&gt;&lt;P&gt;Display errors only: This mode is like Process/foreground except that transactions that have not yet been run and which do not contain errors are run non-interactively. &lt;/P&gt;&lt;P&gt;If an error occurs, processing stops and the screen upon which the error occurred is displayed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Background: Use this mode to schedule a session for immediate processing in the background processing facility.&lt;/P&gt;&lt;P&gt;You receive control of your terminal again as soon as the session has been passed to the background processing system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that your session is automatically released for processing in the background processing system. You need not explicitly release the session for processing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A completed session is handled in one of three ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system deletes a session from the queue when it has been successfully completed. You can check on the outcome of the session by displaying the session log file. &lt;/P&gt;&lt;P&gt;If the KEEP option was set when the session was generated, then the system leaves a session in the queue, even if it was run successfully. The status is changed to Processed. &lt;/P&gt;&lt;P&gt;You cannot run a processed session a second time. You must manually delete it when you no longer need it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a transaction in the session contained an error, the incorrect transaction is aborted. All other transactions are completed. The session remains in the queue and is held in the Errors section of the list. You can correct the session in one of the interactive modes and run it to completion. &lt;/P&gt;&lt;P&gt;A transaction contains an error if it issues a message of type E (error) or type A (abnormal termination). Other messages are ignored and do not affect the execution of a session..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A session also is held in the queue in the Errors list if the session was ended with the /bend OK code. Please see Correcting a Session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 10:44:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376509#M527007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T10:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: coding for maintain the multip[le sessions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376510#M527008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see the example program and the selection screen you can maintain how many records per session.&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;Report     : ZMPPC015&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Type       : Data upload&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Author     : Seshu Maramreddy&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Date       : 05/26/2005&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Transport  : DV3K920025&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Transaction: ??&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description: This ABAP/4 Program to Create Planned Independent&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             Requirement for SMI plants using MD61 Transaction.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             It accepts tab-delimited spreadsheet input and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             creates BDC sessions.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;report zmppc015 no standard page heading&lt;/P&gt;&lt;P&gt;                line-size 120&lt;/P&gt;&lt;P&gt;                line-count 55&lt;/P&gt;&lt;P&gt;                message-id zz.&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;Constants&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;constants : c_x type c value 'X'," Dynbegin&lt;/P&gt;&lt;P&gt;            c_tcode type tstc-tcode value 'MD61'." Transaction Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : v_lines_in_xcel like sy-tabix,&lt;/P&gt;&lt;P&gt;       l_tabix like sy-tabix,&lt;/P&gt;&lt;P&gt;       v_trans_in_ssn type i,&lt;/P&gt;&lt;P&gt;       v_ssnnr(4) type n," Counter&lt;/P&gt;&lt;P&gt;       v_ssnname like apqi-groupid,&lt;/P&gt;&lt;P&gt;       v_matnr(18) type c. " Material Number&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;Internal Tables&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : begin of t_file occurs 0,&lt;/P&gt;&lt;P&gt;       matnr(18) type c,   " Material Number&lt;/P&gt;&lt;P&gt;       berid(10) type c,    " MRP Area&lt;/P&gt;&lt;P&gt;       PLNMG01(17) type n, " Forecast Month -01&lt;/P&gt;&lt;P&gt;       PLNMG02(17) type n, " Forecast Month -02&lt;/P&gt;&lt;P&gt;       PLNMG03(17) type n, " Forecast Month -03&lt;/P&gt;&lt;P&gt;       PLNMG04(17) type n, " Forecast Month -04&lt;/P&gt;&lt;P&gt;       PLNMG05(17) type n, " Forecast Month -05&lt;/P&gt;&lt;P&gt;       PLNMG06(17) type n, " Forecast Month -06&lt;/P&gt;&lt;P&gt;       PLNMG07(17) type n, " Forecast Month -07&lt;/P&gt;&lt;P&gt;       PLNMG08(17) type n, " Forecast Month -08&lt;/P&gt;&lt;P&gt;       PLNMG09(17) type n, " Forecast Month -09&lt;/P&gt;&lt;P&gt;       PLNMG10(17) type n, " Forecast Month -10&lt;/P&gt;&lt;P&gt;       PLNMG11(17) type n, " Forecast Month -11&lt;/P&gt;&lt;P&gt;       PLNMG12(17) type n, " Forecast Month -12&lt;/P&gt;&lt;P&gt;       WERKS(4) TYPE C,    " Plant&lt;/P&gt;&lt;P&gt;       end of t_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for BDCDATA Structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : begin of itab_bdc_tab occurs 0.&lt;/P&gt;&lt;P&gt;        include structure bdcdata.&lt;/P&gt;&lt;P&gt;data : end of itab_bdc_tab.&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; Selection-screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;selection-screen: skip 3.&lt;/P&gt;&lt;P&gt;selection-screen: begin of block id1 with frame.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;parameters: p_name        like rlgrap-filename&lt;/P&gt;&lt;P&gt;                          default 'C:\My Documents\InputFile.txt'&lt;/P&gt;&lt;P&gt;                          obligatory,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;bdc session name prefix&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            p_bdcpfx(6)   default 'ZPIRCT'&lt;/P&gt;&lt;P&gt;                          obligatory,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;number for transction per BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            p_trnssn      type i&lt;/P&gt;&lt;P&gt;                          default 2000 obligatory,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;retain the BDC session after successfull execution&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            p_keep        like apqi-qerase&lt;/P&gt;&lt;P&gt;                          default c_x,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;user who will be executing BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            p_uname       like apqi-userid&lt;/P&gt;&lt;P&gt;                          default sy-uname&lt;/P&gt;&lt;P&gt;                          obligatory.&lt;/P&gt;&lt;P&gt;selection-screen : skip 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Requirement type&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;parameters : p_bedae like t459u-bedae,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;From Date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             p_date like sy-datum default sy-datum obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen: end of block id1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;F4 value for Input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform filename_get.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;main processing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;To get the data from file to Internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform getdata_fromfile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at t_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  hang on to xcel line num&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  if num-of-trnas-in-session = 0, create new BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if v_trans_in_ssn is initial.&lt;/P&gt;&lt;P&gt;      perform bdc_session_open.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  begin new bdc script for rtg create trans&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  fill in bdc-data for prod.version maintenance screens&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    perform bdc_build_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  insert the bdc script as a BDC transaction&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    perform bdc_submit_transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  keep track of how many BDC transactions were inserted in the BDC&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    add 1 to v_trans_in_ssn.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  if the user-specified num of trans in BDC session is reached OR&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  if end of input file is reached, close the BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if v_trans_in_ssn = p_trnssn or&lt;/P&gt;&lt;P&gt;       l_tabix = v_lines_in_xcel.&lt;/P&gt;&lt;P&gt;      perform bdc_session_close.&lt;/P&gt;&lt;P&gt;      clear v_trans_in_ssn.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;clear t_file.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;top-of-page.&lt;/P&gt;&lt;P&gt;  call function 'Z_HEADER'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FLEX_TEXT1       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FLEX_TEXT2       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FLEX_TEXT3       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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  filename_get&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;      F4 Value for input 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;FORM filename_get.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_FILENAME_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            DEF_PATH         = 'C:\Temp\ '&lt;/P&gt;&lt;P&gt;            MASK             = ',&lt;STRONG&gt;.&lt;/STRONG&gt;,&lt;STRONG&gt;.&lt;/STRONG&gt;.'&lt;/P&gt;&lt;P&gt;            MODE             = 'O'&lt;/P&gt;&lt;P&gt;            TITLE            = 'Select File '(007)&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            FILENAME         = p_name&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            INV_WINSYS       = 1&lt;/P&gt;&lt;P&gt;            NO_BATCH         = 2&lt;/P&gt;&lt;P&gt;            SELECTION_CANCEL = 3&lt;/P&gt;&lt;P&gt;            SELECTION_ERROR  = 4&lt;/P&gt;&lt;P&gt;            OTHERS           = 5.&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;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " filename_get&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  getdata_fromfile&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 data from file to 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;FORM getdata_fromfile.&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_name&lt;/P&gt;&lt;P&gt;            FILETYPE                = 'DAT'&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            DATA_TAB                = t_file&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 eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    sort t_file by matnr .&lt;/P&gt;&lt;P&gt;    delete t_file where matnr = ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear v_lines_in_xcel.&lt;/P&gt;&lt;P&gt;    describe table t_file lines v_lines_in_xcel.&lt;/P&gt;&lt;P&gt;    if v_lines_in_xcel is initial.&lt;/P&gt;&lt;P&gt;      write: / 'No data in input file'.&lt;/P&gt;&lt;P&gt;      stop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    write:/ 'Error reading input file'.&lt;/P&gt;&lt;P&gt;    stop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " getdata_fromfile&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_session_open&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;      BDC_OPEN_GROUP&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_session_open.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create bdc session name = prefix-from-selectn-screen + nnnn&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  add 1 to v_ssnnr.&lt;/P&gt;&lt;P&gt;  concatenate p_bdcpfx v_ssnnr into v_ssnname.&lt;/P&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;P&gt;            GROUP               = v_ssnname&lt;/P&gt;&lt;P&gt;            KEEP                = p_keep&lt;/P&gt;&lt;P&gt;            USER                = p_uname&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            CLIENT_INVALID      = 1&lt;/P&gt;&lt;P&gt;            DESTINATION_INVALID = 2&lt;/P&gt;&lt;P&gt;            GROUP_INVALID       = 3&lt;/P&gt;&lt;P&gt;            GROUP_IS_LOCKED     = 4&lt;/P&gt;&lt;P&gt;            HOLDDATE_INVALID    = 5&lt;/P&gt;&lt;P&gt;            INTERNAL_ERROR      = 6&lt;/P&gt;&lt;P&gt;            QUEUE_ERROR         = 7&lt;/P&gt;&lt;P&gt;            RUNNING             = 8&lt;/P&gt;&lt;P&gt;            SYSTEM_LOCK_ERROR   = 9&lt;/P&gt;&lt;P&gt;            USER_INVALID        = 10&lt;/P&gt;&lt;P&gt;            OTHERS              = 11.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &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.                    " bdc_session_open&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_build_script&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;      BDC Script&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_build_script.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local Variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : l_frdat(8) type c,  " From Date&lt;/P&gt;&lt;P&gt;         l_todat(8) type c,  " To Date&lt;/P&gt;&lt;P&gt;         l_frdat1(4) type c, " Year&lt;/P&gt;&lt;P&gt;         l_frdat2(2) type c, " Month&lt;/P&gt;&lt;P&gt;         l_frdat3(2) type c, " Day&lt;/P&gt;&lt;P&gt;         l_tdate like sy-datum, " Subtract date(1)&lt;/P&gt;&lt;P&gt;         l_todat1(4) type c,    " Year&lt;/P&gt;&lt;P&gt;         l_todat2(2) type c,    " Month&lt;/P&gt;&lt;P&gt;         l_todat3(3) type c.    " Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Get the material number from tables ZMSMI_FERR_RAW,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ZMSMI_SNAP_RAW and ZMSMI_SIMP_RAW&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform get_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Screen 0100.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPMM60X'     '0100'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '/EBDPT'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-MATAW'  'X'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-MATNR'  T_FILE-MATNR.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-PRGRP'  SPACE.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-PBDNR'  SPACE.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-BERID'  T_FILE-BERID.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-WERKS'  SPACE.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-VERSB'  '00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Converted the date as per MD61 Transaction.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; From date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  l_frdat1 =  p_date+0(4).&lt;/P&gt;&lt;P&gt;  l_frdat2 =  p_date+4(2).&lt;/P&gt;&lt;P&gt;  l_frdat3 =  p_date+6(2).&lt;/P&gt;&lt;P&gt;  concatenate l_frdat2 l_frdat3 l_frdat1 into l_frdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; To Date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  l_tdate = p_date - 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_todat1 =  l_tdate+0(4) + 1.&lt;/P&gt;&lt;P&gt;  l_todat2 =  l_tdate+4(2).&lt;/P&gt;&lt;P&gt;  l_todat3 =  l_tdate+6(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  concatenate l_todat2 l_todat3 l_todat1 into l_todat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-DATVE'  l_frdat.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-DATBE'  l_todat.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-ENTLU'  'M'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Screen 0127&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform bdc_screen using  'SAPMM60X'     '0127'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=WEIT'.&lt;/P&gt;&lt;P&gt;  if p_bedae is initial.&lt;/P&gt;&lt;P&gt;    perform bdc_field  using  'T459U-BEDAE'  space.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    perform bdc_field  using  'T459U-BEDAE'  P_BEDAE.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Screen 0100.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPMM60X'     '0100'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '/00'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-MATAW'  'X'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-MATNR'  T_FILE-MATNR.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-PRGRP'  SPACE.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-PBDNR'  SPACE.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-BERID'  T_FILE-BERID.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'AM60X-WERKS'  SPACE.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-VERSB'  '00'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-DATVE'  l_frdat.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-DATBE'  l_todat.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-ENTLU'  'M'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Screen 0200&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG04.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG07.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG08.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=S+'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform bdc_screen using  'SAPLM60E'     '0200'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'BDC_OKCODE'   '=SICH'.&lt;/P&gt;&lt;P&gt;  perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " bdc_build_script&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  get_matnr&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;      Get the material number from tables ZMSMI_FERR_RAW,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      ZMSMI_SNAP_RAW and ZMSMI_SIMP_RAW&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 get_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear v_matnr.&lt;/P&gt;&lt;P&gt;  case t_file-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when '0101'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      select single cmatnr from zmsmi_simp_raw&lt;/P&gt;&lt;P&gt;             into v_matnr  where matnr = t_file-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        clear t_file-matnr.&lt;/P&gt;&lt;P&gt;        t_file-matnr = v_matnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when '0103'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      select single cmatnr from zmsmi_ferr_raw&lt;/P&gt;&lt;P&gt;             into v_matnr  where matnr = t_file-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        clear t_file-matnr.&lt;/P&gt;&lt;P&gt;        t_file-matnr = v_matnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when '0102' or '0110' or '0111' or '0112' or '0113'&lt;/P&gt;&lt;P&gt;         or '0114' or '0115' or '0116' or '0117'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      select single cmatnr from zmsmi_snap_raw&lt;/P&gt;&lt;P&gt;             into v_matnr  where matnr = t_file-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        clear t_file-matnr.&lt;/P&gt;&lt;P&gt;        t_file-matnr = v_matnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_matnr&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_screen&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;      BDC Script for Screen 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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_PROG   Program name&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_SCRN   Screen Number&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_screen USING    p_prog&lt;/P&gt;&lt;P&gt;                         p_scrn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear itab_bdc_tab.&lt;/P&gt;&lt;P&gt;  itab_bdc_tab-program = p_prog.&lt;/P&gt;&lt;P&gt;  itab_bdc_tab-dynpro = p_scrn.&lt;/P&gt;&lt;P&gt;  itab_bdc_tab-dynbegin = c_x.&lt;/P&gt;&lt;P&gt;  append itab_bdc_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " bdc_screen&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_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;      BDC Script for Screen fileds&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_NAM   Field name&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_VAL   Field value&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM bdc_field USING    p_nam&lt;/P&gt;&lt;P&gt;                        p_val.&lt;/P&gt;&lt;P&gt;  clear itab_bdc_tab.&lt;/P&gt;&lt;P&gt;  itab_bdc_tab-fnam = p_nam.&lt;/P&gt;&lt;P&gt;  itab_bdc_tab-fval = p_val.&lt;/P&gt;&lt;P&gt;  append itab_bdc_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " bdc_screen&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_submit_transaction&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;      BDC_INSERT Function Module&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_submit_transaction.&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;Load BDC script as a trqansction in BDC session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  call function 'BDC_INSERT'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            tcode          = c_tcode&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            dynprotab      = itab_bdc_tab&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            internal_error = 01&lt;/P&gt;&lt;P&gt;            not_open       = 02&lt;/P&gt;&lt;P&gt;            queue_error    = 03&lt;/P&gt;&lt;P&gt;            tcode_invalid  = 04.&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;  refresh itab_bdc_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " bdc_submit_transaction&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_session_close&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;      text&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_session_close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BDC_CLOSE_GROUP'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NOT_OPEN          = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  QUEUE_ERROR       = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS            = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  skip 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;    write: / 'Error Closing BDC Session ' , 'RETURN CODE: ', sy-subrc.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    write : /  'Session created:', v_ssnname,&lt;/P&gt;&lt;P&gt;            50 '# of transactions:', v_trans_in_ssn.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " bdc_session_close&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if it is helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 10:46:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-for-maintain-the-multip-le-sessions/m-p/2376510#M527008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-13T10:46:41Z</dc:date>
    </item>
  </channel>
</rss>

