Line item data is not saving while creating a Sales order using Interactive

Hi all,
I am creating a sales order Using Interactive forms. In the form i am having Header data and line item data.I had created two structures one for Header data and one for Line item data. For entering  the LINE ITEM DATA i had created a Dynamic table with Buttons ADD ROW and DELETE ROW.
User will Add the Row or Delete the Row based on the requirement.
My issue is When ever the user clicks the SUBMIT button after entering the header data and 3 line items data , Sales order has been created with only first line item and the remaining two line items are not created.
My Interactive form is like below
HEADER DATA
DOC_TYPE
SALES_ORG
DIST_CHN
DIVISION
PURCH_NO
PARTN_ROLE
PART_NO
LINE ITEM DATA
                         ITEM_NO      MATERIAL          PLANT          QTY        COND_TYPE            COND_VALUE
ADD ROW
DELETE ROW
                                                                                SUBMIT
My  code for the method ONACTIONCLICK is like below
method ONACTIONCLICK .
data:
      Node_Adobe       type ref to If_Wd_Context_Node,
      Node_Zsaleheader       type ref to If_Wd_Context_Node,
      Elem_Zsaleheader       type ref to If_Wd_Context_Element,
      Stru_Zsaleheader       type If_Main=>Element_Zsaleheader,
      Node_Zsaleitem       type ref to If_Wd_Context_Node,
      Elem_Zsaleitem       type ref to If_Wd_Context_Element,
      Stru_Zsaleitem       type If_Main=>Element_Zsaleitem.
  data: header_data type BAPISDHEAD.
  data: item_wa type BAPIITEMIN.
  data: item_data type table of BAPIITEMIN.
  data: partner_wa type BAPIPARTNR.
  data: partner_data type table of BAPIPARTNR.
  data: sales_order type BAPIVBELN-VBELN.
  data: Errorlog type BAPIRETURN1.
navigate from <CONTEXT> to <ADOBE> via lead selection
  Node_Adobe = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_Adobe ).
navigate from <ADOBE> to <Zsaleheader> via lead selection
  Node_Zsaleheader = Node_Adobe->get_Child_Node( Name = IF_MAIN=>wdctx_Zsaleheader ).
  Node_Zsaleitem = Node_Adobe->get_Child_Node( Name = IF_MAIN=>wdctx_Zsaleitem ).
get element via lead selection
  Elem_Zsaleheader = Node_Zsaleheader->get_Element(  ).
  Elem_Zsaleitem = Node_Zsaleitem->get_Element(  ).
get all declared attributes
  Elem_Zsaleheader->get_Static_Attributes(
    importing
      Static_Attributes = Stru_Zsaleheader ).
  header_data-DOC_TYPE = Stru_Zsaleheader-DOC_TYPE.
  header_data-SALES_ORG = Stru_Zsaleheader-SALES_ORG.
  header_data-DISTR_CHAN   = Stru_Zsaleheader-DISTR_CHAN.
  header_data-DIVISION = Stru_Zsaleheader-DIVISION.
  header_data-PURCH_NO = Stru_Zsaleheader-PURCH_NO.
  partner_wa-PARTN_ROLE   = Stru_Zsaleheader-PARTN_ROLE.
  partner_wa-PARTN_NUMB = Stru_Zsaleheader-PARTN_NUMB.
   append partner_wa to partner_data.
    Elem_Zsaleitem->get_Static_Attributes(
    importing
      Static_Attributes = Stru_Zsaleitem ).
  item_wa-ITM_NUMBER = Stru_Zsaleitem-ITM_NUMBER.
  item_wa-MATERIAL   = Stru_Zsaleitem-MATERIAL.
  item_wa-PLANT = Stru_Zsaleitem-PLANT.
  item_wa-REQ_QTY = Stru_Zsaleitem-REQ_QTY.
  item_wa-COND_TYPE   = Stru_Zsaleitem-COND_TYPE.
  item_wa-COND_VALUE = Stru_Zsaleitem-COND_VALUE.
  append item_wa to item_data.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
  EXPORTING
    ORDER_HEADER_IN           = header_data
  WITHOUT_COMMIT            = ' '
  CONVERT_PARVW_AUART       = ' '
