cancel
Showing results for 
Search instead for 
Did you mean: 

Copy KF for a product at a location to the same product at another location

ruchi_das2
Active Participant
0 Kudos

Hi all

I am trying to copy a Key Figure for a material, say M at location A to the same key figure for the same material M at location B.

I am using a BAPi to do this. ( The copying happens in the same version ). This is order series copying.

The BAPI being used is /SAPAPO?RRP_LC_PEGID_GET_IO to get the data and prior to that, i use /SAPAPO/DM_MATERIAL_GET_PEGID to get the PEGID.

I need the value for the parameters that would make this BAPI work.

I have just tried putting in the PEGID and it says COM error and the program is terminated.

Any help on making this work successfully is totally appreciated.

Thanks

Ruchi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Ruchi,

Please follow the steps below:

1.Use the fuction module '/SAPAPO/RRP_LC_PEGID_GET_IO' to get the data from live cache.

2.Pass the pegid to the export parameter 'it_pegarea'.

3.Determine pegid by using the function module '/SAPAPO/DM_MATERIAL_GET_PEGID'.

4.And remember to create a sim session using the fm /SAPAPO/RRP_SIMSESSION_CREATE

Please look into the links

Hope this information would solve your query

Regards,

ruchi_das2
Active Participant
0 Kudos

Hi Swetha

1) Created a sim session using /SAPAPO/RRP_SIMSESSION_CREATE, ( didn't know where this was used though )

2) I got the PEGID from /SAPAPO/DM_MATERIAL_GET_PEGID for a given prod & location.

3) Assigned that PEGID to it_pegarea in /SAPAPO/RRP_LC_PEGID_GET_IO.

4) When i execute after putting in the PEGID, i get the following error and the fm is terminated.

A COM routine has encountered a program error.

Regards

Ruchi

former_member209769
Active Contributor
0 Kudos

Hi Ruchi,

If you really want to check /SAPAPO/RRP_LC_PEGID_GET_IO, you can't directly do it in foreground as it will need SIMSESSION internally during processing.

Use the FM through a program after using /SAPAPO/RRP_SIMSESSION_CREATE. In the program, the created SIMSESSION will be used automatically in /SAPAPO/RRP_LC_PEGID_GET_IO when required.

If you really want to try out the FM directly, you need to do the following:

1) Create SIMSESSION using /SAPAPO/RRP_SIMSESSION_CREATE. Let this window be open. You would need this SIMSESSION value later.

2) In FM execution screen, select the checkbox 'Uppercase/Lowercase '. Otherwise the values that you enter would get converted automatically to uppercase.

3) Maintain the pegging ID in the IT_PEGAREA.

4) Select the "debugging" option.

5) In debug when you reach the FM '/SAPAPO/QTA_PEGID_GET_IO', change the values of gs_gen_params & gv_simsession. These would be blank by default. You need to give 000 for first field (SIMVERSION) of gs_gen_params, and give the SIMSESSION that you created earlier for GV_SIMSESSION.

6) Now you can press F8. And you would get the values in ET_IONODES.

This is quite technical, so if you are not comfortable with debug, then ignore this, and use the FMs in a program. It would work.

PS: I am not a technical person, so I can't explain what SIMSESSION really does in this case, but I know that this works.

Hope this helps.

Thanks - Pawan

Edited by: Pawan Pathak on Jan 13, 2012 9:59 AM

Answers (3)

Answers (3)

ruchi_das2
Active Participant
0 Kudos

I thnik i have found a feasible solution to copy data of Product M location A from SNP to DP using TSCOPY and then Use the RLG copy in DP to DP to load the data from Product M location A to Product M location B. After doing that use TSCOPY again to get the data from DP to SNP

ruchi_das2
Active Participant
0 Kudos

I am looking for FM Documentation for the BAPI's that i have mentioned.

I am not able to execute them, maybe because i am missing some parameters.

I am looking for any help on the parameters values or documentation for the FM /SAPAPO/RRP_LC_PEGID_GET_IO

Thanks

Ruchi

m_manimaran
Active Contributor
0 Kudos

Hi Ruchi,

Are you doing this in DP or SNP? I think it can be done without a BAPI using the macro functions TS_GET and TS_SET. Have you looked into these functions?

Regards,

Manimaran M.

ruchi_das2
Active Participant
0 Kudos

Hi Manimaran

I am doing this for SNP, but i have a requirement such that the Key Figures that i have to copy are time series and order series.

Had to bring in a couple of Time Series KF's into the SNP planning books.

So what you have told works for both time series and order series?

Thanks

Ruchi

m_manimaran
Active Contributor
0 Kudos

Hi Ruchi,

I think, we can use those functions for time series only. I tried that in demand planning for one of our requirements and it worked well. I never tried it on SNP.

Regards,

Manimaran M.