LSMW  Field Mapping: can't map Batch Input Structure for Session Data

In step 5 Maintain Field Mapping and Conversion Rules, I can not see Batch Input Structure for Session Data Fields.
Can somebody tell what's wrong?
Here's what I see:
Field Mapping and Rule
        BGR00                          Batch Input Structure for Session Data
            Fields
            BMM00                          Material Master: Transaction Data for Batch Input

Hi Baojing,
To see structure BGR00  you have to map this structure first with input file structure in step 4 (maintain structure relationship).
Regards
Dhirendra

Similar Messages

  • BAPI Contract, input structure for "Contract data" ?

    Hi All,
    I am trying to create contract using BAPI:BAPI_CONTRACT_CREATEFROMDATA. But I am not able to find the structure to fill Header tab "Contract data" like
    - contract start date
    - contract end date
    - Val.period.category
    - Contractval.period and soo on ?
    Could anyone kindly help..as to how these data could be uploaded ?
    Thanks,
    Kushi

    Hi Kushi
    Try these links
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    bapis
    http://www.planetsap.com/list_all_bapis.htm
    BTW, are you the same Kushi I think you are? Did you do your ABAP certification in Hyd in Aug'05? Just asking as I had a class mate with the same name
    If you find my answer useful, please reward me for the same.
    Good luck
    Karthik Potharaju

  • Batch input programs for infotypes

    Hi Experts,
    Can anyone tell me what is the use or how we can use the batch input programs for infotypes maintained in BTCI_PROG field of table T777D.
    Regards,
    Aravind

    I dont think any data is maintained by default in the system for that field.
    Still that field can be used if you want to develop any upload program for the infotype and want to maintain it for future use also, you can always maintain that.
    But if you want to upload data in the infotypes and thinking that this field may help you with any load program..........
    Write one using HR_MAINTAIN_MASTERDATA for that.
    Regards,
    Amit
    Reward all helpful replies.

  • Lsmw  step by step procedure using   batch input method

    hi,
    lsmw  step by step procedure using   batch input method

    Step-by-Step Guide for using BAPI in LSMW
    Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
    Introduction:
    This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
    Pre-requisites:
    It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
    Step-by-Step Procedure:
    Details of the BAPI used in this scenario:
    Business Object: BUS2012
    Method: CreateFromData
    Details of Message Type and Basic IDoc Type:
    Message Type: PORDCR
    Basic IDoc Type: PORDCR02
    Let’s have a look at the BAPI first, before proceeding to the LSMW:
    1. Go to Transaction BAPI
    2. Click on Search Button
    3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
    4. Press ENTER
    5. Following screen appears:
    6. On the left side of the screen, Expand the “PurchaseOrder”.
    7. Select “PurchaseOrder” and double-click on the same for details.
    Building LSMW using BAPI:
    1. Go to Transaction LSMW.
    2. Enter the Project, Subproject and Object information and click on CREATE.
    3. Enter the descriptions for Project, Subproject and Object.
    4. Now select Settings à IDoc Inbound Processing
    5. “IDoc Inbound Processing” screen appears. Enter the required details as shown below:
    6. Click on “Activate IDoc Inbound Processing”.
    7. Click on “Yes” when prompted for “Activate IDoc Inbound?”
    8. Hit on “Back” to return to the main screen.
    9. Click on Continue (F8). Following Screen appears:
    10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
    11. Select the radio button “Business Object Method” and enter the following details:
    Business Object: BUS2012
    Method: CreateFromData
    Hit ENTER
    12. Save and click on BACK button. Following information message is displayed.
    13. Now select step 2 “Maintain Source Structures” and click “Execute”.
    14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
    Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on “Create” again to create the child structure. Following popup appears:
    Select “Lower Level” and click on Continue. Enter the Item data structure name.
    Click Save and hit BACK button to go to the main screen.
    15. Select step 3 “Maintain Source Fields” and hit execute.
    16. Enter the fields as shown below:
    17. Click SAVE and return to main screen.
    18. Select step 4 “Maintain Structure Relations” and click Execute.
    Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
    Select HEADERDATA and hit ENTER
    Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
    Click Save and return to main screen.
    19. Select the step “Maintain Field Mapping and Conversion Rules” and click on execute. Maintain the Field Mapping as seen below:
    20. Select step 7 “Maintain Source Files” and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
    Save and return to main screen.
    21. Select the step “Assign Files” and click on Execute.
    Assign the file provided to the source structure. Here the same file is provided for both the structures.
    Save and return to the main screen.
    22. Select the step “Read Data” and click on Execute.
    Click on Execute.
    Return to the main screen.
    23. Select the step “Display read data” and click on execute.
    Click on the structure name to get the field level values.
    24. Return to main screen and now select “Convert Data”.
    25. Return to the main screen and select “Display Converted data”.
    26. Return to main screen and select “Start IDoc generation”.
    27. Now select the step “Start IDoc Processing” on the main screen.
    28. Return to main screen and click on “Create IDoc overview”. Here the data record and status records of the IDoc could be viewed
    It is given in screen shot.
    http://www.****************
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/LSMW_tutorial.html
    http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
    http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
    http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
    http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
    http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
    http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
    Reward points if useful.

  • Customized LSMW (Batch Input Recording) to upload data for Vendor

    Hello Fiends,
       can u help me on this object and how to upload in xk01.
            Customized LSMW (Batch Input Recording) to upload data for Vendor Master using Transaction code XK01
    With best wishes,
    Chandu.
    Point will be rewarded....

    Hi,
    Go through the following link, you will find your answer
    http://www.sapbrain.com
    Regards,
    Bhaskar

  • Standard Batch Input Programs for Profit Center Creation

    Dear all;
    I am in 4.0B version that doesnt have BAPI_PROFITCENTER_CREATE. Writing a BDC for this would be complicated as my data is compiled in a different way.
    Are there any Standard Batch Input Programs for Profit Center Creation ?

    Hi Srivathsan,
    You can make use of  Standard BAPI by LSMW.
    Business Object   BUS1116      Profit Center Group
    Method                CREATE                      Create
    Message Type      PROFITCENTERGROUP_CREATE   
    Basic Type           PROFITCENTERGROUP_CREATE
    Regards,
    Sivaram.

  • BAPI or Batch Input Program for FB01

    Hi all!
    I am trying to post invoice through transaction code FB01, i need a standard BAPI program or Batch Input Program for FB01 (except recording).
    thanks.

    Hello,
    In the 'Specify Files' step,
    1. give some short file name (about 20 Characters )
    2. In the File option for 'Converted Data' option check the Logical path / logical file entries. Normally it is LSMW ( Logical Path ) and the same File name for logical file. If you do not have a Logical path 'LSMW' create one in Tx. FILE'.
    3. Please note that you need authority to save the file on application server ( You can see the files on Appl. Server in Tx. AL11 ).
    Let me know how it goes on!
    Regds, Murugesh AS
    Message was edited by: Murugesh Arcot
    Message was edited by: Murugesh Arcot

  • Batch Input / Recording for EnjoySAP transaction

    Hi Experts,
    May I know any possibility for us to do recording/batch input processing for EnjoySAP transaction ??
    Nowadays I need to do Recording for ME29N, as ME28 have some problem on release some of the PO document, so may I know any tool that I might can use?
    Thanks
    Cheers,
    Isaac.

    Hi Issac,
    Suggest you to<b> Search in SDN with key - eCATT</b>
    Will get few more useful related Posts.
    Check
    ECATT - Extended Computer Aided testing tool.
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
    Part I - eCATT An Introduction
    /people/sapna.modi/blog/2006/04/10/ecatt--an-introduction-part-i
    Part II - eCATT Scripts Creation - TCD Mode
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation-150-tcd-mode-part-ii
    Part III - eCATT Scripts Creation - SAPGUI Mode
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation--sapgui-mode-part-iii
    Part IV - eCATT Chaining, Parameterization, Creation Of Test Data,Test Configuration, System Data /people/sapna.modi/blog/2006/04/18/ecatt-chaining-parameterization-creation-of-test-datatest-configuration-system-data-part-iv
    Part V - eCATT Scripts Management Via Test Workbench
    /people/sapna.modi/blog/2006/04/13/ecatt-scripts-management-via-test-workbench-part-v
    Part VI - eCATT Logs
    /people/sapna.modi/blog/2006/04/18/ecatt-logs-part-vi
    Reward points if this Helps.
    Manish
    Message was edited by:
            Manish Kumar

  • Can we express batch relationship structure in XML in the database table

    Hi
    please help me ..
    i have a batch XML batch structure ...can we express batch relationship structure in XML in tha database table?
    yes..then how?
    Thanks
    Amu
    Edited by: amu_2007 on Mar 25, 2010 6:57 PM
    Edited by: amu_2007 on Mar 25, 2010 7:03 PM

    But what is the problem with the initial solution given that split the XML into the data?
    I mean you could do something like this?
    SQL> create table batch (customer    VARCHAR2(10)
      2                     ,cust_name   VARCHAR2(10)
      3                     ,cust_type   VARCHAR2(10)
      4                     )
      5  /
    Table created.
    SQL>
    SQL> create table section (customer    VARCHAR2(10)
      2                       ,sect_name   VARCHAR2(10)
      3                       ,sect_depend VARCHAR2(10)
      4                       )
      5  /
    Table created.
    SQL> create table job_sections (customer        VARCHAR2(10)
      2                            ,sect_name       VARCHAR2(10)
      3                            ,job_sect_name   VARCHAR2(10)
      4                            ,job_sect_depend VARCHAR2(10)
      5                            )
      6  /
    Table created.
    SQL> create table job (customer        VARCHAR2(10)
      2                   ,sect_name       VARCHAR2(10)
      3                   ,job_sect_name   VARCHAR2(10)
      4                   ,job_type        VARCHAR2(10)
      5                   ,job_sub_type    VARCHAR2(10)
      6                   ,job_depend      VARCHAR2(10)
      7                   )
      8  /
    Table created.
    SQL>
    SQL>
    SQL> insert all
      2    when batch_rn = 1 then
      3      into batch (customer, cust_name, cust_type) values (customer, cust_name, cust_type)
      4    when section_rn = 1 then
      5      into section (customer, sect_name, sect_depend) values (customer, sect_name, sect_dependency)
      6    when job_sections_rn = 1 then
      7      into job_sections (customer, sect_name, job_sect_name, job_sect_depend) values (customer, sect_name, job_sect_name, job_sect_dependency)
      8    when 1=1 then
      9      into job (customer, sect_name, job_sect_name, job_type, job_sub_type, job_depend) values (customer, sect_name, job_sect_name, job_type, jo
    10  --
    11  WITH t as (select XMLTYPE('
    12  <BATCH customer="ABC" name="ABC1" type="ABC_TYPE">
    13    <BATCH_SECTIONS>
    14      <SECTION name="X" dependency="NULL">
    15        <JOB_SECTIONS name="JOB1" dependency="NULL" >
    16          <JOBS>
    17            <JOB type="X" sub_type="xx" dependency="NULL" />
    18            <JOB type="X" sub_type="yy" dependency="NULL" />
    19            <JOB type="X" sub_type="zz" dependency="NULL" />
    20          </JOBS>
    21        </JOB_SECTIONS>
    22      </SECTION>
    23      <SECTION name="Y" dependency="X">
    24        <JOB_SECTIONS name="JOB2" dependency="X" >
    25          <JOBS>
    26            <JOB type="Y" sub_type="xx" dependency="X" />
    27            <JOB type="Y" sub_type="yy" dependency="X" />
    28            <JOB type="Y" sub_type="zz" dependency="X" />
    29          </JOBS>
    30        </JOB_SECTIONS>
    31      </SECTION>
    32      <SECTION name="Z" dependency="Y">
    33        <JOB_SECTIONS name="JOB3" dependency="NULL" >
    34          <JOBS>
    35            <JOB type="....." sub_type="...." dependency="NULL" />
    36          </JOBS>
    37        </JOB_SECTIONS>
    38        <JOB_SECTIONS name="JOB4" dependency="NULL">
    39          <JOBS>
    40            <JOB type="...." sub_type="...." dependency="NULL" />
    41          </JOBS>
    42        </JOB_SECTIONS>
    43      </SECTION>
    44    </BATCH_SECTIONS>
    45  </BATCH>
    46  ') as xml from dual)
    47  --
    48  -- END OF TEST DATA
    49  --
    50  ,flat as (select a.customer, a.cust_name, a.cust_type
    51                  ,b.sect_name, NULLIF(b.sect_dependency,'NULL') as sect_dependency
    52                  ,c.job_sect_name, NULLIF(c.job_sect_dependency,'NULL') as job_sect_dependency
    53                  ,d.job_type, d.job_sub_type, NULLIF(d.job_dependency,'NULL') as job_dependency
    54            from t
    55                ,XMLTABLE('/BATCH'
    56                          PASSING t.xml
    57                          COLUMNS customer     VARCHAR2(10) PATH '/BATCH/@customer'
    58                                 ,cust_name    VARCHAR2(10) PATH '/BATCH/@name'
    59                                 ,cust_type    VARCHAR2(10) PATH '/BATCH/@type'
    60                                 ,bat_sections XMLTYPE PATH '/BATCH/BATCH_SECTIONS'
    61                         ) a
    62                ,XMLTABLE('/BATCH_SECTIONS/SECTION'
    63                          PASSING a.bat_sections
    64                          COLUMNS sect_name        VARCHAR2(10) PATH '/SECTION/@name'
    65                                 ,sect_dependency  VARCHAR2(10) PATH '/SECTION/@dependency'
    66                                 ,section         XMLTYPE      PATH '/SECTION'
    67                         ) b
    68                ,XMLTABLE('/SECTION/JOB_SECTIONS'
    69                          PASSING b.section
    70                          COLUMNS job_sect_name        VARCHAR2(10) PATH '/JOB_SECTIONS/@name'
    71                                 ,job_sect_dependency  VARCHAR2(10) PATH '/JOB_SECTIONS/@dependency'
    72                                 ,job_sections         XMLTYPE      PATH '/JOB_SECTIONS'
    73                         ) c
    74                ,XMLTABLE('/JOB_SECTIONS/JOBS/JOB'
    75                          PASSING c.job_sections
    76                          COLUMNS job_type        VARCHAR2(10) PATH '/JOB/@type'
    77                                 ,job_sub_type    VARCHAR2(10) PATH '/JOB/@sub_type'
    78                                 ,job_dependency  VARCHAR2(10) PATH '/JOB/@dependency'
    79                         ) d
    80            )
    81  --
    82  select customer, cust_name, cust_type, sect_name, sect_dependency, job_sect_name, job_sect_dependency, job_type, job_sub_type, job_dependency
    83        ,row_number() over (partition by customer order by 1) as batch_rn
    84        ,row_number() over (partition by customer, sect_name order by 1) as section_rn
    85        ,row_number() over (partition by customer, sect_name, job_sect_name order by 1) as job_sections_rn
    86  from flat
    87  /
    16 rows created.
    SQL> select * from batch;
    CUSTOMER   CUST_NAME  CUST_TYPE
    ABC        ABC1       ABC_TYPE
    SQL> select * from section;
    CUSTOMER   SECT_NAME  SECT_DEPEN
    ABC        X
    ABC        Y          X
    ABC        Z          Y
    SQL> select * from job_sections;
    CUSTOMER   SECT_NAME  JOB_SECT_N JOB_SECT_D
    ABC        X          JOB1
    ABC        Y          JOB2       X
    ABC        Z          JOB3
    ABC        Z          JOB4
    SQL> select * from job;
    CUSTOMER   SECT_NAME  JOB_SECT_N JOB_TYPE   JOB_SUB_TY JOB_DEPEND
    ABC        X          JOB1       X          xx
    ABC        X          JOB1       X          yy
    ABC        X          JOB1       X          zz
    ABC        Y          JOB2       Y          xx         X
    ABC        Y          JOB2       Y          yy         X
    ABC        Y          JOB2       Y          zz         X
    ABC        Z          JOB3       .....      ....
    ABC        Z          JOB4       ....       ....
    8 rows selected.
    SQL>But it would depend what you are actually after in terms of primary keys, and table relationships etc.
    Let me put this simply for you...
    h1. IF YOU DON'T DEMONSTRATE TO US WHAT OUTPUT YOU REQUIRE, WE CAN'T GIVE YOU AN ANSWER

  • Standard batch input program for Routing

    Hi,
    Please inform me if there is any standard batch input program for uploading routing data.
    Regards
    Ramakanth

    Hi
    Pls check RCPTRA00

  • Can i create 2 input tracks for 2 separate mics?

    can i create 2 input tracks for 2 separate mics?

    wospoon wrote:
    can i create 2 input tracks for 2 separate mics?
    yes, create an aggregate device:
    http://www.bulletsandbones.com/GB/Tutorials.html#allaboutaggregatedevices
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    and then assign 1 channel to one track, and the 2nd channel to another track in the Track "i"nfo pane

  • LSMW for Chart of Account: Field XSPEB not filled in batch-input session

    Hi all,
    we are using LSMW for importing the chart of account into a new system.
    The LSMW project uses the report RFBISA00 for the creation of the batch-input session.
    Some accounts need to be blocked in the new system. Therefore, we have the field XSPEB in our source structure and of course also in our target structure. But after the creation of the batch-input session the field is not included in the corresponding batch-input session.
    Does anybody know why it is not set? I already debugged the program RFBISA00 but couldn't find the place where the data get lost.
    Thanks in advance and regards,
    Martin

    Did your batch input end with save ( /11 ) or what ok_code are you using ?

  • LSMW Batch Input Recording for Create BOM

    Dear All,
    I want to do LSMW for Creating BOM using Batch Input Recording,
    I know that i have to make 2 time Recording, first for the BOM Header and second for the BOM item
    For the BOM header i have done it, but for the BOM item i got some trouble with the item number (POSNR),
    when i run the LSMW, for the first item (item 0010) was success, but for the item 0020, it can't work and i got error
    message " NO BATCH INPUT FOR SAPLCSDI 0150"
    How is the recording step by step for BOM Item so the Item number can increase well?
    Very need your help,
    Regards,
    Marufat

    Hello Santosh,
    Thanks for the reply,
    I already check in SM35 where i also thought that the main problem is about adding the new item number,
    but when i tried to do repeat recording, i can not find any entry for adding the line item, so the line item after 0010 cannot be input
    Is there any solution?
    Regards,
    Marufat

  • Can we run batch input session in foreground as well as in background

    Hi SAP Gurus,
    I have 23000 records to transfer from one gl account to other gl.
    I want to run the session in foreground for 5 transactions and the rest will be processed in background. Is there any setting through which I can do it.
    I mean to say the first 5 transactions will be processed in foreground as soon as the process starts and after that it will automatically goto background processing for the remaing records. This i desire for a check.
    Regards,
    Anirban

    Hello Anirban,
    Check the below program to split the number of session based number of records in file .
    suppose if you enter 10,000 in selection-screen,if you have 30,000 records in file,then it creates 3 session each session will have 10,000 records.
    I had requirement like i get 2,00,000 records at a time ,if i process all records using session method ,after 20,000 records i get short dump due to performance.
    i created logic into number of session ,i guess it helps you.
    Report     : ZMPPC015
    Type       : Data upload
    Author     : Seshu Maramreddy
    Date       : 05/26/2005
    Transport  : DV3K920025
    Transaction: ??
    Description: This ABAP/4 Program to Create Planned Independent
                 Requirement for SMI plants using MD61 Transaction.
                 It accepts tab-delimited spreadsheet input and
                 creates BDC sessions.
    report zmppc015 no standard page heading
                    line-size 120
                    line-count 55
                    message-id zz.
    Constants
    constants : c_x type c value 'X'," Dynbegin
                c_tcode type tstc-tcode value 'MD61'." Transaction Code
    Variables
    data : v_lines_in_xcel like sy-tabix,
           l_tabix like sy-tabix,
           v_trans_in_ssn type i,
           v_ssnnr(4) type n," Counter
           v_ssnname like apqi-groupid,
           v_matnr(18) type c. " Material Number
    Internal Tables
    Internal table for file
    data : begin of t_file occurs 0,
           matnr(18) type c,   " Material Number
           berid(10) type c,    " MRP Area
           PLNMG01(17) type n, " Forecast Month -01
           PLNMG02(17) type n, " Forecast Month -02
           PLNMG03(17) type n, " Forecast Month -03
           PLNMG04(17) type n, " Forecast Month -04
           PLNMG05(17) type n, " Forecast Month -05
           PLNMG06(17) type n, " Forecast Month -06
           PLNMG07(17) type n, " Forecast Month -07
           PLNMG08(17) type n, " Forecast Month -08
           PLNMG09(17) type n, " Forecast Month -09
           PLNMG10(17) type n, " Forecast Month -10
           PLNMG11(17) type n, " Forecast Month -11
           PLNMG12(17) type n, " Forecast Month -12
           WERKS(4) TYPE C,    " Plant
           end of t_file.
    Internal table for BDCDATA Structure
    data : begin of itab_bdc_tab occurs 0.
            include structure bdcdata.
    data : end of itab_bdc_tab.
    Selection-screen
    selection-screen: skip 3.
    selection-screen: begin of block id1 with frame.
    parameters: p_name        like rlgrap-filename
                              default 'C:\My Documents\InputFile.txt'
                              obligatory,
    bdc session name prefix
                p_bdcpfx(6)   default 'ZPIRCT'
                              obligatory,
    number for transction per BDC session
                p_trnssn      type i
                              default 2000 obligatory,
    retain the BDC session after successfull execution
                p_keep        like apqi-qerase
                              default c_x,
    user who will be executing BDC session
                p_uname       like apqi-userid
                              default sy-uname
                              obligatory.
    selection-screen : skip 1.
    Requirement type
    parameters : p_bedae like t459u-bedae,
    From Date
                 p_date like sy-datum default sy-datum obligatory.
    selection-screen: end of block id1.
    at selection-screen on value-request for p_name.
    F4 value for Input file
      perform filename_get.
    main processing
    start-of-selection.
    To get the data from file to Internal table
      perform getdata_fromfile.
      loop at t_file.
      hang on to xcel line num
        l_tabix = sy-tabix.
      if num-of-trnas-in-session = 0, create new BDC session
        if v_trans_in_ssn is initial.
          perform bdc_session_open.
        endif.
      begin new bdc script for rtg create trans
      fill in bdc-data for prod.version maintenance screens
        perform bdc_build_script.
      insert the bdc script as a BDC transaction
        perform bdc_submit_transaction.
      keep track of how many BDC transactions were inserted in the BDC
      session
        add 1 to v_trans_in_ssn.
      if the user-specified num of trans in BDC session is reached OR
      if end of input file is reached, close the BDC session
        if v_trans_in_ssn = p_trnssn or
           l_tabix = v_lines_in_xcel.
          perform bdc_session_close.
          clear v_trans_in_ssn.
        endif.
    clear t_file.
      endloop.
    top-of-page.
      call function 'Z_HEADER'
    EXPORTING
      FLEX_TEXT1       =
      FLEX_TEXT2       =
      FLEX_TEXT3       =
    *&      Form  filename_get
          F4 Value for input file
    FORM filename_get.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                DEF_PATH         = 'C:\Temp\ '
                MASK             = ',.,..'
                MODE             = 'O'
                TITLE            = 'Select File '(007)
           IMPORTING
                FILENAME         = p_name
           EXCEPTIONS
                INV_WINSYS       = 1
                NO_BATCH         = 2
                SELECTION_CANCEL = 3
                SELECTION_ERROR  = 4
                OTHERS           = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " filename_get
    *&      Form  getdata_fromfile
          Upload the data from file to Internal table
    FORM getdata_fromfile.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                FILENAME                = p_name
                FILETYPE                = 'DAT'
           TABLES
                DATA_TAB                = t_file
           EXCEPTIONS
                CONVERSION_ERROR        = 1
                FILE_OPEN_ERROR         = 2
                FILE_READ_ERROR         = 3
                INVALID_TYPE            = 4
                NO_BATCH                = 5
                UNKNOWN_ERROR           = 6
                INVALID_TABLE_WIDTH     = 7
                GUI_REFUSE_FILETRANSFER = 8
                CUSTOMER_ERROR          = 9
                OTHERS                  = 10.
      if sy-subrc eq 0.
        sort t_file by matnr .
        delete t_file where matnr = ''.
        clear v_lines_in_xcel.
        describe table t_file lines v_lines_in_xcel.
        if v_lines_in_xcel is initial.
          write: / 'No data in input file'.
          stop.
        endif.
      else.
        write:/ 'Error reading input file'.
        stop.
      endif.
    ENDFORM.                    " getdata_fromfile
    *&      Form  bdc_session_open
          BDC_OPEN_GROUP
    FORM bdc_session_open.
    create bdc session name = prefix-from-selectn-screen + nnnn
      add 1 to v_ssnnr.
      concatenate p_bdcpfx v_ssnnr into v_ssnname.
      CALL FUNCTION 'BDC_OPEN_GROUP'
           EXPORTING
                CLIENT              = SY-MANDT
                GROUP               = v_ssnname
                KEEP                = p_keep
                USER                = p_uname
           EXCEPTIONS
                CLIENT_INVALID      = 1
                DESTINATION_INVALID = 2
                GROUP_INVALID       = 3
                GROUP_IS_LOCKED     = 4
                HOLDDATE_INVALID    = 5
                INTERNAL_ERROR      = 6
                QUEUE_ERROR         = 7
                RUNNING             = 8
                SYSTEM_LOCK_ERROR   = 9
                USER_INVALID        = 10
                OTHERS              = 11.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " bdc_session_open
    *&      Form  bdc_build_script
          BDC Script
    FORM bdc_build_script.
    Local Variables
      DATA : l_frdat(8) type c,  " From Date
             l_todat(8) type c,  " To Date
             l_frdat1(4) type c, " Year
             l_frdat2(2) type c, " Month
             l_frdat3(2) type c, " Day
             l_tdate like sy-datum, " Subtract date(1)
             l_todat1(4) type c,    " Year
             l_todat2(2) type c,    " Month
             l_todat3(3) type c.    " Day
       Get the material number from tables ZMSMI_FERR_RAW,
       ZMSMI_SNAP_RAW and ZMSMI_SIMP_RAW
      perform get_matnr.
    Screen 0100.
      perform bdc_screen using  'SAPMM60X'     '0100'.
      perform bdc_field  using  'BDC_OKCODE'   '/EBDPT'.
      perform bdc_field  using  'AM60X-MATAW'  'X'.
      perform bdc_field  using  'AM60X-MATNR'  T_FILE-MATNR.
      perform bdc_field  using  'AM60X-PRGRP'  SPACE.
      perform bdc_field  using  'AM60X-PBDNR'  SPACE.
      perform bdc_field  using  'RM60X-BERID'  T_FILE-BERID.
      perform bdc_field  using  'AM60X-WERKS'  SPACE.
      perform bdc_field  using  'RM60X-VERSB'  '00'.
    Converted the date as per MD61 Transaction.
    From date
      l_frdat1 =  p_date+0(4).
      l_frdat2 =  p_date+4(2).
      l_frdat3 =  p_date+6(2).
      concatenate l_frdat2 l_frdat3 l_frdat1 into l_frdat.
    To Date
      l_tdate = p_date - 1.
      l_todat1 =  l_tdate+0(4) + 1.
      l_todat2 =  l_tdate+4(2).
      l_todat3 =  l_tdate+6(2).
      concatenate l_todat2 l_todat3 l_todat1 into l_todat.
      perform bdc_field  using  'RM60X-DATVE'  l_frdat.
      perform bdc_field  using  'RM60X-DATBE'  l_todat.
      perform bdc_field  using  'RM60X-ENTLU'  'M'.
    Screen 0127
      perform bdc_screen using  'SAPMM60X'     '0127'.
      perform bdc_field  using  'BDC_OKCODE'   '=WEIT'.
      if p_bedae is initial.
        perform bdc_field  using  'T459U-BEDAE'  space.
      else.
        perform bdc_field  using  'T459U-BEDAE'  P_BEDAE.
      endif.
    Screen 0100.
      perform bdc_screen using  'SAPMM60X'     '0100'.
      perform bdc_field  using  'BDC_OKCODE'   '/00'.
      perform bdc_field  using  'AM60X-MATAW'  'X'.
      perform bdc_field  using  'AM60X-MATNR'  T_FILE-MATNR.
      perform bdc_field  using  'AM60X-PRGRP'  SPACE.
      perform bdc_field  using  'AM60X-PBDNR'  SPACE.
      perform bdc_field  using  'RM60X-BERID'  T_FILE-BERID.
      perform bdc_field  using  'AM60X-WERKS'  SPACE.
      perform bdc_field  using  'RM60X-VERSB'  '00'.
      perform bdc_field  using  'RM60X-DATVE'  l_frdat.
      perform bdc_field  using  'RM60X-DATBE'  l_todat.
      perform bdc_field  using  'RM60X-ENTLU'  'M'.
    Screen 0200
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG01.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG02.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG03.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG04.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG05.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG06.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG07.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG08.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG09.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG10.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=S+'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG11.
      perform bdc_screen using  'SAPLM60E'     '0200'.
      perform bdc_field  using  'BDC_OKCODE'   '=SICH'.
      perform bdc_field  using  'RM60X-PLN01(01)'  T_FILE-PLNMG12.
    ENDFORM.                    " bdc_build_script
    *&      Form  get_matnr
          Get the material number from tables ZMSMI_FERR_RAW,
          ZMSMI_SNAP_RAW and ZMSMI_SIMP_RAW
    FORM get_matnr.
      clear v_matnr.
      case t_file-werks.
        when '0101'.
          select single cmatnr from zmsmi_simp_raw
                 into v_matnr  where matnr = t_file-matnr.
          if sy-subrc eq 0.
            clear t_file-matnr.
            t_file-matnr = v_matnr.
          endif.
        when '0103'.
          select single cmatnr from zmsmi_ferr_raw
                 into v_matnr  where matnr = t_file-matnr.
          if sy-subrc eq 0.
            clear t_file-matnr.
            t_file-matnr = v_matnr.
          endif.
        when '0102' or '0110' or '0111' or '0112' or '0113'
             or '0114' or '0115' or '0116' or '0117'.
          select single cmatnr from zmsmi_snap_raw
                 into v_matnr  where matnr = t_file-matnr.
          if sy-subrc eq 0.
            clear t_file-matnr.
            t_file-matnr = v_matnr.
          endif.
      endcase.
    ENDFORM.                    " get_matnr
    *&      Form  bdc_screen
          BDC Script for Screen fields
         -->P_PROG   Program name
         -->P_SCRN   Screen Number
    FORM bdc_screen USING    p_prog
                             p_scrn.
      clear itab_bdc_tab.
      itab_bdc_tab-program = p_prog.
      itab_bdc_tab-dynpro = p_scrn.
      itab_bdc_tab-dynbegin = c_x.
      append itab_bdc_tab.
    ENDFORM.                    " bdc_screen
    *&      Form  bdc_field
          BDC Script for Screen fileds
         -->P_NAM   Field name
         -->P_VAL   Field value
    FORM bdc_field USING    p_nam
                            p_val.
      clear itab_bdc_tab.
      itab_bdc_tab-fnam = p_nam.
      itab_bdc_tab-fval = p_val.
      append itab_bdc_tab.
    ENDFORM.                    " bdc_screen
    *&      Form  bdc_submit_transaction
          BDC_INSERT Function Module
    FORM bdc_submit_transaction.
    Load BDC script as a trqansction in BDC session
      call function 'BDC_INSERT'
           EXPORTING
                tcode          = c_tcode
           TABLES
                dynprotab      = itab_bdc_tab
           EXCEPTIONS
                internal_error = 01
                not_open       = 02
                queue_error    = 03
                tcode_invalid  = 04.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      refresh itab_bdc_tab.
    ENDFORM.                    " bdc_submit_transaction
    *&      Form  bdc_session_close
          text
    FORM bdc_session_close.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
      NOT_OPEN          = 1
      QUEUE_ERROR       = 2
      OTHERS            = 3
      skip 2.
      if sy-subrc ne 0.
        write: / 'Error Closing BDC Session ' , 'RETURN CODE: ', sy-subrc.
      else.
        write : /  'Session created:', v_ssnname,
                50 '# of transactions:', v_trans_in_ssn.
      endif.
    ENDFORM.                    " bdc_session_close
    Thanks
    Seshu

  • IW31 Batch input recording for lsmw

    Hi all,
    I am facing difficulty in doing LSMW for IW31 transaction. I have created the flat file with the identifiers. But when i run the session, for 2 items of a single header, two different orders are created with one for each item.
    Is it the problem with the flat file or with the recording?
    Thanks in advance.
    Vijay

    A method we've used for KB31N using BDC with some success is to loop at an internal table containing the fields to populate (we use an input file with 8 fields and constants/global variables for the rest).  I don't have the code avaialble but here is some pseudo-code:
    open a new session for the document
    append data to a BDCDATA table (either static/global or dynamic/user-/file-input)
    if in list view move cursor to top left (EL2(01)) and insert line; if in individual view simply enter the fields to move to a new record
    when at the last record, post the data
    close the session
    run the transaction with the BDCDATA from the newly created session
    Since the order of our data is important in the final document we read the data into an internal table and assign sy-tabix to an ID field.  Then we simply sort the internal table by ID descending just prior to the main BDC loop.
    Please note that I said we've used this method with some success.  I've found that there seems to be a limit to the number of entries but have, as yet, found no documentation on what the limit may be, why there appears to be one, or even if there is a limit in the first place or if I'm seeing the effects of limited resources.
    I hope this answer helps.  Thanks.
    Scott in New York, USA

Maybe you are looking for

  • Changing DB character set for only one schema

    We are interested in changing the characterset of only one user from Western European to AL32UTF8. Could you please verify if the following steps will be correct to do the same. 1. Run CSScan on the one user 2. Fix any issues 3. Export that one user

  • I'm new to SQL Server Integration Services and I need help on how to begin learning SSIS. Is there any training for it besides msdn?

    I'm new to SQL Server Integration Services and I need help on how to begin learning SSIS. Is there any training for it besides msdn?

  • Copying layers changes layer name

    Hi there, Im pretty good about naming my layers (and sublayers.) I find that when i copy and paste a layer, its being renamed. For example, I'll name a layer, "button_text_01" when i copy and paste that layer, InDesign renames it, "button_text_02" in

  • [SOLVED] Wireshark from a non root user

    Hi, Recently I've tried to install wireshark. I wanted to use it from my everyday user. However I encountered a problem during the installation Failed to set capabilities on file `/usr/bin/dumpcap' (Operation not supported) usage: setcap [-q] [-v] (-

  • How To Suppress Leading Zeroes

    Can someone give a new modeler a tip on how to suppress the leading zeroes in a field? Order number, for example, is returned with many leading zeroes, and each dynamic expression I choose doesn't seem to work. Thanks in advance!