Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> UserExit>MYCATS01



Index

MYCATS01

User Exits for CATS notebook
Customer Exit MYCATS01 (Enhancement of the Picklists for myCATS)

You can use the MYCATS01 customer exit to make the following changes to the picklists for the offline variant of the Cross-Application Time Sheet:

Standard picklists (SAP)

  • Change or delete existing entries
  • Add rows
    Note:If you require additional columns in the picklist, you have to define a customer-specific picklist.

Customer-specific picklists

  • Replace the standard picklist entirely with a customer-specific picklist
  • Define picklists for customer-specific fields in the data entry screen

Please note that any changes that you make in the SAP System must also be made in the XML repository of the offline variant of the Cross-Application Time Sheet. The following naming conventions apply:

  • Standard picklists: PICKLIST_Feldname, for example PICKLIST_RPROJ (you can find the field names in the CATSDB database table of the Cross-Application Time Sheet).
  • Customer-specific picklists: Z_PICKLIST_fieldname

The MYCATS01 customer exit consists of the following elements:

  • SAP_FIELDNAME
    Contains the name of the field for which the picklist is defined.
  • SAP_PICKLIST
    Contains the current standard picklist.You can modify these picklists, but you cannot change the picklist type.
  • REFERENCE_TO_NEW_PICKLIST
    If you want to define a customer-specific picklist, REFERENCE_TO_NEW_PICKLIST must contain a reference to it.If you set this reference, all changes to SAP_PICKLIST are ineffective. Please note that the reference can only refer to a data object that you create using CREATE DATA .If it does not, you cannot evaluate the reference after the system has run through the customer exit.
  • SAP_PERNR, SAP_PROFILE, SAP_LANGU
    Use these elements to implement customer-specific checks or dependencies.
Example

You want to add a row for WBS elements to the current picklist, SAP_PICKLIST .You then want to make the modified picklist into a customer-specific picklist, and add a column to it.


*----------------------------------------------------------------------*
* INCLUDE ZXMYCU01 *
*------------------------------------------------------------------- ---*
IF sap_fieldname = 'RPROJ'.

DATA: my_wbs_picklist TYPE my_wbs_picklist,
wa_my_wbs_picklist LIKE LINE OF my_wbs_picklist,
sap_wbs_picklist TYPE TABLE OF cats_my_str_picklist_rproj,
wa_sap_wbs_picklist TYPE cats_my_str_picklist_rproj.

* append/modify entries to standard picklist
sap_wbs_picklist = sap_picklist.
wa_sap_wbs_picklist-rproj = '12345'.
wa_sap_wbs_picklist-rproj_txt = 'Stand. txt 12345'.
APPEND wa_sap_wbs_picklist TO sap_wbs_picklist.
sap_picklist = sap_wbs_picklist.

* add a row to the standard picklist
FIELD-SYMBOLS: <my_picklist> TYPE ANY TABLE.
CREATE DATA reference_to_new_picklist TYPE my_wbs_picklist.
ASSIGN reference_to_new_picklist->* TO <my_picklist>.

LOOP AT sap_picklist INTO wa_sap_wbs_picklist.
MOVE-CORRESPONDING wa_sap_wbs_picklist TO wa_my_wbs_picklist.
CONCATENATE 'myText is much longer for wbs-element '
wa_sap_wbs_picklist-rproj
INTO wa_my_wbs_picklist-customer_txt
SEPARATED BY space.
APPEND wa_my_wbs_picklist TO my_wbs_picklist.
ENDLOOP.

<my_picklist> = my_wbs_picklist.

ENDIF.
*----------------------------------------------------------------------*

The introductory query, IF sap_fieldname = 'RPROJ' is used to determine the field whose picklist you want to modify.This is the only way of ensuring that you can adjust picklists for different fields separately.

The following lines are used to create the reference to your customer-specific picklist.

  • FIELD-SYMBOLS: <my_picklist> TYPE ANY TABLE.
    CREATE DATA reference_to_new_picklist TYPE my_wbs_picklist.
    ASSIGN reference_to_new_picklist->* TO <my_picklist>.
  • <my_picklist> = my_wbs_picklist

The use of the <my_picklist> field symbol shown here (you can
Function/Program:

  • EXIT_SAPLTT_BASICS_001: Enhancement of Picklists

02-Oct-2005