Ansicht
Dokumentation

/SAPAPO/CMDS_XPRA0001 - Control Profile: Conversion of Procedures into Heuristics

/SAPAPO/CMDS_XPRA0001 - Control Profile: Conversion of Procedures into Heuristics

TXBHW - Original Tax Base Amount in Local Currency   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

Purpose

Conversion of Procedures for the Admissibility Check

The admissibility check is the generic term for all the checks (planning algorithms), which can be carried out when a new due delivery schedule is created. These checks are used to check whether the current quantities and dates requested by the customer are admissible.

In SAP APO Release 3.1, the planning algorithms for the admissibility check are realized using procedures. As of SAP APO Release 4.0, the procedures for the admissibility check are not longer supported. Instead, the planning algorithms for the admissibility check are realized using heuristics. To ensure that the change to the next release is as smooth as possible it is necessary to convert the field Procedure for the Admissibility Check [EPROCID] into the field Heuristic for the Admissibility Check [ADMICHK_HEUR_ID] in the Control Profiles for the Sales Scheduling Agreement Item [Table /SAPAPO/TPSCO_DP].

Conversion of Procedures for the Feasibility Check

The feasibility check is the generic term for all the checks (planning algorithms), which can be carried out for a product with sales scheduling agreement items to check whether the quantities and dates requested by the customer are feasible, that is, available.

In SAP APO Release 3.1, the planning algorithms for the feasibility check are realized using procedures. As of SAP APO Release 4.0, the procedures for the feasibility check are not longer supported. Instead, the planning algorithms for the feasibility check are realized using heuristics. To ensure that the change to the next release is as smooth as possible it is necessary to convert the field Procedure for the Feasibility Check[EPROCID] into the field Heuristic for the Feasibility Check [ADMICHK_HEUR_ID] in the Control Profiles for the Sales Scheduling Agreement Item [Table /SAPAPO/TPSCO_DP].

Prerequisites

The conversion program should only be carried out as part of a release upgrade from SAP APO 3.1 to SAP APO 4.0 (or higher). In addition, the conversion program should only be carried out if the customer was using Delivery Schedule Processing for the Sales Scheduling Agreement in SAP APO Release 3.1.

Features

The program carries out the conversion of procedures into heuristics for all selected control profiles for the sales scheduling agreement item.

Selection

The conversion program selects all control profiles for the sales scheduling agreement item [Table /SAPAPO/TPSCO_DP] for all clients.

Conversion

Conversion of Procedures for the Admissibility Check

The conversion program converts the field Procedure for the Admissibility Check [EPROCID] into the field Heuristic for the Admissibility Check [ADMICHK_HEUR_ID] for all the selected control profiles for the sales scheduling agreement item. The following conversion rules are used in this conversion:

  1. If the procedure for the admissibility check [EPROCID] entered in the control profile is the standard procedure delivered by SAP SAP001 No Admissibility Check and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_SET_ZOK delivered by SAP is defined for this procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_A01 Admissibility Ok Without Check in the control profile as the heuristic for the admissibility check [ADMICHK_HEUR_ID].
  2. If the procedure for the admissibility check [EPROCID] entered in the control profile is the standard procedure delivered by SAP SAP002 New DueDelSched-Valid DueDeSchand the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_LCDDS delivered by SAP is defined for this procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_A02 Tolerance Check in the control profile as the heuristic for the admissibility check [ADMICHK_HEUR_ID].
  3. If the procedure for the admissibility check [EPROCID] entered in the control profile is a customer-specific procedure Z* - ... and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_SET_ZOK delivered by SAP is defined for this customer-specific procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_A01 Admissibility Ok Without Check in the control profile as the heuristic for the admissibility check [ADMICHK_HEUR_ID].
  4. If the procedure for the admissibility check [EPROCID] entered in the control profile is a customer-specific procedure Z* - ... and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_LCDDSdelivered by SAP is defined for this customer-specific procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_A02 Tolerance Check in the control profile as the heuristic for the admissibility check [ADMICHK_HEUR_ID].
  5. If the procedure for the admissibility check [EPROCID] entered in the control profile is the standard procedure delivered by SAP SAP001 No Admissibility Check and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the admissibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  6. If the procedure for the admissibility check [EPROCID] entered in the control profile is the standard procedure delivered by SAP SAP002 New DueDelSched-Valid DueDeSch and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the admissibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  7. If the procedure for the admissibility check [EPROCID] entered in the control profile is a customer-specific procedure Z* - ... and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this customer-specific procedure in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the admissibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  8. If no procedure for the admissibility check [EPROCID] is entered in the control profile then the conversion program cannot enter one of the standard heuristics for the admissibility check delivered by the SAP in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.

