Entering content frameProcedure documentation Developing Your Own Programs, Function Modules, and BAPIs Locate the document in its SAP Library structure

Use

You have to plan the data transfer run for each business object type, divide it into individual task types (EXT, PUR, CHK, MAP, LOA, SPL, and AUD), and find existing programs or even develop and register your own.

For more information about loading data into R/3 (task type LOA), see Data Transfer Techniques.

You can then use these programs or ones you have created to execute tasks in the Data Transfer Workbench.

When you execute these tasks in a run, values are entered in the parameters described below.

Prerequisites

You have analyzed the fields and structures as well as the data to be transferred and the transfer file in SAP format.

Procedure

Developing Programs

There are no specifications for program development because the program is called at runtime with a variant that is specified in the task.

Developing Function Modules

If you create a function module (program type FUNC) to execute the task, it must contain the following parameters:

PROJECT LIKE DXFIELDS-PROJECT,

SUBPROJECT LIKE DXFIELDS-PROJECT,

RUNDEF LIKE DXFIELDS-PROJECT,

TASK LIKE DXFIELDS-TASK,

RUNID LIKE DXFIELDS-RUNID

I_FILES LIKE DXFILEN,

O_FILES LIKE DXFILEN

RETURN LIKE DXRETURN

Note

The status of the task is transferred in the export parameter RETURN. The STATUS field must contain one of the values below:

1: Task ended without errors
The subsequent task will be executed.

2: Task ended with errors
The run is terminated. Once you have removed any errors, the run can be continued and the task is executed again.

3: Task ended with errors, no restart
The run is terminated. Once you have removed any errors and the run is continued, the next task is executed.

You can return messages that are stored in the log using fields MSGTY, MSGID, MSGNO, MSGV1, MSGV2, MSGV3, MSGV4.

If your function module itself stores messages in the application log, you can return the message ID in the LOG_HANDLE field.

Developing BAPIs

If you want to enhance the BAPIs provided by SAP for data transfer by developing your own BAPIs, see the BAPI Programming Guide.

To use the BAPIs you develop for the Data Transfer Workbench, you have to generate BAPI-ALE interfaces.

Recommendation

If you want to provide application data for test purposes, you can create a report and include it in the Data Transfer Workbench tools (see Creating Example Files and Analyzing Structures under Creating a Data File).

As well as fields for selecting objects, a parameter for the receiver of the IDocs is also mandatory.

The Data Transfer Workbench uses this report to write the IDocs to a special file. The receiver is specified when the report is run. For this reason, this field must be defined in the report as follows:
parameters: receiver like tbdlst-logsys no-display or
select-options: receiver for tbdlst-logsys no-display

The report generates IDocs from R/3 objects by determining all the data relevant for the objects and calling the generated ALE outbound function module to create IDocs. This creates outbound IDocs in the database.

If the user has defined outbound partner profiles and a file port beforehand, the outbound IDocs are written to an outbound file. These are then converted to inbound IDocs.

Unlike reports that generate IDocs in an ALE business process, this report must not execute receiver determination.

Leaving content frame