cancel
Showing results for 
Search instead for 
Did you mean: 

To get Pegging link info between requirements and reciepts using FM

richard_gu
Explorer
0 Kudos

Hi all, I wanna how to retrieve the link relationship between requirements(Sales Scheduling Aggreement) and reciepts(Planned Order), now I can only get all of them in one pegging area by using /SAPAPO/RRP_PT_IOLIST_READ with a certain Pegging ID. But I can hardly see the allocation relationship among the SA and pld. order from the result of the FM.

Could anyone give me some clue and advice?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

maheshbabu_mg
Advisor
Advisor
0 Kudos

Hello Richard Gu ,

Can you please try the BAPI BAPI_SLSRVAPS_GETLIST2, which also provides the input and output pegging nodes .

Thanks,

Mahesh

richard_gu
Explorer
0 Kudos

Hi Mahesh, Thanks your reply.

When I try this BAPI, All the result is empty and no error message in the BAPI RETURN. could u help to see the problem? Here I am using ORDER_GUIDS as import parameter. I wonder is it a import parameter or a export parameter?

DATA:
      lt_order_guid TYPE TABLE OF BAPIAPOORDID,
      ls_order_guid LIKE LINE OF lt_order_guid.

CALL FUNCTION '/SAPAPO/CIF_GUID_CONVERT'
      EXPORTING
        iv_guid_c22      = 'toiz}Oef0F6S{W0KNXo1o0'
      IMPORTING
        ev_guid_c32      = ls_order_guid-ORDID
      EXCEPTIONS
        parameters_error = 1
        OTHERS           = 2.
APPEND ls_order_guid TO lt_order_guid.

DATA:
      lt_requirement TYPE TABLE OF BAPI10501SLREQOUT,
      lt_receipt TYPE TABLE OF BAPI10501SLRECOUT,
      lt_pegging_input_node TYPE TABLE OF BAPI10501ORDINPUTPEGOUT,
      lt_pegging_output_node TYPE TABLE OF BAPI10501ORDOUTPUTPEGOUT.
DATA:
      ls_export_flag TYPE BAPI10501SELRETFLAGS2.
ls_export_flag-NO_PEG_INPUT_FLAG = ''.
ls_export_flag-NO_CHARACT_REQ_INPUT_FLAG = ''.
ls_export_flag-NO_DOCUMENTS_FLAG = ''.
ls_export_flag-NO_RECEIPTS_FLAG = ''.
ls_export_flag-NO_PEG_OUTPUT_FLAG = ''.
ls_export_flag-NO_CFG_HEADERS = ''.
ls_export_flag-NO_CFG_INSTANCES = ''.
ls_export_flag-NO_CFG_PART_OF = ''.
ls_export_flag-NO_CFG_VALUES = ''.
ls_export_flag-NO_CFG_VAR_KEYS = ''.
ls_export_flag-NO_CFG_BLOB = ''.
ls_export_flag-NO_COMPLETE_ORDER_READING = ''.

DATA:
      lt_return TYPE TABLE OF BAPIRET2,
      lt_order_key TYPE TABLE OF BAPI10501ORDERKEY.
CALL FUNCTION 'BAPI_SLSRVAPS_GETLIST2'
  EXPORTING
    LOGICAL_SYSTEM              = 'B10CLNT100'
*   START_TIME                  =
*   END_TIME                    =
   EXCLUDE_EXPORT_FLAGS        = ls_export_flag
*   MAX_NUMBER_OF_ORDERS        =
*   TRANSFER_MODE               =
*   PLNG_VERSION                = '000'
*   IO_NODE_SELECTION           = 'I'
* IMPORTING
*   NUMBER_OF_ORDERS            =
 TABLES
*   PRODUCT_SELECTION           =
*   LOCATION_SELECTION          =
*   LOCTYPE_SELECTION           =
*   PRODUCT_LOCATION_KEYS       =
*   ORDER_SELECTION             =
*   ORDERTYPE_SELECTION         =
   ORDER_GUIDS                 = lt_order_guid
   ORDER_KEYS                  = lt_order_key
*   ATPCAT_SELECTION            =
*   CUSTOMER_SELECTION          =
*   CFG_SELECTION               =
   REQUIREMENTS                = lt_requirement
   RECEIPTS                    = lt_receipt
   PEGGING_INPUT_NODES         = lt_pegging_input_node
   PEGGING_OUTPUT_NODES        = lt_pegging_output_node
*   CFG_HEADERS                 =
*   CFG_INSTANCES               =
*   CFG_PART_OF                 =
*   CFG_VALUES                  =
*   CFG_VAR_KEYS                =
*   CFG_BLOB                    =
   RETURN                      = lt_return
*   EXTENSION_IN                =
*   EXTENSION_OUT               =
    .

richard_gu
Explorer
0 Kudos

...... Why the markup doesn't works?

maheshbabu_mg
Advisor
Advisor
0 Kudos

Hello Richard Gu,

I'm sorry, I'm not sure about the problem you were facing. Have you tried reading the BAPI documentation for the recommended input fields.Generally the BAPI documentation should cover this.

Also there are latest correction notes available for this BAPI, please do a note search and implement any missing ones.

Thanks & kind regards,

Mahesh

richard_gu
Explorer
0 Kudos

Hi, the exact problem I am facing now is, I have implement a BADI u201C/SAPAPO/RRP_SRC_EXITu201D-> u201CRRP_USEX_PLORD_CREATEu201D, which will be triggered during the creation of a planned order. In it I want to get the pegging info about the current creating order. However, It seems at that time, the Order hasn't been saved in to Live Cache, so every live cache related Function Module does not work. I am still finding the solution now.

Thanks.

ramesh_mahankali
Active Participant
0 Kudos

Hi,

This method RRP_USEX_PLORD_CREATE has parameter CT_INPUTS/CT_OUTPUTS which should contain the pegging info.

Please check and let us know.

-Ramesh

richard_gu
Explorer
0 Kudos

Hi Ramesh ,

Thanks for the reply. I have debuged this method during MMP running, and found the CT_INPUT is empty and the CT_OUTPUT does contain pegging info of the creating planned order(eg, the pegging id,... ) but, it doesn't show which Requirement (In our case, Sales Agreements) the planned order belong to. I would like to see some data which contain from act id -> to act id, such kind of info indicate the allocation relationship, but it seems the parameters havn't provided them.

Anything misunderstanding, please correct me. Thank u.

richard_gu
Explorer
0 Kudos

And more over, I do not know why CT_INPUT is always empty?