‎2008 Feb 29 7:04 AM
Hi Friends,
I have a sales order no, here i want to change delivery block(Header)and make them space. here i am passing salesorder no and passing DLV_BLOCK = space and using
UPDATEFLAG = 'U'. but also it is not changing that record.
can any one help me its urgent.
Please find my code
t_BAPISDH1-COLLECT_NO = i_list-vbeln.
t_BAPISDH1-DLV_BLOCK = space.
APPEND t_BAPISDH1.
CLEAR t_BAPISDH1.
t_bapisdh1x-UPDATEFLAG = 'X'.
APPEND t_bapisdh1x .
CLEAR t_bapisdh1x.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = i_list-vbeln
order_header_in = t_BAPISDH1
order_header_inx = t_bapisdh1x
TABLES
return = t_bapiret2
schedule_lines = t_bapischdl
schedule_linesx = t_bapischdlx
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Or else i want to change this code.
Regards,
DVNS
‎2008 Feb 29 9:12 AM
Hi,
try the below code i have added
t_bapisdh1x-UPDATEFLAG = 'U'.
t_BAPISDH1x-DLV_BLOCK = 'X'. these two lines two ur old code.
Reward points if it is useful.
t_BAPISDH1-COLLECT_NO = i_list-vbeln.
t_BAPISDH1-DLV_BLOCK = space.
APPEND t_BAPISDH1.
CLEAR t_BAPISDH1.
t_bapisdh1x-UPDATEFLAG = 'U'.
t_BAPISDH1x-DLV_BLOCK = 'X'.
APPEND t_bapisdh1x .
CLEAR t_bapisdh1x.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = i_list-vbeln
order_header_in = t_BAPISDH1
order_header_inx = t_bapisdh1x
TABLES
return = t_bapiret2
schedule_lines = t_bapischdl
schedule_linesx = t_bapischdlx
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Thanks,
Prasanna
‎2008 Feb 29 9:15 AM
2 errors:
1 ) In structure BAPISDH1X :
Field DLV_BLOCK should have value 'X'. Meaning: this field has to be updated.
2 )
t_BAPISDH1 and
t_bapisdh1x should be work areas (structures) and not internal tables.