cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Netweaver 7.31 SP16 - dynamic configuration - Header Properties with variables defined and filled in a routing

0 Kudos

Hi,

I use SAP Netweaver Process Integration 7.31 SP16 Java Only. My problem is to fill Header Properties with variables defined and filled in a routing mapping.

I know, this example isn't practicable for the dynamic Routing. It is only an example to show the problems in combination with dynamic routing, variables and adapter specific message properties.

What do I do step by step:

- Message Mapping defined.

- Operation Mapping defined

- Process Integration Szenario defined

- Process Integration Scenario defined

- Integration flow with dynamic routing defined.

- Receiver channel with file access parameters and adapter spezific message properties defined

- The test is faulty.

What is the problem? Is it generally possible to use the adapter specific message attributes by a receiver-split (Dynamic Routing)? Can anybody help me.

Thanks,

Angelika

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Angelika,

For both Directory and FileName you need to use separate UDFs.

For Directory UDF you need to return corresponding Directory parameter, and for FileName UDF you need to return the corresponding FileName parameter at the end.

Note that, per UDF, you need to take only one input string FileName or Directory as input respectively including container (ofcourse).

Reward points if helpful.

Regards,

Souvik

pvishnuvardan_reddy
Active Contributor
0 Kudos

HI Angelika,

Can you check whether you have enabled the ASMA in sender channel, as in your udf, you have written code first by checking the dynamic configuration object should not be NULL.

Please enable it in the sender channel or else remove the line conf!=null in the udf code if you don't want the first part.

Regards

Vishnu

0 Kudos

Hi,

I set the ASMA in the Sender channel. But the result is unfortunately the same.

Best regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

Please remove the IF condition line(only if(conf!=NULL) &  if-parenthesis) in the udf, and do the testing.


Kindly try this out and let me know the outcome.


Regards

Vishnu

0 Kudos

Hi Vishnu,

I do it so. It is not the solution of the Problem.

Regards,

Angelika

Former Member
0 Kudos

Hi,

Please follow the latest reply which I gave and let me know.

Regards,

Souvik

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

Can you please use the below udf and let me know if you still having issues.

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

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

dc.put(dck,dynConfValue);

return dynConfValue;

Regards

Vishnu

0 Kudos

Hi Souvik,

yes, the UDF-coding-test was successful.

Do you have still any idea?

Thanks in advance.

Regards,

Angelika

Former Member
0 Kudos

Hi,

The FileName is in .xml format, but the UDF returns String.

Try converting the FileName to .txt format and check if it works.

Regards,

0 Kudos

Hi Vishnu,

I changed the UDF as desired, but I see no change whatsoever in the result.

Do you have any other idea.

Thanks and regards,

Angelika

0 Kudos

Hi Souvik,

in the receiver channel is the transfer mode 'Text'.

In other respects I don't know, where I can define the transformation - maybe in the module.

Which module must I embedding.

Thanks in advance and regards,

Angelika

Former Member
0 Kudos

Hi Angelika,

If the transfer mode is in Text, that simply means the file will be transferred in line by line mode

What I meant was in the mapping you have written IF060_.xml.

Kindly change that to text mode.

Regards,

Souvik

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

Can you please let me know why you are validating whether key exists for DynamicConfiguration or not in IF condition?

AFAIK, when we go for dynamicconfiguration mechanism, normally we don't put conditions for validation unless and until if it requires.

Can you just use the below code and check the outcome.

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

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

dc.put(dck,dynConfValue);

return dynConfValue;

Please let me know if this doesn't cover your requirement.

Regards

Vishnu

0 Kudos

Hi Vishnu,

I don't use a condition in the Integration Flow.

I already used the code. Please look at my answer today at 9:18 p.m.

Regards,

Angelika

0 Kudos

Hi Souvik,

I changed the constant to .txt. But the test wasn't successful.

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

I checked your reply at 23rd, 8:19 AM one, where you said that you have changed the udf and still getting the error.

I can see in that udf, still you have used the below condition:

