Ansicht
Dokumentation

RNCZOUT0 - IS-HCM: Templates for Changing Outgoing Message Segments

RNCZOUT0 - IS-HCM: Templates for Changing Outgoing Message Segments

General Data in Customer Master   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

General

Program RNCZOUT0 simply serves as a template for customer-specific user exits relating to the design of IS-HCM message formats. It contains examples of how such exits are implemented for outbound messages. The program itself is not executable. It simply illustrates how to implement customer enhancements.

Program RNCZIN00 fulfills a similar function for inbound messages.

Attention: customer-specific routines require a customer-specific pool. Copy this program (including the documentation). Note the name ranges (Z*) reserved for your use.

The contents of customer-specific HCM message segments can be changed by FORM routines immediately after they have been filled from the IS-H database.

You have to differentiate between the communications standards for the implementation of this FORM routine.

An detailed description of the procedure follows.

Requirements

To implement this kind of customer routine, you have to

  1. Specify the name of the outgoing customer FORM routine (and the name of the module in which it is located) for the corresponding segment, using message segment maintenance;
  2. Set the Autofill indicator;
  3. Re-generate the HCM customer structures;
  4. Write the code for the FORM routine.

Description

An outgoing message in the SAP-HCM format is filled in the order in which the segments are specified. Data retrieval is carried out for complete segments.

The structure of the segments and, in particular, the field names are defined in the Include modules MNCDAT00 (SAP S*-structures) and MNCDAT90 (customer structures). For customer structures, this applies only when the customer structures have been generated successfully.

If a segment is a repetion segment, the segment is created as an internal table. If this is not the case, a segment corresponds to a field structure. The following naming convention applies for HCM structures:

eennnVvv where
ee = owner code,
nnn = segment number and
vv = version indicator (e.g. for 1.3, vv = 13).

Example: the segment with segment number 123, owner code 'Z7' in SAP-HCM version 1.3 has the internal structure name Z7123V13.

Basically, data is always supplied first to the SY segment of the corresponding message version. Where customer-specific segments are concerned, the customer structure is also filled from the SY structure using the ABAP/4 command MOVE-CORRESPONDING immediately afterwards. In this way, only fields with the same name are filled from the SY segment.

Any additional field(s) in the customer segment remain initial.

After a customer segment has been filled in this way, the system checks whether an outgoing FORM routine is defined as a user exit for the segment. If this is the case, this FORM routine is executed here.

Each FORM routine which changes the data of a customer message segment has the segment itself as its only transfer parameter. With a normal segment, transfer takes place via USING, and with repetition segments via TABLES.
In both cases, transfer is carried out "by reference", whereby all changes to the contents remain effective when the routine is exited. Note the supplement '... STRUCTURE ...', so that you can address the fields of the segments by name (see the example below).

An exception rule applies to message segments with a segment number less than ten (10). Such segments are technically limited. It may not be possible to create your own customer-specific version of these segments. If this is feasible, ensure that all technically required fields are also included in the customer segment.

In cases of such a customer-specific segment, the corresponding SY segment and the associated dispatch order from order table NC01 is transferred (see the example below).

The customer-specific functionality must be implemented in the FORM routine. Within this routine, you can make use of the many possibilities of the programming language ABAP/4. You can change the content of message fields (by employing special formatting rules, for example). You can, however, also read data from the database and place it in additional customer-specific segment fields.

Online processing or a similar handling is not possible. The entire message formatting operation is carried out in the background (batch jobs). Thus you have to take the restriction of this type of processing into account.

All segment structures are globally defined using the ABAP/4 command COMMON PART and, as such, are permanently available for all programs. This means, in particular, that all segments of the corresponding message type that have already been filled can be accessed within a user exit for the customer segment xy. In the process, even data fields of SY segments that are not passed on as parameters to the actual customer segment are also filled with up-to-date data.

