Sie sind auf Seite 1von 4

Subsc

XI: Debugging RFC calls from the XI not possible? ribe


Who said that? :-) Print
Michal_Krawczyk_PIXI
Perm
Business Card
alink
Company: Nype
Posted on Jan. 17, 2006 01:38 AM in SAP Process Integration (PI) Share

Have you ever been working with the RFC receiver adapter?
If so then probably you've read the documentation saying that debugging RFC calls
comming from the XI is not supported yet. This might be true but only if we want to debug
RFC directly. In this weblog I'll present a very simple way on how you CAN debug
the RFC calls. Remember it's just one of the ways.

How the procedure looks like?


Very simple, we'll use queues in order to stop the RFC call and debug it later on.

Step 1

At first we have to copy our standard RFC - the one we call from the XI. Let's name it
<old rfc name>_BG. Now we have two RFCs that do exactly the same.

Step 2

The next thing we're going to do it to call the <old rfc name>_BG from the RFC
that get's invoked by the XI. However we're going to call it in such a way
that it will go inside a queue. Clear the function code and replace it with the code sample below
(remember that the old function code still exists in the <old rfc name>_BG function module.
DATA: queue_name like TRFCQOUT-QNAME.

*****************************
*setting the queue name
*****************************

queue_name = 'DEBUG_QUEUE'.

call function 'TRFC_SET_QUEUE_NAME'


exporting
qname = queue_name
exceptions
invalid_queue_name = 1
others = 2.
if sy-subrc <> 0.
endif.

****************************************************
*call the new function in the background
*and passing all the parameters from the old RFC!
*so we'll be able to debug the RFC with correct
*parameters
****************************************************

CALL FUNCTION '<old rfc name>_BG'


in background task
destination 'NONE'
as separate unit
TABLES
TABLESAMPLE = TABLESAMPLE.

***************************************
*remember about the commit work
***************************************
Commit Work.

Endfunction.

Step 3

Now since we got the RFC call done we have to stop the queue from processing.
We can stop the queue with TCODE - SMQ1 by clicking on the Immediately.
Step 4

Now we have to specify the queue name (DEBUG_QUEUE) and the RFC destination.
You can get the RFC destination name from TCODE - SM59 (internal destination) the one with active state.

Step 5

Now we can execute our integration scenario that will call our old RFC.

Step 6

If the old RFC got called we can go to TCODE - SMQ1 again where we should see
that our RFC call (actually the one that we execute from the old function) got caught.

Step 7

We can enable our queue - but without activation.

Step 8

Now by clicking on the queue we can see our RFC call which we can directly debug
(with all the same parameters as with the original call). The only exception will probably be the user
(so remember about the differencies with the authorizations!) but every parameter should be
exactly the same as in the original call.
This weblog introduces just one of the ways how you can debug your RFC calls
but I believe it's very easy to implement in the dev environments.

Michal_Krawczyk_PIXI is an expert SAP contractor consultant with Nype (http://nype.pl), several time top
contributor in SAP PI/XI area and an author of a SAP Press book: "Mastering IDoc Business Scenarios with SAP
PI" and Genie Press book: "The Essentials on SAP NetWeaver Process Integration" and he also wrote many
( >100 ) articles about SAP PI/XI on SDN and magazines like: SAP Professional Journal, SAP CRM Expert
Online, SAP SCM Expert Online, SAP HR Expert Online, SAP Solution Manager Expert Online.

Das könnte Ihnen auch gefallen