Import-/Export-Facility

Userexits

A comprehensive list of userexits can be found in the Userexits online help.

Different Kinds of Userexits

During import and export IEF supports different kinds of userexits.

Interface to IEF

With the interface programs for IEF it is possible to convert fields from an EDB mask to a string and vice versa with the help of an IEF format definition. These functions can also be called up from LogiView.

Integrating Own Userexits or Decision Tables

Userexits

There are two kinds of userexits in IEF:

The field userexits are initiated every time a field definition line is processed. In relationships they are also called up when searching for components or the parent as well as when entering data into the EDB fields or in the file:


Action userexits are executed with the following actions:

All userexits must be contained in the Agile e6 programs. The userexits must be INT-functions . A string is transferred which can be processed with the functions zag_get_buf_elm and zag_set_buf_elm The modified data is returned to IEF with the IEF function "edb_ief_set_val". If the data is not modified, the return value "ZERO" shall be entered. (speed).

Example:
i_ret = edb_ief_set_val (0, cp_buffer);
The contents of the userexit can have a maximum length of 40 characters.

 

Call-up parameter

Parameters can be specified for the name of the userexit ( user parameter) by dividing the individual parameters with comma and including them in parenthesis. The whole string must not contain any "white space". This user parameters are converted by "PARAM".

Example :
usx_wrt_prot(protokoll.dat,datum,zeit)
A character string is transferred to the userexits. This character string can be reduced to its elements with the function zag_get_buf_elm. The parameters can be displayed with the tool userexit "edb_ief_tst_usx".

The userexit must return a character string with exactly the same structure and the possibly occurred error code (ERROR) as well as an action to be executed (ACTION). If no values are to be returned a ZERO pointer is to be transferred as the analysis would be quicker.

The following table gives information on the parameters which can be transferred to the userexits:

Key Import Import Export Export LogiView

Field-
Userexit
Actions-
Userexit
Field-
Userexit
Actions-
Userexit
ET-
Call-up
WIDGET
X
X X
MASK X X X X X
ROW X X X X X
PARAM X X X X
ERROR X X X X X
ACTION X X X X X
IS_ACTION X X
X X
FIELD X
X
X
OLD_FIELD X


X
FORMAT X X X X
FUNCTION IMP. IMP. EXP. EXP. X
BUFFER X
X

PART_ID X
X

SHEET X
X

VERSION X
X

REVISION X
X

RIGHTS
X
X
OWNER
X
X
GROUP
X
X
K-ROW

X (internal)

WHAT


X
FILE
X
X

The following return parameters can be set:

Key Import Import Export Export LogiView
Field-
Userexit
Actions-
Userexit
Field-
Userexit
Actions-
Userexit
ET-
Call-up
ERROR X X X X X
FIELD X
X
X
FILE
X
X
ACTION
X

X
OWNER
X


GROUP
X


RIGHTS
X


As in the course of the further development other parameters might be added the userexit edb_ief_tst_usx which issues all currently transferred parameters on stderr output.

 

Include files

The userexits must be announced in the IEF header files.
As for EDB or DTV userexits they must be declared in the file ief_dcl.h.In the file ief_usx.h the name is specified so that the IEF userexit menu can be built.

Example:
ief_dcl.h int my_own_ief_usx()
ief_usx.h USX->fnc = my_own_ief_usx;
USX->nam = "my_own_ief_usx";
USX++;

 

Decision tables and procedures

At any position where a userexit can be placed it is also possible to call up a decision table or a LOGIVIEW procedure.
A decision table or procedure is indicated by the character"@" (e.g. "@LV_VERBUND/ LV_PROZEDUR") placed in front.
The data transfer between LOGIVIEW and IEF is carried out via LOGIVIEW system variables.
The following LOGIVIEW variables can be employed:

 

An exemplary IEF userexit

/********  Informational PART *****************
MODUL : IEF
PROJECT : EDB
DESCRIPTION : Userexitfunktionen fuer die Import-Export-Facility
MODIFICATIONS:
Date Name Description
************ DECLARATIONAL PART **************/
/* INCLUDED FILES: */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "epz_zag.h2"
#include <errno.h>

#include "epqpara.h"
#include "epqerror.h"
#include "epqdatendef.h"
#include "glbdef.h"
#include "fncdef.h"
#include "wdgdef.h"
/* Include for the IEF error messages */
#include "ief_error.h"
/* Include for parameterising  */
#include "ief_para.h"
/* MODUL LOCAL CONSTANTS:  */
/* DEFINES     */
#define VIR_MOD_OFF       0
#define VIR_MOD_ON 1
/* EXTERN REFERENCES    */
/* EXTERNAL FUNCTIONS */
/* USED FUNCTIONS */
/* int kun_ief_my_usx (par) #001  Examplary  userexit */
/* MODUL GLOBAL VARIABLES  */
/************ IMPLEMENTATIONAL PART **********/
/***************#001 *************************/
/******** START OF FUNCTION ******************/
/*********************************************/
int kun_ief_my_usx (par)
/* INPUT: */
char *par;
/* OUTPUT */
/*********************************************/
/* */
/* RETURN-CODE: */
/* */
/* REMARKS : */
/* */
/* DESCRIPTION: ´ */
/* This userexit replaces all lowercase letters with uppercase letters */
/* */
{ /*******************************************/
char *cp_buffer;
char ca_field [ MAX_STR_LEN +1];
int ok;
/****************** CODING PART **************/
/* */
/*********************************************/
zag_tst ("KUN-USX", 1, "kun_ief_my_usx","Start of function", NULL, NULL, NULL);
cp_buffer = NULL;
ok = zag_get_buf_elm (par, "FIELD", ca_field);
if (ok == 0)
{
ok = bsf_upp_cas (ca_field);
if (ok == 0)
{
cp_buffer = zag_set_buf_elm (cp_buffer, "FIELD", ca_field);
}
else
{
sprintf (ca_field, "%d", ok);
cp_buffer = zag_set_buf_elm (cp_buffer, "ERROR", ca_field);
}
}
ok = edb_ief_set_val (0, cp_buffer);
return (0);
}/****** END OF FUNCTION *********************/