Conversion of Procedures for the Feasibility Check

The conversion program converts the field Procedure for the Feasibility Check [FPROCID] into the field Heuristic for the Feasibility Check [FEACHK_HEUR_ID] for all the selected control profiles for the sales scheduling agreement item. The following conversion rules are used in this conversion:

  1. If the procedure for the feasibility check [FPROCID] entered in the control profile is the standard procedure delivered by SAP SAP001 No Feasibility Check and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_NO_FEASI_CHECK delivered by SAP is defined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_F01 Confirm Compliance Without Check in the control profile as the heuristic for the feasibility check [FEACHK_HEUR_ID].
  2. If the procedure for the feasibility check [FPROCID] entered in the control profile is the standard procedure delivered by SAP SAP002 Days' Supply Checkand the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_COVERAGE delivered by SAP is defined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_F02 Days' Supply Check in the control profile as the heuristic for the feasibility check [FEACHK_HEUR_ID].
  3. If the procedure for the feasibility check [FPROCID] entered in the control profile is the standard procedure delivered by SAP SAP003 Product Heuristic with Days' Supply Checkand the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_MRP_RUN_CHECK_COV delivered by SAP is defined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_F02 Product Heuristic with Days' Supply Check in the control profile as the heuristic for the feasibility check [FEACHK_HEUR_ID].
  4. If the procedure for the feasibility check [FPROCID] entered in the control profile is a customer-specific procedure Z* - ... and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_NO_FEASI_CHECK delivered by SAP is defined for this customer-specific procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_F01 Confirm Compliance Without Check in the control profile as the heuristic for the feasibility check [FEACHK_HEUR_ID].
  5. If the procedure for the feasibility check [FPROCID] entered in the control profile is a customer-specific procedure Z* - ... and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_COVERAGE delivered by SAP is defined for this customer-specific procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_F02 Days' Supply Check in the control profile as the heuristic for the feasibility check [FEACHK_HEUR_ID].
  6. If the procedure for the feasibility check [FPROCID] entered in the control profile is a customer-specific procedure Z* - ... and the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_MRP_RUN_CHECK_COVdelivered by SAP is defined for this customer-specific procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic delivered by SAP SAP_CDS_F03 Product Heuristic with Days' Supply Check in the control profile as the heuristic for the feasibility check [FEACHK_HEUR_ID].
  7. If the procedure for the feasibility check [FPROCID] entered in the control profile is the standard procedure delivered by SAP SAP001 No Feasibility Check and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the feasibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  8. If the procedure for the feasibility check [FPROCID] entered in the control profile is the standard procedure delivered by SAP SAP001 Days' Supply Check and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the feasibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  9. If the procedure for the feasibility check [FPROCID] entered in the control profile is the standard procedure delivered by SAP SAP001 Product Heuristic with Days' Supply Check and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the feasibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  10. If the procedure for the feasibility check [FPROCID] entered in the control profile is a customer-specific procedure Z* - ... and either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module) [FUNCTION] Z* is defined for this customer-specific procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the feasibility check in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.
  11. If no procedure for the feasibility check [FPROCID] is entered in the control profile then the conversion program cannot enter one of the standard heuristics for the feasibility check delivered by the SAP in the control profile. In this case it is necessary for the customer to carry out manual postprocessing.

