SAP4TECH

SAP and ABAP Free Tutorials
Menu
  • SAP Technical
    • ABAP Code Snippets
    • ABAP WebDynPro
    • SAP GW
    • SAP IDOC (ALE)
    • SAP PI (XI)
    • SAP Screen Personas
    • SAP Workflow
  • SAP Functional
    • SAP FI
    • SAP FSCM
    • SAP HR
    • SAP SD & SAP MM
    • SAP PM
    • SAP PP
    • SAP PS
    • SAP QM
    • SAP VIM
    • SAP WM
  • SAP Fiori
  • SAP HANA
  • SAP BW
  • SAP CRM
  • SAP SRM
  • SAP4TECH
    • About Us
    • Contact Us
    • Terms & Conditions
    • Privacy and Cookie Policy

SAP4TECH » How to Link Between PLKO and PLPO for Routine in SAP

SAP PP

How to Link Between PLKO and PLPO for Routine in SAP

March 15, 2016 John

Link between PLKO and PLPO for Routine in SAP will be explain in this post with the definition of each tables involved and a sample ABAP Code to retrieve for a Production Version the Routine.

Table of Contents

  • SAP Routines Tables
  • Main Keys fields for
  • Link between PLKO and PLPO
  • Link Between PLKO and PLMZ

SAP Routines Tables

Let first introduce the SAP Tables used for Production:

TableSAP Routine Tables
PLKO Task list – header 
PLPO Task list – operation/activity 
PLMZ Allocation of bill of material items to operations 
PLAS Task list – selection of operations/activities 
PLABRelationships 
PLAFPlanned order 
PLFHTask list – production resources/tools 
PLFLTask list – sequences 
PLFTProcess Instructions 
PLFVPI Characteristics/Sub-Operation Parameter Values 
PLKVView of planned order header data 
PLKZTask list  main header
PLMKInspection plan characteristics 
PLMWMAPL-Dependent Charac. Specifications (Inspection Plan) 
PLPHCAPP  Sub-operations
PLPBLong-term planning  Independent requirements versions
PLPWIndex of the production/delivery plant in the planned order 
PLSRScheduling results 
PLSTStatus table for planned order processing 
PLZURouting data for group 

The next step is how to link between theses SAP main tables in SAP PP.

Main Keys fields for

In order to figure out the Link Between PLKO and PLPO, it is important to know the Main keys fields for are:

