Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Debug RFC Enabled FM ?

Former Member
0 Kudos

Hello All,

I want to debug an RFC Enabled FM.

I've written a small Test program to check this.


DATA: eenumber	      LIKE	bapip2001-pernr,
      subtype	      LIKE	bapip2001-subty,
      objectid	      LIKE	bapip2001-objps,
      lockindicator	LIKE	bapip2001-sprps,
      validitybegin	LIKE	bapip2001-begda,
      validityend	      LIKE	bapip2001-endda,
      recordnumber	LIKE	bapip2001-seqnr.



CALL FUNCTION 'BAPI_ABSENCE_GETDETAIL 
  EXPORTING
    employeenumber          = eenumber
    subtype                 = subtype
    objectid                = objectid
    lockindicator           = lockindicator
    validitybegin           = validitybegin
    validityend             = validityend
    recordnumber            = recordnumber
* IMPORTING
*   RETURN                  =
*   START                   =
*   END                     =
*   ABSENCETYPE             =
*   ABSENCEDAYS             =
*   ABSENCEHOURS            =
*   NAMEOFABSENCETYPE       =
          .

IF sy-subrc <> 0.
  WRITE:/ 'UNsuccessful'.
ENDIF.

When a Break Point is kept at the above FM and When I press F5 the cursor is going into the FM .

But when I specify the Destination in the Call Statement as :


CALL FUNCTION 'BAPI_ABSENCE_GETDETAIL' DESTINATION 'SID_010'
  EXPORTING
    employeenumber          = eenumber
    subtype                 = subtype
    objectid                = objectid
    lockindicator           = lockindicator
    validitybegin           = validitybegin
    validityend             = validityend
    recordnumber            = recordnumber
* IMPORTING
*   RETURN                  =
*   START                   =
*   END                     =
*   ABSENCETYPE             =
*   ABSENCEDAYS             =
*   ABSENCEHOURS            =
*   NAMEOFABSENCETYPE       =
          .

The control is not going into the FM.

Can any one tell me how to debug the FM within a different system ?

Regards,

Deepu.K

9 REPLIES 9

Former Member
0 Kudos

just put a endless loop before calling BAPI n execute u'r prog. n goto destination server TCODE sm50 select workprocess then goto menu program/mode-->debugging

don't forget to reward.

Sameer

0 Kudos

Hello Sameer,

Thanks for ur reply .

I followed ur steps but still the cursor is not going into the BAPI of the RFC DEstination system.

and one more thing is :

I cant change the program now to write the endless loop.

IN this scenario waht shud I do ?

Regards,

Deepu.K

.

former_member189631
Active Contributor
0 Kudos

Hi Deepu,

*Just put the BreakPoint on ur BAPI Call,

*Put Break point CALL FUNCTION 'BAPI_ABSENCE_GETDETAIL and Execute the Program.

Regards,

Ram

former_member404244
Active Contributor
0 Kudos

Hi,

check whetehr the FM 'BAPI_ABSENCE_GETDETAIL' in presnt in the DESTINATION 'SID_010'.Also check the RFC connectivity between the two systems..also check the logical systems of both the servers.

Regards,

nagaraj

0 Kudos

Hello Nagraj,

I checked everything.

The BAPI is also there in the Destination System.(SID_010)

RFC COnnectivity is perfectly working

Logical Systems are perfectly right.

Regards,

Depu.K

0 Kudos

Hello Nagaraj,

I've gone thru the Help content given by you.

But still it doesn't solve my Problem.

Any other Options ?

Regards,

Deepu.K

0 Kudos

Hi Deepu,

Your function module is at other system and you are calling it at some other system.

I hope you know on which system your function module exists.

First debug your coding at your system where you are calling this RFC Function Module and go to that point where your function module starts, now check the export data here

And

go to that system where this function module exists and give the same export data there and debug this Function Module at that system.

Reward points, if helpful,

Sandeep Kaushik

0 Kudos

Hello Sandeep,

Thanks for ur reply.

In my case I have lot of entries which I can't enter manually in the Target system.

Any other option ?

Regards,

Deepu.K