Skip to Content

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

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 "";

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Apr 11, 2012 at 12:17 PM

    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-messages-using-custom-adapter-module-and-fm

    Thanks

    Amit Srivastava

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 11, 2012 at 12:11 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 11, 2012 at 12:25 PM

    Hi,

    chk this (Using Adapter module):

    http://scn.sap.com/people/praveen.gujjeti/blog/2011/03/29/multi-mapping-assigning-asmas-for-child-messages-using-custom-adapter-module-and-fm

    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

    Add comment
    10|10000 characters needed characters exceeded