Split SNP PDS using BADI /SAPAPO/CURTO_SNP Method CIF_IMPORT

Advertisement

Split SNP PDS using BADI /SAPAPO/CURTO_SNP Method CIF_IMPORT
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.
Repaly
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.
Read More: The other 5 answers