cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to get ASMA file name into message payload by using standard Adapter modules?

former_member190293
Active Contributor

Hi!

I try to get file name from ASMA and put it to message payload in Sender file communication channel.

I use AF_Modules/DynamicConfigurationBean and AF_Modules/PutPayloadValueBean to get it work. But it doesn't.

AF_Modules/DynamicConfigurationBean               1

AF_Modules/PutPayloadValueBean                     1

1     key.1                                                                                                         write http://sap.com/xi/XI/System/File FileName

1     value.1                                                                                                       module.fileName

1     put:/ns0:MT_NVT_Transfer_Message/MESSAGE_HEADER/MESFILENAM    module.fileName

1     xmlns                                                                                                        xmlns:ns0="urn:my_namespace"

I use the same module key in order to get access to module context parameter "fileName". With different module keys it doesn't work either.

During execution I get error in PutPayloadValueBean saying that "value can not be null". I guess the module can't access module.fileName parameter defined in first module.

Is there any chance to get it work in such way?

P.S. Of couse, I know about UDF and Java/XSLT realizations of this task and I did it many times. But now I want to try Adapter modules to do the same.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor

Hi Evgeniy,

No it is not possible to read the ASMA properties into payload via PutPayloadValueBean module, you need to read dynamic configuration properties in the message mapping using UDF.

You need to use PutPayloadValueBean in combination with GetPayloadValueBean as per the help

Adding PutPayloadValueBean in the Module Processor -  Adding Modules to the Module Processor - SAP L...


Use PutPayloadValueBean to enrich the message with values from a module context. You can use this module in combination with GetPayloadValueBean to enrich a response message with information from the request. Normally you use GetPayloadValueBean to extract values from a message, then execute an adapter module (example, synchronous SOAP call) and finally use PutPayloadValueBean to enrich the response with stored values.

Regards,

Praveen.

former_member190293
Active Contributor
0 Kudos

Hi Praveen!

Thanks for reply.

I read that help too. From one side it says that I can use a pair of modules for some additional functionality. But "You can use..." doesn't exactly mean "You can not use in other cases", I think. And the first phrase "Use PutPayloadValueBean to enrich the message with values from a module context" is exactly the task I try to do: I try to put value to payload from module context.

It's just a kind of "tricky" try

engswee
Active Contributor
0 Kudos

Hi Evgeniy

I checked the codes using and confirmed that DynamicaConfigurationBean will not work with PutPayloadValueBean.

DynamicConfigurationBean stores the value in the module context under keys that begin with "module."

However, PutPayloadValueBean retrieves the value in the module context with prefix "ValueBean.".

So the two modules are not compatible

Regards

Eng Swee

former_member190293
Active Contributor
0 Kudos

Hi Swee Yeoh!

Thanks for your answer! Now it looks clear why the trick doesn't work.

And also SAP help topic saying "...to enrich the message with values from a module context" is incorrect.

Answers (1)

Answers (1)

javier_alcubilla
Contributor
0 Kudos

I was trying to do something similar to store the messageId into the payload.

This ruins my standard options, thinking in create a new module 🙂


engswee.yeoh What do you think?


Kind regards