User actions

Manual Conversion of Customer-specific Algorithms for the Admissibility Check

If you have entered a procedure for the admissibility check [EPROCID] in a control profile for the sales scheduling agreement item for which a customer-specific algorithm (function module) Z* defined by you is defined in the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the admissibility check in the control profile. In this case you must manually convert the customer-specific algorithm for the admissibility check which you have defined. This manual conversion consists of the following steps:

  1. Copy the function group /SAPAPO/RRP_HEUR_TEMPLATE and rename it. This function group is used as the main program for subscreen 1000, where you maintain the settings for the heuristic. The system displays a dialog box listing the functions modules that you need to copy. Copy the following function modules and rename them:
    1. Get function module /SAPAPO/HEU_TEMPLATE_DATAGET. This function module is used to read the heuristic settings of the subscreen.
    2. Set function module /SAPAPO/HEU_TEMPLATE_DATASET. This function module is used to write the heuristic settings to the subscreen.
  2. In the ABAP Dictionary [Transaction SE11] create an output structure for the subscreen. You can use the template output structure /SAPAPO/HEU_TEMPLATE_D1000_STR as a template.
  3. Replace the name of the template output structure /SAPAPO/HEU_TEMPLATE_D1000_STR everywhere it appears in the new function group that you have created, with the name of your output structure for example in the
    1. TOP-Include
    2. Get function module
    3. Set function module
    4. Subscreen 1000
  4. Include the constant include /SAPAPO/CMDS_CONSTANTSin the TOP include of your new function group using the INCLUDE statement.
  5. Create a heuristic algorithm (function module) by copying the template heuristic algorithm (function module) /SAPAPO/HEU_CDS_TEMPLATE_ACHK to your new function group. Rename the function module when you copy it.
  6. To integrate the customer-specific algorithm (function module) Z* for the admissibility check that you have been using into the new heuristic algorithm (function module) replace the call of the template function module /SAPAPO/HEU_CDS_CUST_FUNC_ACHK with the call of the customer-specific function module Z* as follows:

    Replace the call of the template function module /SAPAPO/HEU_CDS_CUST_FUNC_ACHK
    ...
    *--------------------------------------------------------------------------------------------------*
    * (9) call customer specific function module *
    *--------------------------------------------------------------------------------------------------*
    CALL FUNCTION '/SAPAPO/HEU_CDS_CUST_FUNC_ACHK'
    EXPORTING
    iv_dialog = i_dialog_flg
    is_tpsco = ls_sa_item
    is_tpsco_td = ls_sa_item_td
    is_tpsco_dp = ls_sa_ctrl_prof
    is_tpsasdlh_act = ls_tpsasdlh_lcdds
    is_tpsasdlh_new = ls_tpsasdlh_dds
    TABLES
    it_tpsasdli_act = lt_tpsasdli_lcdds[]
    it_tpsasdli_new = lt_tpsasdli_dds[]
    EXCEPTIONS
    eligibility_ok = 1
    eligibility_nok = 2
    OTHERS = 3.
    ...

    with the call of your customer-specific algorithm (function module) Z*
    ...
    *--------------------------------------------------------------------------------------------------*
    * (9) call customer specific function module *
    *--------------------------------------------------------------------------------------------------*
    CALL FUNCTION 'Z*'
    EXPORTING
    iv_dialog = i_dialog_flg
    is_tpsco = ls_sa_item
    is_tpsco_td = ls_sa_item_td
    is_tpsco_dp = ls_sa_ctrl_prof
    is_tpsasdlh_act = ls_tpsasdlh_lcdds
    is_tpsasdlh_new = ls_tpsasdlh_dds
    TABLES
    it_tpsasdli_act = lt_tpsasdli_lcdds[]
    it_tpsasdli_new = lt_tpsasdli_dds[]
    EXCEPTIONS
    eligibility_ok = 1
    eligibility_nok = 2
    OTHERS = 3.
    ...
  7. Define the properties of your new heuristic algorithm by first calling up the data browser [Transaction SE16] for the database table /SAPAPO/HEURFUNC. Next, call up the function Create Entries [F5]and create the following data record:

    CLIENT: Client (this field is not ready for input)
    FUNCTION NAME:Name of your new heuristic algorithm (function module)
    REPORT NAME: Name of the main program of your new function group (main program of the subscreen for the heuristic settings)
    NO. OF CURRENT SCREEN:Number of the subscreen (Dynpro) for the heuristic settings
    FUNCTION NAME:Name of the Set function module for writing the heuristic settings to the subscreen
    FUNCTION NAME:Name of the Get function module for reading the heuristic settings from the subscreen
    NO OF CURRENT SCREEN:(no entry)
    DS. HEUR:(no entry)
    BKGR_HEUR:X
    PROD_HEUR:(no entry)
    REM_HEUR:(no entry)
    PP_HEUR:X
    SNP_HEUR:(no entry)
    CDS_HEUR:A
    VALID_FOR_RES:(no entry)
    VALID_FOR_ORD:X
    VALID_FOR_OPR:(no entry)
    VALID_FOR_MAT:(no entry)
    VALID_FOR_LIN:(no entry)
    IMPLICIT_COMMIT:(no entry)
    NO_AUTHCHK_PEGID:(no entry)
  8. In Customizing for Production Planning and Detailed Scheduling (PP/DS) create a heuristic based on the algorithm (function module) you have defined. You can then enter the heuristic as a heuristic for the admissibility check in the corresponding control profile for the sales scheduling agreement item.

Manual Conversion of Customer-specific Algorithms for the Feasibility Check

If you have entered a procedure for the feasibility check [FPROCID] in a control profile for the sales scheduling agreement item for which a customer-specific algorithm (function module) Z* - ... defined by you is defined in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of the standard heuristics delivered by SAP for the feasibility check in the control profile. In this case you must manually convert the customer-specific algorithm for the feasibility check which you have defined. This manual conversion consists of the following steps:

  1. Copy the function group /SAPAPO/RRP_HEUR_TEMPLATE and rename it. This function group is used as the main program for subscreen 1000, where you maintain the settings for the heuristic. The system displays a dialog box listing the functions modules that you need to copy. Copy the following function modules and rename them:
    1. Get function module /SAPAPO/HEU_TEMPLATE_DATAGET. This function module is used to read the heuristic settings of the subscreen.
    2. Set function module /SAPAPO/HEU_TEMPLATE_DATASET. This function module is used to write the heuristic settings to the subscreen.
  2. In the ABAP Dictionary [Transaction SE11] create an output structure for the subscreen. You can use the template output structure /SAPAPO/HEU_TEMPLATE_D1000_STR as a template.
  3. Replace the name of the template output structure /SAPAPO/HEU_TEMPLATE_D1000_STR everywhere it appears in the new function group that you have created with the name of your output structure for example in the
    1. TOP-Include
    2. Get function module
    3. Set function module
    4. Subscreen 1000
  4. Include the constant include /SAPAPO/CMDS_CONSTANTSin the TOP include of your new function group using the INCLUDE statement.
  5. Create a heuristic algorithm (function module) by copying the template heuristic algorithm (function module) /SAPAPO/HEU_CDS_TEMPLATE_FCHK to your new function group. Rename the function module when you copy it.
  6. To integrate the customer-specific algorithm (function module) Z* for the feasibility check that you have been using into the new heuristic algorithm (function module) replace the call of the template function module /SAPAPO/HEU_CDS_CUST_FUNC_FCHK with the call of the customer-specific function module Z* as follows:

    Replace the call of the template function module /SAPAPO/HEU_CDS_CUST_FUNC_FCHK
    ...
    *----------------------------------------------------------------------------------*
    * (15) call customer specific function module *
    *----------------------------------------------------------------------------------*
    REFRESH:
    lt_pegid_chk.
    APPEND -pegid TO lt_pegid_chk.
    CALL FUNCTION '/SAPAPO/HEU_CDS_CUST_FUNC_FCHK'
    EXPORTING
    iv_versid = i_simverid
    iv_simsession = lv_simsessid
    iv_dialog = i_dialog_flg
    iv_proto = gc_false
    IMPORTING
    ev_subrc = lv_subrc
    TABLES
    it_pegid = lt_pegid_chk[]
    it_sa_item = lt_sa_item[]
    it_sa_item_td = lt_sa_item_td[]
    it_trprod = lt_trprod[]
    it_sa_prof = lt_sa_ctrl_prof[]
    CHANGING
    ct_prod_alerts = lt_prod_alerts[]
    EXCEPTIONS
    feasibility_ok = 1
    feasibility_nok = 2
    OTHERS = 3.
    ...

    with the call of your customer-specific algorithm (function module) Z*
    ...
    *----------------------------------------------------------------------------------*
    * (15) call customer specific function module *
    *----------------------------------------------------------------------------------*
    REFRESH:
    lt_pegid_chk.
    APPEND -pegid TO lt_pegid_chk.
    CALL FUNCTION 'Z*'
    EXPORTING
    iv_versid = i_simverid
    iv_simsession = lv_simsessid
    iv_dialog = i_dialog_flg
    iv_proto = gc_false
    IMPORTING
    ev_subrc = lv_subrc
    TABLES
    it_pegid = lt_pegid_chk[]
    it_sa_item = lt_sa_item[]
    it_sa_item_td = lt_sa_item_td[]
    it_trprod = lt_trprod[]
    it_sa_prof = lt_sa_ctrl_prof[]
    CHANGING
    ct_prod_alerts = lt_prod_alerts[]
    EXCEPTIONS
    feasibility_ok = 1
    feasibility_nok = 2
    OTHERS = 3.
    ...
  7. Define the properties of your new heuristic algorithm by first calling up the data browser [Transaction SE16] for the database table /SAPAPO/HEURFUNC. Next, call up the function Create Entries [F5]and create the following data record:

    CLIENT: Client (this field is not ready for input)
    FUNCTION NAME:Name of your new heuristic algorithm (function module)
    REPORT NAME: Name of the main program of your new function group (main program of the subscreen for the heuristic settings)
    NO. OF CURRENT SCREEN:Number of the subscreen (Dynpro) for the heuristic settings
    FUNCTION NAME:Name of the Set function module for writing the heuristic settings to the subscreen
    FUNCTION NAME:Name of the Get function module for reading the heuristic settings from the subscreen
    NO OF CURRENT SCREEN:(no entry)
    DS. HEUR:(no entry)
    BKGR_HEUR:X
    PROD_HEUR:(no entry)
    REM_HEUR:(no entry)
    PP_HEUR:X
    SNP_HEUR:(no entry)
    CDS_HEUR: F
    VALID_FOR_RES:(no entry)
    VALID_FOR_ORD:(no entry)
    VALID_FOR_OPR:(no entry)
    VALID_FOR_MAT: X
    VALID_FOR_LIN:(no entry)
    IMPLICIT_COMMIT:X
    NO_AUTHCHK_PEGID:(no entry)
  8. In Customizing for Production Planning and Detailed Scheduling (PP/DS) create a heuristic based on the algorithm (function modules) you have defined. You can then enter the heuristic as a heuristic for the feasibility check in the corresponding control profile for the sales scheduling agreement item.

See also

For more information about creating heuristics with customer-specific algorithms see SAP Library under SAP Advanced Planner and Optimizer (SAP APO) -> Production Planning and Detailed Scheduling (PP/DS) -> PP/DS-Process -> Automated Production Planning and Optimization -> Heuristics -> Creating Heuristics Using Your Own Algorithms.






BAL Application Log Documentation   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 31617 Date: 20240426 Time: 234635     sap01-206 ( 483 ms )