cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc To File

Former Member
0 Kudos

Hi all,

I have requirement like this,

One Idoc will be send from ECC, this will come to XI, here i need to do following

1) Idoc will have 50 fields, i have to mapp may be 30 fields(Includes control record & some fields from Line Item) to make one file to target system

2) And the remaining 30 fields(Includes control record & some other fields from Line Item) to make another file to target system.

Finally i have to write 2 file to the target system from one Idoc.

And one more thing is i should maintain the time delay in writing between these Two files.

Please suggest me How to do this ....

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hey

You can do this via Multi-mapping.

Thanks

aamir

Former Member
0 Kudos

Aamir,

Could you please give me some more idea on this

And also how to maintain delay in generation of these two files

Regards

Edited by: Vamsi Krishna on Jun 17, 2009 9:42 PM

Former Member
0 Kudos

Krishna,

Do multimapping as mentioned in this weblog which should solve your issue.

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

If you want delay then you need to do with BPM.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Is there any possibility with out using the BPM for the delay in writing the files??

If not

Could you please describe how to mention the delay in BPM process and the steps required

Please share the steps

Regards

Former Member
0 Kudos

Vamsi,

If you only want to few minutes then it should be pretty straight forward. You use the wait step. Check this help out:

http://help.sap.com/saphelp_nw04/helpdata/en/56/e2283f2bbad036e10000000a114084/content.htm

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Then do i need to implement the whole scenario using BPM??? or some how can i use the above mentioned blog by You?? Or do i need to avoid that blog fully??

Please suggest me the whole process once

Regards

Former Member
0 Kudos

Hi Krishna,

You can use the blog only when you dont want to wait for the files.

If you want to wait then you create two individuals mappings for each of those and then your bpm should be like this:

receive --> transformation1(mapping1) --> send1 (file1) --> wait --> transformation2 (mapping2) --> send2 (file2).

Here wait will only wait for the time you mentioned. But if you want to know whether the first file got delivered or needs to send only after delivery, then you may check for the acknowledgement. It is going to be more and more steps.

I would suggest use the blog and write the two files simultaneosly. Else more performance might take with BPM, more troubleshooting in support if issues arise.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Thanks for valuable inputs from you.

The requirement is as exactly as u mentioned here.

I have to wait until and unless the file1 got created at target, i have to write the file2.

Please provide any document or Blogs which explains this type of Req.

Even though it is performance issue , we need to perform this task

Please provide help

REgards

Former Member
0 Kudos

Krishna,

In the BPM get the application acknowledgement, once when you get then continue with the 2nd file, else do whatever your requirement says. Search for applicaiton acknowledgment you shoud be get help in sdn.

Regards,

---Satish

Answers (3)

Answers (3)

AndyK
Explorer
0 Kudos

Hi,

1. As soon as you have to do file content conversion you will find the restriction in the file adapter which can only convert flat XML structures

Sap Help -> The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes.

Solution is to map into a XML without subnodes if you have a very complex mapping i would recommend using ABAP, XSLT or JAVA mapping.

2. For splitting the files with a time delay you have to use a BPM. If the time delay is only required to have different filenames you could use dynamic filenames instead.

Following link might be helpful -> /people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

Regards,

Andreas

Former Member
0 Kudos

Hey

here is what you can do to achieve both the tasks(2 files and time delay)

Create two separate message mapping in IR

Mapping 1:IDOC and DT_File1(only populate first 30 fields)

Mapping 2:IDOC to DT_File2(only populate next 30 fields),add a UDF in this mapping and map it to the root node of DT_File2,this UDF will simply have a time delay of as much time as you want.

Create Interface mapping 1 for Mapping 1

Create Interface mapping 2 for Mapping 2

In ID.

Create 1 receiver determination.

1 interface determination,specify both the interfaces(DT_File 1 and DT_File2 here) and select "maintain Order at Runtime" checkbox.

then do 2 receiver agreement

1 sender agreement.

Message will be posted to first receiver,then it will come to second interface in interface determination,when mapping is executed,it will wait for time frame you have specified in UDF,after mapping is done ,the second scenario will finish and deliver the file.

