cancel
Showing results for 
Search instead for 
Did you mean: 

Converting a flat file to IDOC

Former Member
0 Kudos

Greetings to All,

I have a requirement where i need to convert an IDOC (flat) file to IDOC.

the idoc is SHPMNT04.Presently i am trying to implement it using FCC at the sender side as the flat file is fixed length type.

Can any one suggest me a better method like using XSLT or Java mapping which could make my work smarter as i am Finding it very difficult to count and write the FCC for the IDOC which is have more than 60 segments.

Any help will be greatly admired.

Thnaks,

Anika.

Accepted Solutions (1)

Accepted Solutions (1)

former_member192295
Active Contributor
0 Kudos

Hi,

Configuration is depending on your requirement and source input file. If you getting source is idoc xml simply using bypass scenario else use FCC. According to your requirement your scenario is file to idoc, better to use FCC at sender side. This method is simple and easy way.

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi all,

i used a javamapping and solved my problem

anika

Former Member
0 Kudos

If it is idocFlatFile and you want to convert it to IDOC-XML you can use the ABAP Report for doing so by creating File port

it is not a good idea to go for writing an FCC and more over its painfull

RSEINB00 report can be used for converting idoc flatfile to idoc

Rajesh

Former Member
0 Kudos

Hi

You can try to modify your solution little bit and

try the below to post the txt Idoc into your XI as IDOC xml.

go through the topic 3.2, in last couple of pages, and try if it works.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc...

Regards

Vishnu

Shabarish_Nair
Active Contributor
0 Kudos

Anika,

1. It is not the 60 segments that matter but the hierarchy of the IDoc you need to be created.

Remember that FCC has a limitation. It cannot go beyond two levels of hierarchy

2. In case you are sure that the FCC doesnt need to handle a deep hierarchy go for FCC in the file adapter.

3. In case FCC is not possible i.e to mean creating hierarchy, create a FCC that will read your file as a record row (/people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter) and then have a java mapping to create the IDoc.

Former Member
0 Kudos

Hi shabarish/all,

I have a flat file which is fixed length and it may contain repeated segements and most of the times it is not having all the segments.

I have seen the blog which illustrates javamaping but that is for a comma dilimiter.

How to proceed when with the solution when i have a fixed length and repeating structure at the input flat file.

The IDOC which i need to genetate is SHPMNT04,a standard sap IDOC.this Idoc has deep heirarchy,its more than 4 levels at times.

Any solution will help me a great deal .

thanks in advance

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi shabarish/all,

>

> I have a flat file which is fixed length and it may contain repeated segements and most of the times it is not having all the segments.

> I have seen the blog which illustrates javamaping but that is for a comma dilimiter.

> How to proceed when with the solution when i have a fixed length and repeating structure at the input flat file.

> The IDOC which i need to genetate is SHPMNT04,a standard sap IDOC.this Idoc has deep heirarchy,its more than 4 levels at times.

>

> Any solution will help me a great deal .

>

> thanks in advance

In case of fixed length your java mapping logic will be to utilize String function - subString().

Using this and a fixed index you can extract the fields.

But off track, cant you read the file in a flat manner (FCC for fixed field files) and then try to see if graphical mapping itself can help you?

Former Member
0 Kudos

Hi

Can you check my post above (feb-26th) & see if it provides a solution.

the last couple of pages deals with what you need

as far as I know that should be the simplest way to handle this

Regards

Vishnu

Former Member
0 Kudos

hi Vishnu,

As you said this scenario can be done easily by using trasaction we21 and running a report ,as mentioned in the document you have shared.

I request you to explain the process, i mean as per the document the converted IDOC will be posted to integration server.In that case if i need to send it to ECC system,how and from where i would see and send the IDOC to the ECC system.

I mean what would be the rest of the scenario like,will there be any mapping,Interface mapping,etc what are all the other configuration steps.

Regards,

Anika

Former Member
0 Kudos

hello anika,

