Hello everybody,
I've been trying to use the BAPI ME_PO_CREATE to create some PO material confirmations. I need to create confirmations
of type 'PB' and 'AB', but the BAPI is creating only those of 'PB' type and ignoring the 'AB' ones.
I got it working quick and dirty with this code:
DATA: gt_item type BAPIMECONF_T_ITEM,
wa_item type BAPIMECONFITEM,
gt_itemx type BAPIMECONF_T_ITEMX,
wa_itemx type BAPIMECONFITEMX,
gt_confirmation type BAPIMECONF_T_DETAIL,
wa_confirmation type BAPIMECONFDETAIL,
gt_confirmationx type BAPIMECONF_T_DETAILX,
wa_confirmationx type BAPIMECONFDETAILX,
gt_return type BAPICONF_T_RETURN.
wa_item-item_no = '00001'.
append wa_item to gt_item.
wa_itemx-item_no = '00001'.
wa_itemx-item_nox = 'X'.
append wa_itemx to gt_itemx.
wa_confirmation-item_no = '00001'.
wa_confirmation-conf_ser = '0001'.
wa_confirmation-conf_category = 'PB'.
wa_confirmation-quantity = '1'.
wa_confirmation-DELIV_DATE_TYP = 'D'.
wa_confirmation-DELIV_DATE = '20140718'.
append wa_confirmation to gt_confirmation.
wa_confirmationx-item_no = '00001'.
wa_confirmationx-conf_ser = '0001'.
wa_confirmationx-conf_category = 'X'.
wa_confirmationx-quantity = 'X'.
wa_confirmationx-DELIV_DATE_TYP = 'X'.
wa_confirmationx-DELIV_DATE = 'X'.
append wa_confirmationx to gt_confirmationx.
CALL FUNCTION 'ME_PO_CONFIRM'
EXPORTING
DOCUMENT_NO = '3C40002605'
* TESTRUN = MMPUR_NO
* HEADER =
* HEADERX =
ITEM = gt_item
ITEMX = gt_itemx
CONFIRMATION = gt_confirmation
CONFIRMATIONX = gt_confirmationx
* ITEM_TEXT =
* HEADER_TEXT =
* EXTENSIONIN =
IMPORTING
RETURN = gt_return
* EXP_HEADER =
* EXP_ITEM =
* EXP_CONFIRMATION =
* EXTENSIONOUT =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
* IMPORTING
* RETURN =
.
When I try to create a PB confirmation the BAPI returns a 'S' (success) message along with some other ones.
If I try to create 'AB' confirmations, with the same code I put above for the 'PB' ones, the BAPI does not create the confirmation and shows no success message. Doesn't flag an error either. Just ignores everything.
I've read on other thread that this happens because of the internal and external confirmation categories on the SPRO transaction. The PB is set
as an internal category and the AB is not. But I am not allowed to change those. Furthermore, I have created PB and AB confirmations manually on the ME22N transaction with no trouble at all, so I understand it can be done without modifying the SPRO customizing.
Does anybody know any solution for this? Thank you very much!