Key FieldsSAP Routines Tables Key Fields
PLNTYTask List Type Number (for orders from AFKO, for notifications from
PLNNRGroup (for orders from AFKO, for notifications from QMIH)
PLNALGroup Counter (for orders from AFKO, for notifications from QMIH)

Link between PLKO and PLPO

This section will cover the relationship between PLPO and PLKO.
The link between PLKO : Routine Header and PLPO Routine Post is done in the table PLAS.

An example of SAP Select how to retrieve PLAS : Link between PLPO and PLKO

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
13
*----------------------------------------------------*
* READ PLAS
*----------------------------------------------------*
IF NOT lt_plko[] IS INITIAL.
  SELECT * FROM plas INTO TABLE lt_plas
   FOR ALL ENTRIES IN lt_plko
   WHERE plnty = lt_plko-plnty
     AND plnnr = lt_plko-plnnr
     AND plnal = lt_plko-plnal
     AND loekz NE 'X'.
 
  DELETE ADJACENT DUPLICATES FROM lt_plas COMPARING ALL FIELDS.
ENDIF.

An example SAP Select to retrieve the PLPO with the PLAS-link to PLKO.

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
*----------------------------------------------------*
* READ PLPO
*----------------------------------------------------*
IF NOT lt_plas[] IS INITIAL.
  SELECT * FROM plpo INTO TABLE lt_plpo
    FOR ALL ENTRIES IN lt_plas
    WHERE plnty = lt_plas-plnty
      AND plnnr = lt_plas-plnnr
      AND plnkn = lt_plas-plnkn
      AND zaehl = lt_plas-zaehl.
  DELETE ADJACENT DUPLICATES FROM lt_plpo COMPARING ALL FIELDS.
ENDIF.

An ABAP sample code to retrieve the different link between PLKO and PLPO using PLAS can be :

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
READ TABLE lt_plko INTO ls_plko
    WITH KEY plnnr = IV_plnnr " Input
             plnty = IV_plnty " Input .
IF sy-subrc = 0 .
" write your ABAP Custom Logic
ENDIF.
 
 
" LINK BETWEEN PLKO AND PLPO -> PLAS
LOOP AT lt_plas INTO ls_plas WHERE plnnr = ls_plko-plnnr
                               AND plnty = ls_plko-plnty.
 
  READ TABLE lt_plpo INTO ls_plpo
   WITH KEY plnty = ls_plas-plnty
            plnnr = ls_plas-plnnr
            plnkn = ls_plas-plnkn
            zaehl = ls_plas-zaehl.
  IF sy-subrc = 0 .
  " CUSTOM LOGIC HERE
  ENDIF.
ENDLOOP

Link Between PLKO and PLMZ

PLPO is the SAP Table Routine lines and PLMZ Table stores the relationship between the Routine line and the BOM Component.

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
*----------------------------------------------------*
* READ PLMZ
*----------------------------------------------------*
IF NOT lt_plpo[] IS INITIAL.
SELECT * FROM plmz INTO TABLE lt_plmz
  FOR ALL ENTRIES IN lt_plpo
   WHERE plnty = lt_plpo-plnty
     AND plnnr = lt_plpo-plnnr
     AND loekz NE 'X'
     AND plnkn = lt_plpo-plnkn.
  DELETE ADJACENT DUPLICATES FROM lt_plmz COMPARING ALL FIELDS.
ENDIF.
 
LOOP AT lt_plmz INTO ls_plmz WHERE plnnr = ls_plko-plnnr
                               AND plnty = ls_plko-plnty.
 
  READ TABLE lt_plpo INTO ls_plpo_2
    WITH KEY plnty = ls_plmz-plnty
             plnnr = ls_plmz-plnnr
             plnkn = ls_plmz-plnkn.
  IF SY-SUBRC = 0.
  ENDIF.
ENDLOOP

PLPO Table in SAP, PLKO Table in SAP, PLPO & PLKO Link, PLOK Task List

Prev Article
Next Article
Tags:ABAP Sample SAP TABLE

Related Articles

SAP Process Order
SAP Process Order IDoc in detail is the main topic …

SAP Process Order IDoc LOIPRO – Structure, User-Exit and Outbound Processing

SAP Alternative Unit of Measure for Material
Before dealing with sap alternative unit of measure, let’s define …

SAP Alternative Unit of Measure for Material

Search on SAP4TECH

The Most Populars

  • The Most Important SAP ISU Tables
    The Most Important SAP ISU Tables
  • SAP Users Tables
    SAP Users Tables (for Personal, Logon, and Address Data)
  • List of SAP Purchase Order Tables in SAP MM SAP PO Tables
    SAP Purchase Order Tables: Main PO tables in SAP MM – SAP PO Tables
  • Full list of SAP Movement Types
    SAP Good Movement Types – Full list of SAP Movement Types
  • The Main SAP GL Account Tcodes SAP GL Account Tables
    The Main SAP G/L Account Tcodes & SAP GL Account Tables
  • SAP BOM Tables
    SAP BOM Tables for BOM Header, Items and components and Category

Related Posts

  • SAP EDI
    Most Useful SAP EDI Transactions (SAP Idocs Tcodes) & SAP EDI Tables
  • SAP CRM e1459022344657
    SAP KNVV: Customer Master Sales Data
  • chrysler invoice 46370 o e1442487543248
    IDoc Reduced Segment Check
  • SAP Production Order Tables e1459012874669
    SAP Production Orders Tcodes and SAP Planning Order Transactions
  • SAP UI Theme Designer
    SAP UI Theme Designer PDF Ressources: Step by Step Started Guides

SAP4TECH

SAP and ABAP Free Tutorials

Trending Posts

  • The Most Important SAP ISU Tables
  • SAP Users Tables (for Personal, Logon, and Address Data)
  • SAP Purchase Order Tables: Main PO tables in SAP MM – SAP PO Tables
  • SAP Good Movement Types – Full list of SAP Movement Types
  • The Main SAP G/L Account Tcodes & SAP GL Account Tables
  • SAP BOM Tables for BOM Header, Items and components and Category

The Most Recents

  • The Most Important SAP ISU Tables
  • SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd Lecture
  • The Main SAP Dunning Transaction Codes
  • SAP Accounts Payable Tcodes & Accounts Receivable Tcodes ( SAP AP Tcodes & SAP AR Tcodes)
  • The Most Important SAP Payment Terms Tables (ZTERM, Text…)

Search

SAP Tutorials by Topics

  • SAP Tables
  • SAP Tcodes
  • SAP BAPI
  • ABAP Snippets
  • Top SAP Courses
  • Top SAP Books
Copyright © 2021 SAP4TECH

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
This website uses cookies to improve your experience. We'll assume you accept this policy as long as you are using this websiteAcceptView Policy