if(map.containsKey(StreamTransformationConstants.DYNAMIC_CONFIGURATION)

Hence, asking you to remove this line and its parenthesis and just use the below code and check the outcome.

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

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

dc.put(dck,dynConfValue);

return dynConfValue;

The only difference in this udf code and your's is that I have removed the IF condition validation.

Please check this udf and let me know if you still having issues.

Regards

Vishnu

0 Kudos

Hi Vishnu,

I changed the UDF.

and then I tested the message mapping. This is faulty.

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

We can not test the dynamic configuration object value in mapping level.

Please test end to end and check the outcome.

Regards

Vishnu

0 Kudos

Hi Vishnu,

o.k., but the end to end-test is faulty, too.

Regards,

Angelika

Former Member
0 Kudos

Hi Angelika,

One quick thing I can point here is when receiver communication channel is FTP, it does not involve any mapping, since you will have only file as a whole object getting transferred.

However, since the mapping is essential for dynamic configuration setting, so please use SOAP adapter on the receiver side in order to configure your channel. Also if you refer the error log it says "SOAP_http://sap.com/xi/XI/System" as the end point on the receiver side.

So please use SOAP adapter on the receiver side.

Hope this resolves your problem now after such a lengthy discussion

Regards,

Souvik

former_member184720
Active Contributor
0 Kudos

Do you have the same message id even after the dynamic receiver determination?

if you don't have any mapping needs, just write a java mapping to set the dynamic filename as explained in below wiki.

Dynamic file name for pass-through scenario - Process Integration - SCN Wiki

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

I am not sure where it is going wrong.

Can you please try this, instead of using two graphical variables in the target side.

Directly Map the dynamic Filename mapping logic to the target node Receivers

Directly Map the dynamic Directory mapping logicto the target node Receiver

After doing this change, Test end to end and check the outcome.

Regards

Vishnu

0 Kudos

Hi Souvik,

to change the adapter type isn't possible. I must use the adapter type file!

If I need the dynamical message variables in a 1:1-message mapping (not in a routing-mapping!!!) then the result is right.

Perhaps is it a bug in SAP-PI?

Regards,

Angelika

0 Kudos

Hi Vishnu,

It isn't the solution.

Is it possible that it is a bug in SAP-PI?

Regards,

Angelika

0 Kudos

Hi Hareesh,

thanks for your answer.

I am not a Java-developer - unfortunately.

I'd like only to know, whether I can use the dynamic configuration in a routing mapping and use the variables in the file-receiver-Adapter (ASMA).

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

To trace out the issue, can you please do the following things(this is applicable for PI single stack version):

Enable Receiver Determination(MS) and Mapping Step(AM) LOGGING in the ICO as below:

After doing the above change in the ICO, please do end to end testing. From Message monitoring DataBase tab, open the message and there you can see Message attributes tab, then if the dynamic configuration udf has executed successfully, then you see the filename and directory against the file namespace accordingly. From this, we can trace the issue.

Please try this and let me know the outcome with screen shots, which can help us to narrow down the root cause.

Regards

Vishnu

0 Kudos

Hi Vishnu,

I set the logging parameters and test the scenario.

Is that instead an indicator, that it isn't possible to use dynamic configuration in a routing mapping?

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

From this, we can tell that dynamic configuration mechanism did not work in routing mapping.

Not sure, is this a bug in PI.

One final thing, I can tell you to check is that, remove the graphical variables in the target side, and

Directly Map the dynamic Filename mapping logic to the target node Receivers

Directly Map the dynamic Directory mapping logicto the target node Receiver


Please test end to end.

Regards

Vishnu

0 Kudos

Hi Vishnu,

I did the changes, but it was the same result.

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika

No, what i mean is that remove the graphical variables(Dateiname,Verzeichnis) that you have defined at the target structure in the mapping. And do the mappings of filename logic and directory logic as below:

Map the dynamic Filename mapping logic to the target node Receivers

Map the dynamic Directory mapping logicto the target node Receiver

Can you try this and test end to end.

Regards

Vishnu

0 Kudos

Hi Vishnu,


Regards,

Angelika

Former Member
0 Kudos

Your target structure in mapping is getting the FileName and DirectoryName, but the receiver channel is not able to detect the FileName. You can use Variable Substitution in Receiver FTP channel in Processing tab, but the Directory Name issue will be the next problem

Small mouth, big words from my end, but I feel its a small bug in PI if such a scenario is used.

Regards,

Souvik

0 Kudos

Hi Souvik,

thank you for your support.

I have the same meaning, its perhaps a bug in PI.

I will open a notice by SAP.

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

If you are okay to try for one final time, then please check as below:

1. I have added trace in the udf code, in this way, we can come to know whether our udf is executing or not in the runtime. Try the below udf  in ESR.

AbstractTrace at = container.getTrace();

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

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

at.addInfo("Before putting dynamic" + dynConfKey + "with Value" + dynConfValue);

dc.put(dck,dynConfValue);

at.addInfo("After putting dynamic" + dynConfKey + "with Value" + dynConfValue);

return dynConfValue;

2. I would say to recreate the ICO once again, deleting the existing one...

Not sure, whether this resolves the issue or not, but I could say worth a try...

Regards

Vishnu

0 Kudos

Hi Vishnu,

Should I open a SAP-notice?

What do you mean? Is it a bug in PI?

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

Then it might be a bug in PI.

Can you check the message log, whether the trace which we added is coming in the log or not, from this we can come to know, our udf executed or not..

If you need to handle this in routing mapping itself, then go ahead with OSS message to SAP.

Since it is a pass through scenario, can you create a interface mapping having the same structures on both ends, and handle the dynamic configuration in message mapping...

Regards

Vishnu

0 Kudos

Hi Vishnu,

a trace isn't coming in the message log.

I go ahead with OSS message to SAP.

I have the scenarion already developed as a pass through scenario and this works fine.

Thanks a lot again for your Support.

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

After checking with SAP, please do let us know about the resolution in this thread discussion...

Also, please reward points for helpful replies...

Regards

Vishnu

0 Kudos

Hi Vishnu,

it's o.k., but certainly it will bei take a long time.

So Long!

Angelika

0 Kudos

Hi Vishnu,

the solution of my Problem is SAP-note 2143207.

I have test it and the result was correct.

Regards,

Angelika

0 Kudos

Hi Souvik,

my problem is resolve with SAP-note 2143207.

I test it and the result was correct.

Regards,

Angelika

0 Kudos

Hi Hareesh,

my Problem is resolve with SAP-note 2143207.

I test it and the result was correct.

Regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Thanks Angelika..

Regards

vishnu

Former Member
0 Kudos

Hi Angelina,

Thats really great. Thanks!

Kind Regards,

Souvik

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

Can you please mark the correct answer and close this thread discussion, which would help other fellow mates who will be having the same issue..

Please find below document on how to close the thread discussion.

Regards

Vishnu

Former Member
0 Kudos

Hi,

It seems all the settings are correct. Just move the FileName in the target Message Type above Directory, i.e., FileName should come before Directory.

Reason being in ASMA setting it checks the FileName first.

Regards,

Souvik

0 Kudos

Hi Souvik,

thank you for your Support.

But it isn't the solution for this Problem. The bug is still existing.

Best regards,

Angelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

HI Angelika,

Can you check whether you have enabled the ASMA in sender channel, as in your udf, you have written code first by checking the dynamic configuration object should not be NULL.

Please enable it in the sender channel or else remove the line conf!=null in the udf code if you don't want the first part.

Regards

Vishnu

0 Kudos

Hi,

thank you for your answer.

I set the ASMA in the receiver channel and I filled the variables in the routing mapping.

I don't understand, why I should set the ASMA in the sender channel?

I think the sender ASMA aren't important or is it wrong?

Best regards,

Anelika

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Angelika,

In you udf, you have written code first by checking the dynamic configuration object should not be NULL.

Hence I am asking you to enable the ASMA setting in the sender channel.

If you don't want to do this, then please remove the IF condition line(only if(conf!=NULL) &  if-parenthesis) in the udf, and do the testing.

Let me know if you still facing issues.

Regards

Vishnu