cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc - File, file name sent in IDOC

Former Member
0 Kudos

Hi All,

Scenario is : IDOC to File

Name of the file to be created at receiver is sent in an IDOC that is, a field in IDOC contains file name. And the requirement is , this file name should be copied in the message mapping to the corresponding adapter specific message attribute.

I have a field ' filename ' in IDOC but <b>target structure does not contain any such field/element to map with.</b>

So without having a field ' filename' in target structure is there any way to achieve the requirement.

Your suggestions, clues are welcome.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mughda,

yes this is possible......just create a UDF in which you use dynamicconfiguration to set filename property......in UDF take input your idoc -> filename field.....in UDF, assign the filename property this input argument.......in mapping, take source filename field.....send it to UDF......take output of UDF to the topmost node of your target struc..........in ID, check the apdapter specific attributes and then check the filename attribute.......then your filename will be generated according to the filename field of your source idoc.

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Hi Rajeev

I am replying is bit late. Anyway your clue of mapping filename( at source) with topmost element in target helped me to solve my problem

Thanks

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

If you dont need to write that field in your file, in content conversion use the following

FileName.fieldFixedLengths -- 0

FileName.fixedLengthTooShortHandling --Cut

So that file name is omitted.make sure you should create this field in datatype as the last field.

Cheers

Tiger Woods

Former Member
0 Kudos

Hi,

also see the below link, use the file name instead of folder

Dynamic folder - in payload

Regards

Chilla

Former Member
0 Kudos

Hi,

In the target structure just create another node & field for FileName.perform mapping from Idoc field to target field file name.So that in your target structure you are able to get the filename.

In your receiver file communication channel in Filename give as %filename%.txt and choose variable substiution, here give the refrence of payload like

payload:Message Type Name,1,FileName,1,FileName,1

Now you would be able to see your generated file with the name of your idoc field value.

Cheers

Tiger Woods

Former Member
0 Kudos

HI,

You can do it in UDF to create the dynamic file name.

see the below links

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2

Regards