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

Similar Messages

  • 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

  • Where/ how do I set SNP to create Planned orders with multiple line items?

    Hi
    Currently our SNP is generating planned orders on a daily basis, it creates a single order with a single line item per location.
    Where/ how do set SNP to create planned orders on a daily basis to generate a single order with multiple line items per location, so therefore one planned order with multiple line items for a single location.
    Thanx
    Keegan

    Hi Keegan,
                   In SNP (APO) it is not possible to create order with multiple line items.
    But you can do some settings so that while planning system can do aggregation and disaggregation.
    But your requirment should be set on Aggregation/Dis-aggregation logic.
    Please follow the follwing links:
    http://help.sap.com/saphelp_scm2007/helpdata/en/2c/c557e9e330cc46b8e440fb3999ca51/content.htm
    Aggregation:
    http://help.sap.com/saphelp_scm2007/helpdata/en/42/f731d078e73ee4e10000000a1553f6/content.htm
    Disaggregation:
    http://help.sap.com/saphelp_scm2007/helpdata/en/a6/ebefaf32e22e468355da304cc59387/content.htm
    Please be sure that the setting of this logic will be at planning area level.
    You can't change aggregation/disaggregation logic further.
    Regards,
    Santosh

  • Adding Sales Order with multiple lines

    Hi all,
    I have a C# program whereby I am trying to get Sales Orders from one database (source) and create them in another database (destination). I can't get the code to work properly as lRetCode is never equal to 0 but is -5002.
    How can I fix it so that it adds the sales orders properly?
    Here is the code snippet:
                unaddedSOs = sList.Except(dList).ToList(); // contains the header information
                // Add the Sales Orders that are missing to destination database
                SAPbobsCOM.Documents sboSO =   (SAPbobsCOM.Documents)oCompanyDestination.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);  // Destination
                // Loop through unadded Sales Orders
                foreach (var item in unaddedSOs)
                    // Set properties of the Sales Order object
                    sboSO.CardCode = item.cardCode;
                    sboSO.CardName = item.cardName;
                    sboSO.DocDate = item.docDate;
                    sboSO.DocDueDate = item.docDueDate;
                    // Add Sales Order Document Lines
                    SAPbobsCOM.Recordset rsLines = oCompanySource.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); // Source of lines
                    // Get Sales Orders from source database
                    rsLines.DoQuery("SELECT ItemCode, Quantity, Price FROM RDR1 WHERE DocEntry = '" + item.docNum + "'");
                    rsLines.MoveFirst();
                    if (rsLines.RecordCount > 0)
                        while (!rsLines.EoF)
                            sboSO.Lines.ItemCode = rsLines.Fields.Item("ItemCode").Value;
                            sboSO.Lines.Quantity = rsLines.Fields.Item("Quantity").Value;
                            sboSO.Lines.Price = rsLines.Fields.Item("Price").Value;
                            sboSO.Lines.Add();
                            rsLines.MoveNext();
                    // Try to add the Sales Order to the database
                    int lErrCode = 0;
                    string sErrMsg = "";
                    int lRetCode = sboSO.Add();
                    if (lRetCode != 0)
                        int temp_int = lErrCode;
                        string temp_string = sErrMsg;
                        oCompanyDestination.GetLastError(out temp_int, out temp_string);
                        // Incase adding a Sales Order failed
                        if (lErrCode != -4006)
                            // Display error message
                            MessageBox.Show(lErrCode + " " + sErrMsg);
                MessageBox.Show("Done!!!");
    Kind Regards,
    Kinyanjui.

    Hi Kinyanjui,
    I think you're always writing to the same line:
    int row = 0;
    while (!rsLines.EoF)
        sboSO.Lines.SetCurrentLine(row);
        sboSO.Lines.ItemCode = rsLines.Fields.Item("ItemCode").Value;
        sboSO.Lines.Quantity = rsLines.Fields.Item("Quantity").Value;
        sboSO.Lines.Price = rsLines.Fields.Item("Price").Value;
        sboSO.Lines.Add();
        rsLines.MoveNext();
        row++;
    Best regards,
    Pedro Magueija

  • Partial delivery of sales order with some line items

    Hi all,
    Please help me in the issue i want to create delivery against sales order partially for some line items of the sales order . Can any one suggest me the procedure how to do it through programing .
    Thanks in advance,

    Hi,
    You have several methods of doing same.
    Method 1
    Go to VL01N, and given your sales order number.
    Without giving the line item, just press Enter
    Now inside the delivery, you can delete unwanted line items, and you can adjust quantities under Item overview tab.
    After that do picking and PGI.
    Method 2
    Go to VL10E,
    Give your sales order number and execute.
    Mark relevant schedule lines only and press execute,
    then those line items with marked schedule lines will copied to the delivery document.
    Best regards,
    Anupa

  • Sale order with no line items

    Hi,
      sale order should not be saved if there is no line item.
      Sale order should not be saved if there is no quantity or value for a line item.
    Can anyone update on this please
    Ratna

    Hi,
    You can create sales order directly with out any material in standard.
    If you enter any material you need to specify quantity.
    Regards,
    Ravi Duggirala
    Edited by: ravi duggirala on May 19, 2009 11:56 AM

  • Sales order with multiple Schedule lines

    Hello,
    Could you please help me to create a sales order with multiple line items.
    for example, I need to create a sales order with line item 10 with schedule lines more than 3.
    Thanks in advance,
    Bhaskar.K

    As already explained  Sh. Line Catg. is determined with Item Catg.of the item + MRP type automatically  . As per your assignment in ( SD-sale-sales document-Sh. line-Assign Sh. line Catg.) system automatically propose the Sh. line Catg of your entered item
    Now for three Sh line  - in VA01  create the order  with your  item , give quantity  -now  select the line item, click on the  Display item Details ICON extreme left  bottom of the screen, than click on Sh. line tab here you maintain as many sh. line as you required.
    Actually these Sh lines are nothing but the Requested Delivery Date And Quantity which is ultimately pass on to (Transfer the Requirement) MRP
    Hope this'll help you
    Ashok
    Edited by: Ashok ku. on Aug 17, 2009 11:16 PM

  • Conversion - Doc with multiple line items - LSMW

    Hi Friends,
       I have got a flat file that holds all the open sales orders from a legacy system. I need to upload these data into R/3. If i use LSMW it creates a separate sales order for each line item of a single sales order. That is i am unable to get all the line items for a sales order.How to go about it?.
    Quick replies would be rewarded.
    Regards,
    Tamilarasan.

    Hi,
    of course. We were talking of two approaches, here is a simple one (with one input file):
    1) Source structure definition
    I define several structures (head level / line level)
    ART_HEAD                 Article E1BPE1MATHEAD                                                                               
    5  ART_SITE                 Logistic view source E1BPE1MARCRT 
                                                                              ART_MBEW                 Article Valuation E1BPE1MBEWRT
    (Sorry, can't see correctly the copy, but art_site is below art_head and can contain several sites for one article)
    2) Maintain source fields
    Group your fields into header and line values. In both strucutes one identifier is needed:
    ART_HEAD                  Article E1BPE1MATHEAD                                                                               
    IDENT                          C(010)    Structure Identifier 1     
                                        Identifing Field Content: HEAD       
         HEAD_MATERIAL                  C(018)    Article number             
    Assign all needed fields, double click on field IDENT, you will see attribute 'Identifying field content'.
    3) Maintain Structure relations
    Header fields of BAPI (or whatever method you use) your head-structure has to be assigned, line (tables) input has to be assigned to line-structure.
    4) Field mapping: quite normal
    5) Import file example (tabulator separated text file):
    HEAD  1000014 20050706    OR
    LINE  5334667    15    ST   23,15   EUR
    LINE  5334669    20    ST   15,89   EUR
    HEAD ....
    LINE ....
    LINE ....
    LINE .... and so one
    So no field names, just the field values according to your source field definition. Don't ask me, how to create such a text file, I managed it somehow with some formulas. Visual basic might help better.
    Please ask for me details if necessary.
    The other option of Murugesh uses three files instead: header values, line values, link values. Looks like some online information will tell how to use them in LSMW.
    Regards,
    Christian

  • MIGO-sales order number and line item not validated for 501E mvt in MIGO.

    Hi All,
    In MIGO i am trying to post for 501E(specisl stock=order on hand) movement type, here i am entering the material and in the where TAb even if I enter wrong sales order number or wrong sales order line item number. the system allows to post .
    its not validating the material against the sales order number and line item number that is entered to check whether that material really exists in that particular sales order or not.
    is there a way to fix this?
    Thanks
    Mahendra

    hi
    i dont think vvalidation is possibel
    as the system dont know whaich material is assigned to which SO
    as we r takeing the stock without PO
    if u want to validate then system can validate the quantity that is also with use of some user exit
    correct me if i am wrong

  • Uploading the sales order using BAPI

    hi experts,
    i want to upload the sales order using BAPI.
    can you provide the FM.
    it will be much helpful if i have the sample code........
    thanks

    Hi Shyam,
    Use BAPI : BAPI_SALESORDER_CREATEFROMDAT2
    REPORT ZZBAPI_TEST1 .
    *===========================================================
    *** Start of selection
    *===========================================================
    START-OF-SELECTION.
    * test of sales order with BAPI
    PERFORM SALES_ORDER_BAPI.
    *================ End of main program ======================
    *& Form SALES_ORDER_BAPI
    * text
    FORM SALES_ORDER_BAPI.
    DATA : SD_HEADER LIKE BAPISDHEAD.
    DATA : BEGIN OF ITEMIN_IT OCCURS 1.
    INCLUDE STRUCTURE BAPIITEMIN.
    DATA : END OF ITEMIN_IT.
    DATA : BEGIN OF PARTNR_IT OCCURS 1.
    INCLUDE STRUCTURE BAPIPARTNR.
    DATA : END OF PARTNR_IT.
    DATA : WK_SD_DOCNO LIKE VBAK-VBELN.
    DATA: WK_RETURN LIKE BAPIRETURN.
    CLEAR : SD_HEADER , ITEMIN_IT , PARTNR_IT.
    SD_HEADER-DOC_TYPE = 'TA'.
    SD_HEADER-SALES_ORG = '1793'.
    SD_HEADER-DISTR_CHAN = '01'.
    SD_HEADER-DIVISION = '01'.
    SD_HEADER-PURCH_NO = 'Test'.
    * itemin_it-hg_lv_item = '10'.
    ITEMIN_IT-MATERIAL = '000000000000001143'.
    ITEMIN_IT-PLANT = '3018'.
    ITEMIN_IT-REQ_QTY = '1'.
    ITEMIN_IT-SALES_UNIT = 'CS'.
    APPEND ITEMIN_IT.
    * itemin_it-hg_lv_item = '20'.
    ITEMIN_IT-MATERIAL = '000000000000000848'.
    ITEMIN_IT-PLANT = '3018'.
    ITEMIN_IT-REQ_QTY = '1'.
    ITEMIN_IT-SALES_UNIT = 'KG'.
    APPEND ITEMIN_IT.
    * itemin_it-hg_lv_item = '30'.
    ITEMIN_IT-MATERIAL = '000000000000000848'.
    ITEMIN_IT-PLANT = '3018'.
    ITEMIN_IT-REQ_QTY = '1'.
    ITEMIN_IT-SALES_UNIT = 'EA'.
    APPEND ITEMIN_IT.
    LOOP AT ITEMIN_IT.
    WRITE : / SY-TABIX , ITEMIN_IT-MATERIAL , ITEMIN_IT-PLANT
    , ITEMIN_IT-REQ_QTY , ITEMIN_IT-SALES_UNIT.
    ENDLOOP.
    CLEAR : PARTNR_IT.
    PARTNR_IT-PARTN_ROLE = TEXT-001.
    PARTNR_IT-PARTN_NUMB = '0000000004'.
    APPEND PARTNR_IT.
    CLEAR : PARTNR_IT.
    PARTNR_IT-PARTN_ROLE = 'WE'.
    PARTNR_IT-PARTN_NUMB = '0000000051'.
    APPEND PARTNR_IT.
    LOOP AT PARTNR_IT.
    WRITE : / SY-TABIX , PARTNR_IT-PARTN_ROLE , PARTNR_IT-PARTN_NUMB.
    ENDLOOP.
    CLEAR : ITEMIN_IT , PARTNR_IT , WK_RETURN..
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDATA'
    EXPORTING
    ORDER_HEADER_IN = SD_HEADER
    IMPORTING
    SALESDOCUMENT = WK_SD_DOCNO
    * SOLD_TO_PARTY =
    * SHIP_TO_PARTY =
    * BILLING_PARTY =
    RETURN = WK_RETURN
    TABLES
    ORDER_ITEMS_IN = ITEMIN_IT
    ORDER_PARTNERS = PARTNR_IT
    * ORDER_ITEMS_OUT =
    * ORDER_CFGS_REF =
    * ORDER_CFGS_INST =
    * ORDER_CFGS_PART_OF =
    * ORDER_CFGS_VALUE =
    * ORDER_CCARD =
    EXCEPTIONS
    OTHERS = 1.
    WRITE : / 'sy-subrc = ' , SY-SUBRC.
    IF NOT WK_SD_DOCNO IS INITIAL.
    WRITE : / WK_SD_DOCNO , 'registerd'.
    ELSE.
    WRITE : / 'incorrect'.
    WRITE : / WK_RETURN-TYPE , WK_RETURN-CODE , WK_RETURN-MESSAGE.
    WRITE : / WK_RETURN-LOG_NO, WK_RETURN-LOG_MSG_NO,
    WK_RETURN-MESSAGE_V1.
    ENDIF.
    ENDFORM. " SALES_ORDER_BAPI
    Hope that helps.
    Regards
    Kapadia
    ***Assigning points is the way to say thanks in SDN.***
    Message was edited by:
            Mr Kapadia

  • Error while creating the sales order with billing reference

    hi alll
    i am getting error while creating the sales order with billing reference.The line items are coming in grey.I am not able to change the items as well as the quantity field.Can u guide me
    cheers
    shalsa007........

    Dear SAP SD 007
    I can confidently tell that an enhancement or an user exit has been applied in your scenario
    You have to check that
    Normally when creating a sales order with respect or referring billing documents the qty will be in editable mode and it is standard problem
    Your people has solved the standard problem by enhancement
    Usually OR--LF-PGI----F2 (SAY THE QTY IS 25 UNITS)
    Now you are creating returns order with reference to F2 in the return order type Re there is a standard issue that user can edit the qty to 30 from the original 25
    To solve this only your people have used userexit
    Line items and qty greyed out means definately there is some enhancement or user exit applied
    You have to check that
    Regards
    Raja

  • Create ecatt script for one sales order creation with multiple line items

    Hi ,
    I want to create a ecatt script for one sales order creation with multiple line items. Preferably SAP GUI.
    This selection of data will be from an external file/ variants which will have only one row of data in it.
    Firstly: I have to sort the external file having same PO Numbers in an order.Group them together.
    Second: I have to create sales order for those many line items having same PO Number.
    Best Regard
    Taranum

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

  • How to cancel the sales order - header and line status are in Entered Stage

    Dears,
    I have some sales order to be cancelled in which the header and line status are in *"Entered"*. I am not able to cancel these sales order.
    Also note that these orders are for maintenance service.Once i book these orders the lines will change to closed status.
    So it is not possible to book and cancel the lines.
    Kindly me to resolve this.

    926530 wrote:
    Boss,
    If i do Action-->cancel on header, it just makes the qty to zero.But the header and line status still showing as entered.It will not cancel the order.
    The problem for me is that these lines are coming in my monthly reports. This is what your question says...be more specific as what is your issue..which in turn is your problem
    How to cancel the sales order - header and line status are in Entered Stage
    Coming to your Action-->cancel...as far as i know ...the header status will change to canceled..
    unless until you have some processing constraints in place...which is stopping you...
    HTH
    Mahendra

  • Unable to create PO with multiple line items through LSMW-BAPI method

    Hi All,
    I have a requirement of creating PO through LSMW. I can't use LSMW standard batch input program since there are some fileds not available and also it has many limitations. I'm using LSMW-BAPI method ( Business object BUS2012) which create IDOC and uses BAPI_PO_CREATE1 to ultimately post the PO in the system. I am trying to create PO from a single file which contains both Header and Item data.
    Now my problem is that everytime PO is being created with Single line item only. Everytime I am giving multiple item data in the source file LSMW is preparing multiple IDOCs for multiple line items. As per my understanding this is happenng since header and item is in the same hierarchy level of IDOC type PORDCR102 and the control record is inserted for every line item in the source file.
    It seems that through LSMW-BAPI  it is not possible to create PO with multiple line items. Can anybody provide some input regarding this? Thanks in advance.
    BR,
    Atanu Mukherjee

    Solved by myself.
    Earlier the problem was that LSMW was not being able to recognize items under same header. It was creating new IDOCs every time it gets a new item. To enable this we need to create two structure HEADERDATA and ITEMDATA.  Two additional identifier fields with identifier value 'H' and 'I' should be added in these two structures respectively. Then we need one sequential file with the identifiers field followed by the header and Item data. Example:
    H~header data
    I~item data
    I~item data 
    This would help the standard program to understand what are the items under same header and ultimately create PO with multiple line items.
    BR,
    Atanu Mukherjee

  • Sales order no and line item no in account assignment tab of line item no.

    Hi All,
    When we display a sales order and go to line item --> Account assignment tab --> we can see sales order no and line item no in that screen. We want to know from where this existing no. in that field is populating from.
    We want to know this as we want to check feasibility of changing sales order and item no to maintenance contract no and line item no. ( Maintenance contract we have to pick from notification)
    If anybody has any idea about this do let me know as this is urgent requirment.
    Effort will be rewarded.
    Thanks in advance.
    Edited by: Satish Bharambe on Jul 4, 2008 10:38 AM

    Hi Satish,
    You mean Accounting assignment tab-->In Settlement rule details
    If yes the order number which is coming in that field Sales order and for which sale order you are looking that details both are the same numbers(i.e Nothing but sales order number).
    When you create sales order system will give number of the sales order the number will come in this place.
    I hope it will help you,
    Regards,
    Murali.

