I noticed that, in EBP, when the customer changes the plant the contract number and contract item are empty!!!!
I made the following test:
In debug mode when I change the plant, and enter in BBP_DOC_CHANGE_BADI, the contract and item number are empty. In this Badi, we have a loop in the IT_ITEM table and we have a logic to "recover" the contract/item number.
The logic is like this:
LOOP AT it_item INTO ti_item_aux
IF ti_item_aux-ctr_item_number IS INITIAL.
MOVE ti_item_aux-yyctr_item_numb TO ti_item_aux-ctr_item_number.
MOVE ti_item_aux-yyctr_hdr_number TO ti_item_aux-ctr_hdr_number.
MOVE 'S' TO lc_update.
IF lc_update EQ 'S'.
APPEND ti_item_aux TO et_item.
After the BBP_DOC_CHANGE_BADI occurs the BBP_DOC_CHECK_BADI.
In this logic, when I call the function 'BBP_PD_SC_GETDETAIL', the value of "ctr_hdr_number" is empty again.......
What is wrong?????