Batch input recording - loop

just want to ask how i can make the code flexible:
i have a internal table that contains the matnr, erfmg and werks.
a. if my matnr is 1 the code will look like this:
      PERFORM bdc_dynpro USING 'SAPMM07M'  '0421'.
      PERFORM bdc_field USING:
              'bdc_cursor'  'MSEG-ERFMG(01)',
              'bdc_okcode'  '/00',
              'MSEGK-KONTO'  i_tble_hdr-konto,
              'MSEG-MATNR(01)'  wa_tbl_li-matnr,
              'MSEG-ERFMG(01)'  wa_tbl_li-erfmg,
              'MSEG-LGORT(01)'  i_tble_hdr-lgort,
              'MSEG-WERKS(01)'  wa_tbl_li-werks,
              'bdc_subscr'  'SAPMM07M',
              'bdc_subscr'  'SAPLKACB'.
b. if the matnr is 2 or more the code will look like this.
      PERFORM bdc_dynpro USING 'SAPMM07M'  '0421'.
      PERFORM bdc_field USING:
              'bdc_cursor'  'MSEG-ERFMG(0n)',
              'bdc_okcode'  '/00',
              'MSEGK-KONTO'  i_tble_hdr-konto,
              'MSEG-MATNR(01)'  wa_tbl_li-matnr1,
              'MSEG-MATNR(02)'  wa_tbl_li-matnr2,
              'MSEG-MATNR(0n)'  wa_tbl_li-matnrn,
              'MSEG-ERFMG(01)'  wa_tbl_li-erfmg1,
              'MSEG-ERFMG(02)'  wa_tbl_li-erfmg2,
              'MSEG-ERFMG(0n)'  wa_tbl_li-erfmgn,
              'MSEG-LGORT(01)'  i_tble_hdr-lgort1,
              'MSEG-LGORT(02)'  i_tble_hdr-lgort2,
              'MSEG-LGORT(0n)'  i_tble_hdr-lgortn,
              'MSEG-WERKS(01)'  wa_tbl_li-werks1,
              'MSEG-WERKS(02)'  wa_tbl_li-werks2,
              'MSEG-WERKS(0n)'  wa_tbl_li-werksn,
              'bdc_subscr'  'SAPMM07M',
              'bdc_subscr'  'SAPLKACB'.
how will i code letter b? is the 01/02/0n can be a variable?
thanks.
donna

