Mapping of Multiple Line Items

Hello All,
While trying to post a purchase order creation into R/3, there are several line items in the purchase order. Each has different quantity, GL account, cost center and unit price. So how should I map it to the target field.
Occurence of order detail
order detail                      0..1
      list of item details       1..1
      Item detail                  1..unbounded
      base item detail           1..1
      line item number          1..1
      buyer line item num      1..1
So occurence of buyer line item number is not unbounded. so how can I duplicate this buyer line item number?
For example, In the XML source message I have 5 line items.....
for line item one, I have quantity A, GL account B, cost center C and unit price D,
for line item two, I have line item X, Quantity Y, GL account Z, Cost center M and unit price N, etc
When I am trying to map I am able to pick only the first line item. Can anyone throw some light on how I should map all the line items data?
If anyone can help me with mapping of this. A bit in detail please
Regards,
Neelima
CSC

Hi Neelima,
Check out this blog....
/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool ( with PO only)
Multiple line items are generated basically using Context.
Hope this will help.
Let me know if you need more details.
Nilesh

Similar Messages

  • IDOC to JDBC, problem with the multiple line items structure and mapping

    Hi,
    I have a scenario where the ORDERS data need to update the SQL table. for the idoc which consists one line item its ok but for multiple line item its just updating one line item. In the destination side we have only one table for purchase order which consists of lineitem as a field.(no different tables for Header data and Line item data)
    Can anyone suggest me how to create a structure for target side and how to map them.
    Regards,
    CJ

    Hi Rajan,
    The table structure is
    [PO_DATE]
          ,[VENDOR_NO]      ,[PAYMENT_TERM]      ,[MATERIAL_CODE]      ,ORDERED_QTY]      ,RECEIVED_QTY]                                 
          ,[UOM]       ,[RATE]       ,[CURRENCY]       ,[PO_EXCRATE]       ,[TAX_CODE]       ,[BASE_VALUE]       ,[TAX_VALUE]
          ,[TOTAL_VALUE]       ,[ADVANCE_PAYAMT]       ,[TOTAL_QTY]        ,[SNO]       ,[POLINEITEM]
    Datatype structure:
    PO_XI_MT_ORDERS05 1-1
    STATEMENT   1-UNBOUN
      TABLENAME 1-1
        ACTION   optional
        TABLE    1-1
        ACCESS  1-1
           PO_NO   0-1
           PO_DATE 0-1
    Correct me if im wrong.
    Regards,
    CJ
    Edited by: kuncjy on May 5, 2011 11:32 AM

  • "BDC for multiple line items of PO"

    I am using this code to move data for multiple line items of a PO. But only one is getting transferred. I am using BDC for this.
    FORM transaction_bdc .
      DATA :
      v_cnt(2) TYPE n,
      v_bst(2) TYPE n,
      v_bn TYPE i,
      v_bstpo(25),
      v_ebtyp(25),
      v_menge(25),
      v_eeind(25),
      v_xblnr(25),
      v_xblnr1(25),
      v_ebelp(2) TYPE n,
      v_ebelpt(2),
      v_menge1(11),
      v_ebt TYPE i,
      v_vebtyp LIKE ekes-ebtyp,
      v_eb(2) TYPE n,
      v_tcselflag(40),
      v_tem(2) TYPE n,
      v_correct TYPE i,
      v_file TYPE string.
      DATA: ls_outtab TYPE tb_struc.
      DATA: l_valid TYPE c,
            l_locked TYPE c.
      CALL METHOD g_grid->check_changed_data
        IMPORTING
          e_valid = l_valid.
      IF l_valid EQ 'X'.
        LOOP AT tb_output WHERE check EQ 'X' .
          MOVE-CORRESPONDING tb_output TO itab_output.
          APPEND itab_output.
          CLEAR itab_output.
        ENDLOOP.
        IF tb_output-check <> 'X'.
          MESSAGE e003 WITH text-004.
        ENDIF.
      ENDIF.
      IF itab_output[] IS NOT INITIAL.
        PERFORM open_group.
    ***looping at purchase order level.
        LOOP AT itab_output where ebelp is not initial .
          CLEAR v_bn.
          CLEAR v_ebt.
          PERFORM bdc_dynpro USING 'SAPMM06E' '0105'.
          PERFORM bdc_field USING 'BDC_CURSOR'
          'RM06E-BSTNR'.
          PERFORM bdc_field USING 'BDC_OKCODE'
          '/00'.
          PERFORM bdc_field USING 'RM06E-BSTNR'
          itab_output-ebeln.
    ***Changing alphanumeric fields and quantity fields to character type**
    *v_ebelp = tB_OUTPUT-ebelp.
    *clear v_ebelpt.
    *v_menge1 = tB_OUTPUT-menge.
    *v_ebelpt = v_ebelp.
    ***End Of Changing**
    *Checking for the exact number of the item**
          LOOP AT tb_output where ebeln = itab_output-ebeln.
            READ TABLE itab_output INDEX 1.
            IF tb_output-ebelp = itab_output-ebelp.
              exit.
            ELSE.
              v_bn = v_bn + 1.
            ENDIF.
          ENDLOOP.
    v_bst = v_bn + 1.
    *End Of Checking**
    **Mapping items**
            v_tem = 1.
            CONCATENATE 'RM06E-BSTPO(' v_bst ')' INTO v_bstpo.
            CONCATENATE 'RM06E-TCSELFLAG(' v_tem ')' INTO v_tcselflag.
            PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            v_bstpo.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '=DETA'.
            PERFORM bdc_field USING 'RM06E-EBELP'
            v_ebelpt.
            PERFORM bdc_dynpro USING 'SAPMM06E' '0111'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            'EKPO-BSTAE'.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '/00'.
            PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            v_bstpo.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '=BSTA'.
            PERFORM bdc_field USING 'RM06E-EBELP'
            v_ebelpt.
            PERFORM bdc_field USING v_tcselflag
            'X'.
    **Checking weather Confirmation category already exists**
            SELECT ebtyp FROM ekes INTO v_vebtyp WHERE ebelp =
            itab_output-ebelp AND ebeln = itab_output-ebeln.
            ENDSELECT.
            IF sy-dbcnt > 0.
              v_ebt = sy-dbcnt.
            ENDIF.
            v_eb = v_ebt + 1.
    **End Of Checking**
    **For Line items**
            CONCATENATE 'EKES-EBTYP(' v_eb ')' INTO v_ebtyp.
            CONCATENATE 'EKES-MENGE(' v_eb ')' INTO v_menge.
            CONCATENATE 'RM06E-EEIND(' v_eb ')' INTO v_eeind.
            CONCATENATE 'EKES-XBLNR(' v_eb ')' INTO v_xblnr.
    **End**
            PERFORM bdc_dynpro USING 'SAPLEINB' '0200'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            v_xblnr.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '=BU'.
            PERFORM bdc_field USING v_ebtyp
            itab_output-ebtyp.
            PERFORM bdc_field USING v_eeind
            itab_output-eindt.
            PERFORM bdc_field USING v_menge
            v_menge1.
            PERFORM bdc_field USING v_xblnr
            itab_output-xblnr.
    **End Of Mappings**
    *loop at itab_output.
            MOVE-CORRESPONDING itab_output TO ekes.
            modify ekes.
           MOVE-CORRESPONDING itab_output TO eket.
           MODIFY eket.
           MOVE-CORRESPONDING tb_output TO ekpo.
           MODIFY ekpo.
         ENDLOOP.
          CALL TRANSACTION 'ME22N'
          USING itbdc
          MODE   'E'.
          commit work.
    perform bdc_transaction using 'ME22N'.
    **End Of Purchase Order Loop**
        PERFORM close_group.
        endloop.
         endif.

    Hi Asha,
    check the below code once...
    LOOP AT tb_output where ebeln = itab_output-ebeln.
    READ TABLE itab_output INDEX 1.
    IF tb_output-ebelp = itab_output-ebelp.
    exit.
    ELSE.
    v_bn = v_bn + 1.
    ENDIF.
    ENDLOOP.
    Here you are reading the table itab_output with index 1, it means you alway reading the first record of that internal table.
    Regards,
    Satya.

  • Multiple line items upload in LSMW

    There are 265 line items in an entry. I have around 50 such entries to be uploaded vis LSMW.
    The problem is that, while creating a recording, do i need to record 165 line items (164 line items are of debit and only 165th line item is credit)??
    I am creating the recording for Tcode FB05 ie GL entry.
    PLEASE SUGGEST ME THE SIMPLE WAY TO UPLOAD THE LARGE SUM OF ENTRIES IN LSMW.

    Hi.
    You need not record for 165 line items. You can just record One entry in FB05, with 2 line items alone (one Debit and one credit). The Debit/ Credit indicator will be one of the fields in Recording.
    Now you need to structure this field in your template and create the Field Mapping.
    So, in the Excel template, you maintain all the multiple line items you want - against each line item you can mark this indicator as Debit/ Credit.
    Let me know if this works.
    Regards
    Srini

  • Multiple line items one with default values

    Hi All
    We have a flat file coming into xi that needs to be mapped to an idoc, the idoc will have multiple line items.
    The first line item must have default values but the from the second line item and on must have dynamic value from file? How Can this be achieved?
    Regards

    Hi,
    I didnt get the the exact prb you have been facing...
    But from my understabding,
    Try giving constants for the default values of first Line Item.
    Then, directly map the file data to the second line items onwards..
    Regards,
    Swetha,

  • LSMW program to upload the sales order with multiple line items.

    Dear SD and PP Gurus,
    I am new to creating LSMW Program.
    I want to create a LSMW program to upload the sales order with multiple line items. I have read on SDN that it can be done on two phases. First Create Header Data than line items. IS IT TRUE??, Or
    Is there any procedure by which we can load the sales orders with multiple line items in a single run (part).
    I want to use Batch process, not a BAPI or IDOC procedure.
    I have created a program with
    object 0090
    Method 0000
    Program Name RVINVB10
    Program Type D
    Source Structure 1 - For Header and Source Structure 2  for Line Items.
    Mapped Field INDET (With Fix Value 1), ORDERTYPE, SALESORG, DISTCHANNEL, DIVISION, CUSTOMER, PONUMBER , DELVDATE, PRCGDATE, PMTTERM
    INCOT1 INCOT2 with Source Structure - 1 and
    Field INDENT (With Fix Value 2),  ITEMNO, MATCODE, MATQTY, SUOM, PLANT, BATCH, AMOUNT with Structure-2
    than maintained Structure relation ship, field Mapping, Specified Files, Assigned files, Read Data and other process,
    At final stage (Start Direct Input program RVINVB10) it is giving a message - Table name not allowed.
    Please tell me where I am wrong.
    Thanks in advance.
    DSC

    Dear SD Gurus n Experts,
    I have solved the above problem. But there is another problem appearing regarding the date format. Now system generating a message: Date . . is not valid.
    While I am using Date: YYYYMMDD format in flat file, which is SAP's Standard Format.
    In SDN Link: LSMW upload Sales Order using VA01/VA02     I have found that there are some date fields which are mandatory to filled. Here I have mapped
    VDATU - Requested delivery date,  BSTDK - Customer purchase order date,  PRSDT - Date for pricing and exchange rate,  BSTDK_E - Ship-to party's PO date, FKDAT - Billing Date, KORDT - Delivery Date,
    and PRGRS - Date type is Constant = D
    Can any one tell me, where is the priblem.
    With thanks,
    DSC

  • Inserting Multiple Line Items To Stored Procedure

    Hi
    I need to insert line item values to one of the argument in stored procedure.what data type do i need to pass for type attribute.I tried with different datatypes from sap help but no luck.Please guide me how should i proceed.
    Interface is : Idoc to JDBC (stored procedure)
    Target structure:
                                     DT_Orderstatus_Trgt
                                         --> StatementName
                                                 -->SP Name
                                                        action--->Attribute
                                                        table--->Attribute
                                                         --->Argument (to insert multiple line items)
                                                                 isInput
                                                                 isOutput
                                                                 type
    Just i am showing only one argumnet which needs to be inserted multiple line items.
    Thanks

    Hi,
    Stored procedure can support the below data types
    INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output),CLOB (input and output), CURSOR (output; only in conjunction with the Oracle JDBC driver).
    But
    Instead of passing multiple line items / array of input value in stored procedure, You can go for the below option as having 2 statements in your mapping with below structures and those 2 statements should be linked with the primary key say col1.
    <root>
    <StatementName1>
    <dbTableName action=u201DINSERTu201D>
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName>
    </StatementName1>
    <StatementName2>
    <dbTableName action=u201DINSERTu201D>
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName>
    </StatementName2>
    </root>

  • Mapping Sales Order line item

    Dear PI experts,
        Concept :
      FILE ---> PI --> IDOC
    In my file ,Multiple Line items by same material but different quantity to map to IDOC.
    Please advise me to group by Material and add quantities and map to IDOC.
    Please send me udf if requrired else how to handle ? thanks you.
    Deva

    Dear Mark,
      ORDER, MATERIAL ,QTY
    input :
    0001  ,  MAT1, 1
       0001,    MAT1,  2
       0001,    MAT1,  5
       0001,    MAT2 , 10
       0001,    MAT2,  4
       0002  ,  MAT1, 1
       0002,    MAT1,  2
       0002,    MAT1,  5
       0002,    MAT2 , 10
       0002,    MAT2,  4
    OUTPUT:
    0001,MAT1,8
    0001,MAT2,14
    0002,MAT1,8
    0002,MAT2,14
    Thank you

  • Multiple Line items in Idoc

    Hi All,
    I am trying to send an Idoc to SUS using XI, when i post a PO from the backend ECC 5.0 with multiple line items i am able to get the multiple line items in XI. but in SUS i am able to see only the first line item.
    May i know the reason for that and how do i get all the line items in SUS.
    Regards,
    Anand

    Hi,
    <i>but in SUS i am able to see only the first line item.</i>
    Do you mean the updated PO in the SUS system?.
    Please can you check on the payload of the receiver side if you are getting all line item . If yes then check the IDoc before it got posted. If the IDoc contains all the line item then there is something wrong with the program processing your IDoc.
    If all the line item is not present in the receiver side of the IDoc then you need to check on the mapping.
    Regards
    Vijaya

  • Setting the value of a single attribute for multiple line items

    Hi all,
    I am working on a Web Dynpro application, I have created this applicaion for an accounting document so it has header data and multiple line item data. As per the requirement I have to put the following logic:
    1. When a user enters a value in the field KBLNR on the line item, all the other fields like cost centerm fund, functional area should populate from a database table based on the value of the KBLNR. to get this I have put the following code:
    TYPES: BEGIN OF t_kblp,
              fipos     TYPE kblp-fipos,
              kostl     TYPE kostl,
                      END OF t_kblp.
      DATA lv_kblnr TYPE wd_this->element_t_bseg-kblnr.
      DATA: lt_kblp TYPE STANDARD TABLE OF t_kblp,
            wa_kblp LIKE LINE OF lt_kblp,
            lt_bseg              TYPE STANDARD TABLE OF bseg,
            wa_bseg              TYPE bseg.
      DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
      DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
      DATA: ls_t_bseg TYPE wd_this->element_t_bseg,
            lo_api_controller    TYPE REF TO if_wd_controller,
            lo_message_manager   TYPE REF TO if_wd_message_manager,
            lo_nd_tbseg          TYPE REF TO if_wd_context_node,
             lo_el_tbseg          TYPE REF TO if_wd_context_element,
             lt_el_tbseg          TYPE wdr_context_element_set,
             lv_bseg              TYPE bseg.
      lo_nd_t_bseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
      lo_nd_tbseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
      lt_el_tbseg = lo_nd_tbseg->get_elements( ).
      LOOP AT lt_el_tbseg INTO lo_el_tbseg.
        lo_el_tbseg->get_static_attributes(
                               IMPORTING static_attributes = lv_bseg ).
      IF lv_bseg-kblnr NE ' '.
          SELECT belnr
                 fipos
                 kostl
                 PSPNR
                 geber
                 saknr
                 fkber
                 grant_nbr
                 gsber
                 FROM kblp
                 inTO corresponding fields of wa_kblp
                 WHERE belnr = lv_bseg-kblnr and
                      saknr = lv_bseg-saknr.
            ENDSELECT.
    lo_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
    * get element via lead selection
            lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
    lo_el_tbseg->set_static_attributes(
                               EXPORTING static_attributes = wa_kblp ).
       CLEAR: lv_bseg, wa_kblp.
      ENDLOOP.
    everything is working fine but now the problem is couple of fields that I have in wa_kblp are with different names in bseg table and hence they are not updating... I tried putting the following logic within the loop :
    lo_el_t_bseg->set_attribute(
        name =  `PROJK`
    value = wa_kblp-pspnr ).
    but it's only setting the value of the first line item and not working for the multiple line items, can you please tell me how can do this?
    Thanks,
    Rajat Garg
    Edited by: rajatg on Jun 24, 2011 5:09 PM

    Hi Chris,
    I tried your code and it worked fine but after I put this code I am getting another issue. within the loop I had a code to make the fields non modifiable on the screen and was working fine but now what's happening is it's making the all the lines uneditable except the one with data on it (which is completely opposite), this is what I have coded:
    LOOP AT lt_el_tbseg INTO lo_el_tbseg.
        lo_el_tbseg->get_static_attributes(
                               IMPORTING static_attributes = lv_bseg ).
    IF lv_bseg-kblnr NE ' '.
      SELECT belnr
                 fipos
                 kostl
                 PSPNR
                 geber
                 saknr
                 fkber
                 grant_nbr
                 gsber
                 FROM kblp
                 inTO corresponding fields of wa_kblp
                 WHERE belnr = lv_bseg-kblnr and
                      saknr = lv_bseg-saknr.
            ENDSELECT.
    move: wa_kblp-belnr to wa_bseg-kblnr,
    wa_kblp-fipos to wa_bseg-fipos,
    wa_kblp-kostl to wa_bseg-kostl,
    wa_kblp-pspnr to wa_bseg-projk,
    wa_kblp-geber to wa_bseg-geber,
    wa_kblp-saknr to wa_bseg-saknr,
    wa_kblp-fkber to wa_bseg-fkber,
    wa_kblp-grant_nbr to wa_bseg-grant_nbr,
    wa_kblp-gsber to wa_bseg-gsber,
    lv_bseg-dmbtr to wa_bseg-dmbtr.
    append wa_bseg to lt_bseg.
    lo_nd_edit_property = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG.EDIT_PROPERTY` ).
          get element via lead selection
          lo_el_edit_property = lo_nd_edit_property->get_element( ).
          lo_el_edit_property->set_attribute(
            name =  `EDIT_FIELD`
            value = 'ABAP_TRUE' ).
          lo_el_edit_property->set_attribute(
            name =  `EDIT_WBS`
            value = 'ABAP_TRUE' ).
    endif.
    endloop.
    o_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
    get element via lead selection
            lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
      CALL METHOD lo_nd_t_bseg->bind_table
        EXPORTING
          new_items            = lt_bseg.
    Can you please see what I am doing it wrong here....

  • Production order from sales order with multiple line item(for one material)

    Dear Gurus,
    I am working in MTO scenarios. If there is several line item in a sales order for one material, multiple production order( same as no. of sales order line item) is getting created against each of the line item.My requirement is,since the material code is same in each line item and sales order is one, one production order should be generated for all line item. please tell me how to do it.
    (Here for one material, multiple line item is required for some specific reason)
    Regards
    Rajib Pathak

    Hi,
    This is not possible.
    In Std SAP will create one production order for one sales order. The stock is also allocated to thet particular sales order only. Because each and every sales order may vary in any one of the parameters. Considering this, SAP has designed like this.
    Regards,
    V. Suresh

  • Single/ Consolidated  GR/IR entry for a PO having multiple line items

    Hi,
    In a PO there are couple of line items for materials of similar type and class. While making the Goods Receipt, the Accounting Document is making two no of line items for GR/IR accounts as credit and two no of inventory accounts as debit. Same is happening to GR/IR account while making Invoice Receipt document also.
    Informatively, both the materials above have been assigned to one GR/IR account in the OBYC table.
    My question is, is it possible to consolidate the value of both these materials and post one line item for GR/IR account. This is required as in our case in a PO, normally, we do have multiple line items and hence it is resulting multiple no of GR/IR and inventory accounts in a single accounting document. As we are getting details of the line item from PO history, we do not require it in the accounting document.
    Requested to kindly help.
    Regards
    B.Mohanty

    Hi
    This is not possible (you will compleet los the link between the Invoice and GR)
    The reason is that when you receive an invoice that this is based on a G/R line and the way arround when you receive first the invoice(s).
    The system need this for the automatecly clearing from the  G/R - I/R account, that is based on PO an PO line item number.

  • MM: PO Not Picking up PR Having Multiple Line Items

    Hi All,
    When Creating PO with Reference to PR Having multiple line items, not picking up the line items and also the vendor and also the where in we  have to select  input tax code.
    CASE1: Created PR 760001340 with single line item and also could able to create PO.
    Case2: Created PR 760001341 with multiple line items, When creating PO with reference to PR the line items and Vendor are not picking Up.
    Plz. Advise a solution.
    Thanks in Advance.....
    Regards
    Sudheer

    HI SHWN,
    Thanks for prompt response.
    ERROR Message: When referencing a requisition, please also enter a requisition item no.
    Regards
    Sudheer

  • How to Restrict Single Delivery Date for PO with Multiple Line Items

    Dear Experts,
    How to Restrict Single Delivery Date for PO with Multiple Line Items.
    System needs to through Error Message if User Inputs Different Delivery Dates for PO with Multiple Line Items in ME21N Tcode.
    Can we achive this by Some Enhancement in SAP or Not ???
    If so how to do it.
    Any Inputs is highly appreciated.
    Thanks and Regards,
    Selvakumar. M

    Hi Selvakumar,
    we can resrict the PO to have a single delivery date in all the line items by means of giving a error message or overwiting the delivery date keyed/determined in the line item.
    You can use the BADI -> ME_PROCESS_PO_CUST. In which you need to implement the method PROCESS_SCHEDULE.
    (for technical aid - This method will be called for each and every PO line item, From the imporing parameter im_schedule we can get all the details of current PO line, even we can change the data in the current PO line. )
    Regards,
    Madhu.

  • Creating a PO Using BAPI For Multiple PLants Or Multiple Line Items

    Hi All
        Can you please suggest me how to create a Purchase Order Using BAPI_PO_Create1 for Multiple Plants Or for Multiple Line items. The Requirement is like the PO is for single material for single vendor but for mulple stores i.e plants
    NOte:  Suggest me the  Creation of PO for MUltiple Line items or for multiple plants Using BAPI . Hope you people will give me the needful.
    Regards
    Shivakumar Bandari

    Hi,
    Here is the sample code to do that...
    *---> po header data
      wa_poheader-vendor    =  your vendor..
      wa_poheader-doc_type  =  Your doc type..check with Functional contact....
      wa_poheader-purch_org =  Purchasing Org..
      wa_poheader-pur_group =  Purchasing Group
    *---> po header data (change toolbar)
      wa_poheaderx-vendor    =  'X'.
      wa_poheaderx-doc_type  =  'X'.
      wa_poheaderx-purch_org =  'X'.
      wa_poheaderx-pur_group =  'X'.
    *---> poitem data
    data: item like ekpo-ebelp.
    item = '0010'.
    loop at t_parts.
      it_poitem-po_item  =  '00010'.
      IT_POITEM-PLANT    =  Plant..
      IT_POITEM-STGE_LOC =  Sloc...
    *---> poitemx (item data change toolbar)
      it_poitemx-po_item  =  '0010'.
      it_poitemx-po_itemx  =  'X'.
      IT_POITEMX-PLANT    =  'X'.
      IT_POITEMX-STGE_LOC =  'X'.
    *---> add record's to internal table
      APPEND:  it_poitem,
             it_poitemx.
    endloop.
    *call bapi_po_create1
      CLEAR v_ebeln.
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader         = wa_poheader
          poheaderx        = wa_poheaderx
        IMPORTING
          exppurchaseorder = v_ebeln
        TABLES
          return           = it_return
          poitem           = it_poitem
          poitemx          = it_poitemx.
    *---> check the return table for error message
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc NE 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      endif.
    Thanks,
    Murali

Maybe you are looking for

  • Report generation Footers

    Greetings all... hope someone can help. I inherited a huge Labview application that works well. I have been tasked with cleaning it up and adding some info to the report. The report uses the Report Generation Vi's including New Report, Append Image t

  • Where are my Camera Roll pics n videos saved in iTunes(Laptop) when I backed up my iPhone to iTunes?

    I backed up my iPhone today in order to save my Camera Roll pictures and videos safely in my Laptop and then I deleted them from my iPhone to make some free space.... And I want those pictures and videos in future back into my iPhone. So I know I mus

  • Understanding the app.batch method is CS2 JS scripting

    Hi, I'm a press officer in a fairly busy press office and I'm trying to automate my image-processing workflow for the images we put on our website...So far I've been using photoshop's (CS2) batch command to do this but it's not as performant as I wou

  • Classpath settings changed in new JDeveloper?

    In the tutorial for SOAP web services it says the following: Change the default location to <JDeveloper_home>\soap\webapps\soap\soap\WEB-INF\lib. This puts the file in the classpath automatically, and the server does not need to be stopped and restar

  • In production order checking the errors

    Hi Experts, In production order i have created two new tabs. So if all the errors is rectified means while adding some errors while come"Product Number is missing" "dud date is missing" so if all the condition satisfied means all errors is cleared th