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

BAPI_SALESORDER_CHANGE delete line item

START-OF-SELECTION.

*"----


*" Initialize internal tables.

*"----


REFRESH: i_sched, i_schedx, i_ret.

CLEAR: i_sched, i_schedx, i_ret.

*"----


*" Fill required ORDER_HEADER_IN data.

*"----


i_hdrx-updateflag = 'U'.

*"----


*" Fill required SCHEDULE_LINES data.

*"----


i_sched-itm_number = p_posnr.

i_sched-sched_line = p_etenr.

i_sched-req_qty = p_reqqty.

i_schedx-updateflag = 'D'.

i_schedx-itm_number = p_posnr.

i_schedx-sched_line = p_etenr.

i_schedx-req_qty = 'X'.

i_schedx-ITM_NUMBER = 'X'.

i_schedx-SCHED_LINE = 'X'.

APPEND i_sched.

APPEND i_schedx.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = p_vbeln

order_header_in = i_hdr

order_header_inx = i_hdrx

TABLES

return = i_ret

schedule_lines = i_sched

schedule_linesx = i_schedx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT i_ret.

WRITE / i_ret-message.

ENDLOOP.

i have 5 line item like

item number.

10

20

30

40

50

now i want delete line item 20 then i use above code but not working

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 05:19 AM

    Hi

    Check the RETURN itab of the BAPI and analyse

    Regards

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 10:05 AM

    myself

    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.