!--a11y-->
Affiliation messages until HR SP
ES25 
The Social Insurance affiliation messages are generated by the program 'Affiliation Message by the TGSS RED system' (RPCAFIE1). This program allows you to communicate employee entries or leavings, as well as modifications in the employee data, directly to the Social Insurance affiliation data file.
You must have performed the activities for setting the data interchange through the RED system in the Payroll Implementation Guide, under Social Insurance Evaluations ® RED System.
The program RPCAFIE1 creates a file for sending information to the Social Insurance in order to update the data of the company employees in the affiliation data file. Through this program you can communicate entries, leavings and modifications in the employee data. Notifications of data changes supported by the program include all actions that are performed at the employee level: change of contribution group, contract change and change of IA and ID epigraph. It also offers the possibility to modify or eliminate previous movements.
The file is created according to the specifications published by the Social Insurance Administration for the document interchange through the RED system (for electronic document posting) and is based on the Electronic Data Interchange (EDI) technology.
The data can be displayed and stored in data medium using the Temse files display program (RPUTMSE0). You can also choose to display individual ISM records. This display is also possible through MS-Word or MS-Excel.
The affiliation message is structured in order that the following can be included in just one EDI transmission:
● Employees grouped by company and action
● Documentation on successive entries, leavings and miscellaneous employee data modifications
● Multi-category, multi-company, multi-Contribution Account Code (CAC)
The segments that constitute the AFI message are the following:
● EMP: Company identification
● RZS: Registered company name
● EXC: Business activity and key (1)
● TRA: Employee
● AYN: Last name and name
● DOM: Address (1)
● LDD: Decoded address town (1)
● FAB: Entry and leaving dates
● DAM: Data associated with the movement
Note: (1) Not created by the program, as it is optional for the TGSS.
The program creates the affiliation message using the actions performed in the system at the employee level. Generally, the actions and reasons that are considered are those that have one or various actions with their respective reasons associated according to the RED system through the table ‘Adapt actions and reasons for Social Insurance (T5E30). In order to execute the program successfully it is necessary to establish the corresponding basic data according to the above specifications.
The actions change of epigraph (MT), change of contract type (MC) and change of contribution group (MG) are an exception to this. These actions are reported automatically, and thus it is not necessary to assign them in table T5E30.
To report these changes at employee level, the program reads the 'Personnel actions' infotype (0000). For every segment in this infotype, it searches the ‘Social Insurance’ (0061) infotype for changes (change of epigraph, change of contract type, change of contribution group). If any of such changes exist, it reports them automatically in the FAB segment. Additionally, for every segment of the 0000 infotype, the program searches also the infotype 0061 for a change in the contribution account code. If such change exists, it reports it and generates two EMP segments with a leave action in the previous CAC and an entry action in the new CAC.
The data interchange file that is generated in the user work directory in the SAP server will be called:
MMM.RRRRRRRR.V01.
Where:
MMM is the logon client and
RRRRRRRR is the name of the program that is being run
Access the program through the system menu, under System ® Services ® Reporting.
Enter the name of the program, 'RPCAFIE1', and press the launch key.
In the program selection screen, enter the relevant data according to the information below and launch the program.
'Action' and 'Situation' Fields: The keys entered in these fields will tell the system the transaction and employee-level reason to be carried out.
If you do not enter the action or reason, all the transactions/reasons that have occurred in the period are selected for the selected persons.
The keys allowed by the program are:
Action |
Reason |
Comment |
MA |
01 |
Entry |
MB |
51 |
Voluntary departure of contracted worker (*) |
MB |
54 |
Involuntary departure (*) |
MB |
56 |
Departure due to death (*) |
MB |
58 |
Departure due to becoming a pensioner (*) |
MB |
61 |
Departure for military service (*) |
MB |
63 |
Departure for voluntary leave (*) |
MB |
64 |
Leave for legal strike or employer lockout (*) |
MG |
Change in contribution group (**) |
|
MC |
Change in contract (**) |
|
MT |
Change in IA and ID epigraph (**) |
|
ME |
Deletion of previous movements |
|
MD |
Deletion of consolidated entries |
|

In the case of a leaving action (*), the following special features must be taken into account:
The leaving date for Social Insurance is the day before the day on which the leaving action begins in infotype 00. Therefore, if you want to report the leaving action, the start date of the leaving action must be included in the evaluation time interval shown when launching the program.
The actions marked with (**) are reported automatically, so it is neither necessary nor advisable to allocate them an action in the table T5E30. Otherwise, although the system still accepts the allocation, errors of information can occur.

Any change action allocated to an MC action without a contract change having really occurred in infotype 0061 can lead to the erroneous reporting of a contract change.
The selection screen also offers the following groups of fields:
Ticket data for ETI segment
‘Identify message Syntax’: This identifies the category of the following message.
‘Release message Syntax’: Release of previous message.
‘Identif. process Syntax’: Identifies the version of the validation program, printout and process that the previous issuer has used in the exchange.
‘Release process Syntax’: Version of previous validation module.
‘Authorization Key’ Key provided by the TGSS when it receives administrative authorization to present the nominal employee list. One per company, employer group or authorized professional.
‘SILCON Key’. SILNET network: Key provided by the TGSS. This identifies each physical person that interacts with the system.
'New Silcon key': Since the SILCON key has a limited time duration, a new access key is requested, that is entered as new if the existing key has expired or you want to change it. (Future use).
‘Presentation date’: The year, month and day of sending the message.
‘Presentation time’: In hours and minutes.
‘External name AFI file’: This records the MS-DOS plan file name with AFI suffix that has been prepared for the exchange.
‘Test indicator’: This indicates the category of message sent:
● Blank: Normal
● S: Substitute
● P: Test
‘CENDAR reference’: TGSS reference. For internal use by the TGSS.
‘Change Contract Keys’: This field is related to the use of contract keys.
Ticket data for ETI segment
‘Personnel key’: Operator personnel key.
Ticket data for ETI segment
‘Printout indicator’: This indicates whether the user wants a printed response to the request, or not.
With the object of notifying of a previous movement, you must ensure that personnel action and reason correspond to two actions according to the RED System. The first action is to delete the movement to be modified (ME) and the second, notification of entry, leaving or change in employee data.
Social Insurance Legal
Reports
Data medium exchange
using RED System
