Lsmw  using recording method

hi all,
              i occured some problem while working with lsmw, when enter into step run batch input session in that processing session some error is occured i.e ur session is not processed. what can i do for procrssing any session that i created. i think u  will help me.         thanks .

can u tell exactly where u cant process the session. already have u processed the session or are u trying to create a new session and then processing it????
Regards,
Anil N.

Similar Messages

  • List recipe (tx. c201) in lsmw using recording method

    Hi.
    I'm trying to upload master data for recipe list (tx c201), and I'm not so sure which method I should use, i tried with an standard object but it works with idocs and i supposed to configure a lot of stuffs (ibounds, ports, etc), and using recording... how can i handle controls tables when the number of items it's variable?.
    Reading through the sdn i realized that it's good to work with two files, one with master data and the second one with detail or item data. Actually i used that method to upload data in lsmw but using a standard direct input program and works pretty good..., but using a recording I don't know how to handle this.
    Thanks in advance,
    Regards.
    Albio.-
    Message was edited by: Albio Vivas
    Message was edited by: Albio Vivas

    Get your test data from functional folks then do the recording based on that. After done with the recording you may delete the existing values(which are used for recording). This is because, for example say you are having the data in an EXCEL sheet and for a particular customer one of the fields is empty. In this case, the DB will be updated with the value provided in the recording.

  • Requesting all to help me how to create lsmw using idoc method

    hi
    thanx for ur answer
    requesting every body in the forum to help me how to create lsmw using idoc method.
    regards,
    balaji

    Hi Balaji,
    LSMW using IDOC is similar to using flat file method. Here you are getting data from IDOC container and mapping data with Idoc segments insted of flatfile column.
    Hope this is what you are looking for. If helpful then don’t forget to reward me for that
    Darshan

  • LSMW using IDoc Method *Error :No partner exists with the name '', type ''*

    Hi All,
    I am a newbie. I am trying LSMW using IDoc Method.
    I got an error when i executed Start IDoc Generation step: No partner exists with the name '', type ''
    Could anyone tell what wrong I might have done,
    Thank you,
    Shiv Ram

    Hi,
    You have to setup your IDoc configuration in LSMW:
    1) Enter the menu \Settings\IDoc Inbound Processing
    2) Create a FILE port by clicking "Maintain Ports"
    3) Create a logical system (LS) partner number by clicking "Maintain Partner Numbers"
    4) Be sure your partner profile that you create is "Active" by clicking "Classification"
    5) In the end click "Activate IDoc Inbound Processing" bottom.
    Run your LSMW again. This time it shoud run wothout any problem.
    Hope it helps.
    Chang

  • Data Migration-LSMW using IDoc Method

    Hi Friends,
    I have contract relevant information in the form of a excel spreadsheet/tab delimited flat file.
    This transactional data has information such as Header Data, Item Data and Sub Item data (BOM explosion).
    I need to migrate this data from the flat file to the CRM application using the IDoc Method of LSMW.
    /When I used the Batch Input Recording method, the item data was not captured during recording./
    Kindly send me relevant information to [email protected]
    Thanks in Anticipation
    rgards,
    Praveen

    Hello Sven,
    thanks for your comment. Unfortunatelly those both transactions do not exitst because I work on SAP CRM 7.0 instead of SAP ECC. I also looked for similar transactions in the table but didn't find anything.

  • How to update more than one Bank data in LSMW using recording

    Hi friends,
    please let me know how can we upload more than one bank data for vendore master in LSMW, and i am Using Recording and i have to use that.
    thanks a lot.
    Regards,
    veeru.

    Hi
    I have used the direct input but, there are address fields missing in the direct input like, SORT2, MOB_NUMBER, SMTP_ADDR. these fields.
    when i see the documentation for direct input, it says for additional address you need to use another BAPI. but here the problem is we are using internal numbering for vendor, so how to link the created vendor and the address uploaded to correct vendor.
    thanks a lot,.

  • Working on LSMW using IDoc method for processing Open Sales Orders

    We are currently in middle of creation of a new instance of production for a different Business SBU. We are looking to utilise the LSMW tool using IDocs for uploading / transferring the open orders to the new box. If some one has worked on LSMW using IDocs, please get in touch and if you could share any documents on the process of utilising the LSMW tool using Idocs for any kind of conversions, it would be great. The following is a sample case.
    1. Each order will have multiple segments with different qualifiers under various segments.
    2. Multiple line items would be available under each order.
    Issues we are currently looking to solve :
    1. How do you manage to loop through the qualifiers during processing for the same segment.
    2. How do you prepare the tool to recognise the multiple line items of the same order.
    3. What kind of strategy needs to be used to create the input data file(s). Like, splitting the header and detail level information ?
    Note  : The volume of data we are looking at is somewhere around 40-60 thousand orders worldwide.
    Thanks in Advance.

    hI vikram check this link
    and reward points if helpful
    http://www.****************/Tutorials/LSMW/IDocMethod/IDocMethod1.htm
    http://www.jt77.com/system-dynamics/model-01395.html

  • Lsmw using recording/Direct input for customer using xd01-urgent please

    how will you upload the record for a customer if you have more than one record for bank master data for that customer. becoz a customer have have many bank details associated with his customer no.
    .that is how would you handle table control in screens in lsmw..

    HI,
    Use the Standard Batch Input Program to upload the Customer Bank data.
    <b>Object               0050   Customer master
    Method               0000
    Program Name         RFBIDE00
    Program Type         B   Batch Input</b>
    Create the two structures
    1) Customer data
       Customer Data Structure contains the general Customer details
    2) Customer Bank data ( this structure must be child to th above structure)
        this structure contains the Bnak Details
    while defining the source fields take one field as indicator(Char 1) in both the structures,
    for the Indicator field
    in Customer data structure place the <b>Identifying Field Content      H</b>
    in Customer Bank data structure place the  <b>Identifying Field Content      I</b> 
    i.e. to differentiate the Header and Item
    In Maintain Structure Relations step
       assign the Customer data Structure where required
       assign the Customer bank data structure to the Traget Structure <b>BKNBK</b> 
    In Field Mapping step map the fields accordingly..
    in specify file step
    create a file and select the radio button Data for Multiple Source Structures
    assign the Source file to both the Source Structures.
    then Read data
    Convert data......
    <b>Note</b>:The Source file should contain the Header Item Differentiation
    as Header record should contain the 'H' as the indicator value (First filed value should be H for an Header Record )
    same as for item record (i.e. for bank data , the first field(Indicator) value must be 'I'.).

  • LSMW using BAPI method for ME21N

    Hi to all,
    I am using LSMW BAPI method for the transaction ME21N Iam able to post a PO document successfully, But in my flat file I have a header and followed by item in the same line, while I was posting with same header for different line items its posting different PO's for different  line items but suppose it has to post one document with multiple items.
    My flat file fields are like this : (where as ABCD my header and rest are line items) I am using only one structure 'podata' in LSMW and I am not using any identifier.
    header--Line items
    A B C D S P Q W E X
    A B C D 1 D 3  F K L
    Business Object -     BUS2012     
    Method                -    CREATEFROMDATA1
    Message Type    -    PORDCR1
    Basic Type         -     PORDCR101
    As per my requirement if I have multiple line items for the same header then only one PO should be posted.
    Could you suggest me, How can I achieve this.
    Thanks,
    Lahari

    Hi Jurgen,
    Thanks for your reply.
    As poer your suggestion, I passed my flat file data into a single file and in the begin of transaction, I divided the data into 2 structures as Header & Item.
    Still I am unable to achieve the desired results, can you please elaborate more on how SAP internally joins the structures again.
    To be more clear my flat file data look like this :
    217836     NB     1826162667     0127     00   1     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     60.00     1     EA     
    217836     NB     1826162667     0127     00     2     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     860.00     1     EA     
    217836     NB     1826162668     0127     00     1     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     160.00     1     EA
    217836     NB     1826162668     0127     00     2     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     560.00     1     EA     
    The bold ones being header and the remaining Items, the underlined field is PO number.
    In normal process this file is considered to have 4 records, and tries to create 4 PO's.But my requirement is to create only 2 PO's with 2 items each.
    Thanks.
    Lahari

  • LSMW using Recording

    Hi,
    I am trying to upload Regional structure using LSMW. I have recorded transaction SR10 (Create City) but I am not sure how to proceed further. What changes I need to do in the recording and what should be the target structure for that.
    If anybody can tell how to use the recording it'll be a great help.
    Thanks.
    Jashan

    While recording you should place the cursor on all the fields you need to fill (filling them) and using the transaction SR10 as normal for creating a city. Once you save it the record will be done and you'll have all the fields of the target structure that you will need to map from the source file.
    However I'll suggest you to use within the LSMW the standard Regional Structure upload program instead of your own recording. The standard one works perfectly.
    Cheers,
    Aubin

  • LSMW using IDOC method for scheduling agreement - MM

    I am using LSMW IDOC method to create Scheduling agreement. i am using message type : PURSAG_CREATE. I have completed the field mapping and when i tried to process the idoc i am getting the following error.
    No instance of object type PurchSchedAgreement has been created. External reference: # 1
    There are no clue why this error is popping up.
    please let me know if anyone faced similar issues.

    try entering the values in WE19 and do the posting for teting purpose, make sure you are passing all the values.

  • LSMW using IDOC method for scheduling agreement

    I am using LSMW IDOC method to create Scheduling agreement. i am using message type : PURSAG_CREATE. I have completed the field mapping and when i tried to process the idoc i am getting the following error.
    No instance of object type PurchSchedAgreement has been created. External reference: # 1
    There are no clue why this error is popping up.
    please let me know if anyone faced similar issues.

    Are you using external number range for scheduling agreement, then you have to pass the SA number too if not then check with your MM functional consultant to change the number range from external to internal provided it is agreed by your customer

  • Give a simple example of BDC using Recording method

    give the various steps ...

    For a BDC upload you need to write a program which created BDC sessions.
    Steps:
    1. Work out the transaction you would use to create the data manually.
    2. Use transaction SHDB to record the creation of one material master data.
    Click the New recording button or the Menu - Recording - Create
    3. Save the recording, and then go back a screen and go to the overview.
    4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.
    5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes:
    5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).
    5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data.
    5.3. After perform bdc_transaction, add the endloop.
    Execute the program. It will have options to create a batch session or to process directly.
    These are all my finds . Might be it will be useful to you.
    Direct call of transactions, session handling:
    /nxxxx This terminates the current transaction, and starts transaction xxxx
    /n This terminates the transaction. This generally corresponds to pressing F15 to go back.
    /nend This termiantes all separate sessions and logs off (corresponds to System - Logoff).
    /nex This terminates all separate sessions and logs off immediately (without any warning!).
    /oxxxx This opens a new session and starts transaction xxxx in This session.
    /o This lists existing sessions and allows deletion or opening of a new session.
    /i This terminates the current session (corresponds to System End
    /i1, /i2,... This terminates the session with the number given.
    .xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).
    Batch
    The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session:
    /n This terminates the current batch input transaction and characterizes it as
    /bdel This deletes the current batch input transaction.
    /bend This terminates batch input processing and sets the session to Failed
    /bda This switches from Display errors only to Process in foreground
    /bde This switches from Process in foreground to Display errors only
    ABAP/4
    /h This switches into debugging mode.
    /hs This switches into debugging mode and activates the debugging of system functions.
    Buffer
    WARNING: Resetting buffers can significantly change the performance of the entire system for a long time.
    It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log.
    /$SYNC This resets all buffers of the application server
    /$CUA This resets the CUA buffer of the application server
    /$TAB This resets the TABLE buffers of the application server
    /$NAM This resets the nametab buffer of the application server
    /$DYNP This resets the screen buffer of the application server
    SHDB recording helps you to identify the desired screen flow. It shows details like screen sequence, screen nos, screen element names and required user command keys. This all helps while designing / coding a BDC flow for a transaction in the custom program. If you have any more questions or if you are not clear about SHDB, please check this links -
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.itcserver.com/blog/2006/07/12/shdb-the-transaction-recorder/
    Direct Input.
    Without calling the screens but all the validations should be done and only for master datas upload.
    Direct Input method:
    1. Only for error free datas and also master data
    updation.
    2. It will directly updates the database table. No
    screens involved.
    3. Transaction BMVO or Program RBMVSHOW has been
    used.
    BDC(Batch Input Session):
    1. Screens will be called programmatically.
    2. First sessions will be created then we'll run the seesions in SM35 transaction.
    3.Synchronous database update. After the processing the session only database update will occur.
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    Check this sample one
    ******Internal Table for Header Data.
    TYPES : BEGIN OF type_header,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr(11) TYPE c,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    END OF type_header.
    ****Internal Table for Item Level.
    TYPES : BEGIN OF type_item,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr(11) TYPE c,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    END OF type_item.
    ******Error Table For not found in MVKE.
    TYPES : BEGIN OF type_error ,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr LIKE konp-kbetr,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    text(100) TYPE c,
    END OF type_error.
    ****For error Messages
    TYPES : BEGIN OF type_mtab,
    matnr LIKE mara-matnr,
    msgtyp LIKE bdcmsgcoll-msgtyp,
    msgid LIKE bdcmsgcoll-msgid,
    msgnr LIKE bdcmsgcoll-msgnr,
    text(100) TYPE c,
    END OF type_mtab.
    ****Internal Table
    TYPES: BEGIN OF type_mvke,
    matnr LIKE mvke-matnr,
    vkorg LIKE mvke-vkorg,
    vtweg LIKE mvke-vtweg,
    END OF type_mvke.
    ****Internal Table
    TYPES : BEGIN OF type_tvkov,
    vkorg LIKE tvkov-vkorg,
    vtweg LIKE tvkov-vtweg,
    END OF type_tvkov.
    Declaring Internal Tables
    DATA : t_header TYPE STANDARD TABLE OF type_header,
    t_item TYPE STANDARD TABLE OF type_item,
    t_mvke TYPE STANDARD TABLE OF type_mvke,
    t_tvkov TYPE STANDARD TABLE OF type_tvkov,
    t_error TYPE STANDARD TABLE OF type_error,
    t_mtab TYPE STANDARD TABLE OF type_mtab.
    Work Area Declaration.
    DATA : wa_header LIKE LINE OF t_header,
    wa_item LIKE LINE OF t_item,
    wa_error LIKE LINE OF t_error,
    wa_mtab LIKE LINE OF t_mtab,
    wa_tvkov LIKE LINE OF t_tvkov,
    wa_mvke LIKE LINE OF t_mvke.
    *Rows for Table with Excel Data*******
    DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    ***Constant.
    DATA : c_params LIKE ctu_params.
    DATA : c_ans(1) TYPE c.
    DATA : v_count(4) TYPE c. " To show No.of records
    DATA : bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE. " BDCDATA
    DATA : tmess_mtab LIKE bdcmsgcoll OCCURS 10 WITH HEADER LINE.
    SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    END OF SELECTION SCREEN.
    DATA : repid LIKE sy-repid.
    DATA : v_matnr(50) TYPE c, "used for line items
    v_kbetr(50) TYPE c, "used for line items
    v_dat1(50) TYPE c, "used for line items
    v_dat(50) TYPE c. "used for line items
    DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
    v_lindx1(5) TYPE n VALUE '01', "index counter for 13 records.
    v_item(5) TYPE c, "To increment the line index
    v_pgedwn2 TYPE i . "For Pagedown Counter
    DATA: v_currentrow TYPE i. "For Current Row
    DATA v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
    ************AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    PERFORM get_filename USING p_fname.
    *************START-OF-SELECTION
    START-OF-SELECTION.
    ******Values for Ctu_params to Transaction
    c_params-defsize = 'X'.
    c_params-dismode = 'N'.
    c_params-updmode = 'S'.
    ******Refresh
    PERFORM f_refresh.
    *********To upload File.
    PERFORM upload_file.
    ****User Confrimation only BDC will Process
    IF c_ans = '1'.
    *** BDC Process.
    PERFORM read_data.
    ELSE.
    FORMAT COLOR 3 INTENSIFIED .
    WRITE:/ 'Selected not to Process the Upload'.
    EXIT.
    ENDIF.
    ******On completion of Process Refresh the Internal Table
    REFRESH : t_xls_file,
    t_header,
    t_item,
    t_mvke,
    t_tvkov.
    CLEAR : t_xls_file,
    wa_header,
    wa_item,
    wa_mvke,
    wa_tvkov.
    ***********Display Messages
    WRITE : /01 'Status',19 'Status Text'.
    WRITE AT 0(150) sy-uline.
    LOOP AT t_mtab INTO wa_mtab.
    WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
    ENDLOOP.
    SKIP 2.
    SORT t_error BY matnr.
    WRITE AT 0(150) sy-uline.
    WRITE 'ERROR MESSAGES'.
    WRITE AT 0(150) sy-uline.
    WRITE :/01 'Material.No',20 'Status Text'.
    WRITE AT 0(150) sy-uline.
    LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
    WRITE:/01 wa_error-matnr,20 wa_error-text.
    ENDLOOP.
    *& Form get_filename
    text
    -->P_FILENAME text
    FORM get_filename USING p_fname.
    *****To read the file from Presentation Server
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    program_name = repid
    dynpro_number ! ; = syst-dynnr
    field_name = p_fname
    STATIC = ' '
    mask = '*.XLS'
    CHANGING
    file_name = p_fname
    EXCEPTIONS
    mask_too_long = 1
    OTHERS = 2
    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. " get_filename
    *& Form upload_file
    text
    --> p1 text
    <-- p2 text
    FORM upload_file.
    DATA : frow VALUE 2 TYPE i,
    fcol VALUE 1 TYPE i,
    erow VALUE 10000 TYPE i,
    ecol VALUE 7 TYPE i,
    ecol1 VALUE 1 TYPE i,
    c_col1 TYPE i VALUE '0001',
    c_col2 TYPE i VALUE '0002',
    c_col3 TYPE i VALUE '0003',
    &nb! sp; c_col4 TYPE i VALUE '0004',
    c_col5 TYPE i VALUE '0005',
    c_col6 TYPE i VALUE '0006',
    c_col7 TYPE i VALUE '0007'.
    ***FM used to UPLOAD data from Flat file
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = p_fname
    i_begin_col = fcol
    i_begin_row = frow
    i_end_col = ecol
    i_end_row = erow
    TABLES
    intern = t_xls_file
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE e000.
    ENDIF.
    ****T_XLS_FILE is initial, stop the process & throw message
    IF t_xls_file[] IS INITIAL.
    FORMAT COLOR 6 ON INTENSIFIED ON.
    WRITE:/ 'No Data Exists '.
    FORMAT COLOR OFF INTENSIFIED OFF.
    STOP.
    ELSE.
    Sort table by rows and colums
    SORT t_xls_file BY row col.
    Get first row retrieved
    READ TABLE t_xls_file INDEX 1.
    Set first row retrieved to current row
    v_currentrow = t_xls_file-row.
    **Loop to move data in internal Table
    LOOP AT t_xls_file .
    Reset values for next row
    IF t_xls_file-row NE v_currentrow.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
    v_currentrow = t_xls_file-row.
    ENDIF.
    CASE t_xls_file-col.
    WHEN c_col1. "Kschl
    wa_header-kschl = t_xls_file-value.
    WHEN c_col2. "Vkorg
    wa_header-vkorg = t_xls_file-value.
    WHEN c_col3. "vtweg
    wa_header-vtweg = t_xls_file-value.
    WHEN c_col4. "Matnr
    wa_header-matnr = t_xls_file-value.
    WHEN c_col5. "Kbetr
    wa_header-kbetr = t_xls_file-value.
    WHEN c_col6. "FROm
    wa_header-datab = t_xls_file-value.
    WHEN c_col7. "TO
    wa_header-datbi = t_xls_file-value.
    ENDCASE.
    ENDLOOP.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
    ENDIF.
    ****To process the data
    PERFORM f_process.
    ENDFORM. " upload_file
    *& Form READ_DATA
    text
    --> p1 text
    <-- p2 text
    FORM read_data.
    ****To make Uniq Records in Header Level
    SORT t_header BY kschl vkorg vtweg.
    DELETE ADJACENT DUPLICATES FROM t_header COMPARING
    kschl vkorg vtweg .
    SORT t_item BY vkorg vtweg matnr.
    DATA : wa1_item TYPE type_item.
    DATA : l_cnt TYPE i.
    DATA : flag(1) TYPE c. "to process the Line item.
    ***Looping Header Table.
    LOOP AT t_header INTO wa_header.
    PERFORM bdc_dynpro US! ING 'SAPMV13A' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RV13A-KSCHL'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ANTA'.
    PERFORM bdc_field USING 'RV13A-KSCHL'
    wa_header-kschl.
    PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RV130-SELKZ(03)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=WEIT'.
    PERFORM bdc_field USING 'RV130-SELKZ(03)'
    'X'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'KOMG-VKORG'.
    PERFORM bdc_field USING 'KOMG-VKORG'
    wa_header-vkorg.
    PERFORM bdc_field USING 'KOMG-VTWEG'
    wa_header-vtweg.
    ****To handle Line Items.
    LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
    vtweg = wa_header-vtweg.
    wa_item = wa1_item.
    ******Flag Set only After processing first 14 records .
    IF flag = ' '.
    v_lindx = v_lindx + 01.
    SHIFT v_lindx LEFT DELETING LEADING '0'.
    v_item = v_lindx .
    CONCATENATE 'KOMG-MATNR(' v_item ')' INTO v_matnr.
    PERFORM bdc_field USING v_matnr
    wa_item-matnr.
    CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
    PERFORM bdc_field USING v_kbetr
    wa_item-kbetr.
    CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
    PERFORM bdc_field USING v_dat
    wa_item-datab.
    CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
    PERFORM bdc_field USING v_dat1
    wa_item-datbi.
    IF v_item = 14.
    flag = 'X'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    CLEAR v_lindx.
    CLEAR v_item.
    CONTINUE.
    ENDIF.
    ENDIF.
    ***Flag is Set after Processing of 14 records.
    TO process rest of Records
    IF flag = 'X'.
    v_pgedwn2 = v_pgedwn2 + 1.
    v_lindx1 = v_lindx1 + 01.
    SHIFT v_lindx1 LEFT DE! LETING LEADING '0'.
    v_item = v_lindx1 .
    CONCATENATE 'KOMG-MATNR(' v_it! em ')' INTO v_matnr.
    PERFORM bdc_field USING v_matnr
    wa_item-matnr.
    CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
    PERFORM bdc_field USING v_kbetr
    wa_item-kbetr.
    CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
    PERFORM bdc_field USING v_dat
    wa_item-datab.
    CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
    PERFORM bdc_field USING v_dat1
    wa_item-datbi.
    IF v_pgedwn2 = 13.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    v_pgedwn2 = 0.
    v_lindx1 = 1.
    CLEAR v_item.
    CONTINUE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=SICH'.
    Calling Transaction after Processing All items.
    CALL TRANSACTION 'VK11' USING bdctab
    OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
    REFRESH bdctab.
    CLEAR : bdctab.
    CLEAR : wa_item.
    CLEAR : wa1_item.
    CLEAR : wa_header.
    CLEAR : l_cnt.
    CLEAR : v_lindx1.
    CLEAR: v_pgedwn2,v_lindx.
    LOOP AT tmess_mtab .
    l_cnt = l_cnt + 1.
    READ TABLE t_item INTO wa_item INDEX l_cnt .
    CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
    EXPORTING
    arbgb = tmess_mtab-msgid
    msgnr = tmess_mtab-msgnr
    msgv1 = tmess_mtab-msgv1
    msgv2 = tmess_mtab-msgv2
    msgv3 = tmess_mtab-msgv3
    msgv4 ! = tmess_mtab-msgv4
    IMPORTING
    msgtext = wa_mtab-text
    EXCEPTIONS
    message_not_found = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    wa_mtab-matnr = wa_item-matnr.
    wa_mtab-msgtyp = tmess_mtab-msgtyp.
    wa_mtab-msgid = tmess_mtab-msgid.
    wa_mtab-msgn! r = tmess_mtab-msgnr.
    APPEND wa_mtab TO t_mtab.
    CLEAR wa_mtab-text.
    CLEAR wa_item.
    ENDLOOP.
    ENDLOOP.
    ENDFORM. " READ_DATA
    *& Form BDC_DYNPRO
    text
    -->P_0300 text
    -->P_0301 text
    Start new screen *
    FORM bdc_dynpro USING program dynpro.
    CLEAR bdctab.
    bdctab-program = program.
    bdctab-dynpro = dynpro.
    bdctab-dynbegin = 'X'.
    APPEND bdctab.
    ENDFORM. " BDC_DYNPRO
    *& Form BDC_FIELD
    text
    -->P_0305 text
    -->P_WA_HEADER_KSCHL text
    Insert field *
    FORM bdc_field USING fnam fval.
    CLEAR bdctab.
    bdctab-fnam = fnam.
    bdctab-fval = fval.
    APPEND bdctab.
    ENDFORM. " BDC_FIELD
    *& Form bdc_trc_ansaction
    text
    -->P_0527 text
    *& Form f_Process
    text
    --> p1 text
    <-- p2 text
    FORM f_process.
    DATA : l_todate(12) TYPE c,
    l_frdate(12) TYPE c.
    ***Select for all entries of material in Header "Flat File Materials".
    IF NOT t_header[] IS INITIAL.
    SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
    IN t_header WHERE matnr = t_header-matnr AND
    vkorg = t_header-vkorg AND
    vtweg = t_header-vtweg.
    ENDIF.
    *********select Sales.org & Dist.channel.
    IF NOT t_header[] IS INITIAL.
    SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
    t_header WHERE vkorg = t_header-vkorg
    AND vtweg = t_header-vtweg.
    ENDIF.
    ***Checking for material in Sales Master Table
    SORT t_mvke BY matnr vkorg vtweg.
    SORT t_tvkov BY vkorg vtweg.
    LOOP AT t_header INTO wa_header.
    READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
    vkorg = wa_header-vkorg
    ! ; vtweg = wa_header-vtweg BINARY SEARCH.
    IF sy-subrc <> 0.
    wa_error = wa_header.
    &nb! sp; MOVE text-011 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ELSE.
    ********Date Validations
    IF ( wa_header-datab NE ' ! ; ' AND wa_header-datbi NE ' ' ) .
    l_todate = wa_header-datab.
    l_frdate = wa_header-datbi.
    REPLACE '.' INTO l_toda! te WITH ''.
    REPLACE '.' INTO l_todate WITH ''.
    CONDENSE l_todate NO-GAPS.
    REPLACE '.' INTO l_frdate WITH ''.
    REPLACE '.' INTO l_frdate WITH ''.
    CONDENSE l_frdate NO-GAPS.
    IF l_frdate < l_todate.
    wa_error = wa_header .
    MOVE text-012 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    ELSE.
    wa_error = wa_header .
    MOVE text-016 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    ENDIF.
    ********Rate Validation.
    IF wa_header-kbetr = ' '.
    wa_error = wa_header .
    MOVE text-017 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
    BINARY SEARCH.
    IF sy-subrc = 0.
    READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
    BINARY SEARCH.
    IF sy-subrc <> 0.
    wa_error = wa_header.
    MOVE text-015 TO wa_error-text.
    WRITE wa_header-vtweg TO wa_error-text+13(4).
    APPEND wa_error TO t_error.
    ENDIF.
    ELSE.
    wa_error = wa_header.
    MOVE text-013 TO wa_error-text.
    WRITE wa_header-vkorg TO wa_error-text+9(4).
    APPEND wa_error TO t_error.
    ENDIF.
    CLEAR wa_header.
    ENDLOOP.
    *****Deleting Duplicate Material Form Header "Flat File Data".
    SORT t_header BY kschl vkorg vtweg matnr.
    DELETE ADJACENT DUPLICATES FROM t_header COMPARING
    kschl! vkorg vtweg matnr .
    ****Data Moving from Header to Item Level.
    t_item[] = t_header[].
    *To count No.of records in Item Table.
    DESCRIBE TABLE t_item LINES v_count.
    CONCATENATE text-014 ' ' v_count INTO v_bdc.
    ****Popup to get Confirmation from user to process BDC
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    titlebar = 'Confirmation of File Data'
    text_question = v_bdc
    text_button_1 = 'Confirm'
    text_button_2 = 'Cancel Run'
    default_button = '1'
    IMPORTING
    answer = c_ans.
    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. " f_Process
    *& Form f_Refresh
    text
    --> p1 text
    <-- p2 text
    FORM f_refresh.
    REFRESH : t_xls_file,
    t_header,
    t_item,
    t_mvke,
    t_tvkov,
    t_error,
    t_mtab.
    CLEAR : t_xls_file,
    wa_header,
    wa_item,
    wa_mvke,
    wa_tvkov,
    wa_error,
    wa_mtab.
    ENDFORM. " f_Refresh
    ALSO PLEASE CHECK OUT
    sample code for call transaction method
    http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
    chk this for BDC recording with screen shots
    http://www.sapdevelopment.co.uk/bdc/bdc_recording.htm
    BDC
    http://www.sap-img.com/bdc.htm
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    best typical example is BDC for MM01
    check the below links for the same
    bdc for MM01.
    mm01
    bdc mm01
    BDC
    http://www.sap-img.com/bdc.htm
    http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
    http://www.sappoint.com/abap/bdcconcept.pdf
    Difference between Genrate session& Call transaction
    Re: Steps in BDC

  • Master data upload via LSMW using IDoc method

    Dear all,
    I know this has been a topic of many discussions but I would like to ask you is to share your thoughts and possibly experience with the following scenario:
    Interface between non-SAP system and SAP system has to be built whereby master data gets created in the non-SAP system and has to be uploaded into SAP. This is a process that needs to be performed on a constant basis and hence my question: is there a way that the MD upload takes place in the background via LSMW with IDoc? Or any other way, for instance, with a flat file, etc.?
    Thank you very much for your input!
    Regards,
    Miro

    Miro - It depends upon many factors
    1. Number of source systems
    2. Volumn of recorsds ( Data to be loaded)
    3. Transformation needed or not needed from S to D ( source to destination), We may consider it as
        business rules/mapping
    Based on above you may segrigate the objects related to data, eventually you can shoose approach of loading in SAP,
    As if straigt forward load for some 20k-30K records ( Just a file load on regular basis), one to one mapping then go for LSMW, if some complex transformation logic needed then go SAP data services implementation. best part here is if you multiple sources that can be handeled here.
    Accordingly you can proceed ...
    Hope it helps.
    Best !
    Deep

  • LSMW using IDOC method

    Hi
    I am working on LSMW-IDOC . I am very new to this .
    I am trying to upload open purchase order throgh LSMW IDOC.
    Can anyone send me the steps for the LSMW-IDOC method.
    I wanted to pass header , item position & delivery schedule & item category data.
    How to pass header , item, delivery data. is it pass in different file or it can pass in one file.
    As whatever sample file I got It is only one excel file consist of all data.
    Plz. help me & guide me .
    This is urgent.

    hI vikram check this link
    and reward points if helpful
    http://www.****************/Tutorials/LSMW/IDocMethod/IDocMethod1.htm
    http://www.jt77.com/system-dynamics/model-01395.html

