Solution : https://service.sap.com/sap/support/notes/906314 (SAP Service marketplace login required)
Summary :
SAP Note provides guidance on using the BAPI for posting goods receipts related to order confirmations. The note details extending the MB_BAPI_GOODSMVT_CREATE BAdI via the EXTENSIONIN_TO_MATDOC method within the MB_GOODSMOVEMENT enhancement spot. This approach allows specific confirmation keys to be passed through the EXTENSIONIN structure. Users are instructed to modify the ABAP Dictionary structures, BAPI_TE_XMSEG and CI_MSEGDB, to accommodate custom fields such as Z_ETENS for tracking acknowledgment numbers. Example code snippets and procedural steps are supplied for implementing and testing the enhancements using transaction SE19, SE11, and a sample program calling the BAPI_GOODSMVT_CREATE function to post goods receipts with distinct confirmation keys per line item.
Key words :
call function 'bapi_goodsmvt_create' exporting goodsmvt_header = bapigmhead goodsmvt_code = bapigmcode importing goodsmvt_headret = bapigmheadret tables return = lt_messages goodsmvt_item = lt_imseg extensionin = lt_extensionin exceptions error message, structure ci_msegdb short description append structure material document item component component type dtyp length z_etens etens numc 4add, component component type dtyp length short descriptionmat_doc mblnr char 10 number, material documentdoc_year mjahr numc 4 material document yearmatdoc_itm mblpo numc 4 item, call method cl_mmim_line_id_manager=>analyze_mb_create changing ct_imseg = ct_imseg[] exceptions duplicate_line_id = 1, exporting wait = importing return = endif, digits 1-4 line number - digits 5-8 vendor confirmationls_extensionin-valuepart1 = '00010001', key line_id = wa_bapi_mb_item-matdoc_itm assigning <fs_imseg>, <fs_imseg>-etens = wa_bapi_mb_item-z_etens, call function 'bapi_transaction_commit'
Related Notes :
959797 | WMMBXY/MBGMCR/BAPI_GOODSMVT_CREATE order confirmation |
520813 | FAQ: BAPIs for goods movements |