Ansicht
Dokumentation

RKE_CHACO_PAOBJNR_1 - Conversion of Profitability Segments in Sender Tables

RKE_CHACO_PAOBJNR_1 - Conversion of Profitability Segments in Sender Tables

BAL Application Log Documentation   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

WARNING: This program should only be used in consultation with the SAP development team for CO-PA. You need to ensure that a data backup has been generated for the entire system before the program is used in a production system.

Purpose

This program can be used in cases where the assignment between controlling areas and operating concerns needs to be changed to reflect changes made to the organizational structure of a company.

In particular, it can be used for instances where one or more operating concerns are to be replaced by just one new operating concern.

This program can be used to convert any profitability segments in the document tables for the components SD, FI, MM, and CO that have been made invalid by changes to the Customizing assignments between controlling areas and operating concerns.

Integration

With the value flow logic in the ERP system, the profitability segment number for document line items updated in Profitability Analysis (CO-PA) is updated in the document tables of the components SD, FI, MM, and CO in the PAOBJNR field. The operating concern in which this profitability segment number is valid is determined indirectly from the organizational units stored in the document tables and also from the company structure stored in Customizing.

If the assignment between controlling areas and operating concerns is subsequently changed in a system, this means that the system can no longer correctly interpret any profitability segments stored in the document tables prior to this realignment. Due to the changed assignment of the controlling area, the system then erroneously searches for an affected profitability segment in the new operating concern, whereas the profitability segment was originally created in the old operating concern and can only be interpreted in that operating concern.

A distinction can be made between two types of cases in which the system tries to interpret a given profitability segment number with reference to an incorrect operating concern. If the profitability segment number does not exist in the new operating concern, then a short dump is regularly returned with the message number KE499. If, on the other hand, a profitability segment with the same number should happen to exist in the new operating concern, the system then works with the characteristic values for that particular profitability segment. This leads either to follow-up errors during further processing of the document, or, in the worst case, to incorrect data being updated in CO-PA.

Program RKE_CHACO_PAOBJNR_1 can be used to overcome this problem.

With this program, any profitability segment numbers from the old operating concern rendered invalid in the document tables for the components SD, FI, MM, and CO are systematically replaced with profitability segment numbers from the new operating concern. In doing so, the program is able to convert the data of several old operating concerns that is to be assigned to the same new operating concern in a single run.

Prerequisites

The form of Profitability Analysis activated in both the old operating concerns and the new operating concerns is of no importance.

A prerequisite for this program is that the Customizing assignments between controlling areas and operating concerns should not have been changed before executing the steps described below in Activities. The program cannot run a check on whether this is the case.

Furthermore, profitability segments could already have been determined in the new operating concern and posted in the document tables in SD, FI, MM, or CO. When converting the document tables, however, the program would not be able to recognize whether a profitability segment originates from an old or a new operating concern. The reason for this is that the number range intervals for the profitability segments always depend on the operating concern, and the operating concern is determined indirectly from the organizational units of the document tables. This means that profitability segments from the new operating concern could be converted by mistake because the program assumes they are from an old operating concern.

The following scenarios are supported for changing the assignment between controlling areas and operating concerns:

  1. An operating concern needs to be replaced by another one. All controlling areas assigned to the old operating concern are assigned to a new operating concern.
  2. Multiple controlling areas assigned to multiple operating concerns need to be assigned to a new operating concern.

The following examples demonstrate this for the controlling areas 1000 and 2000 and for the operating concerns C001, D001, and E001:

Example 1
Old assignments New assignments
  1000 --> C001 1000 --> E001
  2000 --> C001 2000 --> E001


Example 2
Old assignments New assignments
  1000 --> C001 1000 --> E001
  2000 --> D001 2000 --> E001

Bear in mind that all controlling areas assigned to an old operating concern must always be reassigned, and that all are to be assigned to the same new operating concern.

Features

The program can be used first to increase the number range status of number range object COPA_OBJ for the profitability segment numbers in the new operating concern to a value that is higher than the profitability segment numbers of the old operating concerns that have already been posted. This means that newly created profitability segment numbers in the new operating concern can be clearly distinguished from those of the old operating concern, enabling the restart option of the program to be used should it terminate due to database problems, for example.

The program supports two different variants of the conversion:

,,Case 1

Before the operating concerns are reassigned, the old Customizing assignments are saved first. Then the assignment between controlling areas and operating concerns is changed in Customizing. The RKE_CHACO_PAOBJNR_1 program has to be executed for the combination of old operating concerns and new operating concern.

