cancel
Showing results for 
Search instead for 
Did you mean: 

FM for pegging relationship

Former Member
0 Kudos

Hello all,

We need to develop a customized report in APO that shows the demand element with pegging relationships with a production order.

In our business scenario, the sales orders are created in a location type distribution center and planned and production orders are created in a location type production plant. To do this, the MRP heuristics create purchase requisition to request the material from production plant to distribution center.

So, our intention is to find a sales order in the distribution center u201Cpeggedu201D to the production order in the production plant.

This information is similar to the data showed by the Order Context function of transaction /SAPAPO/RRP3.

We have developed a Z Function that uses BAPIs below:

BAPI_MOSRVAPS_GETLIST2 u2013 to get pegging data in table PEGGING_OUTPUT_NODES

BAPI_POSRVAPS_GETLIST3 u2013 to get pegging data of purchase requisition

BAPI_SLSRVAPS_GETLIST2 u2013 to finally get sales order information

The logic is more complex when we have dependent demand, because we have to call the BAPI_MOSRVAPS_GETLIST2 more than once until find the related purchase requisition.

The Z Function works fine but the performance is very poor mainly because we have different location.

Our question: is there a standard function module that shows the pegging relationship across the entire chain?

We have also tried the EFPL_ORD_NET_GET but we were not able to find which parameters should we use and how to input it correctly . We didnu2019t find documentation about it.

Can you help us?

Thanks in advance.

Januario Faria

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You were on right track to find out the pegging relationship across the entire structure.

Using BAPIs, you can definitely get the data however it is very cumbersome to call this BAPI in the program.

/SAPAPO/EFPL_ORD_NET_GET this FM will give you the entire pegging relationship for any order in the live-cache.

you need to paas the values to this FM as below.

I_SIMVERID = active version 000

I_SIMSESSID = simsession ID you can create using FM /sapapo/RRP_SIMSESSION_CREATE

I_ORDERS_TAB= in this table,you need to pass the CHAR22 GUID of any order like planned/sales order/pur.req..

In export parameter E_PEG_TAB table, you will get entire pegging structure for that particular order.

this will be in zigzag manner from order id - to order id.

First search for the orderID which you have provided as an input to this FM.

from there, you will get its pegged order iD. then search for that order id in same table but different column....and so on...you will get all the details which we can see in Context of product view.for testing purpose you download the table into excel and convert the order GUIDs into order nos so that you will understand the exact logic behind this.

for every order GUID in E_PEG_TAB, you will get the order no. and other details in E_ORDER_TAB parameter table of this FM.

I hope you have more idea about this FM now,

Regards,

Saurabh

Former Member
0 Kudos

Hi,

I need to do the same kind of report.

But I only need the output pegging of an order GUID.

Is there a way to easlely get only the output peggging with function module /SAPAPO/EFPL_ORD_NET_GET

I've tried with bapi BAPI_MOSRVAPS_GETLIST2 but I can't get it to work with only the order GUID. (I've worked with it before but with the orderNO and nog with only the GUID.

thanks a lot !

Caroline,

Former Member
0 Kudos

Think I found it 🙂

thanks,

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Martin,

Thank you very much for you information.

Bests regards.

Januario Faria

Former Member
0 Kudos

Hi Januario Faria

I am working on similar report to extract pegging relation based on sales order. I am having difficulties in reading pegging data from FM" /SAPAPO/EFPL_ORD_NET_GET".

It will be helpful if you provide me guidance or if you share the report which you have created.

Thanks in advance.

Regards

Kamalraj

Former Member
0 Kudos

Hi Kamalraj,

Please see the attached file with our main FM code to extract the pegging relationship.

Tell me if you need more information.

Best regards,

Januario Faria.

Former Member
0 Kudos

Thanks a lot Januario Jose.. I will  update get back to you if i need any information. Appreciate your support.

Former Member
0 Kudos

Greetings Januario

Try BAPI_PPDSSRVAPS_GET_IO_NODES Reading Receipts and Reqmts for Selection Criteria

This function module contains all information visable in product view, so make sure you do not request more informatino than you need or performance can be an issue. The FM documentation contains the selection options.

These function modules are related:

BAPI_PPDSSRVAPS_CHANPEGMULTI Create, Change, or Delete Pegging Relationships

BAPI_PPDSSRVAPS_REQ_IO_NODES Request: Read Receipts and Reqmts for Selection Criteria

Good luck

Martin

Former Member
0 Kudos

Hi Saurabh,

Thanks for your valuable information.

We will try to use /SAPAPO/EFPL_ORD_NET_GET.

Best regards.

Januario Faria.