cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PRDSRVAPS_SAVEMULTI2 - EXTENSION_IN data not saved during Create

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member245665
Participant
0 Kudos

Hi,

Have you updated Custom fields in Bapi structures..if. Not, I think you have to add the custom fields and its char1 fields in corresponding BAPI extension structures such as BAPE_****, BAPE_****X, ****KZ and ****KZX..

Thanks,

Venu.

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello,

Refer SAP note  1512167 - BAPI_PRDSRVAPS_SAVEMULTI2: Customer-specific fields

Best Regards,

R.Brahmankar

Former Member
0 Kudos

Hallo R.Brahmankar,

thank you for the answer. However, it does not solve my issue. I am aware of the note you mentioned, but it covers only the issue when the provided PRODUCT_ID was not correctly supplied (or reflected by the standard coding due to bug in it) during the change of the product.

What I am explicitly asking for is creation of the new product. Change part is just working fine for me. As mentioned in my original post, the issue is that the standard coding is not able to distribute the GUID (which is created for the new product on the fly) to the EXTENSION_IN data the same way as it's done for the other table parameters.

Any comments on this are highly appreciated

BR

Michal

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello Michal,

I am not a technical person, Parameter EXTENSION_IN

This is an extension parameter that can be used within the SAP enhancement concept for BAPIs. It allows you to enhance BAPI functions without having to make modifications. The extension parameters are always evaluated in the BAdIs intended for this purpose.

could you please check BAdi APO_BAPI_BUS10001 method like CHANGE_SAVEMULTIPLE2 just refer example from SAP note  2046395 - BAPI_PRDSRVAPS_SAVEMULTI2: Fields cannot be maintained for location product

Best Regards,

R.Brahmankar

Former Member
0 Kudos

Hallo R.Brahmankar,

please, read my original post once more. This is not about how to use the EXTENSION_IN structure at all, this is what I am familiar with. Also the suggested notes (both of them) are on much different topic than I am asking about. I appreciate your effort and will be glad if you come across any idea related to my question.

Thank you

Michal