• No se han encontrado resultados

Capítulo 4. Resultados de la investigación

4.1. Resultados del análisis de los documentos

4.1.2. Digitaciones aplicadas al repertorio

Exercise Objectives

After completing this exercise, you will be able to:

• Configure a scenario that transfers an XI-XML message to the file adapter and writes it to a directory as a sequential file

Business Example

Your local PC has a local application with the software component SC_BIT_TravelSoft. This software component has an inbound interface for flight master data and expects the data as a sequential file. The application has been assigned the name BS_BIT_TravelAgency_## as a business system. You want to use SAP Exchange Infrastructure to transfer flight master data from an outbound IDoc interface to an XML structure that is expecting all fields of the required file structure. You want the outbound file adapter to convert the XML data to a sequential file of the line structure expected by the software component. You want the outbound file adapter to place this sequential file in a directory.

Task 1:

Write flight master data to a sequential file by using your local Adapter Engine. Configure a new outbound file adapter and define an end point in the Integration Directory.

1. Check and complete the settings in the Integration Repository.

Create a data type DT_BIT400_##_flat that contains a line row, which is typed with the data type DT_BIT400_##. Create a message type msgT_BIT400_##_flat that references this data type DT_BIT400_##_flat. Create an inbound interface I_msgIF_BIT400_##_flatthat references this message type.

Create a message mapping msgMap_BIT400_##_flat with the source structure FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01 and the target structure msgT_BIT400_##_flat. Create an interface mapping IF_Map_BIT400_##_flat with the outbound interface FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01, the inbound interface I_msgIF_BIT400_##_flat, and the message mapping msgMap_BIT400_##_flat. Activate your objects.

2. Create a new outbound file adapter called

Training##_flatfile_outboundin your Adapter Engine. Use the template Training##_file_outbound.

Continued on next page

26-02-2004 © 2004 SAP AG. All rights reserved.

141

3. Create a subdirectory Files. Place files in this directory with the name Training##_nnnnn.txt. nnnnn signifies a consecutive number.

Which configuration parameters of the outbound file adapter are responsible for these settings? For information on the parameters, see the documentation.

4. Configure the file adapter. Follow the procedure set out in

’Configuring the Outbound File Adapter in the Integration Engine’.

Place the files in the directory that you created in 2. and name them Training##_nnnn.txt. Enter 8212 as the port that XI uses to reach the file adapter and /file/receiver## as the service. Save the configuration and start the adapter.

5. Create an XI connectivity end point for your business system BS_BIT_TravelAgency_##and your inbound interface I_msgIF_BIT400_##_flatin the Integration Directory, in the namespace BIT400_##. Make sure that the URL corresponds to your configurations for port and service. Select Anonymous Logon.

Task 2:

Configure a scenario in the Integration Directory that sends flight master data from the outbound IDoc interface of the Travel_Agency_Summer business system to the BS_BIT_TravelAgency_## business system with the inbound interface I_msgIF_BIT400_##_flat in the namespace BIT400_##by using your local file adapter. The data must only be distributed if the RCVPRN field of the segment EDI_DC40 has the value LS_BIT_##.

1. Create an interface determination from the outbound interface FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01to the

inbound interface I_msgIF_BIT400_##_flat in the namespace BIT400_##in the Integration Directory. Enter your mapping msgMap_BIT400_##_flat.

2. Check whether the system finds your interface determination and your end point in the configurations by using the Refresh icon in your receiver determination.

BIT400 Lesson: Outbound File Adapter

Solution 8: Configuring the File Adapter for a Sequential Target File

Task 1:

Write flight master data to a sequential file by using your local Adapter Engine. Configure a new outbound file adapter and define an end point in the Integration Directory.

1. Check and complete the settings in the Integration Repository.

Create a data type DT_BIT400_##_flat that contains a line row, which is typed with the data type DT_BIT400_##. Create a message type msgT_BIT400_##_flat that references this data type DT_BIT400_##_flat. Create an inbound interface I_msgIF_BIT400_##_flatthat references this message type.

Create a message mapping msgMap_BIT400_##_flat with the source structure FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01 and the target structure msgT_BIT400_##_flat. Create an interface mapping IF_Map_BIT400_##_flat with the outbound interface FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01, the inbound interface I_msgIF_BIT400_##_flat, and the message mapping msgMap_BIT400_##_flat. Activate your objects.

a) Use the solution example for task 1 of the exercise Configuring the Outbound File Adapter for an XML Target File.

2. Create a new outbound file adapter called

Training##_flatfile_outboundin your Adapter Engine. Use the template Training##_file_outbound.

a) Follow the procedure set out in Configuring the Outbound File Adapter in the Integration Engine.

Continued on next page

26-02-2004 © 2004 SAP AG. All rights reserved.

143

3. Create a subdirectory Files. Place files in this directory with the name Training##_nnnnn.txt. nnnnn signifies a consecutive number.

Which configuration parameters of the outbound file adapter are responsible for these settings? For information on the parameters, see the documentation.

a) Create the directory. In the solution example it is called c:/XI_Training/Files.

b) The configuration parameter

file.targetDir=c:/XI_Training/Files

is responsible for the directory name. If necessary, replace the directory with your directory name.

c) The configuration parameter

file.targetFilename=Training##.txtis responsible for the file name. You can number the files consecutively, separated from the file name by an underscore (_), by using the configuration parameter file.writeMode=addCounter

file.counterSeparator=_ file.counterFormat=0000 file.counterStep=1.

4. Configure the file adapter. Follow the procedure set out in

’Configuring the Outbound File Adapter in the Integration Engine’.

Place the files in the directory that you created in 2. and name them

Continued on next page

BIT400 Lesson: Outbound File Adapter

Training##_nnnn.txt. Enter 8212 as the port that XI uses to reach the file adapter and /file/receiver## as the service. Save the configuration and start the adapter.

a) The configuration file should contain the following parameters:

# File adapter java class classname=com.sap.aii.messaging.adapter.ModuleXMB2File

mode=XMB2FILEWITHCONVERSION

#Adress for XMB endpoint XMB.httpPort=8212 XMB.httpService=/file/receiver##

#File Adapter specific parameters file.createDir=1 file.targetDir=c:/XI_Training Files file.targetFilename=Training##.txt #file.writeMode=append

#file.writeMode=overwrite file.writeMode=addCounter file.counterMode=immediately

#file.counterMode=afterFirst file.counterSeparator=_ file.counterFormat=0000 file.counterStep=1

##xml conversion properties if mode XMB2FILEWITHCONVERSION is specified

xml.addHeaderLine=0 xml.fieldSeparator=; xml.endSeparator=:

5. Create an XI connectivity end point for your business system BS_BIT_TravelAgency_##and your inbound interface I_msgIF_BIT400_##_flatin the Integration Directory, in the namespace BIT400_##. Make sure that the URL corresponds to your configurations for port and service. Select Anonymous Logon.

a) Log on to the Integration Directory.

b) Navigate to the end point for your business system by choosing Receiver System End PointsBS_BIT_TravelAgency_##. Double click to navigate to the detail view.

c) Select Create and select the inbound interface

I_msgIF_BIT400_##_flatfrom the input help in the namespace BIT400_##.

d) Select the end point type XI-Connectivity. Enter the URL of your file adapter and select Anonymous Logon.

e) Save and activate the end point.

Continued on next page

26-02-2004 © 2004 SAP AG. All rights reserved.

145

Task 2:

Configure a scenario in the Integration Directory that sends flight master data from the outbound IDoc interface of the Travel_Agency_Summer business system to the BS_BIT_TravelAgency_## business system with the inbound interface I_msgIF_BIT400_##_flat in the namespace BIT400_##by using your local file adapter. The data must only be distributed if the RCVPRN field of the segment EDI_DC40 has the value LS_BIT_##.

1. Create an interface determination from the outbound interface FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01to the

inbound interface I_msgIF_BIT400_##_flat in the namespace BIT400_##in the Integration Directory. Enter your mapping msgMap_BIT400_##_flat.

a) Log on to the Integration Directory.

b) To navigate to the interface determination for the outbound interface FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01, choose Interface Determination for Outbound Interface

FLIGHT_SAVEREPLICA.FLIGHT_SAVEREPLICA01BIT400_##→ . Double click on the node to navigate to the detail view.

c) Choose Create. Enter Travel_Agency_Summer as the sender business system and BS_BIT_TravelAgency_## as the receiver business system. Choose Create.

d) Enter a description and select your inbound interface I_msgIF_BIT400_##_flatfrom the input help in the namespace BIT400_##.

e) Save and activate the interface determination.

2. Check whether the system finds your interface determination and your end point in the configurations by using the Refresh icon in your receiver determination.

a) Navigate to the receiver determination for the sender business system Travel_Agency_Summer by choosing Business Scenarios

BIT400_##Receiver DeterminationTravel_Agency_Summer.

Double click to navigate to the detail view.

b) Select the receiver BS_BIT_TravelAgency_## and use the Refresh icon to check whether the system finds your inbound interface I_msgIF_BIT400_##_flat in the namespace BIT400_##.

BIT400 Lesson: Outbound File Adapter

Lesson Summary

You should now be able to:

• Configure an outbound file adapter and describe the runtime procedure

• Configure a scenario that transfers an XI-XML message to the file adapter and writes it to a directory as an XML file

• Configure a scenario that transfers an XI-XML message to the file adapter and writes it to a directory as a sequential file

26-02-2004 © 2004 SAP AG. All rights reserved.

147