Skip to Content
author's profile photo Former Member
Former Member

some pricing condition types are not getting copied through sd_salesdocument_create

Hi experts,

when i am creating debit memo request, an automated credit memo request will be created using FM SD_SALESDOCUMENT_CREATE with reference to original order. but some pricing conditions are not getting copied. any one can pls provide the code regarding the essential parameters for this FM?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2013 at 08:30 AM

    hi ,

    Please fill all the parameters,

    SAMPLE pgm is


    order_header_in-doc_type = 'ZWV'.

    order_header_in-sales_org = '1000'.

    order_header_in-distr_chan = '10'.

    order_header_in-division = '10'.

    order_header_in-purch_date = sy-datum.

    order_header_in-purch_no_c = 'BAPITEST'.

    order_partners-partn_role = 'AG'.

    order_partners-partn_numb = '0001000005'.

    APPEND order_partners.

    order_partners-partn_role = 'ZS'.

    order_partners-partn_numb = '1046'.

    APPEND order_partners.

    IF ORDER_HEADER_IN-DOC_TYPE = 'ZWV'.

    ORDER_PARTNERS-ITM_NUMBER = '10'.

    order_partners-partn_role = 'ZO'.

    order_partners-partn_numb = '0001000005'.

    APPEND order_partners.

    ENDIF.



    add next line with more than one item


    order_items_in-itm_number = '000010'.

    order_items_in-material = '000000000000111111'.

    order_items_in-target_qty = '1.000'.

    order_items_in-target_qu = 'ST'.

    order_items_in-sales_unit = 'ST'.

    APPEND order_items_in.

    order_schedules_in-req_qty = '1.000'.

    APPEND order_schedules_in.

    *Add following lines with more than one line

    itemx-itm_number = '000010'.

    itemx-updateflag = 'I'.

    itemx-material = 'X'.

    itemx-target_qty = 'X'.

    append itemx.

    order_items_in-itm_number = '000020'.

    order_items_in-material = '000000000000111111'.

    order_items_in-target_qty = '1.000'.

    order_items_in-target_qu = 'ST'.

    order_items_in-sales_unit = 'ST'.

    APPEND order_items_in.

    order_schedules_in-req_qty = '1.000'.

    APPEND order_schedules_in.

    itemx-itm_number = '000020'.

    itemx-updateflag = 'I'.

    itemx-material = 'X'.

    itemx-target_qty = 'X'.

    append itemx.

    *stop add more lines

    REFRESH return.

    call function 'SD_SALESDOCUMENT_CREATE'
    exporting
    * SALESDOCUMENT =
    sales_header_in = ibapisdhd1
    sales_header_inx = ibapisdhd1x
    * BUSINESS_OBJECT = ' '
    importing
    salesdocument_ex = ibapivbeln
    tables
    return = ibapiret2
    sales_items_in = ibapisditm
    sales_items_inx = ibapisditmx
    sales_partners = ibapiparnr
    sales_schedules_in = ibapischdl
    sales_schedules_inx = ibapischdlx
    sales_conditions_in = ibapicond
    sales_conditions_inx = ibapicondx
    sales_text = ibapisdtext
    partneraddresses = ibapiparadr.

    COMMIT WORK AND WAIT.

    LOOP AT return.

    WRITE: / return.

    ENDLOOP.

    hope it helps,

    Vinoth.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.