cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver determintation using Abap Mapping

Former Member
0 Kudos

Hi,

I configured a scenario in which I'm using extended receiver determination to determine the receiver of an incoming message. (The reason for this is that there is only one XI system and two ECC systems - DEV and QAS. By means of the setting in a customizing table it can be determined whether the message is sent to DEV or QAS. The message can't be sent to both systems because it is a synchronous interface). The receiver determination calls an Interface Mapping which has target interface Receiver Determination. I made an Abap Mapping program in which the customize table is read and the output message is formed as follows (according to the structure of the Receivers message):

lrf_output_document = lrf_ixml_factory->create_document( ).

lrf_receivers = lrf_output_document->create_simple_element( name = 'Receivers'

parent = lrf_output_document ).

lrf_receiver = lrf_output_document->create_simple_element( name = 'Receiver'

parent = lrf_receivers ).

lrf_element = lrf_output_document->create_simple_element( name = 'Party'

value = ' '

parent = lrf_receiver ).

lrf_element->set_attribute( name = 'agency'

value = ' ' ).

lrf_element->set_attribute( name = 'scheme'

value = ' ' ).

lrf_element = lrf_output_document->create_simple_element( name = 'Service'

value = 'DEV'

parent = lrf_receiver ).

To fill the RESULT field a stream factory is instantiated and a XSTRING is created. When I send a message to the system, the receiver determination dumps: Error when parsing receiver listLength of XML document 129 Error when parsing receiver listLength of XML Document 129 System expected the element 'Receivers'

Looks like the XSTRING has not got the right structure and can not be parsed into the Receivers message. However, when I create a CSTRING, the message looks OK. I also changed the encoding (Codepage 4103).

When I replace the Abap mapping with a message mapping, the receiver determination works OK. However, in that case it is not possible to read the customizing table. I really need the Abap mapping.

Has anyone ever filled the Receivers massage by means of Abap mapping. Any feedback will be appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>. I really need the Abap mapping. Has anyone ever filled the Receivers massage by means of Abap mapping. Any feedback will be appreciated!

I did it and it worked without any issues

it's a standard ABAP mapping (nothing special) - there are tons on blogs showing how to work with ABAP mapping

on sdn - please have a look them

for sure it works and there is nothing different then with a normal abap mapping

Regards,

Michal Krawczyk

Former Member
0 Kudos

Is it possible to post an example of the way you formed the Receivers XML message in the mapping program by means of the "create_simple_element" method? Thanks in advance!

Edited by: Ivo de Maat on Feb 2, 2010 9:19 AM

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

there is a easier way - totally based on my blogs

create an abap mapping that will feed the dynamicconfiguration in ABAP (with z "Z" namespace) - similar thing shown in my blog

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

and you don't need to create the XML in ABAP mapping just parse it, fill DC and send the same source to the target

(so you don't change the XML)

then add a message mapping to your interface mapping in which you will only use dynamicconfig value

to populate the receiver segment

nice and clean way

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

Thanks for your reaction; this sounds good. However, I've a remaining question. How can I access the dynamicconfig value in the message mapping?

Kind regards,

I. de Maat

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

there are two blogs (one mine) showing how to do that

apart from dozens of posts on this forum

you need to do a little search...

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

I've managed to create an UDF to access the Dynamic Config field. In this way I can populate the Service field of the Receivers message. Many thanks for this nice solution.

Kind regards,

I. de Maat

Answers (0)