IMPORTING
   SALESDOCUMENT             = sales_order
  SOLD_TO_PARTY             =
  SHIP_TO_PARTY             =
  BILLING_PARTY             =
   RETURN                    = errorlog
  TABLES
    ORDER_ITEMS_IN            = item_data
    ORDER_PARTNERS            = partner_data
  ORDER_ITEMS_OUT           =
  ORDER_CFGS_REF            =
  ORDER_CFGS_INST           =
  ORDER_CFGS_PART_OF        =
  ORDER_CFGS_VALUE          =
  ORDER_CCARD               =
  ORDER_CFGS_BLOB           =
  ORDER_SCHEDULE_EX         =
endmethod.
PLEASE SUGGEST ME IF ANY CODE CHANGE IS REQUIRED
Thanks in advance
Ajay

Hi,
The item data is not read because, the dynamically added rows should also reflect back to the Web Dynpro context. When the user clicks on Add Row, use the Onsubmit event to add a empty line to internal table and then bind it to the context. And if the user removes a row, remove a row from internal table and bind it back to the context.
You may refer this article.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
Regards,
Runal

Similar Messages

  • Getting error 'Item 00000 does not exist' while creating a salse order

    Hi All,
    We are facing an issue, we get an error message saying 'Item 00000 does not exist' while creating a sales order for a particular order type, we do not get this problem with all the materials, only a few of them and the materials which give a problem are part of the supersession chain. The problem is not even coming for all the superseded materials.
    This problem is occuring with none of the other order types but just one. We have compared the configuration for the order types for which this error is not coming and the order type which is giving the problem, and its exactly the same.
    When creating the sales order through VA01 even though the error message comes, but on hitting the enter button the processing goes further. But when creating the sales order through the background program the processing stops the moment the error message comes and the Sales Order does not get created.
    Your valuable suggestions for helping us resolving this issue will be highly appreciated.
    Regards,
    Geeta

    HI Geeta
    As per your post "Problem is when you are executing VA01 in background sales orders are not generating due to error message".
    Apart from configuration check alternative is "Take ABAPer's help and change this error message type to warning/information message type in the system". With warning/information message type you could be able to create sales orders in background also.
    try and revert

  • Sale Order Item Quantity Not Populating When Create A Sale Order Using BAPI

    I am having a problem when creating a sale order using BAPI
    BAPI_SALESORDER_CREATEFROMDAT2
    Problem is that sale order item quantity field is not populating
    code is as follows
    ORDER_ITEMS_IN-ITM_NUMBER = '0010'.
    ORDER_ITEMS_IN-MATERIAL = '000000000010000262'.
    ORDER_ITEMS_IN-TARGET_QU = 'LB'.
    ORDER_ITEMS_IN-TARGET_QTY = 1.

    Hi,
    Try populating ORDER_SCHEDULES_IN table in the bapi field REQ_QTY.
    Regds,
    Rudra

  • Error while creating the sales order using Proxy

    Hi Folks,
    I am trying to create a Sales Order using Proxy via BAPI "BAPI_SALESORDER_CREATEFROMDAT2" :
    and i got this type of standard error message
    <Message>FB call: insufficient parameters</Message>
    few days back only i used the same bapi for creating the Sales Order and did it successfully...using the same parameters
    I don't have any clue about this type error .
    Kindly guide .
    Regards,

    Hi Nikhil,
    How refreshing the cache and restart the server will help ?
    basically i am testing the scenario at R/3 end only by generating XML template in SPROXY.
    My ECC 6.0 is on sp 12....I am not sure is it configuration related error or a bug ? as i have used the same code in ECC 6.0 with sp 09.
    regards,

  • How to resolve the issue of route while creating a sales order using IDOC

    Hi,
    When I am creating a sales order mannualy the the route is correct and matching  also but while using IDOC try to create a sales order then the route is showing wrong.
    I tried to debug the program SAPMV45A but I am not getting anything.
    Could any body help me on this.
    Waiting for quick response.
    Best Regards,
    BDP

    Hi Bansidhar,
                 You need to debug the Function Module thats assigned to your Process code.
                 In standard config for Sales Order, Process Code ORDE is assigned to FM IDOC_INPUT_ORDERS. And this FM uses Call Transaction Method to create Sales Orders. SO you can  debug this FM.
               Hope this helps you solving the problem.
    Regards
    Srikanth  M

  • Pop-up while creating a sales order using VA01

    Hi Experts,
           i need to create a pop up in transaction VA01 to input a custom field value. i have done that and it is working fine.
    But when we use the Sales order create BAPI to create a sales order the pop-up still appears.
    This is not required.
    I need to pop-up only for online execution.
    I have checked that parameters of T180 and it is same in both cases.
    Even sy-batch does not help.
    Please suggest how i can avoid this.
    Thanks & Regards,
    Amit

    Hi,
    Check SAP Note 209278 - Display of customer-specific fields in sales doc for mantaining your own fields,
    Regards,
    Eduardo

  • Mapping datas from idoc while creating a sales order.

    Hi Friends,
    From the idoc i want to fill the field 'YOUR REFERNCE' in the tag ORDER DATA at header level while creating a sales order. From which segment i can find the datas for that field.
    Your answers will be valuable.
    Thanks,
    Bestin
    Edited by: Be$t!N on Aug 26, 2009 4:41 PM

    Hi,
    You can find the Your Reference field in the segment E1EDKA1 and the field name is IHREZ.  This Your reference field is at the Partner level. This is a standard field.
    If you can let me know at which place you want this field to be populated then we can find another suitable field in the IDOC.
    Thanks,
    Mahesh.

  • Material Listing Error while creating the sales order

    Hi Guru's
    I have mantained a material in the lisitng for A002 combiantion for SO/DC/Pric. ref. material
    While creating the sales order is throwing an error as material is not listed so the transaction is not possible.
    I have done the basic invetingation on the folowing aspects
    1)checking the material in the listing
    2)Validity periods
    3)Material not blcoked
    4)Mateial is extened for the respective sales org
    Kindly help ASAP.
    Thanks & Regards
    Tarakaram

    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

  • 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

  • Price is not being updated when creating a sales order using DTW oOrders

    Hello experts,
    When I create a sales Order using DTW (oOrders), the information in the input files document.csv and document_lines.csv is updated with no problem, except the price. The price is being ignored from the input files.
    Is there something that I must considered when trying to update the price of a sales order using the DTW?
    The field "price" was mapped in the source and target fields in DTW.
    Here is the document_lines.csv
    RecordKey,LineNum,AccountCode,Address,ItemCode,LineTotal,Price,Quantity,ShipDate,WarehouseCode,TaxCode
    RecordKey,LineNum,AccountCode,Address,ItemCode,LineTotal,Price,Quantity,ShipDate,WarehouseCode,TaxCode
    1,1,_SYS00000000059, ,30PA08-0360-25,1,11.2,3,20110702,V08,A5
    1,2,_SYS00000000059, ,30PA08-0707-25,1,15.2,3,20110702,V08,A5
    1,3,_SYS00000000059, ,30PA08-0707-22,1,18.3,3,20110702,V08,A5
    And the document.csv:
    RecordKey,DocEntry,CardCode,DocDate,DocDueDate,DocTotal
    RecordKey,DocEntry,CardCode,DocDate,DocDueDate,DocTotal
    1, ,c-6167,20110702,20110702,2
    Thank you for your help
    Jorge Manzo

    Hi,
    Try to re-create your dtw using my template,and use text tab when saving your template.
    SO-Header
    RecordKey     CardCode     CardName     Comments     DocDate     DocDueDate     DocNum
    RecordKey     CardCode     CardName     Comments     DocDate     DocDueDate     DocNum
    1     24-25 MANUFACTU     24-25 MANUFACTURING          4/5/2010     4/15/2010     11142
    SO-LINE
    RecordKey     linenum     itemcode     qty     uom      PriceAfterVAT      Price     SalesPersonCode
    RecordKey     linenum     itemcode     qty     uom      PriceAfterVAT      Price     SalesPersonCode
    1     0     SHAFT HEX 7/8"     1     pc     4536     4050     CRIS
    Note : Line -(LINE NUM and QTY is important upon computation of Price if SO is ITEM TYPE Document.
    hope this will help you!
    Regards,
    Darius

  • How to put the value in Header test while creating the sales order

    Hi ,
    I am creating the Sales order using the Idoc Orders05 .
    I have to pass the value in the header text 1. the value is a transaction id which is a string value.
    If anyone has an idea how to do this using the the Orders Idoc. it would be a great help
    Thanks
    Nikhil

    If you have access to idoc before calling the processing Function module, Adding header text segments E1EDKT1 and E1EDKT2 to the idoc will create the header text.
    Regards
    Sridhar

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • Creating a Sales Order using Web Dynpro

    Hi SDN,
      I want to create a Sales Order using Web Dynpro application. For that i have used "Bapi_Salesorder_Createfromdat2" as a adaptive RFC model. Every thing is fine and i could able to create a sales order for a single line item. But my intension is to create a sales order for multiple line items. So in the "Intialview" i have used a "Table" UI element to pass multiple line items. When i execute this application i could pass only single line item from this table. The table UI contol is not allowing to enter the second line item in the second row of the table. Can any one suggest me to solve this problem.
    Thanks in advance.
    Regards
    Basha

    Hi Basha,
    You need to create new element for the model node manually. For example: Create button "New item" and in action handler put someting like described here:
    Add row to table
    How to add more values in a Table in WD appl
    How to add a row to table dynamically?
    How to add a column to a table dynamically.
    add row to table bound to rfc model
    Best regards, Maksim Rashchynski.

  • FM SD_SALESDOCUMENT_CREATE  on creating a sales order using reference

    I create a sales order using a reference order number.On displaying it in VA02, and giving document flow, the reference document which I used to create the sales order gets displayed.
    A program/fm u2018Xu2019 is called on giving document flow (which takes the reference order number I used as input )
    Now if that u2018Xu2019 is getting the data of the reference order I used from some table u201CT_Yu201D.This table u201CT_Yu201D must be set during sales order creation itself. So, some program which is called during creation of sales order gets the reference order number I used as input and puts it in that table u201CT_Yu201D.
    My assumption is that SD_SALESDOCUMENT_CREATE is the function module handling that part. If it is not for that, then what is its function.
    *****If it is handling that part, which structure which this FM gets as input contains that order number which I used as reference?
    There are 3 bapiu2019s called on sales order creation, BAPI_SALESORDER_CREATEFROMDAT2, BAPI_SALESORDER_CREATEFROMDAT1, BAPI_SALESORDER_CREATEFROMDATA.
    Only one BAPI calls SD_SALESDOCUMENT_CREATE namely BAPI_SALESORDER_CREATEFROMDAT2
    *****Why does the FM SD_SALESDOCUMENT_CREATE not get triggered when I set a breakpoint in it during sales order creation?

    Please search in SDN so many thread related to create sales order

  • How to create a sales order using PO ALE Idoc

    Hi,
    I  have a purchase order in my ECC6 system, and output for this PO is ALE idoc.
    Now I want to create a Sales order using that Idoc in the same system,
    can anbody please tell the procedure
    sreeram

    Do NOT USE BAPI_SALESORDER_CREATEFROMDATA, that FM is obsolete!
    Use BAPI_SALESORDER_CREATEFROMDAT1 .
    To build a reference to your contract you have to supply ORDER_HEADER_IN.
    Here´s a sample:
    MOVE:
    gs_vbak-vbeln TO ls_bapisdhd1-refobjkey,
    gs_vbak-vbeln TO ls_bapisdhd1-ref_doc,
    gs_vbak-vbtyp TO ls_bapisdhd1-refdoc_cat,
    gs_vbak-auart TO ls_bapisdhd1-refdoctype.
    also gothrouh the links
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2b-%2bsimple%2bprogram%2bto%2bcreate%2bsales%2border%2busing%2bbapi

Maybe you are looking for

  • LG Vortex sending and recieving picture messages

    This is my first smartphone and I am to able to send or recieve picture messages. It just says sending or downloding but nothing happens. Can anhyone help me please?

  • Error while installing JRun3.1

    Hi, I got your mail id from forums.java.sun.com. After installing JRun3.1(Allaire) on Windows NT, the server is not started automatically. While starting the server mannually(Since it was not started automatically), throws an error saying "seever exi

  • "Network accounts un available"

    Hello Please, am stuck i have added my mybook pro to our windows domain, Now i cannot login. Be using the domain account or the local administrator accounts. The error generated is "Network Accounts un available"  Pleeeaaaaseee help

  • VMware-server: Any way to get this to work? Kernel issues! SOLVED

    Hi all, I am trying to get VMware server installed, but am having a lot of difficulty. According to multiple sources of information, I am told I need to install vmware-server-modules first. When I try to install, yaourt gives the following error: err

  • Ora- Error when trieing to run instanc ORABPEL-09207,ORA-01002:

    Hi, I receive following message when I try to run some process instance. What is going wrong? Is may be something in database wrong. Your test request generated the following exception/fault: ORABPEL-09207 The XML data is invalid. The XML data is inv