cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch Excel sheet through File adapter and Mapping to IDOC in SAP PI?

Former Member
0 Kudos

Dear all

Help me with this scenario?

Thanks

Regards

karan kanotra

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Karan,

You can create a custom adapter module that will read the Excel file through some available java libraries like jxl (for old .xls files) or the new and very popular Apache POI jars (or both .xls and .xlsx) and transform it into the respective xml prior forwarding it to the messaging system.

A very simple example can be seen at the below link that uses jxl library:

http://saptechnical.com/Tutorials/XI/Adapter/Index.htm


Refer the below doc for creating an adapter module:

http://scn.sap.com/docs/DOC-16229

Refer the below blog to: know more about the POI library usage:

http://viralpatel.net/blogs/java-read-write-excel-file-apache-poi/


Regards

Bikash

Former Member
0 Kudos

Thanks for the immediate reply ..I will check to these links and contact to u soon.

Regards

karan kanotra

Former Member
0 Kudos

Hello  according to you which method is better  apache POI  or  through Java libraries.?

Regards

karan

Former Member
0 Kudos

Hello

Can i get your number. i need your help as i am a fresher .

Thanks

Regards

karan

Former Member
0 Kudos

Hello

Can i get your number. i need your help as i am a fresher .

Thanks

Regards

karan

Former Member
0 Kudos

Hi Karan

In order to get help, please attach your sample excel file and also provide the xml structure that you want to create from the excel file.

No body will exchange number in SCN. Please read the rules

Former Member
0 Kudos

k  sir  . I  need to know  that  How data of excel sheet is being pulled from file adapter. how xsls is being converted to xml  format and finally how mapping to IDOC .

please help from the beginning as i am a fresher in the same.

Thanks

Regards

karan

Former Member
0 Kudos

Hi Karan

Let me tell you the steps

1. Create an data type with a dummy field ( any name ) , create message type with that data type, create outbound service interface.

2. Create a file adapter and sender agreement with the outbound interface.

3. You need to create one more intermediate data type say DT_intermediate with the structure that will be generated from excel.

example

<row> ...0 to unbound

  <field1> ..1

  <field2> ..1

  <field3> ..1

 

The file adapter will pick up the excel file, you need to write a java mapping to read the excel file and generate the intermediate structure as output

Below document will help you to understand java mapping and reading an excel file in java

Excel and Java - Read and Write Excel with Java - Tutorial

Once you have the intermediate xml strcture, you need to create one message mapping where

source will intermediate structure and receiver will be idoc interface.

So your operation mapping will have two mapping first one will be java mapping and second one will be message mapping.

Former Member
0 Kudos

Hello  indrajit sir

Thanks for the immediate reply.

I need to ask more that as i am a fresher so i cant directly perform these steps in PI server.

these steps can be performed in IDES server. please tell ?

Thanks

Regards

karan

Former Member
0 Kudos

Dear  sir  This is a  new  scenario .

I got an requirement to activate Forward Error Handling in SRM. I have searched on SDN but didn't find appropriate answer on it.

Even I found some link: PI/XI: Forward Error Handling (FEH) for asynchronous proxy calls with the use of Error and Conflict ...

It explains me some points like activating FEH from SRM in SPRO. I have activated the same, plz check the screen shot:

It also follows some development for the same.

Here my concern is, should I follow this document? Does it applicable to all to all the scenarios?

Step 8: it assign object id and type what does it mean...

Does any one can explain me in detail..... Please provide me any document to configure the FEH in SRM.

I am trying to implement FEH in my SRM system. So that when even XML fails due to error, I should be able to reprocess/restart it with some editing to the XML.

My receiver interface for XML is PurchaseRequestERPSourcingRequest_In

I think this is standard one and no need to make any custom code for it. SAP has all ready given solution for it with some Configuration.

I have made some configurations like:

  • The view FEHV_ACTIVE must have the status active.
  • In transaction /SAPPO/LOGSYS , the logical system must be defined for the software component SRM-EBP-ESA .

As stated in in the link :

http://esworkplace.sap.com/socoview%28bD1lbiZjPTAwMSZkPW1pbg==%29/render.asp?id=2BAABCB0D30111DC2B8D...

Also I have made some configuration according to the Note: 1973768 - No reprocess option is available in FEH for failed in XML in SRM

Resulted, the “Process” button get activated in the XML Post Processing screen.

But can I reprocess my XML with edited value from there..?


All the  configuration part of PI  is already done .

I wanted to know  about the  FEH  Part. what are the  steps   i am  missing  or where  i am  going  wrong ?

Please let me help.

Thanks

Regards

Karan

Former Member
0 Kudos

Dear sir

I have asked  a query .

Please check for me and help me .

Thanks

Karan

Former Member
0 Kudos

Hi Karan

Close this thread and create a new one , as the requirement is for a new issue.

Former Member
0 Kudos

Dear sir

I have created the new thread as well .

Please check and help me .

Thanks

Regards

Karan

Former Member
0 Kudos

Hi

I Haven't work on that so I will be not able to help you.

Check this document. It may help you

Former Member
0 Kudos

Dear sir

No issues sir . But Thanks

Regards
Karan

Former Member
0 Kudos

Hi Karan,

Please help with below thread:  Thanks..!!

Excel(.xlsx) to .csv converison in SAP PI XI | SCN