cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Substitution in File splitting / Multi mapping

itabhishek9
Participant
0 Kudos

Hi SDNites,

Sender structure is

Row

  --Field1

  -- Flag

Receiver 1 Structure is (Based on value of flag Receiver 1 or Receiver 2 is triggered)

Field2 (Mapped to Field 1 of Sender)

Receiver 2 structure is

Field3 (Mapped to Field 1 of Sender)

Variable substitution has to be applied on receiver side. Have used it like payload:Field1,1. But is is not working. Please suggest.

Regards,

Abhishek

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Abhishek,

As per my understanding the inbound payload is sent to two different receivers, based on the value of flag. In this case, you can check the below document.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

Regards,

Deepak Ravi

0 Kudos

Hi,

In this cases I use UDF function to define Dynamic Filename.  This is the code:

try {

String filename    = "";

DynamicConfiguration conf1 = (DynamicConfiguration) container

    .getTransformationParameters()

    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

     filename = conf1.get(key1);

     filename = filename+".xml";

     conf1.put(key1,filename);

     return filename;

} catch(Exception e) {

     String exception = e.toString();

     return "FileName exception: "+exception;

}


You should add by parameter your field and later change this expression:


filename = filename+FieldParametre+".xml";


Regards.

iaki_vila
Active Contributor
0 Kudos

Hi Abhisek,

Have you set the complete path from the first tag to the desired one?

In your example would be: payload:Row,1,Field1,1

Regards.

Former Member
0 Kudos

Hello,

Use like this -

I am assuming you are using two different file receiver channels...

For Receiver 1:

payload:MT_Name,1,Field2,1

For Receiver 2:

payload:Mt_Name,1,Field3,1

@Harish

>>Variable substitution will not work for multmapping scenario. Please check the below blog

It's DC which doesn't work for multimapping scenarios. Var substitution works fine

Thanks

Amit Srivastava

itabhishek9
Participant
0 Kudos


Hi Amit,

I did as you suggested but I am getting the error,

Unable to clone File Adapter receiver channel for parallel

Regards,

Abhishek

iaki_vila
Active Contributor
0 Kudos

Hi Abhishek,

Are you setting the two payload paths for variable substitution in the same communication channel?

Regards.

Former Member
0 Kudos

Hello,

Paste ur channel screenshot (variable substitution) along with input message structure.

Thanks

Amit Srivastava

itabhishek9
Participant
0 Kudos

Hi Amit,

Below are the details,

I am using Commercial_id in between %Commercial_id%. Also I tried to to use the harcoded text as well. Even the same is not working.

Regards,

Abhishek

azharshaikh
Active Contributor
0 Kudos

Hi Abhishek,

I believe this MT Structure screenshot is of your Receiver Message Type..

Also please check if you are mapping some valid data / field to your Target field: Commercial_Id in MM

Regards,

Azhar

former_member191435
Contributor
0 Kudos

Hi Abhishek,

Please change the occurence to 1..1  from 1..unbounded and try

the variable substitution as u already mention.

Thanks,

Sreenivas

Former Member
0 Kudos

Hi Abhishek

Can you please provide screen shot of your output payload which has been generated after the message mapping?

Thanks,

Indrajit

itabhishek9
Participant
0 Kudos

Hi Indrajit,

Below is the ouput payload,

- <ns0:MT_Auth_OR02 xmlns:ns0="My_namespace">

<Commercial_Id>Test_Data1</Commercial_Id>

</ns0:MT_Auth_OR02>


Regards,

Abhi

former_member184720
Active Contributor
0 Kudos

what is the error message?

Also you should configure the variable name in lower case. i.e. instead of Commercial_id use commercial_id

itabhishek9
Participant
0 Kudos

Hi Hareesh,

Thanks for your reponse.

Below is the error message.

MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.lib.ra.cci.XIAdapterException:

Message could not be forwarded to the JCA adapter. Reason: Permanent error: Adapter call failed. Reason: com.sap.aii.af.lib.ra.cci.XIAdapterException:

Message could not be forwarded permantely to the JCA adapter. Reason: {0}

Exception caught by adapter framework: {0}

Delivery of the message to the application using connection REST_http://advantco.com/xi/XI/REST failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.lib.ra.cci.XIAdapterException:

Also in communication channel Processing details below is the error,

Error : MT_Auth_OR02,1,Commercial_Id,1

Regards,

Abhi

former_member184720
Active Contributor
0 Kudos

>>>Delivery of the message to the application using connection REST_http://advantco.com/xi/XI/REST failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.lib.ra.cci.XIAdapterException:


what is your receiver adapter type? Is it advantco rest adapter?

itabhishek9
Participant
0 Kudos

Yes it is advantco Rest adapter.

former_member191435
Contributor
0 Kudos

Hi Abhishek,

Can you please check your communication channel FCC is as per your structures are not.

Generally Clone error will come if your structure is difer in FCC.

Thanks,

Sreenivas

itabhishek9
Participant
0 Kudos

Hi Sreenivas,

That problem was resolved.

Since Rest adapter Variable subsitution was not working, I have replaced it with File adapter to check variable substitution is working fine or not and I was getting this error in that configuration and it was due to the reason that I have harcoded value in the variable substitution and when I replaced with actual value which is payload:.... it starts working fine.

But Variable substitution in Rest adapeter to change the URL is not working.

Ex : http://abc.com/%dynamic value%.

Regards,

Abhi

Harish
Active Contributor
0 Kudos

Hi Abhishek,

Variable substitution will not work for multmapping scenario. Please check the below blog

Dual stack -

single stack -

regards,

Harish