Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_SALESDOCUMENT_CHANGE header block change

Former Member
0 Likes
549

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

2 REPLIES 2
Read only

Former Member
0 Likes
465

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

Read only

Former Member
0 Likes
465

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.