Please search SDN for UDF to add time delay in message mapping

Thanks

Aamir

Edited by: Aamir Suhail on Jun 17, 2009 3:50 PM

Former Member
0 Kudos

Aamir,

Excelent Idea with out using the BPM itself, I searched in SDN for UDF to set delay in Message Mapping.But no Luck...

If you found it plz direct me

REgards

Former Member
0 Kudos

Heyy Aamir,

Got this one, could you please check this once whether this is the right one or..

https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/addTimeDelayinmessage+mapping

REgards

Former Member
0 Kudos

Krishna,

If you do this in message mapping with multimapping, it will wait for both the files because your two files will be within multimapping. If you want to wait then for the second file you can write a os script at the second communication channel to wait for some time.

Check this help for a batch file on windows box.

http://malektips.com/dos0017.html

If yours is unix then google accordingly.

Here in this design with wait is it will simply wait for a specific amount of time, but it will not look whether the first file is successfully written or not.

Regards,

Satish

Former Member
0 Kudos

Hi satish,

Thanks for such great help.

As of now the requirement is to set the delay in writing the file2 after file1 is written

I felt the procedure that is suggested by Aamir rather than going for OS Scripts and commands( for this i need network guy)

Could you please advice that Is the procedure and the UDF code which i pasted there , every thing is perfect or not

Regards

Former Member
0 Kudos

Hey

Looks like we are unable to get your requirement correctly.

If you want to write the second file only after the first file has been written,its going to be a complex process(will involve an actual response message),even by using BPM,you are only making sure that you get "Transport ack",which just tells that the file was transferred from XI,since we cant get application ack for File,we wont know if file was delivered properly or not.An ideal situation would be when you get a response from the actual receiver system,telling you that file has been posted properly.

If you split the scenario as i mentioned before(by creating 2 separate mappings) you can have a time delay in processing but there is no guarantee that the first file has been delivered.

This is a restriction with File adapter,you can not guarantee message delivery since the receiver system does not sends a response.

You have both the design in front of you,now its your business requirement and your choice:)

Yeah this is the UDF i was referring to,use this only in second message mapping,not in first

Thanks

Aamir

Edited by: Aamir Suhail on Jun 17, 2009 4:32 PM

Former Member
0 Kudos

let me test and will update you.

Former Member
0 Kudos

Hi Aamir,

Yes you are right. but my requirement is to deliver the second file after the first file is created in target folder.

Why because while processing the file2 the target application have the dependency that must be load the data which is there in File1

then how can i achieve this with out BPM Aamir??

Please suggest me

Regards

Former Member
0 Kudos

We are using the concept of having the intermediate folder

we will generate the file1 in ABC folder and File2 in XYZ folder.

target application will read the file1 from ABC folder every 1 Hr & we will use the Append option in the receiver File1 & File2

File2 will be moved to ABC folder at the end of the day for target application process

By this we can achieve the time delay between these two files

Regards

Former Member
0 Kudos

Hi,

IR:

1. CReate one source structure DT & MT

2. Create 2 DT & MT for target struct,one with 30 fields other with 30..as required.

3. create message mapping...

here go to messages tab and add these two target msgs MT in target struct.

source will be one MT.

4. now create interface mapping add MI for source 1 and target will be 2.

ID:

1. create scenario and in interface determination select enhanced interface determination.

2. It will give you two inbound interfaces.

3. create 2 recvr agreements for both file and 2 comm channels.

Regards,

Akshay,

Former Member
0 Kudos

Hi,

Can i proceed like this??

In IR

1) Source is Idoc , no need to create any DT, MT, MI

2) Create 2 DT, MT and MI's... one with 30 fields and another one is with another 30 fields

3) Create Mapping1 Source Idoc------First MT with 30 fields

Create Mapping2 Source Idoc---- Second MT with 30 fields

4) Create Two Interface Mapping Accordingly.

In ID

1) Create Two CC's , one for each file to produce to target system

2) One Receiver Det

3) Two Interface Det , one with one Interface Mapping and the another with another IM

4) Create 2 Receiver aggrements.

Please suggest

Regards