cancel
Showing results for 
Search instead for 
Did you mean: 

Split SNP PDS using BADI /SAPAPO/CURTO_SNP Method CIF_IMPORT

Former Member
0 Kudos

Hello APO ABAP experts,

The requirement is to split SNP PDS based on the number of modes. Meaning, the PDS should have only Mode per Activity in the Operations.

My plan was to change the changing internal tables in the method CIF_IMPORT to create number of SNP PDS depending up on Modes. But, i am not sure whether it is possible or not. Please suggest.

Note: BADI will be triggered once per each PDS.

Thanks,

Shaun.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shaun,

You can achieve this using the same BAdi because it is the only BAdi where you can change the PDS related data while CIF from ECC to APO.Let me know if any further help required.

Regards,

Saurabh

Former Member
0 Kudos

Saurabh,

Let me explain you what i am doing:

Since i need to split one PDS into multiple PDS, I am changing the fields EXT_PLANNR and EXT_NAME just by appending a counter. Once after i change them, adding the entries to the changing internal tables (CT_*). At the end of CIF_IMPORT, i am deleting the original PDS entries.

Example code:

LOOP AT ct_planactz INTO ls_planactz.

ls_planactz-ext_plannr = lv_new_ext_plannr.

APPEND ls_planactz TO lt_planactz.

ENDLOOP.

APPEND LINES OF lt_planactz TO ct_planactz.

Right now, for testing purpose - i am not splitting the PDS. I am just trying to create 2 SNP PDS by using one PDS. I want to test my code first to create multiple PDS.

When doing this, i get the following error:

Error: Activity 250006007010001-012 000600000004 P does not exist

Message no. /SAPAPO/CURTO005

Piece of standard code cuasing the problem:

LN 64 in method GET_APO_GUIDS.

READ TABLE ct_cif_planactz INTO ls_cif_planactz

WITH KEY actnr = ls_apo_planactz-r3actnr

plnkn = ls_apo_planactz-plnkn

zaehl = ls_apo_planactz-zaehl

phasenr = ls_apo_planactz-phasenr

uvorn = ls_apo_planactz-uvorn

BINARY SEARCH.

Call stack:

METHOD GET_APO_GUIDS

METHOD CREATE_RTO

METHOD CREATE_SNP_RTO

FUNCTION /SAPAPO/CUSLNTRTO_CREATE_RTO

Question:

May i know what is the significance of other fields in internal table ct_cif_planactz ? Since i am chaning only EXT_PLANNR field, above binary search is picking up the same entries and ignoring my second PDS.

I would appreciate if you can share your ideas.

Thanks,

Shaun.

Former Member
0 Kudos

Hi Shaun,

1) Very first thing,Why you are deleting existing entry of PDS i am not sure about.

2) If CIF_IMPORT is giving you the error, then try with other methods like AFTER_SAVE.

3) Check the parameter tables which are passing to FM /SAPAPO/CUSLNTRTO_CREATE_RTO using external break-point.

4) In the same way, you have to add the second entry to the tables. then check whether it is commiting or not.

5) If it is working then apply the logic in the same method for Spliting PDS in to multiple.Changing only the EXT_PLANNR will not solve the purpose i guess.You have to change the counters in all the CT_* tables....try this.

Regards,

Saurabh

Former Member
0 Kudos

Thanks Saurabh,

I am sure that CIF_IMPORT is the correct method. But, i am missing other parameters which need to be changed.

Has any one done like this? If yes, please share your ideas.

Thanks,

Shaun