cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in BAPI- BAPI_PBSRVAPS_GETDETAIL2 with custom default macro in SNP

Former Member
0 Kudos

Hi Experts,

System Details:

SCM 5.0

SP Pack: 13

SNP PA1- No Time series Key figures, only order series

SNP PA3: With time series KF, which also included dynamic safety stock time series KFs

We have created custom macro ZGSCM_SAFETY_STOCK copy

of /SAPAPO/SAFETY_CALC where we used BAPI- BAPI_PBSRVAPS_GETDETAIL2 to

get the dynamic safety stock values from PA3(Planning area3-Planning book3) to PA1(Planning area1-Planning book1). We are getting two issues while doing this as below:

1) Issue we are facing is that when it goes to PA3, it actually save

PA3 planning book for that user as a active planning book and return

back with PA3-planning book. So to avoid this, we call same BAPI again

where we are just calling PA1 planning book without any selection and It works fine and returns

the safety stock values correctly. But now when we load multiple items and

doing the drill down then we are getting an error message saying:

Error reading planning objects (No SNP master data table found)

Error reading data - Planning book cannot be processed further

Do we have any other way to set the active session for user after BAPI call with in the program?

2) Also it always call default macros when BAPI calls which we don't

want, Is there any way we can avoid calling default macros while calling BAPI-BAPI_PBSRVAPS_GETDETAIL2

Regards,

Hitesh

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member209769
Active Contributor
0 Kudos

Hi Hitesh,

If you read the documentation for the BAPI (Go to SE37, and after you select the BAPI, click on Function Module documentation), it will clearly say that "In the case of SNP planning books on the other hand, macros are always executed.".

So point 2 is not possible.

For point 1, you would only see the values of KFs being returned when you use this BAPI (I assume in a BADI macro).

It's not clear what you mean when you say "Issue we are facing is that when it goes to PA3, it actually save PA3 planning book for that user as a active planning book and return back with PA3-planning book."

If you could explain this, I could try to give some solution if possible.

Thanks - Pawan

Former Member
0 Kudos

Hi,

The first issue which you faced is becasue of the BAPI which tries to access all the Key Figurs of the data view from which you need to copy data. These KF might be used in different Macros & those macro's might be running for different periodicities.

You can create separate data view the the same planning book & assign the KF to the newly created data view. Most probably, this will solve your problem & you wont get any error message.

Incase the error message pops up, you need to create diffent planning book or planning area (based on your previous PA) & then try. This will definately solve problem which u had faced.

Thanks!

Jay