hi vinod,
please check if my code is correct. thanks a lot.
form batch_input.
data: i_ctr type n.
clear bdc_tab.
refresh bdc_tab.
  concatenate 'zexv' sy-datum4(4) sy-uzeit0(4) into bdcname.
  perform open_group.
    PERFORM bdc_dynpro USING 'SAPMM07M'  '0400'.
    PERFORM bdc_field USING:
            'bdc_cursor'  'RM07M-WVERS3',
            'bdc_okcode'  '/00',
            'MKPF-BLDAT'  i_tble_hdr-bldat,
            'MKPF-BUDAT'  i_tble_hdr-budat,
            'RM07-MTSNR'  i_tble_hdr-mtsnr,
            'MKPF-BKTXT'  i_tble_hdr-bktxt,
            'RM07-BWARTWA'  i_tble_hdr-bwartwa,
            'RM07-WERKS'  i_tble_hdr-werks,
            'RM07-LGORT'  i_tble_hdr-lgort,
            'RM07-XNAPR'  'X',
            'RM07-WVERS3'  'X'.
  i_ctr = 0.
  loop at i_tble_li.
      wa_tbl_li = i_tble_li.
      PERFORM bdc_dynpro USING 'SAPMM07M'  '0421'.
      PERFORM bdc_field USING:
              'bdc_cursor'  'MSEG-ERFMG(01)',
              'bdc_okcode'  '/00',
              'MSEGK-KONTO'  i_tble_hdr-konto,
              'MSEG-MATNR' wa_tbl_li-matnr,
              'MSEG-erfmg' wa_tbl_li-erfmg,
              'MSEG-lgort' i_tble_hdr-lgort,
              'MSEG-werks' wa_tbl_li-werks,
              'bdc_subscr'  'SAPMM07M',
              'bdc_subscr'  'SAPLKACB'.
        PERFORM bdc_dynpro USING 'SAPLKACB'  '0002'.
        PERFORM bdc_field USING:
                'bdc_okcode'  '/EENTE',
                'bdc_cursor'  'COBL-KOSTL',
                'COBL-GSBER'  i_tble_hdr-gsber,
                'COBL-KOSTL'  i_tble_hdr-kostl,
                'bdc_subscr'  'SAPLKACB'.
        PERFORM bdc_dynpro USING 'SAPLKACB'  '0002'.
        PERFORM bdc_field USING:
                'bdc_okcode'  '/EENTE',
                'bdc_cursor'  'COBL-GSBER',
                'bdc_subscr'  'SAPLKACB'.
      PERFORM bdc_dynpro USING 'SAPMM07M'  '0421'.
      PERFORM bdc_field USING:
              'bdc_cursor'  'MSEG-ERFMG(01)',
              'bdc_okcode'  '=NLE',
              'bdc_subscr'  'SAPMM07M',
              'bdc_subscr'  'SAPLKACB'.
      PERFORM bdc_dynpro USING 'SAPLKACB'  '0002'.
      PERFORM bdc_field USING:
              'bdc_okcode'  '/EENTE',
              'bdc_cursor'  'COBL-GSBER',
              'bdc_subscr'  'SAPLKACB'.
  endloop.
    PERFORM bdc_dynpro USING 'SAPLKACB'  '0002'.
    PERFORM bdc_field USING:
            'bdc_okcode'  '/EENTE',
            'bdc_cursor'  'COBL-GSBER',
            'bdc_subscr'  'SAPLKACB'.
    PERFORM bdc_dynpro USING 'SAPLKACB'  '0002'.
    PERFORM bdc_field USING:
            'bdc_okcode'  '/EENTE',
            'bdc_cursor'  'COBL-GSBER',
            'bdc_subscr'  'SAPLKACB'.
    PERFORM bdc_dynpro USING 'SAPMM07M'  '0421'.
    PERFORM bdc_field USING:
            'bdc_cursor'  'MSEG-ERFMG(01)',
            'bdc_okcode'  '=BU',
            'bdc_subscr'  'SAPMM07M',
            'bdc_subscr'  'SAPLKACB'.
    PERFORM bdc_dynpro USING 'SAPLKACB'  '0002'.
    PERFORM bdc_field USING:
            'bdc_okcode'  '/EENTE',
            'bdc_cursor'  'COBL-GSBER',
            'bdc_subscr'  'SAPLKACB'.
    PERFORM bdc_insert_mb1a.
   perform close_group.
endform.

