cancel
Showing results for 
Search instead for 
Did you mean: 

Comm Channel Variable Substitution - Use of wildcards to reference payload

Former Member
0 Kudos

Hi!

I am building a solution to write out tagged / XML IDOCs to a file adapter. I am using variable substitution to build the file name to include the message type, sending partner etc... in the target directory and filename.

Is there a way to wildcard nodes in the variable substitution? For example:

<i>Currently</i>

payload:WMMBID01,1,IDOC,1,EDI_DC40,1,RCVPRN,1

<i>Desired</i>

payload:*,1,IDOC,1,EDI_DC40,1,RCVPRN,1

where * is any wildcard.

Reason is that we have multiple IDOC types and I want to avoid having to create multiple communication channels.

Help appreciate and rewarded. Many thanks, Duncan.

Accepted Solutions (0)

Answers (3)

Answers (3)

NikiScaglione
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Duncan,

could you write a custom adapter module to solve your problem,

/people/francesco.bersani/blog/2007/03/27/rename-attachment-adapter-module

Best Regards,

Niki

Former Member
0 Kudos

Hi Matias

Thanks for the reply. I am not running any mapping in this process. I am simply mining the IDOCs as they are delivered from the SAP backend system. Unfortunately, anything that needs to be done during mapping is not an option.

Thanks, Duncan

Former Member
0 Kudos

Hi Duncan !

Maybe you can use the interface name to include the name of the idoc type, and then use variable substitution with : message:interface_name to get that info and build your target filename..I think you will need to take that info from the message header instead of the payload, and create message header object names according to your need..it is a shame that idoc xml structure does not have a common root tagname...

Other interesting link (does not need mapping)

/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean

Regards,

Matias

Former Member
0 Kudos

Hi Duncan !

By mapping...I mean using XI mapping, NO R/3 mapping...just in case..it is very easy..you could also export the IDOC xsd imported from R/3 in repository, add a common root tag and the import it to repository as inbound message type, then map all fields automatically (because all have same names) and use that artificial "root" node for variable substitution.

Regards,

Matias.

Former Member
0 Kudos

Hi Duncan !

You can create the desired target filename and target directory by using dynamic configuration via java UDF in mapping. This allows you to create a target filename and/or directory based on a string..then you could use only one comm channel.

to access info:

// access dynamic configuration

DynamicConfiguration conf = (DynamicConfiguration) param.get(

StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","<b>FileName</b>");

// read value

String Filename = conf.get(KEY_FILENAME);

// to write value:

conf.put(KEY_FILENAME, "MyNewFileName");

Regards,

Matias