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

BAL Application Log Documentation   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

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 newduedelivery 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 usingprocedures.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 usingheuristics. To ensure that the change to the next release is as smooth as possible it is necessary to convert the fieldProcedure for the Admissibility Check [EPROCID] into the fieldHeuristic for the Admissibility Check [ADMICHK_HEUR_ID] in theControl Profiles for the Sales Scheduling Agreement Item [Table /SAPAPO/TPSCO_DP].

Conversion of Procedures for the Feasibility Check

The feasibilitycheck is the generic term for all the checks (planning algorithms), which can be carried out fora 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 usingprocedures.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 usingheuristics. To ensure that the change to the next release is as smooth as possible it is necessary to convert the fieldProcedure for the Feasibility Check[EPROCID] into the fieldHeuristic for the Feasibility Check [ADMICHK_HEUR_ID] in theControl 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 SAPAPO 4.0 (or higher). In addition, the conversion program should only be carried out if the customerwas 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 fieldHeuristic forthe 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 standardprocedure delivered by SAP SAP001 No Admissibility Checkand the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_SET_ZOKdelivered 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 standardprocedure delivered by SAP SAP002 New DueDelSched-Valid DueDeSchandthe standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_LCDDSdelivered 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-specificprocedure Z* - ... and the standard algorithm(function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_SET_ZOKdelivered by SAP is defined for this customer-specific procedure in the procedures for the admissibilitycheck [Table /SAPAPO/TPSCO_EF], then the conversion program enters the standard heuristic deliveredby 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-specificprocedure Z* - ... and the standard algorithm(function module) [FUNCTION] /SAPAPO/CMDS_CHECK_ELI_LCDDSdeliveredby 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 SAPSAP_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 standardprocedure delivered by SAP SAP001 No Admissibility Checkand either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module)[FUNCTION] Z* is defined for this procedurein the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF] then the conversion program cannotenter 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 standardprocedure delivered by SAP SAP002 New DueDelSched-Valid DueDeSchand either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module)[FUNCTION] Z* is defined for this procedurein the procedures for the admissibility check [Table /SAPAPO/TPSCO_EF] then the conversion program cannotenter 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-specificprocedure Z* - ... and either no algorithm (functionmodule) [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 deliveredby 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 conversionprogram 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 fieldHeuristic forthe 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 standardprocedure delivered by SAP SAP001 No Feasibility Checkand the standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_NO_FEASI_CHECKdelivered 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 standardprocedure delivered by SAP SAP002 Days' Supply Checkandthe standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_CHECK_COVERAGEdelivered 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_F02Days' 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 standardprocedure delivered by SAP SAP003 Product Heuristic with Days' Supply Checkandthe standard algorithm (function module) [FUNCTION] /SAPAPO/CMDS_MRP_RUN_CHECK_COVdelivered 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_F02Product 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-specificprocedure Z* - ... and the standard algorithm(function module) [FUNCTION] /SAPAPO/CMDS_NO_FEASI_CHECKdelivered by SAP is defined for this customer-specific procedure in the procedures for the feasibilitycheck [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic deliveredby 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-specificprocedure Z* - ... and the standard algorithm(function module) [FUNCTION] /SAPAPO/CMDS_CHECK_COVERAGEdelivered by SAP is defined for this customer-specific procedure in the procedures for the feasibilitycheck [Table /SAPAPO/TPSCO_FF], then the conversion program enters the standard heuristic deliveredby 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-specificprocedure Z* - ... and the standard algorithm(function module) [FUNCTION] /SAPAPO/CMDS_MRP_RUN_CHECK_COVdeliveredby 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 standardprocedure delivered by SAP SAP001 No Feasibility Checkand either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module)[FUNCTION] Z* is defined for this procedure in the proceduresfor the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of thestandard 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 standardprocedure delivered by SAP SAP001 Days' Supply Checkand either no algorithm (function module) [FUNCTION] or a customer-specific algorithm (function module)[FUNCTION] Z* is defined for this procedure in the proceduresfor the feasibility check [Table /SAPAPO/TPSCO_FF] then the conversion program cannot enter one of thestandard 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 standardprocedure delivered by SAP SAP001 Product Heuristic with Days'Supply Check and either no algorithm (function module) [FUNCTION] or a customer-specificalgorithm (function module) [FUNCTION] Z* isdefined for this procedure in the procedures for the feasibility check [Table /SAPAPO/TPSCO_FF] thenthe 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-specificprocedure Z* - ... and either no algorithm (functionmodule) [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 conversionprogram 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 salesscheduling 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] thenthe conversion program cannot enter one of the standard heuristics delivered by SAP for the admissibilitycheck 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 groupis used as the main program for subscreen 1000, where you maintain the settings for the heuristic. Thesystem 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 everywhereit 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 (functionmodule) /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 admissibilitycheck that you have been using into the new heuristic algorithm (function module) replace the call ofthe 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 [TransactionSE16] 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
    FUNCTIONNAME:Name of the Set function module for writing the heuristic settings to the subscreen
    FUNCTIONNAME: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 thealgorithm (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 salesscheduling 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 feasibilitycheck 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 groupis used as the main program for subscreen 1000, where you maintain the settings for the heuristic. Thesystem 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 everywhereit 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 (functionmodule) /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 feasibilitycheck that you have been using into the new heuristic algorithm (function module) replace the call ofthe 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 [TransactionSE16] 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
    FUNCTIONNAME:Name of the Set function module for writing the heuristic settings to the subscreen
    FUNCTIONNAME: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) createa heuristic based on the algorithm (function modules) you have defined. You can then enter theheuristic 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 underSAP Advanced Planner and Optimizer (SAP APO) -> Production Planning and DetailedScheduling (PP/DS) -> PP/DS-Process -> Automated Production Planning and Optimization -> Heuristics -> Creating Heuristics Using Your Own Algorithms.



BAL Application Log Documentation   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.


Length: 31213 Date: 20120523 Time: 172538     triton ( 839 ms )