cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing COMBI_ENRICH method in BAdI /SAPAPO/SDP_MASTER while creating CVC's from file upload

Former Member
0 Kudos

Hi All,

I am very new to APO.

My requirement is to create CVC's using file upload. While uploading file, I need to look-up for the values maintained in two custom tables comparing with charectersitic combination values maintained in the file.

I found we can use BAdI /SAPAPO/SDP_MASTER and do implementation in COMBI_ENRICH method for the creating CVC's. The BAdI uses program /SAPAPO/TS_PLOB_MAINTAIN. But, I don't know when and how this COMBI_ENRICH method is called into program. How can I read the values from file into this method and again populate after look-up.

I am very confused how to compare field values from file with the fields in custom tables and also it needs to check for duplicate CVC's if already existed.

Can anyone please help me how to write logic and call the COMBI_ENRICH method while creating CVC's.

Appreciate your help and points will be assigned for valuable suggestions.

Thank you very much.

Sri

Accepted Solutions (0)

Answers (2)

Answers (2)

babu_kilari4
Active Contributor
0 Kudos

Hello Sri P,

If I am not wrong you must be uploading the file with the list of CVCs into worklist option of standard transaction /SAPAPO/MC62. After uploading the file, when you execute the program; system internally calls the BADI method "COMBI_ENRICH" where you can do the relevant checks for your CVCs and adjust / remove the unnecessary entries and allow the program to proceed further for CVC creation.

The above mentioned BADI method gets called in the standard function module /SAPAPO/TS_PLOB_MAINTAIN.

However, if I had develop something to meet your requirement, I may be interested in looking at the other BADI method which gets triggered in the piece of code that is being used by Standard SAP to check the validity of the master data ( see the check boxes "Check Char. Data, Check SCM Data, Check BW Data" ). The method to be used would be set_combi_value_check in the same BADI mentioned by you in your query. Implement the logic here to log the errors and proceed further for CVC creation with the remaining entries.

Hope this helps. Please get back to us if you have any other query.

Babu Kilari

Former Member
0 Kudos

Thanks for your suggestion Babu,

I found internal table which is storing flat file values in the program and I can write code comparing the values.

But, My question now is this BAdI needs to be called only when we are using File option while creating CVC's.

Is there any method or control to restrict the BAdI only for File while CVC's creation.

Thank you.

Sri

babu_kilari4
Active Contributor
0 Kudos

Hello Srikanth,

In my view, you can handle this with the help of an ABAP person. Ask him to see if he can find any implicit enhancement in the source code of the program /SAPAPO/TS_PLOB_MAINTAINF03 and whenever the file option ( field LOAD )is selected store the content of the selection screen ( whether the field is non-blank or not ) it in a global variable or a global function group( with get and set kind of modules defined ) and use the same global variable in the BADI method and develop the logic only if the above variable has non-blank value ( indicates that file option has been chosen by the user )

You may create the implicit enhancement fill_variables_from_variant at the end of the method in the include mentioned above ( /SAPAPO/TS_PLOB_MAINTAINF03 ). Test it once in the debugger and make sure it it the right place to store the data in the memory.

Hope this helps

Babu Kilari

satish_waghmare3
Active Contributor
0 Kudos

Hello Sri

Sorry, I am not answering the query you asked, but giving the details about possible workaround to satisfy similar requirement.

In the past I had worked on the similar requirement where CVCs requirement to be created based on the file being uploaded by the user.


1. This was done by creating the program which will upload file into Application Server(AL11).

2. While uploading file, individuals records from the file were validated against the Master data(Info objects - /BIC/PXXX tables) in APO and also against the /sapapo/v_matloc table.

Erroneous or invalid records  were written into the log file and was shown on the screen. Only valid records used to be uploaded in a file on application server.

3. Then batch job used to run to pickup the file and upload it into the Infocube.

4. Then CVC will be created based on infocube by running standard /SAPAPO/TS_PLOB_MAINTAIN program.

5. Once CVCs are generated, the run /SAPAPO/TS_LCM_PLOB_DELTA_SYNC to do Adjust Time Series.

I believe this is much simpler approach, less development effort and also it leverages standard inherent SAP features.

Hope this will help.

Thank you

Satish Waghmare