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

Former Member
0 Likes
959

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

6 REPLIES 6
Read only

Former Member
0 Likes
704

you also have to pass DLV_BLOCK = 'X' in ORDER_HEADER_INX parameter.



t_BAPISDH1-COLLECT_NO = i_list-vbeln.
t_BAPISDH1-DLV_BLOCK = space.

APPEND t_BAPISDH1.
CLEAR t_BAPISDH1.

t_bapisdh1x-UPDATEFLAG = 'X'.
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'.

Edited by: Abhishek Sarkar on Feb 29, 2008 8:03 AM

Read only

Former Member
0 Likes
704

Hi,

You have not populated one field. Hence it was not changing the record. The change has been highlighted: (t_bapisdh1x-DLV_BLOCK = 'X' - INX for dlv_block has to be set to X)

t_BAPISDH1-COLLECT_NO = i_list-vbeln.

t_BAPISDH1-DLV_BLOCK = space.

APPEND t_BAPISDH1.

CLEAR t_BAPISDH1.

t_bapisdh1x-UPDATEFLAG = 'X'.

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

Vijay

Read only

0 Likes
704

Hi Friends,

Tks for your replay.

but also that sales document no is not updating

Kindly help m e friends,

Regards,

DVNS

Read only

0 Likes
704

Hi

Can you tell the contents of the bapi return table t_bapiret2 on execution (find this in debugging mode).

Thanks

Vijay

Read only

0 Likes
704

Hi Vijay,

Return parameter is showing

Field header_inx-updateflag is not an input field

Can you please help me.

Regards,

DVNS

Read only

0 Likes
704

hi,

i'm able to update the header block to blank with the following.

*update header level delivery block

v_head1x-DLV_BLOCK = 'X'.

v_head1x-updateflag = 'U'.

v_head-DLV_BLOCK = w_so-vlifsk.

only thing is i'm not able to update those header block which is blank to other value.