Maybe you are looking for

  • Lock a PDF file when converted from Smartform

    Hello Experts, In our current project we have an urgent requirement to apply a Lock to a PDF document so it cannot be amended. This is a PDF document and not an Adobe interactive form, which currently cannot be used on the project. We are seeking hel

  • Sometimes my power supply gets hot

    I have the newest MacBook Pro 15 with the 2.5 Ghz Intel i7. I've noticed that sometimes my power transformer gets pretty when charging the laptop. Other times it doesn't get warm at all. Why would this happen? Is there something wrong with it?

  • Moving MSI K8N Neo RAID.0 array to new MOBO (from Nforce4 Ultra + Sil3114!)

    Hi folks!, my MSI K8N Neo4 Platinum is GONE  , and I had 5 disks on it: Disk 1: No RAID - OS - WinXP installed Disk 2+3: RAID.0 on Nforce4 Ultra MCP controller (onboard) Disk 4+5: RAID.0 on Sillicon Image Sil3114 controller (onboard) Questions are: 1

  • Reg:Java Server proxies

    Hi ...   I was doing soap to Java Proxy scenario.I have deployed the ear file in the server. Then while executing the sceanrio, in SXMB_MONI i am getting the below error.   <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Inbound Mess

  • What is resource to product process in SAP

    Hi friends..       Good Morning,          <b>What is resource to product process in SAP?</b>          Based upon this process, i need to design the BPM.. Please reply me ASAP. Points will be given for correct answers. Advance Thanks, Kumar