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: 

Update field ref_doc_ca in vbap

Former Member
0 Kudos

Hi all,

I want to change the value of the Document category of preceding SD document.

But it does not work...

order_headerx-updateflag = 'U'.

CLEAR: order_item, order_itemx.

REFRESH: order_item, order_itemx.

order_item-itm_number = it_vbap-posnr.

order_item-ref_doc_ca = 'A'.

APPEND order_item.

order_itemx-itm_number = it_vbap-posnr.

order_itemx-updateflag = 'U'.

order_itemx-ref_doc_ca = 'X'.

APPEND order_itemx.

  • Change Quotes

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = it_vbap-vbeln

order_header_inx = order_headerx

TABLES

return = return

order_item_in = order_item

order_item_inx = order_itemx.

APPEND LINES OF return TO return_all.

IF sy-subrc EQ 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDIF.

Any ideas?

regards

2 REPLIES 2

Former Member
0 Kudos

is it SD_DOC_CAT at header level (SD document category) ?

0 Kudos

In both header and items...

But in header it doesn't work, too.