During program execution, the system processes the document table selected. From the organizational units (such as plant, sales organization, company code, or controlling area) stored in the document table and on the basis of the old Customizing assignments stored previously, the system determines whether a profitability segment belongs to one of the old operating concerns that is being processed. If one does, a new profitability segment is determined in the new operating concern and loaded back into the document table.

,,Case 2

The assignment between controlling areas and operating concerns is not changed before the program is executed. In this case, the old Customizing settings do not need to be saved. The program has to be started for the combination of old operating concerns and new operating concern.

During program execution, the system processes the document table selected. From the organizational units (such as plant, sales organization, company code, or controlling area) stored in the document table and on the basis of the current Customizing assignments, the system determines whether a profitability segment belongs to one of the old operating concerns that is being processed. If one does, a new profitability segment is determined in the new operating concern that has not yet been assigned to a controlling area, and loaded back into the document table.

In both cases described, the field PAOBJNR is always converted in the respective document table. In the case of some selected document tables, however, the following special features apply:

  • Table COBRB: Here, the field REC_OBJNR1 (Object number for settlement receiver) is converted, since the operating concern is coded in this field for settlement rules to operating concern. Field REC_OBJNR1 is used to make it possible to read the text of a settlement receiver from this master record. At the same time, the field SORT(Settlement rule sort field) in table COBRAcan be converted, as the operating concern is also coded in this field for settlement rules to operating concern. The field is used in a display report for settlement rules.
  • Table AUAA: Here, the field COOBJNR(Object number) is also converted, since the operating concern is coded in this field as in the first two cases. The field is used during settlement, such as for reversing settlements that have already occurred.

The assignment between controlling areas and operating concerns can then be changed in Customizing.

Activities

Before executing the program, you can first automatically determine the data volume for those document tables in the components SD, FI, MM, and CO that will be converted when the program is executed. This gives you an idea of the amount of table lines to be processed. For this, choose

,,Extras --> Determine Data Volume

from the menu in the selection screen and confirm the dialog box asking whether you want to continue by selecting Yes. Because determination of the data volume can take a while, it must be started in the background. The program creates the job ZZRKE_CHACO_CHECK_SIZE_1 and you can specify a start time in the screen that then appears. The job is automatically scheduled and released. The results are saved in the spool list for the job, which you can call up by choosing

,,Goto --> Job Overview.

The steps required for performing the program are described below. A distinction is made between cases 1 and 2 described above.

,,Case 1

Step 1

Ensure that no documents are posted to the system while the program is being executed.

Step 2

Start the RKE_CHACO_PAOBJNR_1 program and then choose ,,Extras -> Save Old Customizing Assignments

in the menu of the selection screen.

The program saves the old assignments currently stored in Customizing, including those between controlling areas and operating concerns.

Step 3

To display the saved assignments, choose

,,Extras -> Display Old Customizing Assignments.

Step 4

In Customizing under

,,Enterprise Structure --> Assignment --> Controlling --> Assign Controlling Area to Operating Concern

change the assignments of all controlling areas of the old operating concerns to the new operating concern.

Step 5

In Profitability Analysis Customizing under

,,Flows of Actual Values --> Activate Profitability Analysis

activate (if necessary) the new operating concern.

Step 6

Start the program for the combination of old operating concerns and new operating concern.

The following areas of the selection screen are to be filled in this process:

Operating Concerns

Old Operating Concerns / New Active Operating Concern:

Enter here the old operating concerns and the new active operating concern.

Example 1
Old assignments New assignments
1000 --> C001 1000 --> E001
2000 --> C001 2000 --> E001

In this case, the program needs to be started for the combination C001 (Old Operating Concerns) and E001 (New Active Operating Concern).

Example 2
Old assignments New assignments
  1000 --> C001 1000 --> E001
  2000 --> D001 2000 --> E001

In this case, the program needs to be started for the combination C001 / D001 (Old Operating Concerns) and E001 (New Active Operating Concern).

New Active Operating Concern Already Assigned / New Active Operating Concern Not Yet Assigned:

Where case 1 applies, choose the option New Active Operating Concern Already Assigned. Using the organizational units stored in the document tables and also taking into account the Customizing assignments saved previously, the program determines the old operating concern.

Where case 2 applies, choose the option New Active Operating Concern Not Yet Assigned.

Control Parameters

Test Run for a Profitability Segment:

This option allows you to start the program for a profitability segment from one of the old operating concerns. If you select this option, you can enter a profitability segment number in the Profitability Segment Selectionfield. In this instance, you must specify exactly one old operating concern in the selection option Old Operating Concerns. When the program has been executed, the system generates a log containing the characteristics vector in the old and new active operating concern. The system displays

  • which characteristics have been transferred from the old to the new operating concern
  • which characteristics have been converted in the user exit described under Converting the Profitability Segments (see below)
  • which characteristics have been derived in the new active operating concern, if the option Call up Derivation in New Active Operating Concern (see below) has been selected. In this case you can also branch to the derivation analysis.

Test Run:

With this option, the program is executed in a test run for the step selected in the Processing Steps area or the selected application. Processing can be executed in the foreground or in the background. The program generates a log and issues error messages if errors occur during characteristic derivation or the validity check of the characteristic values.

To keep the log manageable, processing ends once the number of errors exceeds 100. In this mode, no profitability segment numbers are converted in the document tables. The system makes a note of the application for which the test run was started and whether it ran without errors.

Update Run:

With this option, the program is executed in an update run for the step selected in the Processing Steps area or the selected application. Processing should occur in the background, due to the risk of a timeout.

The program can only be executed in an update run if a test run has already been performed with no errors for the selected step or application.

Convert table CE4XXXX_FLAG:

As of SAP 4.6C, the information whether manual entries have been made for a profitability segment on the CO-PA account assignment screen is stored in table CE4XXXX_FLAG. Consequently, this table does not contain entries for every profitability segment. Nevertheless, it still needs to be converted.

This option is not ready for input, and is displayed only as of SAP 4.6C, as table CE4XXXX_FLAG did not exist up to SAP 4.6B

For the logic on table entries conversion, see Converting the Profitability Segments below.

Lock Operating Concern (for 'Update Run' option):

This option is only relevant for update runs. It locks the old operating concerns and the new active operating concern against postings. Users trying to post data to these operating concerns receive anappropriate error message.

Call up Derivation in New Active Operating Concern:

This option makes it possible to derive the converted characteristics vector in the new active operating concern again (see Converting the Profitability Segments below).

Check Characteristics in the New Active Operating Concern:

This option makes it possible to carry out a validity check of the characteristic value for the converted characteristics vector in the new active operating concern (see Converting the Profitability Segments below).

User Exit for Field Assignment:

This option makes it possible to create the characteristic assignment between old operating concerns and a new active operating concern individually using a user exit (see Converting the Profitability Segments below)

'Identification':

This option is only available if the selection option

User Exit for Field Assignment has been set. It makes it possible to uniquely identify the user exit.

Converting the Profitability Segments:

This section describes the logic applied for transferring a profitability segment created in an old operating concern into a profitability segment in the new active operating concern.

Note that a MOVE-CORRESPONDING between fields of the same name in the old and the new active operating concern is always performed first in this program. This applies for entries in table CE4XXXX_FLAG as of SAP 4.6C.

You have the additional option of applying a logic stored in a user exit to transfer CO-PA characteristics from the old operating concern into the new active operating concern. Provided the exit is activated, it is accessed for each profitability segment after the MOVE-CORRESPONDING step. Fields in the new active operating concern that have already been filled using the MOVE-CORRESPONDING logic can be changed subsequently in the exit. Even converted entries in table CE4XXXX_FLAG can be adjusted in this exit as of SAP 4.6C.

To activate the exit, an entry has to be added to the TKEEXITS table. You can use transaction SE16 to maintain the table in the following way:

EXITID 'KE_CHACO_CE4'
  APPL 'KE'
  SEQNO '001'
  ISACTIVE 'X'
  REPORT Program name of a ZZ... program
  FORM Name of a form routine in program REPORT

For the exit to be accessed at all, the User Exit for Field Assignment indicator has to be set. A three-character abbreviation then needs to be entered in the Identification field adjacent to this indicator.

The exit logic is implemented in the form routine FORM of the program REPORT. The form routine transfer parameters are the following parameters in the order given here, in which the last three parameters have only been available since SAP 4.6C:

  • Old operating concern
  • New active operating concern
  • ID for the exit: The exit ID entered in the selection screen is transferred.
  • Indicator specifying whether the exit is active and whether it is to be called up in subsequent program runs: You need to set this indicator in the coding so that the exit is called for the subsequent profitability segments.
  • Characteristics vector for the old operating concern: The characteristics vector is transferred in the structure CE4XXXX, where XXXX designates the old operating concern.
  • Characteristics vector for the new active operating concern after the MOVE-CORRESPONDING step: The characteristics vector is transferred in the structure CE4YYYY, where YYYY designates the new active operating concern.
  • Indicator specifying whether an entry in table CE4XXXX_FLAG has been found, where XXXX designates the old operating concern.
  • Entry from table CE4XXXX_FLAG in the old operating concern: the entry is transferred in structure CE4XXXX_FLAG, where XXXX designates the old operating concern.
  • Entry from table CE4YYYY_FLAG in the new active operating concern after the MOVE-CORRESPONDING step: The entry is transferred in the structure CE4YYYY_FLAG, where YYYY designates the new active operating concern.

Example

If

  • 'S001' stands for the old operating concern
  • 'IDEA' for the new active operating concern
  • 'ABC' for the ID of the User Exit

and the characteristic Customer (KNDNR) is always to be set to 0000001001 in the new active operating concern if it had the value 0000001000 in the old operating concern, the exit implementation could appear as shown below. As the characteristic Customer is a fixed characteristic of every operating concern, an entry from table CE4S001_FLAG, for which the characteristic Customer had been assigned manually, would already have been transferred by the MOVE-CORRESPONDING step in the entry for table CE4IDEA_FLAG, meaning no changes would need to be made in the exit.

Entry in Table TKEEXITS:

EXITID 'KE_CHACO_CE4'
  APPL 'KE'
  SEQNO '001'
  ISACTIVE 'X'
  REPORT ZZKE_CHACO_CE4
  FORM MODIFY_CHARACTERISTICS

Implementation of the exit in program ZZKE_CHACO_CE4:

REPORT ZZKE_CHACO_CE4.

....
FORM MODIFY_CHARACTERISTICS
  CHANGING I_ERKRS_OLD   LIKE TKEBB-ERKRS
           I_ERKRS_NEW   LIKE TKEBB-ERKRS
           I_EXITID      TYPE KEDRSTEPID
           I_EXIT_ACTIVE TYPE C
           IS_CE4_OLD    TYPE ANY
          IS_CE4_NEW    TYPE ANY
           I_CE4FLAG     TYPE C
           IS_CE4FLAG_O  TYPE ANY
           IS_CE4FLAG_N  TYPE ANY.

DATA: LS_CE4S001 LIKE CE4S001,
        LS_CE4IDEA LIKE CE4IDEA.

CASE I_EXITID.
   WHEN 'ABC'.
     IF I_ERKRS_OLD = 'S001' AND I_ERKRS_NEW = 'IDEA'.
       I_EXIT_ACTIVE = 'X'.,,,,"Activate for further processing
        LS_CE4S001 = IS_CE4_OLD.
       LS_CE4IDEA = IS_CE4_NEW.
       IF LS_CE4S001-KNDNR = '0000001000'.
          LS_CE4IDEA-KNDNR = '0000001001'.
        ENDIF.
        IS_CE4_NEW = LS_CE4IDEA.,,,,"Return characteristics of the
,,,,,,,,,,,,,,"new active operating concern
      ENDIF.
ENDCASE.

ENDFORM.
....

No further changes are possible at this point for entries from table CE4XXXX_FLAG, only for the characteristic vector determined.

If the Call up Derivation in New Active Operating Concern indicator was selected, characteristic derivation is run in the new active operating concern after the exit has been run for the determined characteristics vector.

If an error occurs during characteristic derivation, a corresponding information message is issued in the processing mode Test Run with a Profitability Segment. In this instance, the cause of the error can be determined by running a derivation analysis, accessible from within the log.

During thetest run or the update run, only the error message is written to the log. During an update run, the non-derived characteristics vector can be used to determine a profitability segment number in the new active operating concern. If necessary, the profitability segments for which an error occurred could be adjusted by realignments in the new active operating concern.

To run a validity check on the characteristic values, the Check Charactecristics in the New Active Operating Concern indicator can be set. The validity check is made after calling up the exit and before characteristic derivation. It only makes sense to run a validity check on the characteristic values if the user exit is applied. If characteristic values are changed in the derivation, it checks their existence automatically.

As is the case during derivation, an error is reported as an information message in the processing mode Test Run with a Profitability Segment. During the test run or the update run, only the error message is written to the log. In these last two cases, the program continues processing in spite of the error messages.

Profitability Segment Selection:

This option is only available for the mode Test Run with a Profitability Segment. Here it is possible to enter a profitability segment number for an old operating concern, and the existence of the number is checked automatically.

New Number Range Status:

This option is only available for the step Raise Number Range Object COPA_OBJ in New Active Operating Concern. Here a new number range status can be explicitly specified for the profitability segment numbers (object COPA_OBJ) in the new active operating concern. The system automatically proposes a level that is higher than the maximum of the numbers posted in the old operating concerns. This can be increased manually.

