Ansicht
Dokumentation

EXIT_SAPLCYPP_004 - Sorting: Replace Initial Fields

EXIT_SAPLCYPP_004 - Sorting: Replace Initial Fields

ROGBILLS - Synchronize billing plans   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The system sorts capacity requirements on the planning board for capacity leveling according to the fields in the sort formatting key. For each field, you can define a sort sequence in ascending or descending order. The system performs the sort based on the ASCII character set. For example, in this character set, the number 1 has the value 31, SPACE has the value 20. If the sort sequence is in ascending order, then the value 20 comes before the value 31. This means that SPACE is before the number 1.

You can use user exit CYPP0004 to assign other values to the fields and thereby change the sort sequence.

For this, you transfer the following import parameters to the enhancement:

  • Value of field, to which you want to assign a new value (FIELDNAME)
  • Values of fields for current requirements group (CURR_BED_GRU)
These values are transferred to the user exit for information purposes and are not required for the new assignment of values.

Example

You have three orders with the following priorities:

Order 1: Priority '1'

Order 2: Priority '2'

Order 3: Priority ' '

If you have defined a sort by increasing priority for the field 'Priority' in the formatting key, the system generates the following sequence:

Order 3: Priority ' '

Order 1: Priority '1'

Order 2: Priority '2'

If you have defined a sort by decreasing priority for the field 'Priority' in the formatting key, the system generates the following sequence:

Order 2: Priority '2'

Order 1: Priority '1'

Order 3: Priority ' '

You cannot define other sort sequences in the formatting key.

For the following sequence of orders, for example, you need user exit CYPP0004:

Requirement 1: Priority '1'

Requirement 2: Priority '2'

Requirement 3: Priority ' '

To achieve this sort, you can use the following source text in the Include program for the user exit:

statics: low_priok like caufvd-priok value 'Z'.
* caufvd-priok wird durch 'Z' ersetzt.
case fieldname.

when 'CAUFVD-PRIOK'.
assign low_priok to .
when others.

endcase.

Notes

Note the following points:

  • Do not change the content of the field itself.
This leads to problems during updating. The system does not recognize whether the change to the object is valid or permitted.
  • The STATIC statement is required. A missing STATIC statement results in a program termination.
The STATICS statement is a variation of the DATA statement. It allows you to define variables in a procedure (FORM or FUNCTION) with local visibility, but static validity.
Local visibility means that static variables, like normal local variables created with DATA, can only be accessed by their name within the defining procedure.
Static validity means that, unlike normal variables, the life of static variables does not depend on the defining procedure, but on the program at runtime. Static variables are thus not redefined on the stack each time the defining procedure is called up, but exist independently of this in the program and keep their value, regardless of the defining procedure being called up.
  • The value specified by the customer is also displayed on the planning board.

Further information

None.





Parameters

CURR_BED_GRU
FIELDNAME

Exceptions

Function Group

XCY1

Addresses (Business Address Services)   General Material Data  
This documentation is copyright by SAP AG.

Length: 3955 Date: 20240523 Time: 055516     sap01-206 ( 63 ms )