Order creation logic how to pass line items

experts
i have the following data in iternal table itab.
po number ,customer number, matnr,quantity ,order date.
1212838383  7494749  8383938833   20  20032009
1212838383  7494749  8383938832   10  20032009
1212838382  7494749  8383938833   20  20032009
1212838384  7494745  8383938823   30  22032009
1212838384  7494745  8584858588   05  22032009
now i want to populate this data into idocs orders segement .
for all po the customer will be the same and i need to create one order for that.
in the above data first 2 lines have same po so i need to create order with 2 line items.
sales org,division,distribution channnel,ordertype will be same for all the records.
loop at itab into workarea.
at new po. "for same po, same header data so i am using AT NEW
edi_dd40-segnum = 1.
edi_dd40-segnam = 'E2EDK14 '.
edi_dd40-mandt = sy-mandt.
edi_dd40-psgnum = psgnum.
e2edk14-qualf = '008' .
e2edk14-orgid = 'NN21.
MOVE e2edk14 TO edi_dd40-sdata.
append edi_dd40 to itab_output.
edi_dd40-segnum = 1.
edi_dd40-segnam = 'E2EDK14 '.
edi_dd40-mandt = sy-mandt.
edi_dd40-psgnum = psgnum.
e2edk14-qualf = '006' .
e2edk14-orgid = 'ni.
MOVE e2edk14 TO edi_dd40-sdata.
append edi_dd40 to itab_output.
endat.
now the item data comes , so i need to create items with same po.and afetr this i need to submit this data to fm before another diffent  po comes.below same customer and po so need to consider as one sales order and submit to fm.
item1  1212838383  7494749  8383938833   20  20032009
item2  1212838383  7494749  8383938833   20  20032009
call function 'MAST_IDOC_DISTRIBUTE'
My concern is how to tell to the system for the same po create the order with multipl line items , do i need to use to AT NEW
or some other commands above?
endloop.

i have used at end of po. but my matnr is becoming *************. no date is showing in the internal table while populating the matnr to segments.
Loop at itab into workarea.
at end of po.
here i am filling the matnr to the segment. here  workarea-matnr is showing ***********  only stars,
endat.
endloop.
If i remove the at end of po , then the matnr is comming .
Please sugggest me what to do.
my fields sequence are like this.
kunnr " customer
bstnk "po
matnr " material
currency
kwmeng "order quantity
podate
orderdate
so how to handle this please suggest.