After the customer routine is exited, the processing of the (in the meantime changed) customer segment proceeds normally, regardless of the functionality defined in the user exit. In other words, it is appended to the already created message component. The processing of subsequent segments within the message type also proceeds unchanged.

Example

For customer segment 'Z7104V13', the case number is 2 characters longer than in the IS-H database. It has been agreed to 'pad' the first two characters with '47'.

The name of the field is CASENO (see Include MNCDAT90). The FORM routine CHANGE_CASENO_LEADING_2 specified here reformats these characters by shifting them two places to the right (right-justified) and entering '47' left-justified.


* Your SAP-HCM message segment user exit:
* ... Format processing for message dispatch
* ... with normal segment:
FORM CHANGE_CASENO_LEADING_2
USING Z7104V13 STRUCTURE Z7104V13.
SHIFT Z7104V13-CASENO BY 2 PLACES RIGHT.
WRITE '47' TO Z7104V13-CASENO.
ENDFORM.

If the segment is a repetition segment in which each line must be changed in this way, the FORM routine must look as follows:


* Example for SAP-HCM message segment user exit:
* ... Format processing for message dispatch
* ... with repetition segment:
FORM CHANGE_CASENO_LEADING_2
TABLES Z7104V13 STRUCTURE Z7104V13.
LOOP AT Z7104V13.
SHIFT Z7104V13-CASENO BY 2 PLACES RIGHT.
WRITE '47' TO Z7104V13-CASENO.
MODIFY Z7104V13.
ENDLOOP.
ENDFORM.
If segment number < 10), the FORM declaration looks as follows:


* Example for SAP-HCM message segment user exit:
* ... Format processing for message dispatch
* ... with technically limited segments (SGNR < 10):
FORM FILL_CUSTOMER_SEGMENT_ZS007V13
USING SY007V13 STRUCTURE SY007V13
NC01 STRUCTURE NC01.
MOVE-CORRESPONDING SY007V13 to ZS007V13.
...
(customer processing)
...
ENDFORM.

The HL7 segments are already formatted when transfer takes place. Technical considerations (repetition fields) do not allow any alternative. Consequently, there is no structure available. Fields cannot be addressed directly.

In order to change HL7 segments in a meaningful way, the segment must be interpreted according to the HL7 rules. This is the only way to access particular field contents. A considerable amount of work is involved here, and you should only go ahead with this option if the conversion provided by table TNHL7 falls short of your requirements.

By means of INCLUDE MNCCOM01, you can make the HL7 special characters available in the variables FIELDSEP, COMPOSEP, REPETSEP, ESCAPSEP and SUBCOSEP.

Warning: you are responsible for the correctness of the HL7 syntax! In general, a check is not carried out after such changes!

Each FORM routine for changing the data of an HL7 customer message segment must have 6 transfer parameters:

  • PARAM1 is 4000-character character field in which the HL7 segment filled by SAP is transferred.
  • PARAM2 - PARAM6 are the same parameters as used by the corresponding SAP-SH segment (see RNCHL700).

Example

For the customer case segment 'ZAPV1V21', where

ee = ZA owner code
nnn = PV1 the internal name of the case segment
vv = 21 for HL7 standard version 2.1,
a '1' should be inserted as the first character in the second field, irrespective of its contents:


* Example for HL7 message segment user exit:
* ... Format processing for message dispatch
FORM MODIFY_ZAPV1
USING STEXT EINRI FALLNUMMER
BEWEGUNG PARAM4 PARAM5.
FIELD-SYMBOLS: .
SHIFT STEXT RIGHT BY 1 PLACES.
IF STEXT CS FIELDSEP.
ADD 1 TO SY-FDPOS.
SHIFT .
SY-FDPOS = SY-FDPOS - 1.
WRITE '1' TO STEXT+SY-FDPOS(1).
ENDIF.
ENDFORM.






CPI1466 during Backup   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 10568 Date: 20240531 Time: 193820     sap01-206 ( 166 ms )