for this you need to place the file to your SAP PI directory and the same path as to be configured while creating file port using we21.

Once the report runs idoc flatdata will be converted into idoc xml and the data will be passed to integration engine as in case of idoc scenario and there after you can do whatever need with that idoc.

Make sure you set the business system witj SNDPOR+Client as logical system name and port as been created with the same in using idx1 and associate some dummy rfc destination which is working and contains your idoc metadata

hope you got this

Rajesh

Former Member
0 Kudos

Hi

In XI, configure a normal Idoc*-to-Idoc^ scenario

where Idoc* - is your flat file idoc, take the Control Record information of the Idoc for configuring XI

Idoc^ - is your target Idoc, sent to the target system with a proper Idoc adapter.

This is similar to sending msg using your RWB, while testing

Regards

Vishnu

Former Member
0 Kudos

Thanks Vishnu & Rajesh,

I am still having a doubt if this method will work on real time scenario.I mean i have to pick files from an 3rd party FTP location (polling and picking as and when i get a file starting with say ABC*.txt).Added to this there will be issue related to the volume of file(1000 per day),will that create any performance issues.

Can we schedule a job for running the report periodically?

I have started a POC ,getting access to XI local file server to place a file on it and need your help on configuration related issues if any.

I have imported the Required SHPMNT04 IDOC,i will use that for target.My question is how will i get the flat file xml(IDOC) in the source side.

Thanks in advance,

Best Regards,

Anika

Former Member
0 Kudos

Can we schedule a job for running the report periodically?

Yes you can schedule report for this.

getting access to XI local file server to place a file on it and need your help on configuration related issues

Here what you need is to do configure File Sender CC with NFS protocol. All you need to have is access to that folder atleast for PIAFUSER (adapter service user for that directory as this user will be used by CC)

For source after running report you flatfile will convert into idoc and posts to IE

Rajesh

Former Member
0 Kudos

Hi

I am still having a doubt if this method will work on real time scenario.I mean i have to pick files
 from an 3rd party FTP location (polling and picking as and when i get a file starting with say
 ABC*.txt).Added to this there will be issue related to the volume of file(1000 per day),will that create
 any performance issues.

It is now that you are sharing the complete scenario/ problem , just have a glance from your first post at the top & the replies, because its the problem statement that steers the discussion.

Making the files available for the Report is a seperate task. You have to develop FTP-to-File XI scenario (or regular ftp process to send files across, which normally will not be allowed in XI server), I dont see any other way, if any, I 'assume' that it might complicate the situation.

Performance - it is not something to do with your scenario alone, but the overall system load, configuration etc. (b.t.w 1000 is normal)

Can we schedule a job for running the report periodically?

Yes, scehdule a batch job calling this Report (with necessary variants) with required frequency or exact time (if there is any agreement with sender)

I have started a POC

I appreciate that, best way at this moment. you can reverse engineer from the errors to configure your scenario. for any reason,if you think it does not work, you can always stop and/or look for different solution.

need your help

- Definitely I will share my thoughts, if time permits

how will i get the flat file xml(IDOC) in the source side

do you mean the source structure, you can use the same structure as your target.

once you are convinced with your solution approach, then it is better to close this thread & start a new one with new issues, for more views & suggestions and better readability.

@Rajesh - I appreciate your efforts to solve the issue , but the below is not correct & possible, w.r.t this issue

Here what you need is to do configure File Sender CC with NFS protocol.

Regards

Vishnu

Former Member
0 Kudos

Hi Anika,

Hear is another solution that meet ur requirements

1) create an dummy scenario with out mapping

i.e. this scenario picks file from third party FTP location and place in ur xi server.

check below blog and thread.

/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository

2) As suggested by vishnu and rajesh

create a file port and run report that will do rest of the thing.

Thanks and regards,

pradeep.

Former Member
0 Kudos

Hi Anika,

you need to go for a FCC which would be more than 60 lines. No other way is left.

JoelTrinidade
Active Contributor
0 Kudos

No substitute for hard work.