Sapass

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



Index

COOPA003

Customer exits for internal orders
Overview

The order data is stored in the database tables defined by SAP. Enhancement COOPA003 enables you to transfer user-defined fields to the table for order master data (AUFK table).

The transactions for processing internal orders (KO01, KO02, and KO03) enable you to show group boxes (technical name: Subscreens) with the user-defined fields. You can display and maintain the fields.

Enhancement COOPA003 contains the following components:

Function modules:

  • EXIT_SAPMKAUF_002 (Function callup PBO: Data SAP -> Customer and group box number -> SAP)
  • EXIT_SAPMKAUF_003 (Function callup PAI: Data customer -> SAP)

Includes:

  • CI_AUFK (Include for the AUFK table, which contains user-defined fields)
Functions for user-defined fields
  • Selection by the CI_AUFK fields in collective processing (Once you activate the project, the corresponding button appears there).
  • Classification using the CI_AUFK fields.

In Release 4.0A/B you can transfer the CI_AUFK fields as reference characteristics to classification (enhancement KKRF0001).

From Release 4.5A you can summarize orders with user-defined fields, which has significant advantages over classification. Classification will not be included in the system for much longer, therefore you need to develop this enhancement for a suitable conversion of the classification data. For more information, see the Implementation Guide (IMG) for internal orders, under the activity on " Replace Classification With User-Defined Fields ".

  • Printing the inspection text for the user-defined fields (with the COOPA004 enhancement).
  • Automatic collective processing

Caution

This does NOT process the function modules for the COOPA003 enhancement. For overall checks, you can use the COOPA_01 enhancement.

  • Transfer of old data for master data in user-defined fields.
  • The system writes change documents for user-defined fields if each data element has the appropriate indicator. To display change documents, go to the order master data and choose "Extras -> Change documents for the order".
  • You can use note no. 2596 to transfer your fields to the list variants.
  • The field selection in the order type maintenance does not use fields in user-defined programs. To influence the field characteristics you can change the program for the group box PBO accordingly. Use the COOPA_01 enhancement to make a complete inspection to ensure that all of the required entries are made.
Procedure
  1. Use the CMOD transaction to create an enhancement project, then assign the COOPA003 extension to it. To classify the CI_AUFK fields, also assign the KKRF0001 enhancement to your project. To be able to print out the short texts in the new fields using SAPScript, assign the COOPA004 enhancement. If you require the system to check the user-defined fields when saving, then assign the COOPA_01 enhancement to the project. (This is recommended if you want to use automatic collective processing, or for example, to ensure that the required entry fields, which you included, are filled).

The more fields that you transfer, the more system resources will be necessary (such as, disk space, or CPU time). Therefore, if possible you should use the predefined fields USER0 to User9, and transfer as few user-defined fields as possible. This is especially important because the AUFK table is also used for other order types (maintenance orders, production orders, and so on).

  1. Use the SE11 transaction (ABAP/4-Dictionary) to generate the CI_AUFK structure. Transfer the required fields to this structure taking note of the reserved namesace for customer fields. Restrict the field names to ten characters. The fields may be a maximum of 30 characters (you can use the fields with a 30 character domain). Activate the CI_AUFK structure. Note that a table may contain a maximum of 255 fields. SAP reserves the right to transfer new fields to the AUFK table.

It is recommended that you reactivate the COAS and AUFKV views separately.

  1. Use the SE51 transaction (Screen Painter) to create one or more subscreens in the SAPLXAUF function group with flow logic. You can control the field characteristics (visible, ready for input, and so on) in the flow logic (see programming example). You can also control which fields are displayed under which circumstances, on which tab page as required.

A user-defined group box (subscreen) is displayed on tab page "04" in position "02" in the default layout. You can define a different layout in Customizing and position the group box for user-defined fields differently there. A user-defined group box is possible for each tab page.

If you have required entry fields in a user-defined group box, you should position this group box on the first tab page and / or make an overall check during saving using the COOPA_01 enhancement.

The user-defined group boxes can be up to 50 rows long on position "01", and from position "02" to "05", 20 rows.

  1. Create the EXIT_SAPMKAUF_002 function module to transfer the order master data from the SAP program to your function group XAUF. The EXPORT paramters enable you to specify the group box number that is to be shown. This is shown in the specified position in the order layout.

Avoid performance intensive operations in the database.

The I_KAUF import structure contains the following parameters:

  • PAR_ACTVT (01 = Create, 02 = Change, 03 = Display)
  • PAR_LAYOU (Contains the order layout; SPACE = Default layout)
  • PAR_TABSTR (Contains the number of the most current tab page ("01" to "05"))
  • The other I_KAUF contain adminstrative data for the order, and are not usually required. SAP reserves the right to change the structure and meaning of the parameters.
  1. To transfer your user-defined fields to the SAP program, create the EXIT_SAPMKAUF_003 function module . This is where you should check the entries in the user-defined fields and create any messages.

Note

The EXIT_SAPMKAUF_002 and the EXIT_SAPMKAUF_003 function modules are processed exclusively for the PBO or PAI for the tab pages containing the user-defined group box "09". If you wish to make checks again when saving, use the COOPA_01 enhancement.

You should avoid making selections from the database that are performance intensive at this point also.

As well as the fields in the CI_AUFK structure, you can also transfer other fields defined in the USER_CI_AUFK structure. SAP accepts these fields without further checks, and saves the fields. Only overwrite the fields USER0 to USER9 if you have transferred them to your own group box.

  1. Activate the project and test whether the group boxes you created are displayed in the correct place, and wether the data you entered is saved.

Do not execute a COMMI-WORK or make writing access to the database in SAP tables at any time, as this can lead to severe program errors and data inconsistencies.

Example

In the KOXM function group, SAP provides a preconfigured example of the COOPA003 enhancement. If you execute this example, you should be able to transfer new fields without detailed ABAP knowledge in a short space of time.

Caution: This example involves a change in the AUFK table. Therefore for test purposes, create the CI_AUFK as a temporary object ($TMP).

Proceed as follows:

  1. You can use the CMOD transaction to create an enhancement project for the COOPA003 enhancement.
  2. You can use the SE11 transaction to create the CI_AUFK structure as described above. Transfer three fields into this structure and activate it:

Field name Data element

ZZMATNR MATNR (Material nummer)

ZZKUNNR KUNNR (Debitor)

ZZTEXT30 TEXT30 (30-character text)

It is recommended that you reactivate the COAS and AUFKV views separately.

  1. Copy the following objcts from the KOXM function group to the XAUF function group, using the SE80 transaction (Workbench Organizer). There, display the KOXM function group, position the cursor on the source object, and copy it to the corresponding target object.

Caution

When you copy, the target objects are overwritten. If the target objects already exist, then insert the source code for the source object into the target object.

Object type Source Target

Screen SAPLKOXM 0100 SAPLXAUF 0100

Include (Top include) LKOXMTOP ZXAUFTOP

Include (PBO) LKOXMF04 ZXAUFU04

Include (PAI) LKOXMF05 ZXAUFU05

  1. The ZXAUFTOP still requires changes to the source code. Use the SE38 transaction (ABAP Editor) to process this include. Detailed instructions are contained in the source code as comments.
  2. Activate the enhancement project. The fields should now be available in the master data maintenance, and should be saved.

  3. Function/Program:
    • EXIT_SAPMKAUF_002: Function callup for customer fields: PBO data SAP -> Customer
    • EXIT_SAPMKAUF_003: Function callup for customer fields: PAI data customer -> SAP

02-Oct-2005