LSMW-BAPI Method sales order creation

Hi,
Please any one guide me to create sales order using bapi method.
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Jul 1, 2011 9:23 AM

Hi
USE AG German key word fro sold to part and check if there is any issue with leading zeros.Post if need more help . You can pass two record for one sales order in partner function. Please check that also.

Similar Messages

  • LSMW-BAPI Method sales contract creation

    Hi,
    I have a requirement to create sales contract through batch input or bapi method or idoc .
    Please let me know if there are any existing applicable methods for it.
    with regards,
    Bharath

    Business object BUS2034, method CreateFromData.
    There is no ALE interface delivered for this BAPI in our system but you might generate with transaction BDBG.
    Regards Jack

  • BAPI for Sales Order Creation.

    Hello gurus,
    I want to create a sales order using BAPI.
    I have tried some BAPI's like BAPI_SALESORDER_CREATEFROMDAT1, BAPI_SALESORDER_CREATEFROMDAT2, BAPI_SALESORDER_CREATEFROMDATA, BAPI_SALESDOCU_CREATEWITHDIA.
    But I am not able to update the Miscellaneous Information like Mode of transport(VBAP-OIC_MOT), Forwarding Agent(VBAP-OIC_LIFNR), Base Location(VBAP-OIA_BASELO), Truck Number(VBAP-OIC_TRUCKN), Pipeline trip No.(VBAP-OIC_PTRIP), Pipeline operator´s external batch number(VBAP-OIC_PBATCH).
    Is there any other BAPI thru which i can update these fields while creation of Sales Order.
    The Fields which I can provide to BAPI as import parameter is:
    Order Type(VBAK-AUART),
    Contract(VBAK_VGBEL),
    SALES Org (VBAK-VGORT),
    Dist Channel(VBAK-VTWEG),
    Division (VBAK-SPART),
    Open Quantity (VBAK-KWMENG)
    Plant(VBAP-WERKS)
    Storage Location (VBAP-LGORT)
    Mode of transport(VBAP-OIC_MOT), Forwarding Agent(VBAP-OIC_LIFNR), Base Location(VBAP-OIA_BASELO), Truck Number(VBAP-OIC_TRUCKN), Pipeline trip No.(VBAP-OIC_PTRIP), Pipeline operator´s external batch number(VBAP-OIC_PBATCH).
    Thanks In Advance,
    Points will be rewarded for Best Solution......
    Yogesh Sharma

    hi,
    I can give u a suggestion .. try it ..
    its a quite a long process....
    in BAPI_SALESORDER_CREATEFROMDAT2
    there is a table EXTENSIONIN...
    here u can add append structure and carry on ur sales order creation
    Follow the process
    Customer Enhancement for VBAK, VBAP, VBEP
    Description
    You can use this parameter to transfer user-specific enhancments to a BAPI. The customer has to complete the EXTENSION structure and the system automatically continues processing it. If you have not defined any user-specific fields, then you can transfer a blank EXTENSIONIN structure.
    Technical information about Customer Enhancements
    The following description uses an example to explain how to proceed with customer enhancements to the SD tables VBAK, VBKD, VBAP and VBEP.
    The customer has added their own fields to table VBAP using the INCLUDE structure CUTEST. This structure contains 2 fields:
    CFIELD1, CHAR 10
    CFIELD2, CHAR 3.
    The customer also requires that these two fields can be maintained with the BAPI.
    1. Maintain structure CUTEST in table VBAP
    2. Because the BAPIs work with checkboxes, you must also define a CUTESTX checkbox for the customer structure. It should be structured like this:
    Field name       Data element
    CFIELD1            CHAR1
    CFIELD2          CHAR1
    3. Define these customer structures in the structures VBAPKOZ und VBAPKOZX using INCLUDE or APPEND.
    4. Add the customer structures to the BAPE_VBAP and BAPE_VBAPX BAPI structures using the APPEND technique.
    5. Adjust the following structures for customer enhancements to table VBAK:
    a) VBAKKOZ
    b) VBAKKOZX
    c) BAPE_VBAK
    d) BAPE_VBAKX
    6. Adjust the following structures for customer enhancements to table VBEK:
    a) VBEPKOZ
    b) VBEPKOZX
    c) BAPE_VBEP
    d) BAPE_VBEPX
    7. Generally, the data should be added to the BAPI interface in the internal communication structures (VBAKKOM, and so on). There, you can process the data in the SD tables (VBAK, and so on).
    8. If the EXTENSIONIN parameter contains customer data, you must complete at least the key fields in the relevant standard parameters.
    For example:
    You want to change customer field VBAP-CFIELD2 for item 20 to "XYZ" in order 4711.
    The following entries are expected:
    Import:     BAPIVBELN-VBELN       = '0000004711'  Document number
                BAPISDHD1X-UPDATEFLAG = 'U'           UPDKZ for doc header
    Tables:     BAPISDITM-ITM_NUMBER  = '000020'      Item number
                BAPISDITMX-ITM_NUMBER = '000020'      Item number
              + BAPISDITMX-UPDATEFLAG = 'U'           UPDKZ for item
    You must complete the EXTENSION table as follows:
    STRUCTURE                          VALUEPART1       1234561234567890123
    BAPE_VBAP                       0000004711000020                 XYZ
    BAPE_VBAPX                      0000004711000020       X
    Further Information
    You can find more information in the BAPI programming guide in the chapter for enhancements to BAPIs.
    Notes
    You must complete the STRUCTURE field with the name of the relevant enhancement structure (BAPE_VBAK, BAPE_VBAP, BAPE_VBEP). You can complete the remaining fields with the append structures from the enhancement structures.
    At the moment, you can use the BAPI to store enhancements in the following structures:
    VBAK : An enhancement to header data requires an append structure to BAPE_VBAK and an enhancement to structure VBAKKOZ.
    VBAP : An enhancement to item data requires an append structure to BAPE_VBAP and an enhancment to structure VBAPKOZ.
    VBEP : An enhancement to schedule line data requires an append structure to BAPE_VBEP and an enhancement to structure VBEPKOZ.
    VBKD : If you are using an enhancement for header data, you must add an append structure to BAPE_VBAK. You also need to enhance structure VBAKKOZ. If it is for item data, you need to add an append structure to BAPE_VBAP. You must also enhance structure VBAPKOZ.
    If you also want to work with checkboxes, each X-structure must also contain an append structure.
    For example:
    A customer has created an order and wants to include the material long text (50 digits long).
    The EXTENSIONIN structure must be completed with BAPE_VBAP. Two fields have fixed definitions in this structure. These are in the VBAP host key (VBELN, POSNR). The customer sets up an append structure that contains field ZMAT50.
    Because the VBELN is normally blank when you create an order, the data can look like this:
    STRUCTURE   |BAPE_VBAP
    VALUEPART1  |          000010Customermateriallongtext50
                  VBELN     POSNR ZMAT50

  • Regarding bapis for sales order creation and modification

    Hi,
    I am trying to create a syncbo for sales order creation, modification and display. The bapis that I am using are
    1.BAPI_SALESORDER_GETLIST
    2.BAPISDORDER_GETDETAILEDLIST
    3.BAPI_SALESORDER_CREATEFROMDATA1
    4. BAPI_SALESORDER_CHANGE
    Am I using the correct bapis. When I tried to create a syncbo it gave the following errors
    BAPISDORDER_GETDETAILEDLIST does not have RETURN parameter in export or tables parameter
    RETURN parameter in Create BAPI Wrapper should refer to structure BAPIRET2
    RETURN parameter in GetList BAPI Wrapper should refer to structure BAPIRET2
    GetDetail BAPI Wrapper does not have RETURN parameter in export or tables parameter
    No Export parameter referring to header structure exists in GetDetail BAPI Wrapper
    No Import parameter referring to header structure exists in Create BAPI Wrapper
    No Import parameter referring to header structure exists in Modify BAPI Wrapper
    No Import parameter referring to a field of header structure exists in GetDetail BAPI Wrapper
    No Export parameter referring to a field of header structure exists in Create BAPI Wrapper
    No Tables parameter referring to item structure exists in Create BAPI Wrapper
    No Tables parameter referring to item structure exists in Modify BAPI Wrapper
    I am informed that the above bapis are standard bapis.
    I am not sure as to why I am getting the errors.
    Does the syncbo require the  bapi's to be in a specific format.
    What would be the header and item structures for sales order bapis
    Regards
    Raja Sekhar

    Hi Raja,
      ya , for creating Sync BOs ,our BAPI wrappers must satisfy certain conditions..
    just go through this link.
    u can use the standard BAPIs of SALES Order in ur Custom BAPI Wrapper
      http://media.sdn.sap.com/public/html/submitted_docs/MI/MDK_2.5/content/appdev/smartsync/what_is_a_bapi_wrapper.html
    the RETURN must be of type BAPIRET2..
                    Regards
                    Kishor Gopinathan

  • LSMW BAPI Open Sales Order Load - How to update conditions?

    Hello gurus,
    I was using the BAPI SALESORDER_CREATEFROMDAT2 to upload open sales orders. Wanted to overwrite the default PR00 pricing condition that gets pulled from the customer-material info record, with the price that was existing in the original legacy system when the order was created there. Used the E1BPCOND structure in the Idoc, but since there is no such thing as a E1BPCONDX structure(corresponding to the structure BAPICONDX in the origial BAPI) where you could specify whether the condition should be updated, added or deleted, it adds a second PR00 condition with the legacy system price. The original PR00 condition with the customer-material record price still stays there. Eventhough the order seems to be taking into consideration only the second one I added, to determine the total pricing, I am worried the original sitting there, might cause problems down the document flow. Is there a way to update the existing PR00 condition(rather than adding a new one) on the order, through some flag in the Idoc structure that I am not aware of?
    Would greatly appreciate an answer ASAP.
    Thanks a lot in advance,
    Wayfarer

    Thanks and appreciate your taking your time to reply, Gerard, I guess my problem is, we are still on 46C, and the only message type available for this BAPI is SALESORDER_CREATEFROMDAT201. Just called a friend who is on ECC 60 who confirmed that the later version of this message type, SALESORDER_CREATEFROMDAT202 has the E1BPCONDX structure. I don't have that option since on LSMW it automatically defaults to the only message type(and method CREATEFROMDAT2) that is available, when you choose business object BUS2032. Guess I am out of luck, unless you have any other options to suggest.
    Thanks,
    Wayfarer

  • BAPI for Sales Order Creation from Third-party Application

    Hi,
    I need to create a Sales order in a SAP system from a third-party applications. Please provide the list of BAPIs/Interfaces that are involved in creation of Sales Order.

    Hi,
    Check this link, explains step by step.
    http://abaplovers.blogspot.com/2008/02/bap-sales-order-create.html
    Thanks,
    Krishna

  • BAPI for sales order creation with Reference

    Hello Experts,
    I have a order, with its reference I have to create a new sales order.
    Am looking for BAPi, with which I can create a sales order with a Reference order (which is in my hand), so I checked SE37 with wild cards, but I did not find any!!
    1) Pls. let me know a BAPI
    2) And just like that I do not want to create a new order with the reference(existing) order, I have to change the PO number & order Reason(2 fileds) in newley creationg order, pls. let me know How to do it
    Thank you

    Hi,
    First try to pass these two parameters to BAPI_SALESORDER_CREATEFROMDAT2
    ORDER_HEADER_IN-REFDOCTYPE = Your Sch. Agreement No. (Please Check) and
    ORDER_HEADER_IN-SD_DOC_CAT = 'E'.
    If the above doesnt work ,than try using BAPI "BAPI_SALESDOCUMENT_COPY"
    I hope you are working in SAP R/3 4.6C and above version because i am not sure whether this BAPI is available in lower version.
    Let us know if this helps you..
    Rgds,
    Mayank

  • Reg:BAPI for sales order creation

    Dear All,
    I am not able to populate  Order Quantity in Sales Oder
    from bapi BAPI_SALESORDER_CREATEFROMDAT2
    in which structure the order quantity field will be there.
    In the structure BAPISDITM there is a field TARGET_QTY but it is not  populeting in Cumulative Order Quantity in Sales Units.
    In the structure BAPISCHDL there is a field REQ_QTY
    is it Cumulative Order Quantity in Sales Units.
    please can you tell me which is the field for Order Quantity througn bapi in BAPI_SALESORDER_CREATEFROMDAT2.
    thanks
    mars

    Pass the quantity in ORDER_SCHEDULES_IN-REQ_QTY.  Also update the field ORDER_SCHEDULES_INX-REQ_QTY with value 'X'.
    Regards
    Vinod

  • Need to create z bapi for sales order creation

    Hi
    We are having some showrooms which are running on some other platform. All their sales files come to us through net. so we have to upload all those sales in SAP. So I want to know whether we can create a Bapi like "create_sales_order_from_data2".
    to upload all the file and do all tyhe rquired coding for fetching sales area etc in source code.
    Thanks

    Hai,
    Yes you can create ZBAPI ...if the standard is not matching your requirement.
    There are plently of material available on how to create custom BAPIs
    But instead of doing all that hard work....try to use the standard one.
    jeevan

  • Userexit in BAPI sales order creation

    HI all,
      My requirement is one SERIALNUMBER field add BAPI salesorder creation.
    That field not existed in satndard BAPI structures.BAPI input XML file.
    Salesorder>extras(menu)>Technical object->serialmumber[RIPW0SERNR).
    please give any enhancement serial number  BAPI sales order creation.
    Thanks.
    Edited by: sreddy GPs on Sep 23, 2008 5:59 AM

    Hello,
             Whatever the Structure that you are refering to in the BAPI for Sales Order Creation, use an Append Structure to add the SERIALNUMBER field to the existing Standard BAPI Structure.
    For your information, the following are the BAPIs that can be used for Sales Order Creation.
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_SALESORDER_CREATEFROMDAT2
    BAPI_SALESORDER_CREATEFROMDATA
    BAPI_SALESORDER_CREATEBOS
    Hope it would serve your purpose.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • LSMW -BAPI method

    hi frndz..
    I am trying LSMW - BAPI method for PO creation.
    in have done 7 steps upto "assign file"
    But system is not reading line item data.
    it is reading header data only...
    I want to knw, what should i have in my file, that system will read both data's.
    or provide the file contents.
    njoy SAP..
    njoy Lyf..
    Regards,
    Amit P Hiran

    Check these LSMW links, you might get what you are looking for
    http://www.sap123.com/showthread.php?t=98
    http://help.sap.com/saphelp_erp2004/helpdata/en/7f/b6f45805b111d2b41c006094b944c8/content.htm
    http://www.mydatabus.com/visitor.php?pt=downloadFile&tc=6289701541332&cl=53&cn=000003&uid=6659
    http://www.erpgenie.com/sap/saptech/lsmw.htm
    /people/hema.rao/blog/2006/09/14/lsmw--step-by-step
    http://www.sap-img.com/sap-data-migration.htm
    http://www.erpgenie.com/sap/saptech/lsmw.htm
    http://www.allsaplinks.com/lsmw.html
    http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc

  • Get condition prices before sales order creation

    Hi Experts,
    I have a non-SAP system which needs price information from SAP.
    As we know, in SAP after Sales order creation, the prices can be found in item condition tabs. All condition records and prices can be found.
    Now, before the non-SAP system sends data to SAP for sales order creation, non-SAP needs the condition record and prices same as after sales order creation.
    seems i have to write code in SAP for the logic of price determination. i assume that will be a big work.
    so i'm supposing whether we can get the condition from the bapi for sales order creation. i can mask testrun = 'X', then get the conditions. but i tried creating sales order in code and found the condition - ORDER_CONDITIONS_IN is not populated.
    anyone got a idea to solve this?
    Thanks a lot.
    Legend Lee.

    Hi,
    If you run the BAPI under the same conditions but without the text flag checked do you get anything returned? Are there any messages in the RETURN table?
    There are a number of OSS notes on this BAPI e.g. 93091 if you search on service.sap.com. The answer may lie in the pricing configuration; that the BAPI is not designed to work how you want it to work or a parameter has not been specified correctly.  You could look at FM SD_SALESDOCUMENT_CREATE and try and use that however it is not released. Unfortunately I canu2019t give you a definitive answer or solution.
    Regards, David

  • LSMW Sales Order creation using Bapi method

    Hi folks ,
    iam doing Lsmw bapimethod ,sales order creation .In the step start idoc processing iam getting error "Has Not been Accepted for Processing ",why iam not getting plz let me know points will be awarded for all answers .

    Hi,
              You need to set the IDOC settings in the initial LSMW screen. It will be there in menu path.
           Award points if helpful
    Regards,
    RamaKrishna C

  • LSMW-BAPI Sales order creation

    Hi All,
    I was trying to create sales order through the LSMW BAPI method.
    For the first line item i'm getting the correct quantity that i''m passing.
    But from second line item onwards quantity field is appearing as 0 (zero) even though i pass the different quantity values.
    i'm assiging the quantity to the REQ_QTY field in the schedule line items structure.
    Please suggest any solution for this.
    Thanking you.
    with regards,
    Bharath

    Hi,
    Can u tell me the steps to create a sales order using idoc, i've created a bapi but thats a temprory use. I wanted to created a sales order automatically when a purchase order is saved.
    Please let me know if u can help me, i wanted to do it using idoc
    Regards
    Sanju

  • Sales order creation with bapi in webdynpro using table control

    When i use table control to update the line items only first row is getting updated in the sale order creation and the loop is not updating the other row to header only the first row is getting saved, for the same set of data sale order is getting created in va01 for multiple line items. Pls give me some idea to resolve this issue, here is the code i am using for creating sale order using bapi 'BAPI_SALESORDER_CREATEFROMDAT2' method CREATE_SALES_ORDER .
    Declaration for Order Header Node DATA: node_order_header TYPE REF TO if_wd_context_node, elem_order_header TYPE REF TO if_wd_context_element, stru_order_header TYPE if_componentcontroller=>element_order_header . * Declaration for Order Items Node DATA: node_order_items TYPE REF TO if_wd_context_node, elem_order_items TYPE REF TO if_wd_context_element, stru_order_items TYPE if_componentcontroller=>element_order_items . * Declaration for Order Partners Node DATA: node_order_partners TYPE REF TO if_wd_context_node, elem_order_partners TYPE REF TO if_wd_context_element, stru_order_partners TYPE if_componentcontroller=>element_order_partners . node_order_header = wd_context->get_child_node( name = if_componentcontroller=>wdctx_order_header ). elem_order_header = node_order_header->get_element( ). elem_order_header->get_static_attributes( IMPORTING static_attributes = stru_order_header ). * via lead selection node_order_items = wd_context->get_child_node( name = if_componentcontroller=>wdctx_order_items ). elem_order_items = node_order_items->get_element( ). elem_order_items->get_static_attributes( IMPORTING static_attributes = stru_order_items ). * via lead selection node_order_partners = wd_context->get_child_node( name = if_componentcontroller=>wdctx_order_partners ). elem_order_partners = node_order_partners->get_element( ). elem_order_partners->get_static_attributes( IMPORTING static_attributes = stru_order_partners ). DATA: v_sales_doc TYPE bapivbeln-vbeln. DATA: w_order_header_in TYPE bapisdhd1, i_order_header_in TYPE table of bapisdhd1," i_order_partners TYPE TABLE OF bapiparnr, w_order_partners TYPE bapiparnr, i_return TYPE TABLE OF bapiret2, w_return TYPE bapiret2, i_order_items_in TYPE TABLE OF bapisditm, w_order_items_in TYPE bapisditm, i_order_conditions_in TYPE TABLE OF bapicond, w_order_conditions_in TYPE bapicond, w_order_SCHDL type BAPISCHDL, i_order_SCHDL type table of BAPISCHDL. * Order Header Details CLEAR: w_order_header_in, i_order_partners, i_return, i_order_items_in, i_order_conditions_in, w_order_SCHDL, i_order_SCHDL. refresh : i_order_partners, i_return, i_order_items_in, i_order_conditions_in, i_order_SCHDL. w_order_header_in-doc_type = stru_order_header-doc_type. w_order_header_in-sales_org = stru_order_header-sales_org. w_order_header_in-distr_chan = stru_order_header-distr_chan. w_order_header_in-division = stru_order_header-division. w_order_header_in-req_date_h = stru_order_header-req_date_h. w_order_header_in-sales_dist = stru_order_header-sales_dist. w_order_header_in-purch_no_c = stru_order_header-purch_no_c. * Order Item Details CLEAR: i_order_items_in,w_order_items_in. * w_order_items_in-itm_num = stru_order_items-itm_num. w_order_items_in-ITM_NUMBER = stru_order_items-ITM_NUMBER. w_order_items_in-material = stru_order_items-material. w_order_items_in-target_qty = stru_order_items-target_qty."'5'. w_order_items_in-target_qu = stru_order_items-target_qu."'5'. w_order_items_in-plant = stru_order_items-plant. w_order_items_in-target_val = stru_order_items-target_val. w_order_items_in-currency = stru_order_items-currency. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = w_order_items_in-material IMPORTING output = w_order_items_in-material. APPEND w_order_items_in TO i_order_items_in. * Order Partner Details CLEAR: i_order_partners,w_order_partners. w_order_partners-partn_role = stru_order_partners-partn_role. w_order_partners-partn_numb = stru_order_partners-partn_numb. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = w_order_partners-partn_numb IMPORTING output = w_order_partners-partn_numb. APPEND w_order_partners TO i_order_partners. * Order Condition Details w_order_SCHDL-ITM_NUMBER = stru_order_items-itm_number." '000010'. w_order_SCHDL-req_qty = stru_order_items-target_qty." '5'. APPEND w_order_SCHDL to i_order_SCHDL. * Create Sales Order BAPI Call *loop at i_order_header_in into w_order_header_in. CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2' EXPORTING order_header_in = w_order_header_in IMPORTING salesdocument = v_sales_doc TABLES return = i_return order_items_in = i_order_items_in order_partners = i_order_partners order_schedules_in = i_order_SCHDL order_conditions_in = i_order_conditions_in. * Get message manager DATA: l_current_controller TYPE REF TO if_wd_controller, l_message_manager TYPE REF TO if_wd_message_manager. l_current_controller ?= wd_this->wd_get_api( ). CALL METHOD l_current_controller->get_message_manager RECEIVING message_manager = l_message_manager. DATA: v_message_text TYPE string. * When Sales Order is created commit the data IF NOT v_sales_doc IS INITIAL. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. CONCATENATE 'Sales Document' v_sales_doc 'has been created.' INTO v_message_text SEPARATED BY space. * Report Success message CALL METHOD l_message_manager->report_success EXPORTING message_text = v_message_text. ELSE. v_message_text = 'Error Creating Sales Order'. * Report Error message CALL METHOD l_message_manager->report_error_message EXPORTING message_text = v_message_text. ENDIF. *endloop. endmethod. and code for table control i am using is method WDDOINIT . Types : Begin of item_tab, itm_number type bapisditm-itm_number, material type bapisditm-material, plant type bapisditm-plant , target_qty type bapisditm-target_qty, target_qu type bapisditm-target_qu, target_val type bapisditm-target_val, currency type bapisditm-currency, end of item_tab. *Creating internal table and Work Area of the same structure *as that of the Node created. Data : it_item type standard table of item_tab, wa_item type item_tab. *Appending Blank Work Area to Internal table. ***********************************************888 *LOOP AT it_item INTO wa_item. **wa_item-itm_number to bapisditm-itm_number. **wa_item-material to bapisditm-material. **wa_item-plant to bapisditm-plant. **wa_item-target_qty to bapisditm-target_qty. **wa_item-target_qu to bapisditm-target_qu. **wa_item-target_val to bapisditm-target_val. **wa_item-currency to bapisditm-currency. ** * APPEND wa_item TO it_item. *ENDLOOP. **********************************************88 ******** Do 10 times. Append wa_item to it_item. enddo. ********* "Binding the table DATA lo_nd_order_items TYPE REF TO if_wd_context_node. * DATA lt_material TYPE wd_this->Elements_material. * navigate from to via lead selection lo_nd_order_items = wd_context->get_child_node( name = wd_this->wdctx_order_items ). * @TODO handle non existant child * IF lo_nd_material IS INITIAL. * ENDIF. ** @TODO compute values ** e.g. call a model function * lo_nd_order_items->bind_table( new_items = it_item set_initial_elements = abap_true ). endmethod.

    DATA: node_order_header TYPE REF TO if_wd_context_node, elem_order_header TYPE REF TO if_wd_context_element, stru_order_header TYPE if_componentcontroller=>element_order_header . * Declaration for Order Items Node DATA: node_order_items TYPE REF TO if_wd_context_node, elem_order_items TYPE REF TO if_wd_context_element, stru_order_items TYPE if_componentcontroller=>element_order_items . * Declaration for Order Partners Node DATA: node_order_partners TYPE REF TO if_wd_context_node, elem_order_partners TYPE REF TO if_wd_context_element, stru_order_partners TYPE if_componentcontroller=>element_order_partners . node_order_header = wd_context->get_child_node( name = if_componentcontroller=>wdctx_order_header ). elem_order_header = node_order_header->get_element( ). elem_order_header->get_static_attributes( IMPORTING static_attributes = stru_order_header ). * via lead selection node_order_items = wd_context->get_child_node( name = if_componentcontroller=>wdctx_order_items ). elem_order_items = node_order_items->get_element( ). elem_order_items->get_static_attributes( IMPORTING static_attributes = stru_order_items ). * via lead selection node_order_partners = wd_context->get_child_node( name = if_componentcontroller=>wdctx_order_partners ). elem_order_partners = node_order_partners->get_element( ). elem_order_partners->get_static_attributes( IMPORTING static_attributes = stru_order_partners ). DATA: v_sales_doc TYPE bapivbeln-vbeln. DATA: w_order_header_in TYPE bapisdhd1, i_order_header_in TYPE table of bapisdhd1," i_order_partners TYPE TABLE OF bapiparnr, w_order_partners TYPE bapiparnr, i_return TYPE TABLE OF bapiret2, w_return TYPE bapiret2, i_order_items_in TYPE TABLE OF bapisditm, w_order_items_in TYPE bapisditm, i_order_conditions_in TYPE TABLE OF bapicond, w_order_conditions_in TYPE bapicond, w_order_SCHDL type BAPISCHDL, i_order_SCHDL type table of BAPISCHDL. * Order Header Details CLEAR: w_order_header_in, i_order_partners, i_return, i_order_items_in, i_order_conditions_in, w_order_SCHDL, i_order_SCHDL. refresh : i_order_partners, i_return, i_order_items_in, i_order_conditions_in, i_order_SCHDL. w_order_header_in-doc_type = stru_order_header-doc_type. w_order_header_in-sales_org = stru_order_header-sales_org. w_order_header_in-distr_chan = stru_order_header-distr_chan. w_order_header_in-division = stru_order_header-division. w_order_header_in-req_date_h = stru_order_header-req_date_h. w_order_header_in-sales_dist = stru_order_header-sales_dist. w_order_header_in-purch_no_c = stru_order_header-purch_no_c. * Order Item Details CLEAR: i_order_items_in,w_order_items_in. * w_order_items_in-itm_num = stru_order_items-itm_num. w_order_items_in-ITM_NUMBER = stru_order_items-ITM_NUMBER. w_order_items_in-material = stru_order_items-material. w_order_items_in-target_qty = stru_order_items-target_qty."'5'. w_order_items_in-target_qu = stru_order_items-target_qu."'5'. w_order_items_in-plant = stru_order_items-plant. w_order_items_in-target_val = stru_order_items-target_val. w_order_items_in-currency = stru_order_items-currency. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = w_order_items_in-material IMPORTING output = w_order_items_in-material. APPEND w_order_items_in TO i_order_items_in. * Order Partner Details CLEAR: i_order_partners,w_order_partners. w_order_partners-partn_role = stru_order_partners-partn_role. w_order_partners-partn_numb = stru_order_partners-partn_numb. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = w_order_partners-partn_numb IMPORTING output = w_order_partners-partn_numb. APPEND w_order_partners TO i_order_partners. * Order Condition Details w_order_SCHDL-ITM_NUMBER = stru_order_items-itm_number." '000010'. w_order_SCHDL-req_qty = stru_order_items-target_qty." '5'. APPEND w_order_SCHDL to i_order_SCHDL. * Create Sales Order BAPI Call *loop at i_order_header_in into w_order_header_in. CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2' EXPORTING order_header_in = w_order_header_in IMPORTING salesdocument = v_sales_doc TABLES return = i_return order_items_in = i_order_items_in order_partners = i_order_partners order_schedules_in = i_order_SCHDL order_conditions_in = i_order_conditions_in. * Get message manager DATA: l_current_controller TYPE REF TO if_wd_controller, l_message_manager TYPE REF TO if_wd_message_manager. l_current_controller ?= wd_this->wd_get_api( ). CALL METHOD l_current_controller->get_message_manager RECEIVING message_manager = l_message_manager. DATA: v_message_text TYPE string. * When Sales Order is created commit the data IF NOT v_sales_doc IS INITIAL. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. CONCATENATE 'Sales Document' v_sales_doc 'has been created.' INTO v_message_text SEPARATED BY space. * Report Success message CALL METHOD l_message_manager->report_success EXPORTING message_text = v_message_text. ELSE. v_message_text = 'Error Creating Sales Order'. * Report Error message CALL METHOD l_message_manager->report_error_message EXPORTING message_text = v_message_text. ENDIF. *endloop. endmethod. and code for table control i am using is method WDDOINIT . Types : Begin of item_tab, itm_number type bapisditm-itm_number, material type bapisditm-material, plant type bapisditm-plant , target_qty type bapisditm-target_qty, target_qu type bapisditm-target_qu, target_val type bapisditm-target_val, currency type bapisditm-currency, end of item_tab. *Creating internal table and Work Area of the same structure *as that of the Node created. Data : it_item type standard table of item_tab, wa_item type item_tab. *Appending Blank Work Area to Internal table. ***********************************************888 *LOOP AT it_item INTO wa_item. **wa_item-itm_number to bapisditm-itm_number. **wa_item-material to bapisditm-material. **wa_item-plant to bapisditm-plant. **wa_item-target_qty to bapisditm-target_qty. **wa_item-target_qu to bapisditm-target_qu. **wa_item-target_val to bapisditm-target_val. **wa_item-currency to bapisditm-currency. ** * APPEND wa_item TO it_item. *ENDLOOP. **********************************************88 ******** Do 10 times. Append wa_item to it_item. enddo. ********* "Binding the table DATA lo_nd_order_items TYPE REF TO if_wd_context_node. * DATA lt_material TYPE wd_this->Elements_material. * navigate from to via lead selection lo_nd_order_items = wd_context->get_child_node( name = wd_this->wdctx_order_items ). * @TODO handle non existant child * IF lo_nd_material IS INITIAL. * ENDIF. ** @TODO compute values ** e.g. call a model function * lo_nd_order_items->bind_table( new_items = it_item set_initial_elements = abap_true ). endmethod.

Maybe you are looking for

  • ORACLE Tags in Dynamic Pages

    In the beta version, a Dynamic Page could be developed that did not contain the Oracle tags, <ORACLE> and </ORACLE>. The production version appears to require the use of these tags. I've tried to work around this by using <ORACLE> select ' ' from dua

  • How do i make safari remember my zoom preferences.

    I own the 17" and is really not great to see when i open a website and see all the waisted real estate at the sides of the web pages, here i attach several screenshoot of several websites. file://localhost/Users/apple/Desktop/Screen%20Shot%202011-11-

  • Read Table ITAB with key Dynamic Value index 1

    Here is sample Intenral table Columnname-C01 / C02 / C03 Value-123 / 456 /789 I would like to search value of the internal table according to dynamic value given by the code. i.e. read table ITAB with key <Dynamic Value> index 1.

  • Mozilla to phase out non-secure HTTP

    Mozilla has announced its intent to phase out all use of "standard" HTTP, replacing it by the (more-)secure HTTPS.   This involves: Setting a date after which all "new" features will be available only to secure websites Gradually phasing out access t

  • HT201274 erase ipad when I do not know my Restrictions Passcode?

    can I erase all content on ipad when I do not know my restrictions code?  How?