Menu
If you are developing a module for the sender file/FTP adapter and want to access the file name in the module, see SAP Note819761. You have created a new communication channel or have. Performing File Content Conversion (FCC) is a common requirement when developing interfaces that deal with flat file formats. This can be easily accomplished in the File/FTP adapter. Hi all, I am going to share you End to End Configuration of File Content Conversion using IFlow in SAP PO 7.4. This end to end scenario consist Design(ESR) and configuration(ID) details for File Content Conversion with testing snapshots.
Previous post useOneAsMany explained in easy example used an example to convert tree structure into flat structure by using useOneAsMany. This post will do the reverse, convert flat structure back to tree structure.
The source message type is flat structure. The target message type is tree structure. This mean Category, CatID, CatName need to be grouped based on same value. Book, BookID and BookName need to placed under corresponding Category.
The objective of the mapping is to convert below test source data (flat data) and target data (tree data):
Firstly, map the first element in target message type, which is “Category” field. Below transformed queue with 6 values and 6 contexts, into queue with 3 values and single context.
For field CatID and CatName, follow above similar way to map, and add additional SplitByValue [Each value].
For field Book, use formatByExample to get correct context changes for each category. Example: values B1,B2,B3 under single context will group and place these 3 books under first category C1.
For field BookID and BookName, use directly one-to-one mapping only. This is because source fields have a context change, and for each target fields under Book group also always have a context change.
Done. We completed the mapping!
The technique and tips in these 2 posts to convert tree structure to flat structure and vice-versa, should be useful to tackle actual mapping development that involved different hierarchy levels. Enjoy!
The source message type is flat structure. The target message type is tree structure. This mean Category, CatID, CatName need to be grouped based on same value. Book, BookID and BookName need to placed under corresponding Category.
The objective of the mapping is to convert below test source data (flat data) and target data (tree data):
Firstly, map the first element in target message type, which is “Category” field. Below transformed queue with 6 values and 6 contexts, into queue with 3 values and single context.
For field CatID and CatName, follow above similar way to map, and add additional SplitByValue [Each value].
For field Book, use formatByExample to get correct context changes for each category. Example: values B1,B2,B3 under single context will group and place these 3 books under first category C1.
For field BookID and BookName, use directly one-to-one mapping only. This is because source fields have a context change, and for each target fields under Book group also always have a context change.
Done. We completed the mapping!
The technique and tips in these 2 posts to convert tree structure to flat structure and vice-versa, should be useful to tackle actual mapping development that involved different hierarchy levels. Enjoy!
collapseContext and formatByExample to Convert Flat Structure to Tree Structure
Step-by-step guide to develop Adapter Module to read Excel file in PI/XI
By Jyothi Anagani, Yash Technologies
Before proceeding with the actual scenario, we would discuss about the importance of Adapter module.
Module acts as a special function that is used by an Adapter to provide the additional functionality to the Adapter.
By using File Adapter we can only read .xml files and .txt files (using File Content Conversion).If we want to read an excel sheet, it is not possible by using the normal File Adapter. For this purpose we are developing a module & Deploying it into the sap j2ee server and we will specify the module name in module tab of Communication channel. Then this module will read excel sheet and convert that into an xml format which XI can understand.
Here is a simple example to read data from excel sheet and pass it into the Adapter Framework
The Step By Step Solution to Develop a Simple Adapter Module:
For the module development you have to extract following libraries from your PCK/AF installation:
aii_af_mp.jar à the interface Moduleaii_af_ms_api.jarà Dealing with payload and attachmentaii_af_trace.jar à Writing Traceaii_af_svc.jar à Adapter Servicesaii_af_cpa.jar à Reading Channel Entriesaii_af_ms_spi.jar aii_af_cci.jarSteps in SAP Net Weaver Developer Studio
Open SAP Net Weaver Developer Studio.
Create a new Project as J2EE à EJB Module Project.
ChooseProject à Properties à Java Build Path à LibrariesàAdd External Jars to assign the libraries to your project.
![Fcc adapter in sap pi Fcc adapter in sap pi](/uploads/1/1/8/9/118960715/599574347.png)
We have to add one more jar file here. That isjxl.jaràto read excel sheet contentYou will find the jxl.jar at this location.http://vonage.otabi.com/activity/lib/jxl.jarand the corresponding API will be found at http://jexcelapi.sourceforge.net/resources/javadocs/current/docs/
Under EJB Module Project select ejbModule folder and Right Click to create a Package.
Right Click on Package à New à Java Class
That Class has to implement SessionBean and Module interfaces
When you create the adapter module your Java class has to implement Module Interface of adapter Module API (com.sap.aii.af.mp.module.Module).
This Module Interface has only one Method process
Write your Business Logic inside this process method ( ie Conversion of Exceel sheet content to xml structure ).
·You get the error message: Bean problem: No Interface classes found. This occurs because there is no Java source available for the EJB interface classes.
- Choose the Package Explorer view in the Developer Studio.
- Choose your project, and in the context menu, choose Close Project.
- Choose Open Project again.
- Finally, switch back to the J2EE Explorer view
·Your Class will Look Like this.
Fcc In Sap Pick
Click here to continue....