Similar Messages

  • 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

  • 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

  • LSMW for material master using Batch input recording method

    Dears,
    I am using Batch input recording method to upload material master data. But while selecting views , I need to scroll to select the vies lets say Plant storage loc view. While scrolling and selecting ,views are not recorded propelry . That is when I run in foreground system selects only basic data and purchasing views but the plant data views are not selected(palnt data views are selected by scrolling while recording).
    How to resolve this issue.
    Pls help
    Regards
    Kamesh

    HI,
    , I need to scroll to select the vies lets say Plant storage loc view. While scrolling and selecting ,views are not recorded propelry
    Don,t scroll use Page down button from key Bord
    like select Basis view and then press page down button from key board ,then you will get next view now select it
    Regards
    Kailas Ugale

  • SaveAs in Batch Input Recorder

    Hi! I'm Cherrie, a newbie. Is it possible to incorporate exporting attached file of an email message to Batch Input Recorder? How?
    Trying to save the file to a local pc automatically as batch input recorder process. However, it always stops where export button is to be clicked as before SaveAs dialog shows.
    Please help.

    Hi,
    It's not possible to save file to local pc if you run your program in background.
    Krzys

  • LSMW for Listings via Batch Input recording - Help ?

    Hi
    Has anyone had any luck with trying to upload Listings via LSMW at all ?
    I have created on, via batch input recording
    I have lots of records with entries from 1 to 16
    I have recorded enough entries to cope with 16
    However when i try to execute the batch session, if there is only 1 material that requires an entry, then i cannot get past this screen, the LSMW is wanting entries for the next line and so on
    I presume I must have to put some sort of a ruling in per Material number it is expecting, so if it is not poupulated then to move on, but to save the entries that have already been made
    I do not have much experience in writing rules into LSMW so
    Any ideas / help would be much appreciated
    Thanks
    Tony

    Hello Tony,
    In the past I have suggested this to few people and were successful with this link, please try, but only thing you need to take care is use VB02 instead of XK01 with reference to this link what I am trying to say.
    http://youtu.be/fz94PcvtdZw
    Regards,
    Sridhar.

  • LSMW, batch input recording, structured file

    Hello,
    I'm new with LSMW.
    Is it right that with LSMW when used in batch input recording, it is impossible to use a structured file, with a header and with many item for exemple ?
    ( i try to do that with a financial transaction like F-02 )
    Thanks in advance for any help.
    (we are in WAS 6.20, LSMW 4.0 )
    Denis

    hai
    can any one help me how to handle lsmw with two structures  header & item data structures
    how can i map the target structures to source structures
    for example target recording structure have  ematn_01
                                                ematn_02
                                       how to map these 01 and 02 to source structures
    i have to take two source fields as ematn_01 & ematn_02
    or i have to map only one source ematn to all emant_01
                                                       _02
                                                       _03
    if there are n ematn's in that case how to map dynamically

  • Lsmw (batch input recording)

    explain step by step procedure for uplodig master data through lsmw (batch input recording) method. please explain settings for auto field mapping in 5th step

    Hi Neela,
    These are the steps to be followed while doing a Batch Input Recording.
    LSMW STEPS (Batch Input Recording)
    1. Maintain Attributes:
    Here you have to choose the second option and you can do the recording how this should work. Then assign the same to the Batch Input Recording name.
    2. Maintain Source structure:
    Create a structure name
    3. Maintain Source field:
    Create a structure like the Input File
    eg:
    Name - LIFNR
    Description - Account number or Vendor Number
    4. Maintain structure relations:
    This will link the structure to the input file.
    5. Maintain field mapping and conversion rules:
    You can choose the Auto Filed Mapping under Extras Menu. Yopu can also do coding, depending upon the code you have written or assignment you have done the values will get picked up from the file and get processed.
    6. Maintain field mapping and conversion rules:
    If you have any fixed values you can define here.
    7. Specify files:
    Specify the input file path and type.
    8. Assign files:
    This will assign ur file to the Input file
    9. Read Data:
    This will read ur data from teh file.
    10. Dispaly Read Data:
    You can see the uploaded data
    11. Convert Data
    This will convert the data to the corresponding format for processing
    12. Display Converted data:
    13. Create batch input session
    Here this will create a batch input session for processing
    14. Run Batch Input session:
    By clicking on the session and process (Back ground or Display Errors)
    Refer the Below Links
    http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
    /people/hema.rao/blog/2006/09/14/lsmw--step-by-step
    http://help.sap.com/bp_blv1500/BL_US/documentation/LSMW_EN_US.doc
    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
    http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
    Reward Points if Useful
    Regards
    Gokul

  • Difference between batch input method and batch input recording in LSMW?

    hi,
    plz tell me the difference between batch input method and batch input recording in LSMW?
    thanks & regards
    Ruban

    Hi Ruban,
               The main difference between the two is in lsmw we can view the code status at any time just by coming to prvious steps, but whereas in batch input method unless the recording is finished we cant view the code.
    second diff is tht we need to do lot of coding in batch inptu whereas here in lsmw we need not do much coding and mapping to data.
    third diff is that batch input is both inbound and outbound where as lsmw is only inbound.
    hope u got the differences.....
    Regards,
    sana M...

  • Batch input recorder - subscreen missing

    Hi all,
    I made a batch input recording with transaction VCH2.
    But in recording mode the subscreen with the already existing classification values is missing. The subscreen is not shown...
    Any ideas?
    regards

    If these subscreen is part of Modification or enhancement to the transaction.(i.e the subscreen is added later on for some specific requirement).
    you just need to add these screen Manually in you code they don't appear in recording.
    Even if you add custom fields to the tcode they will behave the same.
    The is issue is just will custom fields and subscreens.
    Regards,
    Gurpreet

  • Lsmw for cl20n through batch input recording

    Hi Experts
    I tried to create lsmw using recording method for CL20N for uploading classification for rel object.
    But i am unable to create lsmw.
    Please suggest possible solution.
    regards
    ramSiva

    Hi,
    You can use the standard Batch input program(details below):
    Object                0130   Classification
    Method               0001   Batch input  
    Program name    RCCLBI02            
    Program type      B   Batch input
    Hope this is useful.
    Reetesh
    Edited by: Reetesh on Dec 5, 2011 4:49 PM

  • 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

  • Batch Input Recording - GUI Upload Function

    Hello,
    i want to record a batch input.
    Within the recording a Gui Upload Function is called, so that the user have to select a file from the local disk, which should be uploaded into the system. That step wasn't recorded by the bach input recording.
    Is there any soluion for that?
    Regards,
    TomSd

    As Suhas said, these kind of UI dialogs cannot be handled by batch input technology.
    Sometimes transactions allow the batch input by displaying another kind of UI dialog that is allowed. Try to record using "simulate background mode", maybe the program will display another UI dialog. Make sure also to untick the "no BI mode" checkbox.
    But maybe this transaction isn't planned to be used in batch input at all (which transaction do you need to record?). In that case, the only solution is maybe eCATT (with external tool connected as I am aware).

  • Help in batch input recording

    HI Experts ,
    if u go to transaction CNE1 & i put project number ,
    and i remove the v from TEST RUN and i Execute,
    i get pop-up with message : Actual values can be deleted.
    i don't wont this pop-up how can i neutralize it?
    i Try with Batch input, i recored the process and when i get the pop-up i push V and save,
    but when i try to run process again i get the pop-up again .
    I Think that here is the problem this is the pop-up (in bold i check in appl.data ) i can change it?
    T CNE1
    SAPLKAZB 1000 X
    BDC_CURSOR RKAUF-TEST
    BDC_OKCODE =RUN
    RKAUF-TEST
    *BDC_SUBSCR SAPLCNEV_01_MASTER_DATA* 0550BLOCK1
    LKP74-PSPID E0-0005
    BDC_SUBSCR SAPLKAZB 2450BLOCK2
    RPSCO_X-VERSN_EV N01
    RKAUF-TO 5
    RKAUF-GJAHR 2008
    Regards

    hi,
    sorry in this line :
    BDC_SUBSCR SAPLCNEV_01_MASTER_DATA 0550BLOCK1
    Regards

  • 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

  • Interactive rollover function isn't working in full screen mode.

    I've created an interactive document with animation in Indesign CC. Part of this document has menu bars that change to longer bars when rolled over. I export as an swf and then place that in a separate document to export to pdf. When I open it in Acr

  • Documentation for install of 3.6.1?

    Hi. We have, for a client, a version of UPK installed which is 3.1.7. The new version to be installed is 3.6.1. I have uploaded the new content to the server. But I am looking for documentation that would explain the new setup....something like Oracl

  • Accept and invite in outlook, disappears from my desktop PC calendar but shows on my ipad exchange calendar

    If i accept an invitation on my pc (outlook 2007, Exchange 2003)  it shows up for a brief time and then disappears but shows up on my ipad2. This was a message sent to all users and all users that do not have an iPad2 have the message on their calend

  • Lease Accounting Scenario

    Dear:             We have Lease accounting for assets configured in Organization Now the leasing process has changed. Management now receives funds from bank for the value of asset being purchased i-e finance lease. AS-IS process (currently running )

  • Adobe Form translation from English to Chinese

    Hi,     I am using SE63/PDFB to edit the target language to chinese, for some reason when I try to paste chinese characters, system is not recognizing, I see square boxes for the chinese chars. Please let me know what would be the problem. I am good