cancel
Showing results for 
Search instead for 
Did you mean: 

To build query related to SNP: Planned Order

former_member263130
Participant
0 Kudos

Hi,

System: SCM 5.0

Scenario: SO received at plant and planning creates PR against SO at plant and accordingly SNP:Planned Order at Vendor location. If SO is cancelled/deleted (manually), sometime only the PR gets cancelled/deleted (automatically during planning run) but corresponding SNP:Planned Orders still remains at vendor location and so the dependent requirements. PR and Planned Orders are pegged to SO so one-to-one relation is maintained.

I could not find any reason why system is not deleting Planned Order at vendor location despite SO and PR is deleted at plant location. So I am planning to build query where SNP:Planned Orders are not pegged to any PR or SO.

Can anyone help with list of SNP:Planned Order tables so that I can build query around it to identify ghost Planned Orders.

Hope I was clear with my query but let me know if any further information is require.

Thanks and regards,

Devang

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

You could always delete planned orders at the vendor location prior to the SNP planning run by using the RLCDELETE function.  That way there is no mistake when SNP runs.  The job itself could be scheduled as a step in the batch job/process chain you use to run SNP.

Lower level codes should be generated before each SNP run - SAP help is here http://help.sap.com/saphelp_ewm70/helpdata/en/47/dc352f5bc33b8be10000000a421937/content.htm


Former Member
0 Kudos

Hi Devang,

If it was helpful for you please validate the right answers. So, the others consultant can benefit!

Thanks.

Regards, Marius 

former_member263130
Participant
0 Kudos

HI Marius,

Sorry for delay reply.

I was working on on some other more critical issues to business.

Finally we decided to built report to identify obsolete Planned Orders for which PR is not available in ordering plant. I have listed below logic for that report:

  1. Get Location ID from table /SAPAPO/LOC based on Location entered in selection screen
  2. Get PEGIDs from FM /SAPAPO/DM_MATLOC_GET_PEGIDS based on IV_SIMID as 000 and location id from step 1
  3. In FM /SAPAPO/OM_PEG_CAT_GET_ORDERS, use SIMVERSION as 000 and in Import Para IS_GEN_PARAMS insert all PEGIDs from step 2.
  4. From Export Para ET_PEG_INPNODE take From_OrderID and store in internal table.
  5. Execute T.Code /SAPAPO/RRP4 with following selection (Use Selection Variant: OBSOLETE PR and add Location as entered in Selection Screen)

Planning Version: 000

From: Current date – 60 days

To: Current date +180 days

Location: 0000201328

Product: *

Order Type: 1F

    6. Compare output of step 4 and step 5 and display result.

From FM /SAPAPO/DM_MATLOC_GET_PEGIDS the output (step 4) will be Order ID (22 characters) while step 5 (T.Code /SAPAPO/RRP4) will give Planned Order number (8 character). I am not sure how to compare Internal Order ID (22 characters) for corresponding Planned Order Nos. (8 characters).

I have not marked your post as correct answer as still need to find answer of above query.

Thank you in advance for your guidance.

Regards,

Devang Shah

former_member263130
Participant
0 Kudos

Hi,

Finally we build report to identify Obsolete Planned Orders for which PR at plant is already deleted. Above mentioned design was not followed because of technical difficulties and report was developed based on below mentioned logic.

Transaction to execute report with 1 selection screen where user can enter single location for which report needs to be executed.

  1. Retrieve all models from table /SAPAPO/V_MATLOC for location entered in initial selection screen.
  2. Use BAPI ‘BAPI_MOSRVAPS_GETLIST2’, select Uppercase/Lowercase, mention Logical_System as system ID, Plng_version as 000 and under table PRODUCT_LOCATION_KEYS enter Product and Location as retrieved in step 1.
  3. From Output table PEGGING_OUTPUT_NODES collect all the PGOUT_ORDER_NUMBER and ORDID with PGOUT_OBJECT_TYPE as 8 and PGOUT_INT_ORDER_TYP as 31. Remove duplicates from collected PGOUT_ORDER_NUMBER.
  4. Compare PGOUT_ORDER_NUMBER (collected in step 3) with PGIN_ORDER_NUMBER (from Output table PEGGING_INPUT_NODES, after removing duplicates) having PGIN_OBJECT_TYPE as 8 and PGIN_INT_ORDER_TYPE as 31. Collect all the delta PGIN_ORDER_NUMBER and delta PGOUT_ORDER_NUMBER along with corresponding ORDID.
  5. From Output table OUTPUT_NODES retrieve Product and Location based on ORDID collected in step 4 earlier.
  6. Display delta PGIN_ORDER_NUMBER (collected in step 4) along with Product and Location (collected in step 5).

Cheers,

Devang

Former Member
0 Kudos

Hi Devang,

Excellent job .

Regards, Marius

Former Member
0 Kudos

Hi Devang,

Also be sure than SNP.Pl.order is not fixed. The heuristic will not delete it if is fix.

Are you sure than during the planning the heuristic takes in consideration also vendors/products combination (not just plant/product)?

Is low level code performed before heuristic run?

Thanks.

Regards, Marius

former_member263130
Participant
0 Kudos

Hi Marius,

Sorry for delay.

I checked SPRO setting and Heu. Order Update is set as Complete Mode. I am sure vendor+product combination is considered as well because that is how we have planned orders at vendor location and also dependent demands at vendor locations.

I am not sure where to check if low level code is performed before heuristic run. But somehow I think the issue is because of system (SCM 5.0) inconsistency because otherwise why only some time PR at plant is deleted but Planned Order and Dependent Requirements downwards at vendor location are intact.

Hence I want to build query around Planned Order to check if there is any trend where upward elements like PR at plant is deleted.

I hope you got my point and can help me tables for Planned Orders and Purchase Requisitions.

Thanks and regards,

Devang Shah

Former Member
0 Kudos

Hi Devang,

There are few BAPI that can be used to read orders. For example for P.Requisition you can use BAPI_POSRVAPS_GETLIST3 and for manufacturing orders you can use BAPI_MOSRVAPS_GETLIST2. To extract from planning book by key figures you can use BAPI_PBSRVAPS_GETDETAIL2.   

You can have a list of BAPI in SE37.

From SE16 if you enter as table name /SAPAPO/*  and press F4 you will have all possible SAPAPO tables.

http://wiki.scn.sap.com/wiki/display/scm/apo-technical?original_fqdn=wiki.sdn.sap.com&bc=true

http://sapexperts.wispubs.com/scm/articles/sample-design-sap-netweaver-bw-for-apo-snp-reporting-and-...

http://wiki.scn.sap.com/wiki/display/SCM/SCM+Useful+Tables

Hope that can help you.

Thanks.

Regards, Marius

Former Member
0 Kudos

Hi Devang,

Did you try with the setting COPLETE MODE for the heuristic?

In SPRO, Global SNP Settings, field Heu.Order.Update choose Complete Mode.

Hope than can help you!

Thanks.

Regards, Marius