Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
peter_atkin
Active Contributor

1. Introduction


Objectives:

  • To create a Configurable General Task List along with a VC function to make more complex decisions on which operations to select

  • Provide an example that can manage seasonal operations


The basic data creation process:


The basic data flow:


In this scenario we will create a configurable general task list with selectable operations based on the month of the year that the order was planned. In the image below we can see the various operations for each month, and the last operation is selected only in June, July and August.


 

The following steps detail how to set up the data:

 




2. Classification


2.1 Define Class/Characteristic Data (CL02/CT04):


We first need to create a new class (type 300) which we will use to carry the order month information from the order into the variant configuration engine:


The DUMMY characteristic is mandatory when we come to set up the configuration profile and VC function. Otherwise, it plays no other part in the process.

The PM_VC_ORDER_MONTH characteristic will be used to carry data from the VC function to the selection condition dependencies.

 




3. Variant Configuration Function


3.1 Create a Function (CU65):


We now need to create a variant configuration function that can contain our ABAP code:


 

3.2 Create a Function (CU65): Add Characteristics


You now need to add the characteristics via the Characteristics button above. Remember that the DUMMY characteristic is mandatory even though we don’t need it.


 

3.3 Create a Function (CU65): Create Function Module


You now need to create the function module via the Function Module button above.

The function module has the following parameters:




 

3.4 Create a Function (CU65): ABAP Code


The following ABAP code is used:
function zpm_get_ord_date.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(GLOBALS) TYPE CUOV_00 OPTIONAL
*" TABLES
*" QUERY STRUCTURE CUOV_01
*" MATCH STRUCTURE CUOV_01
*" EXCEPTIONS
*" FAIL
*" INTERNAL_ERROR
*"----------------------------------------------------------------------

data: lv_order_month type atwrt,
lv_order_type type atwrt,
lv_month type cacspstmon.

field-symbols <fs_caufvd> like caufvd.

*Get Basic Start Date from order
assign ('(SAPLCOIH)CAUFVD') to <fs_caufvd>.
if <fs_caufvd> is assigned.

* Determine the month from the Call Date or Basic Start Date
if <fs_caufvd>-nplda is not initial.
call function 'CACS_DATE_GET_YEAR_MONTH'
exporting
i_date = <fs_caufvd>-nplda
importing
e_month = lv_month.
else.
call function 'CACS_DATE_GET_YEAR_MONTH'
exporting
i_date = <fs_caufvd>-gstrp
importing
e_month = lv_month.
endif.

lv_order_month = lv_month.

*&--------------------------------------------------------------------&*
*& The following characteristics will be used in Object Dependencies
*& assigned to the task operations
*&--------------------------------------------------------------------&*

* Populate the month into characteristic PM_ORDER_MONTH
call function 'CUOV_SET_FUNCTION_ARGUMENT'
exporting
argument = 'PM_VC_ORDER_MONTH'
vtype = 'CHAR'
sym_val = lv_order_month
tables
match = match
exceptions
existing_value_replaced = 1
others = 2.

endif.

endfunction.

Return to the configuration function header and release, then save.

 




4. Variant Config. Procedure Dependency



4.1 Create an Procedure Dependency (CU01):


We are going to create an procedure dependency which we will use in the configuration profile in a subsequent step. We need this dependency as it allows us to link into a function module where we will write the required ABAP code:



Dependency source code:

FUNCTION ZPM_GET_ORD_DATE
(DUMMY = $ROOT.DUMMY,
PM_VC_ORDER_MONTH = $SELF.PM_VC_ORDER_MONTH)

Return to the dependency header and release then save.

 




5. Task List: Part 1


5.1 Create General Task List: (IA05):


Create your general task list and add the operations as required. Add the operations for the various months you require. We will add the object dependencies to the task list at a later stage.

This is all we require right now as we need the task list name before we can create the configuration profile in the following steps.


 




6. Configuration Profile


6.1 Create a Configuration Profile (CU41):


We now create a configuration profile and link all the objects together:

 


 

6.2 Create a Configuration Profile (CU41): Classification Assignment:


We assign the class that we created at the beginning of this process via the Assign Classification button. Make sure you enter a value in the DUMMY characteristic - remember that the system needs this data, but it is of no use to us in this process.


 

6.3 Create a Configuration Profile (CU41): Dependency Assignment:


We now assign the procedure dependency we created in step section 4.1 above:


Return to the configuration profile header and release, then save.

 




7. Selection Condition Dependencies


7.1 Create a Selection Condition Dependencies (CU01):


We will now create the selection-condition dependencies that will be used in the task list to select the relevant operations. We will create one dependency per month, and then an additional dependency for June/July/August:



PM_VC_ORDER_MONTH = '01'

Now create the remaining dependencies with the source code as follows:

  • PM_VC_ORDER_MONTH = '02'

  • PM_VC_ORDER_MONTH = '03'

  • PM_VC_ORDER_MONTH = '04'

  • PM_VC_ORDER_MONTH = '05'

  • PM_VC_ORDER_MONTH = '06'

  • PM_VC_ORDER_MONTH = '07'

  • PM_VC_ORDER_MONTH = '08'

  • PM_VC_ORDER_MONTH = '09'

  • PM_VC_ORDER_MONTH = '10'

  • PM_VC_ORDER_MONTH = '11'

  • PM_VC_ORDER_MONTH = '12'

  • PM_VC_ORDER_MONTH in ('06', '07', '08')


 

Return to the dependency header and release then save.

 




8. Task List: Part 2


8.1 Assign Selection Condition Dependencies to Task List Operations:


Assign the selection condition dependencies created in section 7 above to the operations as required:


 




9. Testing


9.1 Testing with Manually Assigned Task Lists (IW31/2):


Create or change an existing order and ensure that the configured equipment is entered in the order header.

Select the configurable general task list via menu path: Extras->Task List Selection->General Task List:


Notice that the basic start date of this corrective order is 31.12.2021.

Once you have selected the relevant general task list (A_PUMP_WAT-02 in this case) a classification popup screen will now be displayed.


Notice that the correct Order Month characteristic value has been determined via the VC function. You can manually change this characteristic value if required.

Green-arrow back out of this screen and the order should now be updated with the relevant operations i.e. those operations that satisfy the object dependency parameters, or those operations with no object dependency assignments.

In the case of a corrective maintenance order (i.e. no maintenance plan), the month is derived from the basic start date on the order header. In the order below we can see that the correct operations have been determined:



 

9.2 Testing with Maintenance Plans (IP10):


Create a maintenance plan for the configurable task list you created above.



Schedule the plan via IP10 and release the calls as required. In this example I will release all of the calls so we can see the result.


The orders should now be created with the relevant operations i.e. those operations that satisfy the object dependency parameters, or those operations with no object dependency assignments. Notice that the classification popup does not appear in this case.


The orders above have been created with operations selected from the task list by month. In addition you can see that June, July and August have additional operations.

 

 




10. Appendix


SAP Help:

 

In this series:

 

Here are some other useful blogs:

 

 

 

 

 
1 Comment
Labels in this area