Application Development and Automation 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: 
Read only

How to debug a FM executed from an external source

Former Member
0 Likes
1,015

Hello. sap developers

I am running a functional module using RFC (take a look at the code example):

DATA it9106 LIKE p9106 OCCURS 0.
  DATA p_pernr LIKE p0001-pernr VALUE '83000845'.
  DATA p_des(6) VALUE 'THR200'.
  CALL FUNCTION 'RH_READ_INFTY'
    DESTINATION p_des
    EXPORTING
*      authority            = 'DISP'
      with_stru_auth       = ' '
      plvar                = '01'
      otype                = 'P'
      objid                = p_pernr
      infty                = '9106'
      istat                = '1'
    TABLES
      innnn                = it9106
    EXCEPTIONS
      all_infty_with_subty = 1
      nothing_found        = 2
      no_objects           = 3
      wrong_condition      = 4
      wrong_parameters     = 5
      OTHERS               = 6.

I got sy-subrc value equals to 6 and I don't know why.

So could you help me how I can debug this FM ?

Thank You.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
978

Dear Kernel,

What I have undestood from your problem is that, the function module which you want to execute is located in another system (as you are passing the: pdes).

What you can do is go to that particular system and in the called functio module you can put the break-point.(if the FM is created by you, you can insert the statement: BREAK-POINT <userid>(check for the addition for putting the break-point by pressing F1 on it.)) So when you will call the FM, it will take the control to the particular function module.

Also check whether the RFC destination has been maintained properly(tCode SM59).

Hope this helps.

Regards

s@k

8 REPLIES 8
Read only

Former Member
0 Likes
978

Hi,

Put an External breakpoint in your code

thanks

Read only

0 Likes
978

external breakpoint ?

never heard of it

Read only

0 Likes
978

hi,

In your code

go to Utilities- External Breakpoints- Set/Delete External Breakpoint

Also Declare

DATA it9106 LIKE p9106 OCCURS 0 with header line .

thanks,

Read only

0 Likes
978

hi,

In your code

go to Utilities- External Breakpoints- Set/Delete External Breakpoint

Also Declare

DATA it9106 LIKE p9106 OCCURS 0 with header line .

thanks,

Read only

0 Likes
978

hmm, strange. I can't find external breakpoint in my SAP version.

Is it let me to debug FMs run via RFC ?

Read only

Former Member
0 Likes
979

Dear Kernel,

What I have undestood from your problem is that, the function module which you want to execute is located in another system (as you are passing the: pdes).

What you can do is go to that particular system and in the called functio module you can put the break-point.(if the FM is created by you, you can insert the statement: BREAK-POINT <userid>(check for the addition for putting the break-point by pressing F1 on it.)) So when you will call the FM, it will take the control to the particular function module.

Also check whether the RFC destination has been maintained properly(tCode SM59).

Hope this helps.

Regards

s@k

Read only

0 Likes
978

Yes. I understood my problem right.

But this modude is not mine and I can't modify it, so if I put breakpoint in destination system and call FM in source system debugger skips my breakpoint anyway.

RFC address is set correct.

But when I run FM in destination system I got correct results.

Read only

0 Likes
978

Thank you guys. Versions of infotype structure are differes, therefore I was getting an error.