cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic configuration in HTTP receiver channel with use of additional query parameters

mayank_yadav
Explorer
0 Kudos

Hi All,

I have a scenario : IDoc to HTTP in  SAP PI 7.4  where I need to post messages at receiver HTTP_AAE

with GLN nos & filenames which are unique each time.

Also need to use additional query parameters for passing query string expected at 3rd party system.

Currently I have set 2 parameters in addnl query parameters in advanced tab:

fromZ:60030565400016
filenameINVOICE128424589.xml

But these are constant , and client needs different filename and GLN no each time when IDoc is being sent.

Quick solution appreciated.

Regards,

Mayank

Accepted Solutions (0)

Answers (1)

Answers (1)

mayank_yadav
Explorer
0 Kudos

In short I need to pass additional query parameters dynamically.

Can anyone give a quick solution on this as we have different filenames & GLN no at receiver system.

Regards,

Mayank

Ryan-Crosby
Active Contributor
0 Kudos

Hi Mayank,

Here is a piece of sample code you can add to your mapping to insert two dynamic url parameter values (once for each value):


//Get the dynamic configuration from the container 

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

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

conf.put(dcKey, value);

return value;

The name of the key would need to be passed into the UDF as a parameter along with the dynamic value.  You can use URLParamOne and URLParamTwo as constant values which would represent from and filename.  Refer below for the channel settings to pass the dynamic values into the HTTP receiver channel:

mayank_yadav
Explorer
0 Kudos

Hi Ryan,

Thanks for the info , I have used dynamic configuration in the same way for passing 2 parameters.

But I am getting above error in the channel.DO you have any clue why its coming.

Are we using the right combination of parameters in channel or query string parameters expected at receiver end could be different.

Regards,

Mayank

mayank_yadav
Explorer
0 Kudos

Hi Ryan,

Using additional query parameters & URL paramters in my case , it was sending constant value from

'from' & filename (from addnl query parameters).

Was it working in your case. please specify how.

Regards,

Mayank

Ryan-Crosby
Active Contributor
0 Kudos

Hi Mayank,

The values come from the mapping code that I supplied above - in the channel you mention the name but in a mapping you need to pass the values you want to send for those parameters.  So for those you need to use the keys URLParamOne & URLParamTwo and you also have to designate what the values should be for each.  The value assigned for URLParamOne would be whatever should be passed for from and the value assigned for URLParamTwo would be whatever should get sent for filename.

You can ignore the additional query parameter values as I temporarily changed the names for the ASMA attributes to give a sample but those others are relative to my use case.  The usage of the ASMA parameters did work for me also.

Regards,

Ryan Crosby