cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic configuration in ABAP Mapping

Former Member
0 Kudos

Dear All,

I have requirement to use the filename's name in the mapping to the target message.

e.g: Filename is Victor.303, i need to take this 303 and map it to the target message.

I understand i can get that value using dynamic configuration in Adapter-Specific Attributes.

But all the samples are using Java code used in UDF.

How to do the same in ABAP Mapping?

I tried:


   record =  dynamic_configuration->get_record( namespace = 'http://sap.com/xi/XI/System/File'
                                                    name = 'FileName').
  

But record-value return blank.

Best Regards,

Victor.

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

You will find the required code here

/people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping

Regards,

Prateek

Former Member
0 Kudos

Dear Prateek,

I changed my code with:


  DATA: record TYPE mpp_dynamic.

  CALL METHOD dynamic_configuration->get_record
    EXPORTING
      namespace = 'http://sap.com/xi/XI/System/File'
      name      = 'FileName'
    RECEIVING
      record    = record.

but record-value still return as blank.

I have doubt in this, do i need to populate the FileName in the dynamic configuration (in the graphical mapping) first before i can get the value in the ABAP mapping? or System should filled it and i just can use it directly in the ABAP mapping?

How we know what is the available name and namespace in that dynamic configuration-->get record??

(e.g: my case is FileName, and in the link that you gave is ERROR.)

Any link for this?

Best Regards,

Victor.

siddhesh_pathak4
Contributor
0 Kudos

Hello,

Use the below UDF in graphical maping and pass the FileName coming from source side in any field to the UDF.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(key,a);

return "";

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>I have doubt in this, do i need to populate the FileName in the dynamic configuration (in the graphical mapping) first before i can get the value in the ABAP mapping?

of course not

>>or System should filled it and i just can use it directly in the ABAP mapping?

this is the way it works but!

you need to select - adapter specific attributes use

in your communication channel did you do that??

>>How we know what is the available name and namespace in that dynamic configuration-->get record??

you can see it in SXI_MONITOR in your message in dynamic_configuration section of your message

Regards,

Michal Krawczyk

Former Member
0 Kudos

Dear All,

My problem was solved.

FYI for my query:


I have doubt in this, do i need to populate the FileName in the dynamic configuration (in the graphical mapping) first before i can get the value in the ABAP mapping? or System should filled it and i just can use it directly in the ABAP mapping?

The answer is NO need, system will fill it for us.

We just need to tick the "Set Adapter-Specific Message Attributes" and "FileName"

in the advanced tab in the File Adapter.

Best Regards,

Victor.

Former Member
0 Kudos

Dear Michal,

You're too fast, i just find out myself for the configuration and when i update this thread you already gave me the same answer. Your reply make me more sure that I'm doing in the correct way.

Thanks a lot,

Victor.

MichalKrawczyk
Active Contributor
0 Kudos

Hi Victor,

glad it works

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

Last question


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

Can i create my own key for that dynamic configuration? And i populate the value by myself?

maybe like :


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

Best Regards,

Victor.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>Can i create my own key for that dynamic configuration? And i populate the value by myself?

maybe like

yes

just make sure you don't use the namespace of SAP but your own

just like I did with ERROR in my blog

Regards,

Michal Krawczyk

Former Member
0 Kudos

Dear Michal,

Thank You! Thank You!

Best Regards,

Victor.

Answers (0)