Maybe you are looking for

  • Adobe Photoshop OpenGL Rectangular Marquee Bug

    Per this thread on the Adobe support forums, there is currently a bug with the Rectangular Marquee tool in Photoshop CS4 and CS5. The "marching ants" selection outline is not positioned correctly, making it difficult to tell if you have selected the

  • Text flow to additional pages at end of document, how to set up in InDesign CS5

    I've added additional pages to a document in InDesign CS5 -- but how do I set up my document so when text is supposed to get pushed to the additional pages the text flows from page to page on these extra added pages? Right now I've added additional p

  • Apple tv 2 power supply replacement

    Is there any way of buying a replcement power supply for apple tv 2? Delta Electronics ADP-6BF S Be handy as mine has packed in one of my Apple tvs! Any help appreciated!

  • Got new Ipod 4gen today.

    having problem with new ipod 4th gen.  Took backup of old ipod then plugged in new one. message saying unable to install 'could not find software'. i have 'connect to itunes' logo on ipod screen. have tried to shut it down but can't, also tried to pu

  • TC works in airport utility - but can't find it under time machine

    Hello out there I have a BIG problem .. I have for some while ago, bought a TC and used it with no problems for some month while i have had a wi-fi at home .. Now, I don't have the wi-fi connection anymore - i use my iPhone for sharing, so the settin