on ‎2021 Mar 08 4:36 PM
Hello all,
I am trying update VBEP table record using BAPI_SALESORDER_CHANGE but it is duplicating the record instead of updating to the old record.
What would be the issue ?
Any help would be appreciated!
w_order_sch_in-itm_number = i_item.
w_order_sch_in-ms_date = i_matl_avail_date.
append w_order_sch_in to i_order_sch_in.
CLEAR: w_order_sch_in.
w_order_sch_inx-itm_number = i_item.
w_order_sch_inx-ms_date = 'X'.
w_order_sch_inx-updateflag = 'U'.
append w_order_sch_inx to i_order_sch_inx.
CLEAR: w_order_sch_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = I_SALES_DOCUMENT
ORDER_HEADER_INX = order_headerx
TABLES
RETURN = t_return
SCHEDULE_LINES = i_order_sch_in
SCHEDULE_LINESX = i_order_sch_inx.
CLEAR w_return.
READ TABLE t_return INTO w_return WITH KEY type = 'E'.
IF w_return IS NOT INITIAL. " error found
MESSAGE w_return-message TYPE 'I'.
RETURN.
ENDIF.
CLEAR w_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = w_return .
IF w_return-type = 'E'. " error found
MESSAGE w_return-message TYPE 'I'.
RETURN.
Endif.
Request clarification before answering.
Hi,
you need to enter an existing etenr to complete the key
KR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
w_order_sch_in-sched_line = wa_vbep-etenr.
vinayad don't forget that other line:
w_order_sch_inx-sched_line = wa_vbep-etenr.
Thank you for your response!
Instead of moving the value, I made mistake here.
w_order_sch_inx-sched_line = 'X'.
It's working now thanks.
robert.forster3 and Sandra Rossi
It is working for present and future date but user also requires for past date.
How to achieve it ? It is showing information message on screen
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.