Similar Messages

  • How to pass line item values in the table paramer of FM

    Hi all,
    When i will give the import of  the FM as VBELN"sales order number.
    I want to display all the line items for "PO Quantity in the out put of the FM.
    For this i thnk i have to pass the line item values in the table parameter of the FM.
    Can any body please tell me how to pass the values for the line items in the table parameter fo teh FM.
    Please give a example.
    Thanks

    Sub pLoopThroughPivotFields()
    Dim oItem As Excel.PivotItem
    Dim oField As Excel.PivotField
    Set oField = ThisWorkbook.Worksheets("Sheet1").PivotTables("Pivot Table name").PivotFields("field name")
    For Each oItem In oField.PivotItems
    oField.CurrentPage = oItem.Name
    'Put your copy code here
    DoEvents
    Next oItem
    End Sub
    Felipe Costa Gualberto - http://www.ambienteoffice.com.br

  • How to change line item numbers

    HI
    when we are creating sales order, if we enter material number, line item number will be autmaticallly assigned(for eg 10,20,30 ....). if i want to change that number what i have to do(eg: to 1, 4, 5, .....). in standard SAP, the field is grayed out once the no is assigned. so i dont know how to change the no. please help me in this.

    Hello,
    You can give any number manually as the line item when you are creating the sales order.
    While creating the order give the item number also manually, then the system will accept. Once you given the line item number , it will not allow you to change it.
    Then you need to delete the line item and re-insert with the line item number you want.
    Prase

  • How to default Line item display in GL master record???

    Hi..Guys
    How to default Line item display selection in GL master creation.....When we create GL master it will automatically get selected.
    Is it possible to do.
    Plz reply .

    Hi
    With sample account you can succeed your requirement
    Give all the defualt fields whtatever you want then use this sample account while creating GL account
    One more possibility is with SHD0 screen layout change with defaults (this thing i am not sure)
    Reg
    Vishnu

  • Urjent-how to add line items in tcode-FBL3N

    Hi Experts,
      How to add line items customer, customer name,  vendor and vendor name in FBL3N.
    Thanks in advance.
    mahe
    Moderator message - Please do not use words like "urjent". Please ask a specific question. Please search the forum. This question has been asked and answered before. Post locked
    Edited by: Rob Burbank on Apr 29, 2009 11:27 AM
    Edited by: Rob Burbank on Apr 29, 2009 11:28 AM

    Hi,
    Check the BTE's:
    00001020     POST DOCUMENT:       Prior to final checks             SAMPLE_INTERFACE_00001020
    00001025     POST DOCUMENT:       Final checks completed       SAMPLE_INTERFACE_00001025
    00001030     POST DOCUMENT:       Posting of standard data     SAMPLE_INTERFACE_00001030
    00001050     POST DOCUMENT:       Accounting interface           SAMPLE_INTERFACE_00001050
    Thanks & Regards,
    Harish

  • How to transfer Line Items

    Hi
    How to transfer Line Items from One GL account to another GL account.
    We, at the time of changing Non Open Item Manged account to Open Item Manged account, how can we transfer Line items to make this GL account Zero, If suppose line items are more than 200.
    Satish
    Points assured.

    If you are attempting to change the account from Non Open Item managed,  you need to make the account balance zero. The change will be be effective only for future transactions. You need not transfer all line items,  find the balance and  make an  entry to debit or credit to make it zero, to a temporary account. Later, once you have activated, you can reverse that transaction.
    The OSS 606977 refered may be helpful if you are looking for reverse activation. i.e from Open to Non Open. Here is a brief:
    Symptom
    In the G/L account master record, you can activate/deactivate the 'Open item management' indicator if the balance of the account is zero. In this case, the system does not check whether postings exist on the account.
    If postings exist, this could lead to problems, for example, if the clearing is reversed after the change to the indicator is made.
    Other terms
    FS00, FS02, FSS0, FS02, FH190, XOPVW
    Reason and Prerequisites
    The transactions for the maintenance of the G/L account master record did not check whether postings exist on the account. Now the program checks whether postings exist in the current year or previous two fiscal years.
    Solution
    Implement the attached correction or import the corresponding Support Package. Since it could make sense to change an account with balance zero from open item managed to non-open item managed (and vice versa) - despite postings to the account - the message is delivered as customizable (with error as a default setting).
    The check is also carried out, when open-item management is activated, is postings exist on the account.
    If you implement the note you must also carry out the following:
    Use Transaction SE91 to create message 190 in message class FH with the following text:
    Account balance = 0; however, postings exist on the account
    Use Transaction SM30 to insert the following entry into view T100S:
    Application area   FH
    MsgNo              190
    Allowed            EW
    Standard          E
    Afterwards, the message can be customized in View V_T100C. To do this, you can use Transaction OBA5.

  • Work Order to cost center settlement with line item detail

    Iu2019m having difficulty finding a method to settle from a work order to a cost center with line item detail.  When an order is settled with KO88 or KO8G the total value for that work order/cost element combination is combined and posted to the cost center as a lump sum with the description of CTR\######.  Users would like to see the individual values that posted to the work order in a cost center report such as  KSB1.
    I donu2019t see anything in the settlement rule, settlement profile or allocation structure that will allow line item settlement from work order to cost center.     Is line item settlement possible when settling to a cost center?   Is there an alternate way to see these expenses as line items in KSB1?
    Thanks,
    Jeff

    Thanks Christian,
    We've defined an allocation structure that we use for Project System and Work Order settlement and have Receiver Categories established as FXA, CTR and WBS with "by Cost Element"  checked.  Work order costs do settle to the cost center entered in the settlement rule, the problem is it combines all items values as a single amount when posting to the cost center.
    For example:  
    expenses post to the work order under cost element 500000 for $500, $200, $300 and cost element 600000 for $250 and $250.  The settlement rule says to settle to cost center 170000.  When the settlement takes place cost center 170000 is debited $1000 to cost element 500000 and $500 to cost element 600000.  We would prefer to see individual posting of $500, $200, $300 to 500000  and $250, $250 to 600000.
    Thanks,
    Jeff

  • How to get line item net price and net value?

    I have using "BAPI_SALESORDER_SIMULATE" to SIMULATE to create SO,
    the return table
    ORDER_ITEMS_OUT-NET_VALUE is not equals than created by VA01 .
    how to get line item net price and net value?

    Hi,
    Can u elaborate ur query ?
    By this FM you cannot create a SO . Use FM --> BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    MAdhukar Shetty

  • How to pass apex item value into custom xml for chart or guage?

    Re-opening the old thread : Re: How to pass apex item value into custom xml for chart or guage?
    Which was not answered.
    Roel - Thanks. Its working - but in a semi quotes in the custom XML
    <pointers>
    <pointer value= '&P5_RUNNING_TOTAL.'
    <label enabled="true">
    <position placement_mode="ByPoint" x="50" y="15" />
    <format>{%Value}{numDecimals:1}</format>
    <background enabled="false" />
    </label>
    </pointer>
    </pointers>This question was helpful for us to resolving one recent thread : AnyChart - set Dial axis intervals dynamically?
    (Re: AnyChart - set Dial axis intervals dynamically?
    Edited by: P.Ranish on Dec 13, 2012 6:23 AM

    P.Ranish wrote:
    Is there any update for this question ???
    Edited by: P.Ranish on Dec 13, 2012 3:36 AMNo, And there won't be in the future.
    Please stop posting followup's to old threads, if you have a real problem please search the forum first and post a new question with all information
    Roel wrote:
    Try using &P5_RUNNING_TOTAL. or #P5_RUNNING_TOTAL#Just to make it clear - this will only work if page is reloaded after setting the item values dynamically via AJAX

  • How to update line items if it exceeds 17 during creation of SO in va01.

    Hi,
    I have implemented one logic in mv45afzz for updating IO (internal order) with respect to line items during creation of SO through VA01.
    It is working fine.
    My problem is: For first 17th line items it is working fine , but those line items which come after 17th not working.
    Please suggest.
    Thanks,
    Sakti

    Hi,
    Pls find the below code for your reference.
    LOOP AT xvbap INTO wa_xvbap.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input  = wa_xvbap-matnr
          IMPORTING
            output = wa_xvbap-matnr.
        IF ( wa_xvbap-matnr = c_matno_1 OR
           wa_xvbap-matnr = c_matno_2 ) AND
           wa_xvbap-updkz <> 'D'.
    *Before changing container number first check first check the IO attached to
    *this container number fully settled or not.
          IF NOT yvbap[] IS INITIAL.
            SORT yvbap[] BY vbeln posnr.
            READ TABLE yvbap INTO wa_yvbap WITH KEY vbeln = xvbak-vbeln
                                                    posnr = wa_xvbap-posnr
                                                    BINARY SEARCH.
            IF sy-subrc = 0 AND
              ( wa_yvbap-arktx <> wa_xvbap-arktx OR
               wa_yvbap-z_container_no <> wa_xvbap-z_container_no.
              CALL FUNCTION 'CONVERSION_EXIT_OBART_INPUT'
                EXPORTING
                  input  = c_sdi
                IMPORTING
                  output = l_output1.
              CONCATENATE 'ORX'
                          wa_yvbap-z_container_no
                          INTO g_objnr1.
              SELECT SINGLE *
                          INTO wa_cobrb_sdi
                          FROM cobrb
                          WHERE objnr = g_objnr1 AND
                                konty = l_output1.
              IF sy-subrc <> 0.
                CONCATENATE 'ORY'
                              wa_yvbap-z_container_no
                              INTO g_objnr1.
                SELECT SINGLE *
                            INTO wa_cobrb_sdi
                            FROM cobrb
                            WHERE objnr = g_objnr1 AND
                                  konty = l_output1.
              ENDIF.
            ENDIF.
          ENDIF.
    *If the Io is fully settled, then can not change container number.
          IF wa_cobrb_sdi-ersja IS NOT INITIAL.
            MESSAGE s303(me) WITH 'Container can not be changed as IO already settled for' wa_yvbap-posnr.
            CLEAR:wa_yvbap,
                  wa_cobrb_sdi,
                  g_objnr1.
            PERFORM folge_gleichsetzen(saplv00f).
            fcode = 'ENT1'.
            SET SCREEN syst-dynnr.
            LEAVE SCREEN.
          ELSE.
    *Check container number is initial or not
            IF wa_xvbap-z_container_no IS NOT INITIAL AND tcode = c_va01.
              CONDENSE wa_xvbap-z_container_no.
    *Add 'X' to container number and serch for IO exist or not
              CONCATENATE c_x
                          wa_xvbap-z_container_no
                          INTO l_aufnr.
              SELECT SINGLE aufnr objnr
                         FROM aufk
                         INTO (g_aufnr,g_objnr)
                         WHERE aufnr = l_aufnr.
              IF sy-subrc = 0.  " AND wa_xvbap-arktx = l_aufnr.
                l_flag = 'X'.
              ELSE.
    *Add 'Y' to container number and search for IO
                CONCATENATE c_y
                            wa_xvbap-z_container_no
                            INTO l_aufnr.
                SELECT SINGLE aufnr objnr
                          FROM aufk
                          INTO (g_aufnr,g_objnr)
                          WHERE aufnr = l_aufnr.
                IF sy-subrc = 0.  " AND wa_xvbap-arktx = l_aufnr.
                  l_flag = 'X'.
                ELSE.
    *Display error message if Io was not found or forgot to enter IO in description field
                  MESSAGE s083(me) WITH 'IO was not found for' wa_xvbap-posnr.
                  PERFORM folge_gleichsetzen(saplv00f).
                  fcode = 'ENT1'.
                  SET SCREEN syst-dynnr.
                  LEAVE SCREEN.
                ENDIF.
              ENDIF.
           ELSE.
            ELSEIF tcode = c_va01.
    *Display error message if user forget to enter container number
              MESSAGE s083(me) WITH 'container number for' wa_xvbap-posnr.
              PERFORM folge_gleichsetzen(saplv00f).
              fcode = 'ENT1'.
              SET SCREEN syst-dynnr.
              LEAVE SCREEN.
            ENDIF.
            IF l_flag EQ 'X'.
              CALL FUNCTION 'CONVERSION_EXIT_OBART_INPUT'
                EXPORTING
                  input  = c_sdi
                IMPORTING
                  output = l_output.
              CALL FUNCTION 'CONVERSION_EXIT_PERBZ_INPUT'
                EXPORTING
                  input  = c_ful
                IMPORTING
                  output = l_ful.
    *Fetch 1st line of settlement rule
              CALL FUNCTION 'CONVERSION_EXIT_OBART_INPUT'
                EXPORTING
                  input  = c_gl
                IMPORTING
                  output = l_gl.
              SELECT SINGLE *
                    INTO wa_cobrb_gl
                    FROM cobrb
                    WHERE objnr = g_objnr AND
                          konty = l_gl.
              IF sy-subrc EQ 0.
    *Populate values for second line settlement
                wa_cobrb-objnr = g_objnr.            "OBJNR
                wa_cobrb-lfdnr = '003'.
                wa_cobrb-konty = l_output.           "Category
                wa_cobrb-kdauf = xvbak-vbeln.        "Order No
                wa_cobrb-kdpos = wa_xvbap-posnr.     "Item No
                wa_cobrb-prozs = c_percent.          "Percentage
                wa_cobrb-perbz = l_ful.              "Settlement
                wa_cobrb-extnr = c_no.               "No
                wa_cobrb-gabpe = wa_xvbap-erdat+4(2).      "From period
                wa_cobrb-gabja = wa_xvbap-erdat+0(4).      "From Fiscal
                APPEND wa_cobrb TO gt_cobrb.
              ELSE.
    *Populate values for second line settlement
                wa_cobrb-objnr = g_objnr.            "OBJNR
                wa_cobrb-lfdnr = '003'.
                wa_cobrb-konty = l_output.           "Category
                wa_cobrb-kdauf = xvbak-vbeln.        "Order No
                wa_cobrb-kdpos = wa_xvbap-posnr.     "Item No
                wa_cobrb-prozs = c_percent.          "Percentage
                wa_cobrb-perbz = l_ful.              "Settlement
                wa_cobrb-extnr = c_no_1.               "No
                wa_cobrb-gabpe = wa_xvbap-erdat+4(2).      "From period
                wa_cobrb-gabja = wa_xvbap-erdat+0(4).      "From Fiscal
                APPEND wa_cobrb TO gt_cobrb.
              ENDIF.
              IF wa_cobrb_gl IS NOT INITIAL.
                wa_cobrb_gl-gbisp = wa_cobrb-gabpe - 1.
                wa_cobrb_gl-gbisj = wa_cobrb-gabja.
                APPEND wa_cobrb_gl TO gt_cobrb_gl.
              ENDIF.
         ELSEIF wa_cobrb-ersja IS NOT INITIAL.
           MESSAGE 'Container number can not be reassign' TYPE 'E'.
            ENDIF.
          ENDIF.
        ENDIF.
        CLEAR:wa_cobrb,
              g_objnr,
             wa_aufk,
              wa_cobrb_gl,
              wa_cobrb_sdi.
      ENDLOOP.
      IF l_flag EQ 'X'.
    *Create 2nd line for settlement rule.
        SORT gt_cobrb[].
        DELETE ADJACENT DUPLICATES FROM gt_cobrb[].
        IF NOT xvbak-vbeln IS INITIAL AND tcode = c_va01.
          IF NOT gt_cobrb[] IS INITIAL.
            CALL FUNCTION 'K_SRULE_SAVE_UTASK'   "IN UPDATE TASK
              TABLES
                t_cobrb_insert    = gt_cobrb[]
              EXCEPTIONS
                srule_utask_error = 1
                OTHERS            = 2.
    Thanks,
    Sakti

  • How to disable line items of sales order ie not editable

    Hi All,
      I want to diable line items of BOM when using it in sales order, Can any one tell me how to do it and which USER EXIT or BADI i have to use it for.
    Regards,
    Sudhakar.A

    Hi,
    You have to write your code in this Include : MV45AFZZ
    Here i have diabled the components of BOM...change the code accordingly.
    IF ( sy-tcode EQ 'VA01'
             OR sy-tcode EQ 'VA02' ).
        loop at xvbap where pstyv eq 'ZABC'.
          if not vbap-uepos is initial.
            if sy-subrc = 0.
              screen-input = 0.
            endif.
         endif.
        endloop.
      endif.
    Here Xvbap is like Internal table
    VBAP is strucure.
    Regards,
    Sudhakar Reddy.A

  • How to delete line item from sales order ?

    Dear All ,
                               user is having 20 line items from which 3 line items of which prod order confirmation cancellation is done also goods reversal done now as user tries to delete the line items an info box pops up --> Due to cost management the line item can not be deleted . Can u tell me that if these line item is not deleted than how to delete this ?  sos what user had done that he had selected reason for rejection for these 3 line items so now the total wt is reduced but user is not able to delete the lineitems .
    pl help
    sap11

    Hi
    For those line items you can assign a REASON FOR REJECTION. Automatically the status of those line items will be closed.
    Thanks,
    Ravi
    PS : sorry....please ignore my post.
    Edited by: sankar ravi on May 20, 2008 3:45 PM

  • How to delete line item in a Work Order (only a line created in operation)

    Hi,
    I have created a refurbishment order to refurbish a mechanical seal at external parties. In the work order operation tab, I have created one line items for this purpose and a Purchase Requisition is generated. Suddenly, operation decided to cancel this request and I have problem to delete the Work Order and  Purchase Requisition. I have tried to delete the operation line item but failed. This is the message when try to delete the line item " The last active operation cannot be deleted".  Appreciate help on how to delete this Work Order and Purchase Requisition.
    Edited by: Zahari Yusof on Apr 4, 2008 3:20 AM

    hi
    In Standard SAP while creating an order the short text you are specifying will automatically appear in the first operation,also in order system will ask you to enter atleast single operation ,hence it is not possible to delete the operation line ,
    what you can do this either TECO the order which will clear any open PR for this
    or create another operation with control key for internal activities say dummy with operation no 20 and save,then go in to order in change mode and try to delete the operation line 10 ,i think system will allow you to do that
    regards
    thyagarajan

  • How to delete line items from PM order

    Dear SAPient's,
    We have created PM order, in this one line item  material is defective. For that we want to cancel the PM order
    and return the material to the vendor. Now situation is this PM order is allready released and material is also issued.
    Material stock is showing on ON-ORDER Stock.
    Please suggest some Ideas.
    With warm regards
    Bijay Kumar Jha

    Hi,
    Well, the qty shall be brought to stock in some way. If the PM order is already completed, you can bring it with any other movement, e.g. trs MI10 (invetory adjustment) or trs MB1C and mvt 501. But then your accountants will have to deal with the offsetting posting to some P&L account. You have already debited some P&L account when you did the GI to the PM order (you can find which acct it was if you display the accounting documents for the GI material document). This charge was assumingly wrong since you haven't actually consumed the qty but returning it to the vendor. This means that this account shall be credited.
    At the same you have the debit posting to another P&L acct when you do MI10 or MB1C. The accounting people will have to repost the debit amount from the first acct to the second one, so that the total P&L is zero.
    BR
    Raf

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

Maybe you are looking for

  • Importing subtitles from an outside vendor

    Here's a list of questons from our supplier. what file format you'll need from us: .tif or .bmp? - navigation (script file) – .son, .sst, .stl or any other - color scheme for subtitles: o text o edging o aliasing o background Any help would be apprec

  • Problem of memory size

    I developed an applet which permits to see some 3D object (from a VRML file). When the source file is light (between 1 to 4 MB), there is not problem, but if its size is 15MB for example, nothing appears ! With a normal java program, I would have to

  • RequestFocus in JTextField

    I am not able to get the focus in my JTextField, when I run the following in an appletviewer: import javax.swing.*; public class TestClass extends JApplet {      JLabel label1;      JTextField tx;      JPanel panel;      public void init()           

  • Delete line issue... 8.81 PL09

    Hi, I'm deleting a row in the Sales Order Matrix by the following line : oMatrix.DeleteRow(MyRow) This doesn't put the grid in Update mode and the button is still OK The line is deleted but if I click OK and get back in the order my line is there Wha

  • Livemotion

    Hola a todos ¿Alguien sabe si ocurrirá algo con Livemotion? Saludos