Processing Steps (for the 'Test Run' and 'Update Run' options)

Execute the program for the selected combination of old operating concerns, new active operating concern, and also the corresponding additional options, initially for step A below, and then for the nine applications also detailed below under step B.

Step A: Raise Number Range Object COPA_OBJ in New Active Operating Concern:

In this step, the program sets the number range status for the profitability segment numbers (object COPA_OBJ) in the new active operating concern to a value that is higher than the maximum of the profitability segment numbers in the old operating concern. In doing so, the program proposes a value in the New Number Range Statusfield that can be adjusted to be a higher figure. The program saves the new number range status, as this is required for the restart option should the program terminate due to database problems, for example. New postings in the new active operating concern would as a result be given profitability segment numbers that are higher than this reset number range status.

Step B: Billing Documents
Sales Documents
Deliveries
Financial Accounting
Settlement Rules
Controlling
Materials Management
Profit Center Accounting
Other Tables

On the program selection screen, those database tables that are being converted are specified after the names of the nine applications just listed. Only one of the listed applications can be processed at a time in a program run.

The program selects all records with profitability segment in field PAOBJNR from the relevant table where the profitability segment number is between one and the new number range status for object COPA_OBJ set in step A in the new active operating concern. This is sufficient, as lines with higher profitability segment numbers must already have been created in the new active operating concern.

The field PAOBJNR is converted for each document table. Moreover, the program

  • field REC_OBJNR1 (Object number for settlement receiver) in table COBRB, where the settlement rules are stored, as well as SORT ('Settlement rule sort field') in table COBRA, where the header entries for the settlement rules are stored
  • field COOBJNR ('Object number') in table AUAA, where the settlement documents are stored

For Profitability Analysis, these fields contain objects with the form 'EOXXXXYYYYYYYYYY'. In this instance XXXX designates the operating concern and YYYYYYYYYY the profitability segment number. Field COBRB-REC_OBJNR1 is used to make it possible to read the text of a settlement receiver from this master record. COBRA-SORT is used in a display report for settlement rules. AUAA-COOBJNR contains the receiver object of a settlement document and is used, for example, for the reversal of settlements.

If the program terminates in step B, it can be restarted with the same selections. This is possible, because new postings to the new active operating concern are given profitability segment numbers that are higher than the new number range status set in step A, and because this also applies to profitability segments already converted with program RKE_CHACO_PAOBJNR_1.

The conversion status for each of the steps is displayed on the program selection screen as a traffic light next to the steps. These display the status for the relevant step and a special combination of old operating concerns and new active operating concern. If the traffic light is

  • green, an update run has already been successfully carried out
  • yellow, a test run has already been successfully carried out, but not the update run.
  • red, no test run has yet been successfully run.

To delete status records you can use the menu path

,,Extras --> Delete Status Information.

On the oveview screen that appears, you can select the status records to be deleted as in the program selection screen corresponding to the areas Operating Concerns, Control Parameters and Processing Steps. Confirm the confirmation prompt that appears with Yes.

Step 7

If required, you can remove the old customizing assignments once the conversion has been performed completely and successfully by choosing the menu path

,,Extras -> Display Old Customizing Assignments.

This is not, however, a requirement.

Step 8

There are different methods for processing the profitability segments and transaction data already posted in the old operating concerns.

If costing-based Profitability Analysis is active in the old operating concerns and the new active operating concern, you can copy the costing-based transaction data from the old operating concerns to the new active operating concern using program COPA_COPY.

Nevertheless, the profitability segments and costing-based transaction data can be retained in the operating concerns, should you still need to execute reports on the data already posted.

If the costing-based transaction data is to be deleted from the old operating concerns, you can use the CO-PA archiving tool with the objectCOPA1_XXXX, where XXXX designates the relevant old operating concern.

In addition, if account-based Profitability Analysis is active in the old operating concerns and the new active operating concern, you can convert the account-based data from the old operating concerns to the new active operating concern using program RKE_CHACO_PAOBJNR_2

If you also want to delete the profitability segments concerned from the operating concerns, you can also do this using the CO-PA archiving tool by implementing SAP Note 383728. However, you should only do this once programs COPA_COPY and RKE_CHACO_PAOBJNR_2 have been run (if this is necessary).

,,Case 2

This case can be treated in the same way as case 1. The only difference is that steps 2 through 5 do not apply. In this case, the option New Active Operating Concern Not Yet Assigned should be selected in the selection screen for the program. Once the conversion has been performed successfully, steps 4 and 5 can be carried out.






General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 37795 Date: 20240531 Time: 174008     sap01-206 ( 406 ms )