Hi Gurus,
I have a scenario as below:
1. I have a sales order with 3 items and all have reason for rejection. Basically if we have reason for rejection we cannot see this items in MD04 (Requirements).
2. I have a program that uses BAPI_SALESORDER_CHANGE to remove the reason for rejection. My structure fields are like:
SALESDOCUMENT = existing sales order number
ORDER_HEADER_INX-UPDATEFLAG = U
ORDER_ITEM_IN-ITM_NUMBER = 000010
ORDER_ITEM_IN-REASON_REJ = ' '
ORDER_ITEM_IN-ITM_NUMBER = 000020
ORDER_ITEM_IN-REASON_REJ = ' '
ORDER_ITEM_IN-ITM_NUMBER = 000030
ORDER_ITEM_IN-REASON_REJ = ' '
ORDER_ITEM_INX-ITM_NUMBER = 000010
ORDER_ITEM_INX-UPDATEFLAG = 'U'
ORDER_ITEM_INX-REASON_REJ = 'X'
ORDER_ITEM_INX-ITM_NUMBER = 000020
ORDER_ITEM_INX-UPDATEFLAG = 'U'
ORDER_ITEM_INX-REASON_REJ = 'X'
ORDER_ITEM_INX-ITM_NUMBER = 000020
ORDER_ITEM_INX-UPDATEFLAG = 'U'
ORDER_ITEM_INX-REASON_REJ = 'X'
3. After this program was executed, the reason for rejection was removed from the sales order items BUT ONLY ITEM 000010
can be seen in MD04. The change log of the sales order is as follows:
000010 Reason for rejection of quotations and sales orders changed
000020 Item has been created
000030 Item has been created
4. BUT if I use ORDER_ITEM_INX-UPDATEFLAG = 'I' for all the items I CAN SEE ALL THE ITEMS IN MD04 and the log is as follows
000010 Reason for rejection of quotations and sales orders changed
000020 Reason for rejection of quotations and sales orders changed
000030 Reason for rejection of quotations and sales orders changed
As I have read from the BAPI DOCUMENTATION, if we want to change the VALUES of the EXISTING SALES ORDERS we must use 'U' in the field UPDATEFLAG. But why do I have some inconsistencies as my scenario ABOVE. I can only get the correct behavior if I use 'I' as the UPDATEFLAG?
Thanks and Best regards,
Andre