cancel
Showing results for 
Search instead for 
Did you mean: 

Combine IDoc and RFC Respone in one Message Type

simon_bredel
Explorer
0 Kudos

Hello,

I need to have the possibility to store the data of one IDoc and one RFC Response in one Message Type.

The structure should be something like this:

IDoc_AND_RFC_RESPONSE (root)

--item (0..onbounded)

-


ID (Attribute, type xsd:string)

-


IDOC (Elemtent, type IDOC <--unfortunately not possible in data type definition)

-


RFC_Response (Element, type RFC_Response <--unfortunately not possible in data type definition)

The goal is to merge 2 messages (idoc data and the data of a rfc response) into 1 message with logical connected items.

e.g.

IDOC (message 1)

--ID 01

-


IDOC_DATA_01

--ID 02

-


IDOC_DATA_02

RFC_Response (message 2)

--ID 01

-


RFC_DATA_0101

-


RFC_DATA_0102

--ID 02

-


RFC_DATA_0201

I need this data to be transformed into:

IDoc_AND_RFC_RESPONSE

--item

-


ID 01

-


IDOC

-


IDOC_DATA_01

-


RFC_RESPONSE

-


RFC_DATA_0101

-


RFC_DATA_0102

--item

-


ID 02

-


IDOC

-


IDOC_DATA_02

-


RFC_RESPONSE

-


RFC_DATA_0201

The problem ist NOT how to do the mapping, BUT how to define the data type of the target message.

The IDoc and the RFC have a very complex structure so manually building the structure is not possible.

Thanks for your help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Simon,

To build the destination message type for this complex scenario,i suggest u to go for

the JAVA mapping(SAX Parser)...

Any how u know the structure in the destination,but mapping is complex,so Java mapping will really make u r job simple

simon_bredel
Explorer
0 Kudos

Hi,

the question is NOT about how to do the mapping.

The question is how to define the target message structure.

This has to be done before I can start working on the mapping.

Former Member
0 Kudos

Hi,

Keep them separate, there is no need to define one message type.

Try following approach:

- Use one interface with 2 message type. OR

- Copy XSD of RFC and Idoc modify manually and import as new message/data type.

Regards,

Gourav

simon_bredel
Explorer
0 Kudos

Hi,

thank you for your hints.

- How can I define one interface with 2 message types? I work with XI 3.0.

- Manually manipulatiing the xsd files is what I wanted to avoid (besides that, there is no possibility to get the rfc as xsd, only wsdl). Besides that, I tried to extract the IDoc xsd and imported it as message type, but there is an error message telling me "Schema to be handled does not contain a definition of type <Data Type Name>", whereas <Data Type Name> is the name I give to the Data Type. I tried the name of the IDoc Type here. Importing the xsd as external definition would work, but that would still not solve the problem as I cannot use the message in my data type definition.

Maybe I should specify the scenario a bit better:

I have an R3 System sending an IDoc.

The Idoc contains multiple items.

The data in the IDoc is NOT sufficient (and due to warranty reasons and company guidelines, it is not possible to add all the needed data to the IDoc).

Therefore, the IDoc is passed to an Business Process, where an RFC is invoked (input are the item IDs of the IDoc).

So afterwar the rfc call, I have all neccessary data per item in 2 messages, the IDoc and the RFC response.

Now I need to merge the data per item into one message.

This one message than is splitted into the several items and every item has to be sent separately. So I need a possibility to unite the IDoc with the rfc response.

Any hint?

Thanks a lot!

Former Member
0 Kudos

Hi,

>Therefore, the IDoc is passed to an Business Process, where an RFC is invoked (input are the item IDs of the IDoc).

If RFC and Idoc belong to same R/3 then it is better to merge them in R/3 then making expensive RFC calls to R/3 from XI.

- Write wrapper RFC in R/3 which use Idoc and RFC to get full data you want.

- Use this wrapper RFC in XI for mapping (this way it is easy to maintain).

Otherwise, modify datatype out of XI (for RFC and Idoc) by copying xsd and create single message type by making necessary changes.

Regards,

Gourav

former_member181962
Active Contributor
0 Kudos

Hi Simon,

Alternatively, what you can do is to Extend the standard IDOC to include the additional fields.

http://help.sap.com/saphelp_nw70/helpdata/EN/dc/6b7d6243d711d1893e0000e8323c4f/content.htm

Implement the user exit in the dioc procesing function module to call the RFC function module and populate the additional fields that are added to the IDOC.

Now, you can use this extended IDOC in your XI system as the source and proceed further.

Regards,

Ravi

prateek
Active Contributor
0 Kudos

As per your explanation, you have Idoc entering BPM. Then RFC sync call also enters BPM. Now in BPM, you have two abstract asyn interface, one for RFC and one for Idoc. Here, why don't you simply use multi-mapping N:1?

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

Regards,

Prateek