LSMW to create Sales Order using direct input RVINVB10

Hi,
I need advise on 2 parts of Sales Order creation using direct input program RVINVB10.
1) How do I enter the WBS Element PS_POSID in the item line of Account Assignment tab? There does not seem to be a field in the direct input program structure to fill this in.
2) How can I fill in item tab 'Billing Plan' that appears only when Item Category = 'Milestone Billing'?
Thanks

Nandan,
Please go through the documentation of the BAPI. It gives you details of what needs to be filled in in which structure/parmater. Also, read the documentation associated with each structure, that will tell what to fill.
It is really hard to explain it in simple terms as to what are required. But, you need the header, items and partners at the minimum. Also, with some of these structures there are also 'X' structures(like ORDER_ITEMS_INX for ORDER_ITEMS_IN) which should also be filled based on what fields you filled in the original structure. For example, if you filled 'MATERIAL' field on the ORDER_ITEMS_IN structure, you should also fill in the same field on the ORDER_ITEMS_INX structure with an 'X' in it.
All this is well documented in the BAPI.
Srinivas

Similar Messages

  • Create Sales Order using IDoc

    Hi All,
    Based upon customer's input file which contains header and line item details I have to create sales order in our system. We would like to use IDoc for this. Customer will send us file once a day by email or FTP.
    For this I have created a port and partner profile but I am not sure how the process will get initiated?
    Can someone please let me know how can I do this? There is now outbound process involved, I just need to create sales order based upon input file using IDoc.
    Regards,
    Sanjay

    HI,
    You cannot directly call the function modules that process the idoc, because these functions are called dynamically by the ALE layer and the function expects data in a certian format (IDoc format ).
    BAPI would be the best way to go for your scenario.
    However there is a workaround if you want to use IDoc only. You can follow this approach :
    1. Populate an outbound ORDERS05 IDoc from the file data.
    2. Distribute it to the same system, i.e sender system and receiver system is same.
    3. On the Inbound side the Idoc that you created on the outbound side will be received and processed.
    "R3  File----->Outound ORDRES05  -----
    ______________________________________|
    |
    '------> " Inbound ORDERS05 ( in the same R3 system)
    The tricky part is sending an Idoc and receiving in the same system, but you can find how to do this on the wiki pages.
    regards,
    Advait

  • Creating sales order using bapi

    while creating sales order using bapi serial no is added in dat but its not saving.
    plz reply

    Hi
    See tha sample code for sales order creation
    SALES ORDER INPUT CREATION.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    PARAMETERS: p_spart TYPE vtweg OBLIGATORY.
    PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
    PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
    *ITEM
    PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
    PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    PARAMETERS: p_itcat TYPE pstyv OBLIGATORY.
    DATA DECLARATIONS.
    DATA: v_vbeln LIKE vbak-vbeln.
    DATA: header LIKE bapisdhead1.
    DATA: headerx LIKE bapisdhead1x.
    DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
    DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
    DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
    WITH HEADER LINE.
    DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
    WITH HEADER LINE.
    HEADER DATA
    header-doc_type = p_auart.
    headerx-doc_type = 'X'.
    header-sales_org = p_vkorg.
    headerx-sales_org = 'X'.
    header-distr_chan = p_vtweg.
    headerx-distr_chan = 'X'.
    header-division = p_spart.
    headerx-division = 'X'.
    headerx-updateflag = 'I'.
    PARTNER DATA
    partner-partn_role = 'AG'.
    partner-partn_numb = p_sold.
    APPEND partner.
    partner-partn_role = 'WE'.
    partner-partn_numb = p_ship.
    APPEND partner.
    ITEM DATA
    itemx-updateflag = 'I'.
    item-itm_number = '000010'.
    itemx-itm_number = 'X'.
    item-material = p_matnr.
    itemx-material = 'X'.
    item-plant = p_plant.
    itemx-plant = 'X'.
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    item-target_qu = 'EA'.
    itemx-target_qu = 'X'.
    item-item_categ = p_itcat.
    itemx-item_categ = 'X'.
    APPEND item.
    APPEND itemx.
    Fill schedule lines
    lt_schedules_in-itm_number = '000010'.
    lt_schedules_in-sched_line = '0001'.
    lt_schedules_in-req_qty = p_menge.
    APPEND lt_schedules_in.
    Fill schedule line flags
    lt_schedules_inx-itm_number = '000010'.
    lt_schedules_inx-sched_line = '0001'.
    lt_schedules_inx-updateflag = 'X'.
    lt_schedules_inx-req_qty = 'X'.
    APPEND lt_schedules_inx.
    Call the BAPI
    CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    EXPORTING
    sales_header_in = header
    sales_header_inx = headerx
    IMPORTING
    salesdocument_ex = v_vbeln
    TABLES
    return = return
    sales_items_in = item
    sales_items_inx = itemx
    sales_schedules_in = lt_schedules_in
    sales_schedules_inx = lt_schedules_inx
    sales_partners = partner.
    Check the return table.
    LOOP AT return WHERE type = 'E' OR type = 'A'.
    EXIT.
    ENDLOOP.
    IF sy-subrc = 0.
    WRITE: / 'Error in creating document'.
    ELSE.
    COMMIT WORK AND WAIT.
    WRITE: / 'Document ', v_vbeln, ' created'.
    ENDIF.
    after that check in the table VBAP whether serial number is cretaed or not
    Reward points if useful
    Regards
    Anji

  • Creating sales order using ' BAPI_SALESORDER_CREATEFROMDAT1'

    Hi ,
    i have a problem in creating sales order using ' BAPI_SALESORDER_CREATEFROMDAT1 '  .
    order number is created and every thing unless the order quantity isn't created for material item .
    my inputs are .
    in "ORDER_HEADER_IN"
    (DOC_TYPE , SALES_ORG , DISTR_CHAN , DIVISION ,SALES_OFF )
    in " ORDER_ITEMS_IN"
    (MATERIAL ,PLANT ,REQ_QTY  )
    in "ORDER_PARTNERS"
    (PARTN_ROLE , PARTN_NUMB)
    so the order created but as i say the the order quqntity isn't created for the material  so the "net value and maertial net valve )
    aren't calcoluted .
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    waiting .
    thanks for all
    Edited by: Rob Burbank on Jan 7, 2011 4:28 PM

    Hi Mr. Ahmed Tohamy,
    my point is just create a schedule line with each item line. The relevant code we used was (excerpt)
    perform bapi_map_filled using:
          lv_matnr      'MATERIAL'   space
            changing ls_in    ls_inx,
          lv_tax_class1 'TAX_CLASS1' gc_true
            changing ls_in    ls_inx,
          lv_qty        'TARGET_QTY' space
            changing ls_in    ls_inx, "QTY to item line
          lv_qty        'REQ_QTY'    space
            changing ls_schdl ls_schdlx,"QTY to schedule line
          lv_itm_number 'ITM_NUMBER' space
            changing ls_in    ls_dummy,
          lv_itm_number 'ITM_NUMBER' space
            changing ls_schdl ls_dummy,
          lv_ref_doc_ca 'REF_DOC_CA' space
            changing ls_in    ls_inx,
          lv_orderid    'ORDERID'    space
            changing ls_in    ls_inx,
          lv_ref_doc    'REF_DOC'    space
            changing ls_in    ls_inx.
        append:
          ls_in       to pt_order_items_in,
          ls_inx      to pt_order_items_inx,
          ls_schdl    to pt_order_schdl,
          ls_schdlx   to pt_order_schdlx.
    Here the quantity is put to item line and schedule line, we always mark the correspoing X structure fields:
    *&      Form  bapi_map_filled
    *       if the value passed is not initial, it is moved to the field
    *       and the corresponding (BAPI-) X-field is marked
    *       if no x-structure is required, a dummy structure is passed
    *       if p_initial parameter is filled, initial fields will be marked
    *       in x-structure. Purpose: transfer of initial values to BAPI
    form bapi_map_filled using    p_value      type any
                                  p_fieldname  type fieldname
                                  p_initial    type flag
                         changing p_structure  type any
                                  p_structurex type any.
      field-symbols:
        <any> type any,
        <c>   type c.
      check:
         not ( p_value is initial and p_initial is initial ).
      assign:
        component p_fieldname of structure p_structure to <any>,
        component p_fieldname of structure p_structurex to <c>.
      <any> = p_value.
      check <c> is assigned.
      <c> = gc_true.
    endform.                    " bapi_map_filled
    Also, we did something to create conditions (i.e. tax) but I think that was project-specific.
    We used BAPI_SALESORDER_CREATEFROMDAT2, I do not know about BAPI_SALESORDER_CREATEFROMDAT1.
    Regards,
    Clemens

  • Issue in creating sales order using process_header API

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

  • How to create sales order using BAPI.

    Hi all,
    I am trying to create sales order using standard BAPI
    "BAPI_SALESORDER_CREATEFROMDAT2". But, even I had entered all mandatory fields, I am unable to create sales order sucessfully.
    I had gone through the documentaion of this BAPI and entered these fields.
    These are the mandatory fields that which I had tried to create,
    ORDER_HEADER_IN :
    DOC_TYPE Sales document type
    SALES_ORG Sales organization
    DISTR_CHAN Distribution channel
    DIVISION Division
    ORDER_PARTNERS..:
    PARTN_ROLE Partner role, SP sold-to party
    PARTN_NUMB Customer number
    ORDER_ITEMS_IN..:
    MATERIAL Material number
    Do we have anymore fields to give as inputs? I am getting this error message as below :
    Msg: Personal number 00007176 does not exit.
    But, I am not giving any personal number manually. This personal number was having connection with partner role field,
    I had reffered this from the VBPA (Sales Document: Partner Table). Now, please suggest me how to solve this?
    Can anyone tell me how to solve this problem and create sales order sucessfully.
    Thanks in advance,
    Surender Batlanki.

    hi surendra ,
    chech with below code.
    REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    let us know if you have any qauistions.
    ~linganna

  • How to create sales order using bapi( test purpose)

    Hi all,
           while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,
    version 0 is not defined for the fiscal year ****.
    I have given the fallowing parameters as input
    ORDER_HEADER_IN
         DOC_TYPE     OR
                    SALES_ORG  1000
         DISTR_CHAN  10
                    DIVISION         00
    ORDER_PATNERS
         PARTN_ROLE     SP
         PARTN_NUMB     1000
    ORDER_ITEMSIN
         MATERIAL     M-13
    I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).
    Regards
    Deviprasad.

    Hi Prasad,
    Try using BAPI_SALESORDER_CREATEFROMDAT2.
    While creating sales order using FM: BAPI_SALESORDER_CREATEFROMDAT2, please make sure ORDER_ITEMS_IN, ORDER_ITEMS_INX, ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX.
    Pricing Conditions will not be mandatory to create a sales order via BAPI.
    As you were saying, you can create a sales order but not with items. Do populate the internal tables that i have specified above.
    Also try to pass the item number internally, this will help you in identifying the schedule lines.
    Regards,
    Priyanka.

  • Setting user specific contract data while creating sales order using BAPI

    Hi all,
    I am creating sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2.
    Now my problem is that there is no structure for contract data (i.e. VEDA), system automatically set contract data using customization values.
    I am doing some validations on cotract data in MV45AFZZ which fails, because these validations are performed on standard values, user specific values r not set.
    How to handle this issue, your small clue may help a lot.
    Regards,
    S@meer

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • PS Project description when creating sales order using BAPI

    I am trying to create sales orders using BAPI_SALESORDER_CREATE_FROMDAT2.
    Because of the material configuration in table TCN61 the material will trigger a project creation in the project system.
    Now, in order to create a project, we must provide the project description.
    I would like to ask you if anyone knows how to pass the project description in one of the BAPI parameters.
    Thank you for your help.

    Thank you Sreedhar for the answer.
    I tried the CAMPAIGN field but did not work...
    In fact, I am not able to find a field, in any of the of the tables, that could hold the project description (PROJ-POST1).
    An entry is created in PROJ table when we manually create a sales order for materials specified in table TCN61.
    Thanks.

  • Creating sales order using BDC

    I need to create sales order using BDC by reading material from material master(R/3) and customer from
    customer master(R/3).
    For example. combination should be like this
                Customer1 + Material 1 = Sales order 1
                Customer2 + Material 2 = Sales order 2
    Other than customer and material, all other values are fixed... Could you please help me......

    Hi,
    Better go for BDC rather then BAPI for this requirement.
    Simply, record the transaction and upload the data, Hope you know how it works.
    Try this, In case of any clarification feel free to reply.
    Regards,
    Vikas

  • TO CREATE SALES ORDER USING BAPI PROBLEM

    I am trying to create Sales Order using bapi function, this is giving me error as mentioned below
    *Please enter SHIP-TO-PARTY OR SOLD TO PARTY
    *SALES DOCUMENT WAS NOT CHANGED.
    it does not GIVE ME THE SALES DOCUMENT NO .
    The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2.
    Would someone know which parameters I have to papulate,or have any other suggestion
    THE INTERNAL TABLES I AM PASSING TO BAPI FUNCTION ARE
    DATA:  IT_BAPI_HEADER LIKE BAPISDHD1.
    DATA:     IT_BAPI_SOLD_TO_PARTY LIKE BAPIPARNR occurs 0 with header line.
    DATA:  SO_NO LIKE BAPIVBELN-VBELN.
    DATA:  IT_BAPI_ITEMS_IN LIKE BAPISDITM occurs 0 with header line.
    DATA: IT_BAPI_RETURN LIKE BAPIRET2 occurs 0 with header line.
    IS THERE ANYTHING ELSE TO POPULATE OTHER THAN THIS STRUCTURES
    HEADER
          Sales-Document type:      
    *     Sales-Organization
    *     Distrubution-Channel: 
    *     Division          
    PARTNER
            Partner Function     
         Customer Number      
    ITEM DETAIL
             Material Number      
    how to accomplish my task?

    Nandan,
    Please go through the documentation of the BAPI. It gives you details of what needs to be filled in in which structure/parmater. Also, read the documentation associated with each structure, that will tell what to fill.
    It is really hard to explain it in simple terms as to what are required. But, you need the header, items and partners at the minimum. Also, with some of these structures there are also 'X' structures(like ORDER_ITEMS_INX for ORDER_ITEMS_IN) which should also be filled based on what fields you filled in the original structure. For example, if you filled 'MATERIAL' field on the ORDER_ITEMS_IN structure, you should also fill in the same field on the ORDER_ITEMS_INX structure with an 'X' in it.
    All this is well documented in the BAPI.
    Srinivas

  • Create sales order using BAPI

    HI,
    I need to create sales orders using BAPI.
    these sales orders are different sales order type and it need to upload from excel file. anyone send me some sample programs for this one.
    kathir.

    use this code to create salesorder using bapi.
    REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
    bye

  • Creating Sales Order using Web Dynpro for java

    Hi SDN,
    I am new to Web Dynpro for java. I have developed an application for creating a sales order using adaptive RFC Model using BAPI. It's working fine when i create a single order. I wanna create SO with more than one line item. I have used the Table UI Element to do so. But i could not able to enter the 2nd item details. Please suggest me how to pass more than one line item from the Table UI element.
    Thanks in advance.
    Regards,
    Basha

    Hi Basha,
    Do you need to display the header items and detailed items?
    If the BAPI Contains Output values in R/3 side.
    I mean to say if BAPI  contains 4 line items.u can get thru wdjava the followinf way.
    1. Create webdynpro application.
    2.Import the model.
    3.Create Customcontroller and model binding .
    4. Write the execute method in controller.
      BAPI b = new BAPI();
      WdContext.node<BAPI>.bind(b);
       give inputs for BAPI
    b.setname(" ");
    b.setno("");
    wdContext.currentBAPI().modelObejet().execute();
    wdContext.node<output>.invalidate(); in try catch
    5. create view or when u give the dynpro application its
    in the add custom to view and drag BAPI custom to view .
    6.Crete UI for ur table thru insertTemplate table directly mapp the  output values.
    7. deploy and run
    U can get the out line items .
    Or any thing else post ur requirement.
    Thanks
    Lohi

  • Create sales order using  IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER

    Hi,
    I am trying to create an sales order using following api. which creates cart from shopping cart.
    SET serveroutput ON
    DECLARE
    P_API_VERSION_NUMBER NUMBER;
    P_INIT_MSG_LIST VARCHAR2(200);
    P_COMMIT VARCHAR2(200);
    X_RETURN_STATUS VARCHAR2(200);
    X_MSG_COUNT NUMBER;
    X_MSG_DATA VARCHAR2(200);
    P_QUOTE_HEADERID NUMBER;
    P_LAST_UPDATE_DATE DATE;
    P_SHAREE_NUMBER NUMBER;
    P_SHAREE_PARTY_ID NUMBER;
    P_SHAREE_ACCOUNT_ID NUMBER;
    P_SC_BOOK_FLAG VARCHAR2(200);
    P_SC_RESERVE_FLAG VARCHAR2(200);
    P_SC_CALCULATE_PRICE VARCHAR2(200);
    P_SC_SERVER_ID NUMBER;
    P_SC_CC_BY_FAX VARCHAR2(200);
    P_CUSTOMER_COMMENTS VARCHAR2(200);
    P_REASON_CODE VARCHAR2(200);
    P_SALESREP_EMAIL_ID VARCHAR2(200);
    P_MINISITE_ID NUMBER;
    X_LAST_UPDATE_DATE DATE;
    X_ORDER_NUMBER NUMBER;
    X_ORDER_HEADER_ID NUMBER;
    X_ORDER_REQUEST_ID NUMBER;
    X_CONTRACT_ID NUMBER;
    X_STATUS VARCHAR2(200);
    X_HOLD_FLAG VARCHAR2(200);
    BEGIN
    P_API_VERSION_NUMBER := 1;
    P_INIT_MSG_LIST := FND_API.G_TRUE;
    P_COMMIT := FND_API.G_FALSE;
    P_QUOTE_HEADERID := 18534;
    P_LAST_UPDATE_DATE := to_date('2012-10-01 04:33:45','YYYY-MM-DD HH24:MI:SS');
    P_SHAREE_NUMBER := FND_API.G_MISS_NUM ;
    P_SHAREE_PARTY_ID := FND_API.G_MISS_NUM ;
    P_SHAREE_ACCOUNT_ID := FND_API.G_MISS_NUM ;
    P_SC_BOOK_FLAG := FND_API.G_MISS_CHAR;
    P_SC_RESERVE_FLAG := FND_API.G_FALSE;
    P_SC_CALCULATE_PRICE := FND_API.G_FALSE;
    P_SC_SERVER_ID := -1;
    P_SC_CC_BY_FAX := FND_API.G_FALSE;
    P_CUSTOMER_COMMENTS := FND_API.G_MISS_CHAR;
    P_REASON_CODE := FND_API.G_MISS_CHAR;
    P_SALESREP_EMAIL_ID := FND_API.G_MISS_CHAR;
    P_MINISITE_ID := 10660;
    IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER(
    P_API_VERSION_NUMBER => P_API_VERSION_NUMBER,
    P_INIT_MSG_LIST => P_INIT_MSG_LIST,
    P_COMMIT => P_COMMIT,
    X_RETURN_STATUS => X_RETURN_STATUS,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    P_QUOTE_HEADERID => P_QUOTE_HEADERID,
    P_LAST_UPDATE_DATE => P_LAST_UPDATE_DATE,
    P_SHAREE_NUMBER => P_SHAREE_NUMBER,
    P_SHAREE_PARTY_ID => P_SHAREE_PARTY_ID,
    P_SHAREE_ACCOUNT_ID => P_SHAREE_ACCOUNT_ID,
    P_SC_BOOK_FLAG => P_SC_BOOK_FLAG,
    P_SC_RESERVE_FLAG => P_SC_RESERVE_FLAG,
    P_SC_CALCULATE_PRICE => P_SC_CALCULATE_PRICE,
    P_SC_SERVER_ID => P_SC_SERVER_ID,
    P_SC_CC_BY_FAX => P_SC_CC_BY_FAX,
    P_CUSTOMER_COMMENTS => P_CUSTOMER_COMMENTS,
    P_REASON_CODE => P_REASON_CODE,
    P_SALESREP_EMAIL_ID => P_SALESREP_EMAIL_ID,
    P_MINISITE_ID => P_MINISITE_ID,
    X_LAST_UPDATE_DATE => X_LAST_UPDATE_DATE,
    X_ORDER_NUMBER => X_ORDER_NUMBER,
    X_ORDER_HEADER_ID => X_ORDER_HEADER_ID,
    X_ORDER_REQUEST_ID => X_ORDER_REQUEST_ID,
    X_CONTRACT_ID => X_CONTRACT_ID,
    X_STATUS => X_STATUS,
    X_HOLD_FLAG => X_HOLD_FLAG
    DBMS_OUTPUT.PUT_LINE('X_RETURN_STATUS = ' || X_RETURN_STATUS);
    DBMS_OUTPUT.PUT_LINE('X_MSG_COUNT = ' || X_MSG_COUNT);
    DBMS_OUTPUT.PUT_LINE('X_MSG_DATA = ' || X_MSG_DATA);
    DBMS_OUTPUT.PUT_LINE('X_LAST_UPDATE_DATE = ' || X_LAST_UPDATE_DATE);
    DBMS_OUTPUT.PUT_LINE('X_ORDER_NUMBER = ' || X_ORDER_NUMBER);
    DBMS_OUTPUT.PUT_LINE('X_ORDER_HEADER_ID = ' || X_ORDER_HEADER_ID);
    DBMS_OUTPUT.PUT_LINE('X_ORDER_REQUEST_ID = ' || X_ORDER_REQUEST_ID);
    DBMS_OUTPUT.PUT_LINE('X_CONTRACT_ID = ' || X_CONTRACT_ID);
    DBMS_OUTPUT.PUT_LINE('X_STATUS = ' || X_STATUS);
    DBMS_OUTPUT.PUT_LINE('X_HOLD_FLAG = ' || X_HOLD_FLAG);
    END;
    When i use this from a OA_HTML jsp the sales order is created . But when i use it from the sql developer
    i got following error
    X_RETURN_STATUS = E
    X_MSG_COUNT = 1
    X_MSG_DATA = You do not have access to this cart.
    X_LAST_UPDATE_DATE =
    X_ORDER_NUMBER = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_ORDER_HEADER_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_ORDER_REQUEST_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_CONTRACT_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_STATUS =
    I checked logs for both .
    For working one log is ie. using jsp
    01-OCT-2012:01:24:46 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:24:46 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:24:46 IBE Begin validate_user_update10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Incoming party_id is 423832
    01-OCT-2012:01:24:46 IBE Incoming cust_account_id is 140757
    01-OCT-2012:01:24:46 IBE Incoming quote_header_id is 18529
    01-OCT-2012:01:24:46 IBE User id obtained from environment is: -1
    01-OCT-2012:01:24:46 IBE p_save_type is :6
    01-OCT-2012:01:24:46 IBE Entered Validation...T
    01-OCT-2012:01:24:46 IBE no sharee number
    01-OCT-2012:01:24:46 IBE quote_source_code of cart passed in=IStore Account
    01-OCT-2012:01:24:46 IBE In validating Owner flow: 423832,140757 10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Validate_user_update: Before Last update date validation,p_last_update_date= 01-10-12
    01-OCT-2012:01:24:46 IBE Validate_user_update: Last update date validation START
    01-OCT-2012:01:24:46 IBE Validate_user_update: l_last_update_date=
    01-OCT-2012:01:24:46 IBE Validate_user_update: p_last_update_date=10/01/2012:00:22:07
    01-OCT-2012:01:24:46 IBE Validate_user_update: Last update date validation END
    01-OCT-2012:01:24:46 IBE Before calling validate_quote10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Begin Validate_quote10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Validate_quote: Validation for one-click start
    01-OCT-2012:01:24:46 IBE End validate_quote10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE End validate_user_update10/01/2012:01:24:46
    but for the failure it is.
    01-OCT-2012:01:20:53 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:20:53 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:20:53 IBE Begin validate_user_update10/01/2012:01:20:53
    01-OCT-2012:01:20:53 IBE Incoming party_id is 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    01-OCT-2012:01:20:53 IBE Incoming cust_account_id is 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    01-OCT-2012:01:20:53 IBE Incoming quote_header_id is 18529
    01-OCT-2012:01:20:53 IBE User id obtained from environment is: -1
    01-OCT-2012:01:20:53 IBE p_save_type is :6
    01-OCT-2012:01:20:53 IBE Entered Validation...T
    01-OCT-2012:01:20:53 IBE no sharee number
    01-OCT-2012:01:20:53 IBE quote_source_code of cart passed in=IStore Account
    01-OCT-2012:01:20:53 IBE Owner flow with env. userid: 10/01/2012:01:20:53
    01-OCT-2012:01:20:53 IBE partyId::quotehdrId(9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125,18529)
    01-OCT-2012:01:20:53 IBE End:Expected exception:IBE_Quote_Misc_pvt.validate_user_update
    From this u can see that party id and account is fetched when using jsp. but direct running of procedure not getting these values.
    is there sql api running when accessing through jsp . so that these values are got from session.
    Thanks
    Mark

    Hi,
    I have passed that too . still getting same error.
    IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER calls IBE_Quote_Checkout_Pvt.submitQuote
    which calls another package
    PROCEDURE Validate_User_Update(
    p_api_version_number IN NUMBER := 1.0
    ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
    ,p_quote_header_id IN NUMBER
    ,p_party_id IN NUMBER := FND_API.G_MISS_NUM
    ,p_cust_account_id IN NUMBER := FND_API.G_MISS_NUM
    ,p_quote_retrieval_number IN NUMBER := FND_API.G_MISS_NUM
    ,p_validate_user IN VARCHAR2 := FND_API.G_FALSE
    ,p_privilege_type_code IN VARCHAR2 := 'F'
    ,p_save_type IN NUMBER := FND_API.G_MISS_NUM
    ,p_last_update_date IN DATE := FND_API.G_MISS_DATE
    ,x_return_status OUT NOCOPY VARCHAR2
    ,x_msg_count OUT NOCOPY NUMBER
    ,x_msg_data OUT NOCOPY VARCHAR2)
    in it like this
    IBE_Quote_Misc_pvt.Validate_User_Update(
         p_init_msg_list => FND_API.G_TRUE
         ,p_quote_header_id => p_quote_Header_Id
         ,p_quote_retrieval_number => p_sharee_number
         ,p_validate_user     => FND_API.G_TRUE
         ,p_privilege_type_code => 'A'
    ,p_save_type => PLACE_ORDER
    ,p_last_update_date => p_last_update_date
    ,x_return_status => x_return_status
    ,x_msg_count => x_msg_count
    ,x_msg_data => x_msg_data
    from this u can see that there no value passed for party id and account id .
    Thanks
    Mark

  • LSMW to create Sales Order refer to Quotation with multiple line items.

    Hi Gurus,
    I am new to LSMW, and my requirement is that, I have a file downloaded from another system, it is like this:
    Quotation No.  Sold to party  data        item no.       material no.     quatity
    556                         10000012                 10              19077                1
    556                         10000012                 20              19078                1
    557                         10000011                 10              19076                1
    And it is required I need to create orders in VA01 refering to quotations, and then delete all the items from quotation, and add the items in the file. I am now doing it through transaction recording in VA01, but I came to a difficult part, that is how I can process line items. Because the items number will only be decided at runtime, so I can not record a BDC for that. And I have read some guides on LSMW, one of it said that transaction recording in LSMW can not deal with deep structures. So could any1 help on this?
    Best regards,
    Vincent

    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

Maybe you are looking for

  • How to get the values multiple times for the specified element - ABAP IXML.

    Hi all,          i have requirement to get the values for the specified elements multiple times. eg:., if the element is used in the xml 4 times then i need to get all the 4 values.  here is the sample xml, <View mmRelease="6.30" mmVersion="2.0" mmTi

  • Sapscript: display in main window table ... repeat table haeder on new page

    Hi all, I have a form with one Window -> Main Window, in this Window it will be written many different information... there is also a table, when the table cause a new-page, the header (discription of the table) should be written (repeated) also on t

  • Can't import CTI Ports in CUE 3.1

    Hi Everyone, I have recently migrated CallManager 4.1 to CUCM 7.1. Everything is working fine but CUE is not able to integrate with CUCM 7.1 I have provided the new credentials for Admin User and JTAPI user in CUE 3.1 and also made a new application

  • Itunes - No artwork displaying in Library/Music Store/Pocasts etc.

    I have just upgraded to the latest version of itunes and wthis worked with no problem for a few days - I then had to do a system restore and re-install this and now all I get where the artwork should be is a blank white space (library) or black boxes

  • IMovie Export freeze on IOS Iphone5 any answers?

    Used imovie once before and worked fine including on export. This second 6second clip will not export. I select lowest quality upon export, export process begins but doesn't seem to start. It just freezes on "Exporting".