Application Development 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: 

how can i change VBAK-Faksk of VAO1 at header level using BAPI_SALESORD_CHA

Former Member
0 Kudos

Hi Experts,

How can i change the value of VBAK-FAKSK (Billing doc value) at header level .

by using the bapi_salesorder_change.Could you please send the sample code

how to change the value of any field in VBAk . so that i can take as reference and work accordingly ..

It's urgent,

thanks

kumar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this



PARAMETERS: p_vbeln type vbak-vbeln.

DATA: l_header_inx TYPE bapisdh1x,
l_header_in TYPE bapisdh1.

data: lt_return type standard table of bapiret2.

MOVE: 'U' TO l_header_inx-updateflag,
'X' TO l_header_inx-bill_block,  " Billing
'ZL' TO l_header_in-bill_block.  " Billing block.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = l_header_in
order_header_inx = l_header_inx
TABLES
return = lt_return.

* check for errors.
LOOP AT lt_return transporting no fields WHERE type = 'A' Or type = 'E'.
  EXIT.
ENDLOOP.

If sy-subrc = 0.
  write: / 'Error in updating'.
ELSE.
  commit work and wait.
endif.

Thanks

Naren

2 REPLIES 2

Former Member
0 Kudos

Hi,

set the value to BILL_BLOCK field in your BAPI header structure,

Regards,

Raghavendra

Former Member
0 Kudos

Hi,

Check this



PARAMETERS: p_vbeln type vbak-vbeln.

DATA: l_header_inx TYPE bapisdh1x,
l_header_in TYPE bapisdh1.

data: lt_return type standard table of bapiret2.

MOVE: 'U' TO l_header_inx-updateflag,
'X' TO l_header_inx-bill_block,  " Billing
'ZL' TO l_header_in-bill_block.  " Billing block.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = l_header_in
order_header_inx = l_header_inx
TABLES
return = lt_return.

* check for errors.
LOOP AT lt_return transporting no fields WHERE type = 'A' Or type = 'E'.
  EXIT.
ENDLOOP.

If sy-subrc = 0.
  write: / 'Error in updating'.
ELSE.
  commit work and wait.
endif.

Thanks

Naren