cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc to multiple file with dynamic file names where receiver is AS2

former_member190358
Participant
0 Kudos

Hello All,

My scenario is from one IDOC to multiple file.

The number of files which i need to create is dynamic, which depends on the number of delivery .

I want to use only receiver one CC, and files should be created in the same directory.

I have created a UDF which is mapped to one of the header node.

Everything was working fine untill business asked for this 1:n sceanrio ( earlier it was 1:1 )

Also, please note that my received is AS2 ,so i cannot use variable substitution.

Can i modify my UDF with message  id so that  i can have unique file names in target side and it does not get overwriten.

My UDF is as follows :

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://seeburger.com/xi/AS2","dtAS2FileName");

SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmmss");

String timestamp = dateformat.format(new Date());

    String valueNew  = "XXX_CUS_" + timestamp;

    conf.put(key, valueNew);

return "";

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

chk this (Using Adapter module):

http://scn.sap.com/people/praveen.gujjeti/blog/2011/03/29/multi-mapping-assigning-asmas-for-child-me...

With AS2 adapter you cannot use variable substitution. Alternate approach( Which I call as 2 way approach, Not a better one but workable ), generate files on a temp directory using variable substitution and then create a pass through scenario(Integrated configuration) to send these files to target system over AS2 protocol.

Regards,

Amol

Former Member
0 Kudos

Hi,

Normal DC code wont work with multimapping..

So you have to tweak ur design...chk this article:

http://scn.sap.com/people/praveen.gujjeti/blog/2011/03/29/multi-mapping-assigning-asmas-for-child-me...

Thanks

Amit Srivastava

former_member184681
Active Contributor
0 Kudos

Hi,

For 1:n interfaces, you cannot use Dynamic Configuration. Use Variable Substitution instead, it will be able to generate file names for each separate delivery number, as per your requirement (if only the delivery number is available in the content of the target message). See an example configuration in this Wiki: http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407

Hope this helps,

Greg

Message was edited by: Grzegorz Glowacki The original question did not mention the AS2 adapter initially. Use the functionality mentioned below.

former_member190358
Participant
0 Kudos

Hi Greg,

Could you  pls suggest if the receiver is AS2 then , what needs to be done.

Regards,
Ravi

former_member184681
Active Contributor
0 Kudos

Hi,

I believe the blog mentioned by Amit and Amol will get the job done for you.

Regards,

Greg