[Test] Process route expansion Function

During development, there will be a need to display the C203 master recipe list in batches. Normally, when we make the process list of the general discrete manufacturing industry, we can directly access the numbers through the mutual links of the following tables.

  1. MAPL-Assign task list to material
  2. PLKO-Task List-Header
  3. PLAS-Task List-Process/Job Selection
  4. PLPO-Task List-Process/Job
  5. CRHD-Work Center Header

Sample code:

  SELECT A~WERKS A~MATNR A~PLNTY 
         A~PLNNR A~PLNAL A~DATUV
         B~KTEXT D~BMSCH D~MEINH
         D~LAR01 D~VGE01 D~VGW01
         D~LAR02 D~VGE02 D~VGW02
         D~LAR03 D~VGE03 D~VGW03
         D~LAR04 D~VGE04 D~VGW04
         D~LAR05 D~VGE05 D~VGW05
         D~LAR06 D~VGE06 D~VGW06
         D~PLNKN D~DATUV AS DATUV_P
         E~NAME1 F~MAKTX G~ARBPL
         H~KTEXT AS ARBPL_KTEXT

  FROM MAPL AS A

  INNER JOIN PLKO AS B
        ON A~PLNTY = B~PLNTY AND
           A~PLNNR = B~PLNNR AND
           A~PLNAL = B~PLNAL

  INNER JOIN PLAS AS C
        ON A~PLNTY = C~PLNTY AND
           A~PLNNR = C~PLNNR AND
           A~PLNAL = C~PLNAL

  INNER JOIN PLPO AS D
        ON D~PLNTY = C~PLNTY AND
           D~PLNNR = C~PLNNR AND
           D~PLNKN = C~PLNKN

  INNER JOIN T001W AS E
        ON A~WERKS = E~WERKS

  INNER JOIN MAKT AS F
        ON A~MATNR = F~MATNR

  INNER JOIN CRHD AS G
        ON D~ARBID = G~OBJID

  INNER JOIN CRTX AS H
        ON G~OBJID = H~OBJID

  INNER JOIN MARA AS I
        ON A~MATNR = I~MATNR
  INNER JOIN MARC AS J
        ON A~WERKS = J~WERKS AND
           A~MATNR = J~MATNR

  INTO CORRESPONDING FIELDS OF TABLE GT_ROUTING_LIST

  WHERE A~WERKS IN S_WERKS AND
        A~MATNR IN S_MATNR AND
        A~LOEKZ = ' ' AND
        B~LOEKZ = ' ' AND
        C~LOEKZ = ' ' AND
        D~LOEKZ = ' ' AND
        A~PLNTY IN S_PLNTY AND
        F~SPRAS = SY-LANGU AND
        H~SPRAS = SY-LANGU AND
        I~MTART IN S_MTART AND
        J~DISPO IN S_DISPO.

But the process manufacturing industry is not the case, usually their master formula is similar to the following figure:

Check the PLPO table and some work centers (that is, the resources mentioned here) will not be displayed, causing some troubles to the development. I am not sure about the specific business. Friends who are familiar with the process manufacturing industry can leave a message to inform.

 

Here is a useful function: CP_EX_PLAN_READ

      CALL FUNCTION 'CP_EX_PLAN_READ'
        EXPORTING
          CMODE_IMP     = 'R'
          PLNTY_IMP     = GT_TAB-PLNTY
          PLNNR_IMP     = GT_TAB-PLNNR
          PLNAL_IMP     = GT_TAB-ALNAL
          STTAG_IMP     = SY-DATUM
*         CHECK_IMP     = 'X'
*         CUOBJ_IMP     =
*         PARNT_IMP     = ' '
*         FCAPO_IMP     = ' '
*         TCA11_IMP     = ' '
*         FLG_VAL_REC_IMP                      = ' '
*         STLNR_IMP     =
*         I_PLAS_KEY_TAB                       =
*         PRODCOST      = ' '
*         I_BUSINESS_OBJECT                    =
*         I_FLG_CHARACTERISTICS_PLANNING       = ' '
*         I_EDGNO       =
*         VBELN_IMP     = ' '
*         POSNR_IMP     = 0
*         LOSGR_IMP     = 1
*         I_PLANT       =
*         I_FLG_CALLED_F_MRP                   = ' '
*   IMPORTING
*         RES_APPR_CHK_EXP                     =
*         ERROR_EXP     =
*         E_MAPL        =
*         PI_SET_USED   =
        TABLES
*         MLST_EXP      =
*         PLAB_EXP      =
*         PLAS_EXP      =
*         PLFH_EXP      =
*         PLFL_EXP      =
*         PLFT_EXP      =
*         PLFV_EXP      =
          PLKO_EXP      = LT_PLKO_EXP
*         PLMZ_EXP      =
          PLPO_EXP      = LT_PLPO_EXP
*         PLTX_EXP      =
*         AENNR_EXP     =
*         PLMK_EXP      =
*         PLMW_EXP      =
        EXCEPTIONS
          NOT_FOUND     = 1
          PLNAL_INITIAL = 2
          OTHERS        = 3.
      IF SY-SUBRC <> 0.
      ENDIF.

Just enter the following parameters:

  • PLNTY-task list type (type "2")
  • PLNNR-Task List Group Code
  • PLNAL-group counter
  • STTAG-Effective date (current date)

Special attention should be paid to the "PLNAL" (group counter) field. Leading zeros need to be added, otherwise the function will not get a value.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = GT_TAB-ALNAL
        IMPORTING
          OUTPUT = GT_TAB-ALNAL.

 

 

Only this record is useless, please don't delete my blog post by the CSDN administrator, thank you.

 

Guess you like

Origin blog.csdn.net/zhongguomao/article/details/108027723