Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

This Weblog is a complete walk through Scenario for integrating a Legacy System (File) with the R/3 system and determining different receivers by specifying conditions in X path (Receiver Determination) for starters.

 

Scenario:

 

The file should be picked up from the specified directory and validated for mandatory fields .Valid file should be sent to R/3 system via ABAP Proxy and the required data should be stored in the custom table (Z table).   Invalid file should be sent back to the source directory.

 

Assumptions:

 

1.                   Software Component is configured in SLD

2.                   FTP server is up and running.

3.                   Connection b/w R/3 and XI is established.

 

Sample Input File:

 

Y447859TEST FILE    941524 D 0000005500000944606708921 SUBS:447859TEST FILE    08921D                                                             

VOL14478590                               400000                                 1                          

HDR1A447859Z          44785900010001000100 05098 07098 000000 B.O.BBBB                                     

HDR2F0190800106                                    00                                                      

UHL1 05098447859     00000000          001               050408 B.O.BBBB                                     

44785950478598073407032             0000000000002401160900        12027358/387805/03000000

44785950478598073407032             0000001237602402223700        11766008/489759/02000000

44785950478598073407032             0000000118202403290100        12031567/395544/03000000

44785950478598073407032             0000002258702403311500        11860233/062909/02000000

44785950478598073407032             0000000129302404529700        12039448/364851/03000000

44785950478598073407008             0000003000003402031700        11733238/087137/02000000

44785950478598073407008             0000001938303404736400        11871534/513085/03000000

44785950478598073407008             0000000200003404736500        11865118/196103/03000000

44785950478598073407008             0000008451203405756800        11947944/183184/03000000

EOF1A447859Z          44785900010001000100 05098 07098 000018 B.O.BBBB                                     

EOF2F0190800106                                    00                                                       

UTL10000000000000000000944606700000000000550                  B.O.BBBB style="COLOR: gray">            

 

The input file has only ‘data records’ unbounded where as the rest all are occurring only once.   The file structures are as follows:

 

Sources File structure:

 

Y447859 - File Header

VOL1 - Volume Header Label…

HDR1 - First File Header Label…

HDR2 - Second File Header Label…

UHL1 - User Header Label…

447859 - Data Records…

EOF1 - End of File 1

EOF2 - End of File 2

UTL - File Trailer

 

Destination File Structure: Validated structure to be sent to ABAP Proxy.

 

HDR1 - First File Header Label…

UHL1 - User Header Label…

447859 - Data Records…

 

Rejected file has the same structure as the input file.

 

1. Design Time:

 

 Interface Objects:

 

1.1 Data Types:

 

Two Data types should be created one for source and other for validated target. Rejected file will have the same structure as the source. The data types are as shown in Fig 1 and Fig 2.

 

 

Fig 1: Source data type.

Fig 2: Destination data type.

 

1.2 Message Types:

 

Two message types should be created with reference to the data types created as shown in Fig 1 and Fig 2.

 

1.3   Message Interfaces:

 

 Three message interfaces should be created.

 1)    Outbound Asynchronous referring to the source message type.

2)       Inbound Asynchronous referring to the target message type for the rejected file.

3)       Inbound Asynchronous referring to the target message type for the validate file to be send to ABAP Proxy.

 

Mapping Objects:

 

1.4   Message Mapping:

 

The mapping for the rejected file is direct one to one mapping. The mapping for the validated file is also one to one mapping with only restricted fields on the target side. Incase of conversion needed in any fields, user defined functions can be used. The mapping for the validated file is as shown in Fig 3.

 

Fig 3: Message mapping for the validated File.

 

1.5 Interface Mapping:

 

Two interface mappings should be created one for the rejected file and the other for the validated file. The corresponding interfaces and mapping programs are selected to do the interface mappings.


The interface mapping for the validated file is as shown in Fig 4.

 

Fig 4: Interface mapping for the validated file.


2. Configuration Time:

 

2.1   Communication Channels:

Three communications Channels are to be created totally style="COLOR: blue">.

Two under the file system

1.       File sender to send the file to the XI.

2.       File receiver to collect the rejected file from XI.

One under the receiver (R/3) system

1.       XI Adapter to send the message to the ABAP Proxy.

 

 

The file sender and the file receiver adapters have normal configurations specifying the directory, name of the file, poll interval and file content conversion (fieldFixedLengths in our Case).

 

The configuration for the XI Adapter is as shown in Fig 5.

 

Fig 5: Communication channel configurations.

 

Note: In the XI Adapter configuration the message protocol is selected as XI 2.0 because the receiver R/3 application runs on WAS 6.20. The protocol XI 3.0 can be selected only if the receiver application runs on WAS 6.40 and above.

 

2.2 Receiver Determination:

 

The validation of the file is done while determining the receivers. The conditions are specified and the receiving systems are selected according to the conditions. This is as shown in Fig: 6.

 

Fig 6: Receiver determination with Conditions.

 

2.3 Interface Determination and Receiver Agreement:

 

It has two interface determinations and two receiver agreements as shown below in Fig 7 because the validated file should go to the R/3 system and rejected file should go back to the File system.

 

Fig 7: Interface determinations and receiver Agreements.

 

2.4 Sender Agreement:

 

The sender agreement is created by selecting the file sender communication channel and it looks as shown in Fig: 8 below.



Fig 8: Sender Agreement.

 

3. ABAP Proxies:

 

Now to receive the validated message in the R/3 system, create the ABAP Proxy in the R/3 system.

 

The entire Integration repository Objects will appear in the transaction SPROXY.  

 

Go to the particular SWCV / Name Space / Message interface IB / and right click and select Create Proxy. It looks as shown in the following Fig 9.

 

Fig 9: Creating a proxy in R/3.

 

It will ask for a package where the package under which the proxy details (classes and methods) should come should be specified.

 

It automatically generates a Proxy interface and a class as shown below.

 

Fig 10: Interface and Class generated by the Proxy.

 

A Double click on the Class will lead to the Method inside where the ABAP code to retrieve the data from the structure and appending it in to the Z table should be written. The structure where the data are stored can be found by clicking the parameters   tab and double clicking the component type and the nested structure can be accessed by using the hyphen symbol .

 

Fig 11:   Method generated by the Proxy.

 

The Sample code looks as follows.





This code writes the required data in to the Z table ZTEST_PAYMENT which looks as shown in the Fig: 12 below

 

Fig 12: The destination Z table.

 

Testing:

 

1.           Input: The file with Error conditions should be placed in the source directory.       

Output: The rejected file with the same format as the input file can be seen in the source directory.

 

2.        Input: The file with valid conditions should be placed in the source directory.

Output: The Z table can be seen populated with the intended data.


Monitoring:

 

1.       Go to SXMB_MONI in the XI system give the sender service name to filter the message and see if it shows a chequered flag for proper transfer. In case of any error the errors can be corrected by finding them out in the trace.

2.       Go to SXMB_MONI in theR/3 system and check style="COLOR: blue"> if it shows a chequered flag which indicates that the data is success fully transferred to the R/3 system.

3.       The Z table in the R/3 system can be checked for population with the intended data.  

 

 
 
2 Comments