Skip to Content

*Executing Multiple Mapping Programs*

We know the feature of interface mapping which can execute multiple mapping programs consecutively. This blog talks about the execution of multiple mapping programs in interface mapping. When you find the complexity in mapping, with help of this feature we can divide up the mapping into multiple mapping programs. +Could be helpful for beginners+. Example: AMR (Automated Meter Reading) to SAP-ISU (Industry Solution utilities). AMR generates fixed length files in FTP server from there PI should pick the files and converts into BAPI calls. +AMR Fixed Length text file should be converted into BAPI XML.

+ *Possible ways:*

1. This can be done with java mapping without FCC.

2. With FCC can be done (Single message mapping) *

3. Multiple Mapping programs* (Java mapping and message mapping without FCC) *Multiple mappings in one interface mapping:* There are two mapping programs are taken as mentioned below, these are executed in the order of top to bottom. 1.Java mapping which takes fixed length source files and generates source xml file (MT_AMR_Source). 2.Message mapping, it takes the source xml file (MT_AMR_Source) generated by Java mapping, as input, and generates BAPI xml file. 1. Java Mapping: /**  * *@author* PNemalikanti */

*import* java.io.BufferedReader;

*import* java.io.InputStream;

*import* java.io.InputStreamReader;

*import* java.io.OutputStream;

*import* java.util.Map;

*import* com.sap.aii.mapping.api.*;

*public* *class* AMR *implements* StreamTransformation { *private* Map param; *public* *void* setParameter(Map param)  

  { *this*.param = param;             }

*public* *void* execute(InputStream in ,OutputStream out)           

{

*try*                  String inLine=*null*;         

         BufferedReader bin = *new* BufferedReader(*new* InputStreamReader(in));

*while*((inLine = bin.readLine())!=*null*)                 

{                     String profileNo=*null*;                   

String fromDate=*null*;                    

String fromTime=*null*;                  

  String fromOffset=*null*;              

      String toDate=*null*;              

      String toTime=*null*;                   

String toOffset=*null*;            

        String profileVal=*null*;             

       String status=*null*;              

      String unit=*null*;”+profileNo+””+fromDate+””+fromTime+””+fromOffset+””+toDate+””+toTime+””+toOffset+””+profileVal+””+status+””+unit+””).getBytes());                     out.write(“”.getBytes());    

              }                 

   out.write(“”.getBytes());     

         }

*catch* (Throwable e)            

  {               }             } }

*+Note:+* Java mapping gives input source xml file to message mapping. 2. Message Mapping:(Generates BAPI XML ) image

Interface Mapping: +Java Mapping and Message Mapping are registered here.+ image

image” *

source fixed lenth file

Bimage

API XML:*

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply