2008 May 19 11:51 AM
hello,
I am using above BAPI to update reason for rejection in sales order.
Let me take an example.
One particular order has 2 items, one item fully delivered. another item not delivered.
Now for me the result must be :
- for the first item, reason for rejection must not be changed.
- for second item, reason for rejection must be set.
but the problem is BAPI is not updating the second item. it is neglecting the whole order.
Do you have any idea where the problem is ?
hello,
I am using above BAPI to update reason for rejection in sales order.
Let me take an example.
One particular order has 2 items, one item fully delivered. another item not delivered.
Now for me the result must be :
- for the first item, reason for rejection must not be changed.
- for second item, reason for rejection must be set.
but the problem is BAPI is not updating the second item. it is neglecting the whole order.
Do you have any idea where the problem is ?
2008 May 19 12:24 PM
Hi,
check if u have set the field REASON_REJ in ORDER_ITEM_INX table set that item...
its value should be 'U'
Regards,
lavanya
2008 May 19 12:35 PM
Hi,
I have set the flag 'X'.
it is working for other cases. only in the example case I mentioned, it does not work
2008 May 19 12:40 PM
Hi,
are you able to reject item number 2 manually using VA02 ? If not then probably the item has already been delivered or invoiced or a Purchase Order has been created for this. You need to reverse these documents first.
If yes, then here are the parameters you need to pass to the BAPI :
SALESDOCUMENT
ORDER_ITEM_IN-ITM_NUMBER ( 00020 for item 2 )
ORDER_ITEM_IN-REASON_REJ
ORDER_ITEM_INX-ITM_NUMBER = ( '00020' for item 2 )
ORDER_ITEM_INX-UPDATEFLAG = 'U'
ORDER_ITEM_INX-REASON_REJ = 'X'.
regards,
Advait
2008 May 19 12:45 PM
Hi,
Thanks for the reply. Here is my code.
gs_item_in-itm_number = gs_vbap-posnr.
gs_item_in-reason_rej = gf_reason_rej.
APPEND gs_item_in TO gt_item_in.
gs_item_inx-itm_number = gs_vbap-posnr.
gs_item_inx-reason_rej = 'X'.
gs_item_inx-updateflag = 'U'.
APPEND gs_item_inx TO gt_item_inx.
Surprisingly, via VA02 I am able to reject the item. only via BAPI, I face the problem.
2008 May 19 12:56 PM
debug and see the value being passed from gs_vbap-posnr to gs_item_in-itm_number if it is what it should be
also make sure that gf_reason_rej is not blank.
do u get any return messages from the system.
Assuming you are also passing the Salesdoucment
regards,
Advait
2008 May 19 1:01 PM
hi,
I checked Reason for rejection is not blank.
Itm_number also passed correctly.
I get below messages -
Field 'ABGRU' cannot be changed, VBAPKOM 000010 ready for input
Sales document 0200001019 was not changed.
2008 May 19 1:18 PM
I think u will need to debug a bit then, check the message number, message class and setup a watchpoint on sy-msgid sy-msgno with those values after the BAPI is called.
then see the code before that, you will get the reason why it is not updating.
regards,
Advait
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |