2007 Mar 15 4:27 PM
I would like to update vbak and set lifsk = 'x' when vbeln in (a,b,c,d)
2007 Mar 15 4:39 PM
Hi,
Please do not update any VBAK table directly.
But you can use FM SD_SALESDOCUMENT_CHANGE to update VBAK-LIFSK.
Just pass the order number and set ORDER_HEADER_IN-DLV_BLOCK to your new value and ORDER_HEADER_INX-DLV_BLOCK to 'X'. Also set ORDER_HEADER_INX-UPDATEFLAG to 'U'.
PARAMETERS: p_order LIKE vbak-vbeln.
DATA: ord_in LIKE bapisdhd1,
ord_inx LIKE bapisdhd1x,
t_ret LIKE bapiret2 occurs 0 with header line.
ord_in-dlv_block = '01'.
ord_inx-dlv_block = 'X'.
ord_inx-updateflag = 'U'.
CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
EXPORTING
SALESDOCUMENT = p_order
ORDER_HEADER_IN = ord_in
ORDER_HEADER_INX = ord_inx
TABLES
RETURN = t_ret
Regards,
Ferry Lianto
Hi,
Please do not update any VBAK table directly.
But you can use FM SD_SALESDOCUMENT_CHANGE to update VBAK-LIFSK.
Just pass the order number and set ORDER_HEADER_IN-DLV_BLOCK to your new value and ORDER_HEADER_INX-DLV_BLOCK to 'X'. Also set ORDER_HEADER_INX-UPDATEFLAG to 'U'.
PARAMETERS: p_order LIKE vbak-vbeln.
DATA: ord_in LIKE bapisdhd1,
ord_inx LIKE bapisdhd1x,
t_ret LIKE bapiret2 occurs 0 with header line.
ord_in-dlv_block = '01'.
ord_inx-dlv_block = 'X'.
ord_inx-updateflag = 'U'.
CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
EXPORTING
SALESDOCUMENT = p_order
ORDER_HEADER_IN = ord_in
ORDER_HEADER_INX = ord_inx
TABLES
RETURN = t_ret
Regards,
Ferry Lianto
2007 Mar 15 4:30 PM
Hi Megan,
You should not update the database directly from a program.
Do a BDC for VA02 or use the BAPI: BAPI_SALESORDER_CHANGEto update the sales tables.
Regards,
Ravi
2007 Mar 15 4:34 PM
Hi Megan
Doing direct table updates on SAP tables is extremely poor programming practice, and can cause untold chaos and pain. Try to use a SAP standard function module or BAPI, or a BDC if this is not available.
In your case, you'll probably be able to do these changes with BAPI_SALESORDER_CHANGE.
Cheers
Lyal
2007 Mar 15 4:35 PM
I have never run the BAPI
How do I implement it?
Do I just include the syntax in a custom report ?
2007 Mar 15 4:45 PM
I have to admit that I have not used this BAPI before, either. So I can't help you with the fields that are required to be populated for it to run. But, if you do a search on the forum for that BAPI, you'll get loads of hits.
To insert it into your program, it is very handy to use the Pattern button, and then put BAPI_SALESORDER_CHANGE into the CALL FUNCTION field. This will import the BAPI's structure.
Cheers
Lyal
2007 Mar 15 4:39 PM
Hi,
Please do not update any VBAK table directly.
But you can use FM SD_SALESDOCUMENT_CHANGE to update VBAK-LIFSK.
Just pass the order number and set ORDER_HEADER_IN-DLV_BLOCK to your new value and ORDER_HEADER_INX-DLV_BLOCK to 'X'. Also set ORDER_HEADER_INX-UPDATEFLAG to 'U'.
PARAMETERS: p_order LIKE vbak-vbeln.
DATA: ord_in LIKE bapisdhd1,
ord_inx LIKE bapisdhd1x,
t_ret LIKE bapiret2 occurs 0 with header line.
ord_in-dlv_block = '01'.
ord_inx-dlv_block = 'X'.
ord_inx-updateflag = 'U'.
CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
EXPORTING
SALESDOCUMENT = p_order
ORDER_HEADER_IN = ord_in
ORDER_HEADER_INX = ord_inx
TABLES
RETURN = t_ret
Regards,
Ferry Lianto
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |