cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Lookup in message mapping is called twice

former_member190293
Active Contributor
0 Kudos

Hi!

In my graphical mapping I use RFC Lookup function to get data from SAP system.

In development system it works fine, but in productive it returns a pair of values instead of one value. I checked queues for inbound parameters - they all contain only one value for the context. But when I check execution log at "Test" tab of mapping I see that RFC function is called twice - one time with values from inbound queues and the second time - with empty request message. I have only one segment with data which is used as source for inbound parameters.

The only difference between development and productive systems is that development system runs on PI 7.31 and productive system - on PI 7.1.

The versions of mapping and RFC definition are the same in both systems.

Any ideas, please?

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Evgeniy,

Just a couple of comments. I've had the same behavior when executing the graphical RFC lookup in our 7.11 system except that the blank line comes on the first line. However, this was not present on one of our FMs so I decided to investigate.

In the FM that had two lines, the output was taken from the TABLES part in the FM definition. In the FM without the blank line, the output was taken from the exporting parameter of the FM. I think this behavior was fixed in PI 7.3 but I could be wrong.

PS: Can you confirm if the FM is called twice by checking in RWB cc monitoring? It should have two different message ids executed at the same time.

Regards,

Mark

iaki_vila
Active Contributor
0 Kudos

Hi Mark,

I didn't know this particularity. Another way to check it can be to set an external breakpoint on the ABAP code with the same user than the user set in RFC channel, however in production environment is not a good way.

Regards.

Answers (6)

Answers (6)

iaki_vila
Active Contributor
0 Kudos

Hi Evgeniy,

This is a really weird issue. Have you checked Mark suggestion if there are two or one calls?

Have you tried to test your RFC manually on the ABAP system and to check that it returns really one value?, may be in production there is an empty value recorded accidentally.

On the other hand there is a note about similar issues 2096837 - Control the use of values from previous context in the message mapping, but i would contact first with SAP by OSS talking your issue before to apply any patch.

Regards.

former_member190293
Active Contributor
0 Kudos

Yes, there are two calls. RFC function returns single value and accepts single values as Import parameters. I've checked RFC in SE37 - it returns one value. And from test log I see two calls:

  •              Document start
  • Start tag [ns0:Z3PL_GET_KUNNR]
  • Add raw attribute [ xmlns:ns0="urn:sap-com:document:sap:rfc:functions"]
  • Start tag [_--33PL_ADDR]
  • Add raw attribute []
  • Put value [г.Владивосток, до терминла]
  • Close tag [_--33PL_ADDR]
  • Start tag [_--33PL_KUNNR]
  • Add raw attribute []
  • Put value [03574]
  • Close tag [_--33PL_KUNNR]
  • Start tag [_--33PL_NAME]
  • Add raw attribute []
  • Put value [Ильчуков В.В.]
  • Close tag [_--33PL_NAME]
  • Start tag [PARNUM_3PL]
  • Add raw attribute []
  • Put value [NOVATOUR]
  • Close tag [PARNUM_3PL]
  • Close tag [ns0:Z3PL_GET_KUNNR]
  • Document end
  • The RFC lookup returned an RFC responce
  • closing accessor.
  • accessor closed.
  • Document start
  • Start tag [ns0:Z3PL_GET_KUNNR]
  • Add raw attribute [ xmlns:ns0="urn:sap-com:document:sap:rfc:functions"]
  • Start tag [PARNUM_3PL]
  • Add raw attribute []
  • Put value [NOVATOUR]
  • Close tag [PARNUM_3PL]
  • Close tag [ns0:Z3PL_GET_KUNNR]
  • Document end
  • The RFC lookup returned an RFC responce
  • closing accessor.
  • accessor closed.          
former_member190293
Active Contributor
0 Kudos

And one more difference I see is the RFC Lookup output queue first value. In case of development system it's initial context change with value "null" and in productive system it shows "__cC_" value.

This also seems strange to me.

former_member190293
Active Contributor
0 Kudos

And there are two messages for RFC Lookup in RFC receiver channel

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Evgeniy,

Well it is indeed being called twice. Your option here would be to filter the blank after the rfc lookup.

Regards,

Mark

former_member190293
Active Contributor
0 Kudos

I'm about to use pure java mapping with RFC calls inside as my graphical mapping becomes too complex for future design :-).

iaki_vila
Active Contributor
0 Kudos

Hi Evgeniy,

You have an example here http://wiki.scn.sap.com/wiki/display/Snippets/User-defined+Mapping+Function+for+RFC+Lookup

However, in my opinion is not a good idea to develop your own RFC lookup, this can generate several support issues in the future. I think if you are sure that you are not generating empty values to the sender parameters you should open an OSS assistance to SAP.

Regards.

former_member190293
Active Contributor
0 Kudos

Hi Iñaki!

I'm not going to develop my own RFC Lookup. It's a SAP library for Java development. I think, when you use RFC Lookup in your graphical mapping, it uses the same class to make a call. I've already tried it and it worked.


former_member190293
Active Contributor
0 Kudos

No, still no luck

It uses empty request even after I inserted IFWithoutElse condition before calling RFC Lookup.

RFC uses export parameter to return value. No TABLES are used.

former_member190293
Active Contributor
0 Kudos

I have a quess about this situation.

I use IFWithoutElse function while setting parameters for RFC Lookup to use only segment with particular data inside. But I guess now that RFC is called for other segment too without parameters as they don't meet the condition. I'm gonna check it out now.

But it's strange why it's called only once in development system. Or it's a different behavour of RFCLookup in PI 7.3?

iaki_vila
Active Contributor
0 Kudos

Hi Evgeniy,

In production enviroment you are passing an empty value to the queues, try to use IF without Else asking in the IF condition the value is differente that the empty one.

I don't know if with RemoveContext+CollapseContext will work, you can try it.

Regards

former_member190293
Active Contributor
0 Kudos

Hi Iñaki!

As you can see on screenshots there are no empty values. Only one set of parameters and the final context change.

The test message is the same for both systems so are mappings.