cancel
Showing results for 
Search instead for 
Did you mean: 

How we can mention varible substitution for diffrent message payloads

Former Member
0 Kudos

Hi,

How we can mention varible substitution for diffrent message payloads,

My sceanrio like following,

According the Outbound idoc message,based on the condition the messages to be split into 9 diffrent files.The sender message may or may not satisfied the condition to one or two messages or all messages.

I done the mapping 1:N multimapping in messagemapping & Interface mapping too.

In reciever file adapter i put the variable substiution like as fallows.

Variable Refrence

Name-- -


Filename -- payload:message_type_1,1,Segment1,1,Segment2,1,Field_1,1

<b>How we can mention variable substitution for remaining messages in the same communication channel.my message type names are diffrent for all 9 messagetypes.</b> Any ideas pl forward..,

When i am testing this scenario,able to processing a one file but the file is not placed in the specified target & gives the follwing error:

'Conversion configuration error: Unknown structure 'ns1:message_type_2' found in document', probably configuration error in file adapter (XML parser error)'.The file is

In this case Idoc data satisfied the one message condition only.

If any ideas & suggestions ..?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Thanx for all inputs,

instead of payload: option i put the message:interface my file was created & there are no errors in communication channel. In this scenario 9 message types of structure is the same.Based on the condition i have to saggregate the data into diffrent messages.i used an single communication channel for all messages & i did 9 Reciever aggrements.The scenario generates a file.

<b>As per my test data the condioin was satisfied for one message only,If all the conditions are satisfies then the communication channel will writes the 9 files one after the other with diffrent message interfaces</b>.if it does not generated then i should use 9 communication channels.Pl suggest..

By placing the some more dummy test data i checked my message & interface mappings.The given test data satisfies for three messages.

The following is the message mapping test result : message_type1,message_type3,message_type4 are generated at target side

The following is the Interface mapping test result :MIIA_interface1,MIIA_interface3,MIIA_interface4 are generated at target side.

Former Member
0 Kudos

Hi Anjan

Have you achieved a resolution to this problem? It would seem that a single communication channel with multiple receiver agreements will get the job done for you. Are your file names fixed? or can you use any of the "File Construction Mode" options to generate unique names - this would mean that you do not have to use variable substitution at all.

Stephen

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Adding to the discussion here, try to go for Conditional Receiver Determination or Comnditional Interface determination and then create multiple Comm Channels and Interafce mappings for each File in the target.

using Adapter Specific identifiers without Conditioonal Receievr or Inetrafce Determination would lead to the same file name in all target files.

Would suggest you use Adapter Specific Identifiers plus Conditional Receiver / Interface Determination.

Regards,

Bhavesh

moorthy
Active Contributor
0 Kudos

Hi,

If all the 9 files are of different message structure one option is to go with creating 9 different communication channels and configure the variable substitution for each one.

Second option is to make your target structure as genric one. And then you can achieve this with one communication channel. In this case, you may end up with doing file format in the mapping and then you are routing these files into target folder.

For e,.g if u want your files should be comma separated, then you need to use content conversion. But if you go with generic structure , it will be difficult. In that time, you can go with Java Mapping and you can format the message in the mapping itself. But it involves some complex Java Mapping..

Hope this helps,

Regards,

moorthy

Former Member
0 Kudos

Hi Anjan

You could always put the "FileName" and "Directory" names into the Dynamic Configuration using a UDF in the map - possibly using a value mapping table to determine the correct values. Then simply reference "%Directory%" and "%FileName%" in the file adapter. This way you do not have to reference payload variables and you set the names in the map. You will need to tick the box for "use adapter specific message attributes" in the file adapter. you UDF code will look something like

String dir = "/path";

String fil = "filename.txt";

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

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");

conf.put(key,dir);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(key,fil);

- Stephen

Former Member
0 Kudos

Hi,

Not sure if I understood, but isn't is possible to create 9 channels ( and 9 receiver agreements etc..) ( ok not so nice but better then nothing ). Then you can specify the settings for each channel separately

Dirk