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

BAPI_SALESORDER_CHANGE problen

Hi,

With bapi_salesorder_change bapi.I can not change quantity field.It adds the new value to existing value.

What is te problem?Do i need to fill other fields?

My code is below;

gt_order_items_in-itm_number = '10'.

gt_order_items_in-material = '000000001100000235'.

APPEND gt_order_items_in.

gt_order_items_inx-itm_number = '10'.

gt_order_items_inx-updateflag = 'U'.

gt_order_items_inx-material = 'X'.

APPEND gt_order_items_inx.

gt_order_schedules_in-itm_number = '10'.

gt_order_schedules_in-req_qty = '1'.

APPEND gt_order_schedules_in.

gt_order_schedules_inx-itm_number = '10'.

gt_order_schedules_inx-req_qty = 'X'.

APPEND gt_order_schedules_inx.

DATA:ls_order_header_in TYPE bapisdh1,

ls_order_header_inx TYPE bapisdh1x.

ls_order_header_in-sales_org = '0020'.

ls_order_header_in-distr_chan = '00'.

ls_order_header_in-division = '01'.

ls_order_header_inx-updateflag = 'U'.

ls_order_header_inx-sales_org = 'X'.

ls_order_header_inx-distr_chan = 'X'.

ls_order_header_inx-division = 'X'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = '0000007030'

order_header_in = ls_order_header_in

order_header_inx = ls_order_header_inx

TABLES

return = gt_return

order_item_in = gt_order_items_in

order_item_inx = gt_order_items_inx

schedule_lines = gt_order_schedules_in

schedule_linesx = gt_order_schedules_inx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 14, 2010 at 09:17 AM

    Add this line

    gt_order_schedules_inx-updateflag = 'U'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2010 at 09:20 AM

    Hi,

    The issue is in this.

    Give the schedule line number and update flag

    gt_order_schedules_in-itm_number = '10'.

    gt_order_schedules_in-sched_line = '0001'. <--- " You might need to select from VBEP to get the correct value.

    gt_order_schedules_in-req_qty = '1'.

    APPEND gt_order_schedules_in.

    gt_order_schedules_inx-itm_number = '10'.

    gt_order_schedules_inx-sched_line = '0001'. " You might need to select from VBEP to get the correct value.

    gt_order_schedules_inx-updateflag = 'U'. <----- This is required

    gt_order_schedules_inx-req_qty = 'X'.

    APPEND gt_order_schedules_inx.

    Hope it helps.

    Sujay

    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.