Hi,
we use BAPI_PRDSRVAPS_SAVEMULTI2 not only for updating the existing products but also for creating products in APO, however there is an issue using the product identification field PRODUCT_ID. Let me explain.
When we create the new product and the data is supplied via standard fields in 'ordinary' table parameters (fx. PRODUCT_ALT_UOM), then it's sufficient to provide just PRODUCT and PRODUCT_INT to identify the product. Of course, some other data is supplied as well. The field PRODUCT_ID (GUID of length 32) is generated when the product is saved and it is spread by the system into all tables as needed (following the example with data in parameter PRODUCT_ALT_UOM, the same GUID is stored in respective table /SAPAPO/MARM as is used in product master data /SAPAPO/MATKEY). So far, so good.
However, we need to save the custom fields data as well in EXTENSION_IN, using the structure BAPI_TE_SAPAPO_MATLOC. It seems that the system is not able to transfer the newly generated PRODUCT_ID to these fields which are passed as formatted, aligned strings in fields VALUEPART1-VALUEPART4 of EXTENSION_IN. That's why we need to save the product first in normal way (without passing in EXTENSION_IN) and call BAPI_TRANSACTION_COMMIT, then read it again using BAPI_PRDSRVAPS_GETLIST2 to obtain the PRODUCT_ID just generated for the new product and then we update (already existing) product again - now already with filled PRODUCT_ID in EXTENSION_IN.
That is a problem as it introducesunnecessary COMMITs and more BAPI calls than needed.
My question is: Is there any way to force the system to supply the PRODUCT_ID not only for the standard tables but to the data in EXTENSION_IN during the very first save already, so that we could spare one more COMMIT, BAPI_PRDSRVAPS_GETLIST2 and BAPI_PRDSRVAPS_SAVEMULTI2?
Just to avoid misunderstandings, the data for BAPI_TE_SAPAPO_MATLOC_X in EXTENSION_IN are supplied, too, so this is not a problem. We know that it's only the missing PRODUCT_ID in EXTENSION_IN in the first call which is causing the problem of data not being saved. The thing is, how to make the system treat the data in EXTENSION_IN the same way as in standard tables? The PRODUCT_ID is missing during the first save in all the table parameters - the standard ones and in data contained in EXTENSION_IN. However, the data in standard table parameters are saved well while data in EXTENSION_IN are not.
Thank you, Michal