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

Perform Subroutine Issue

Former Member
0 Likes
4,547

Hi,

I am calling the subroutine in FM where that subroutine is used in a include program.

perform get_substatus(Zethan_test) if found.

No errors i got while activating the FM, but it is not working. The breakpoint is not triggering .

Any solution for this?

Regards,

EH

27 REPLIES 27
Read only

Former Member
0 Likes
4,134

hi

put break point in FM at perform statement and check whether it is goin in that perform or not.

regards.

laxman

Read only

0 Likes
4,134

Yes i did...

I am checking this from the WEB backend.... So after the IF condition, the breakpoint is going to PERFORM, but it will exit from there.

Read only

0 Likes
4,134

Can you share that subroutine code

regards

laxman

Read only

0 Likes
4,134

FORM get_sub_status  USING    p_gt_alv_recno
CHANGING p_gt_alv_fsub_status
p_gt_alv_fsub_stat_date
p_gt_alv_lsub_status
p_gt_alv_lsub_stat_date
p_gt_alv_fsub_descrip
p_gt_alv_lsub_descrip
p_delete.

DATA: BEGIN OF lt_t02 OCCURS 0,                           "#EC
recno        
LIKE      t02-recno,
substats     
LIKE      t03s-substats,
stdes        
LIKE      t03-stdes,
trtim        
LIKE      t02-trtim,
trdat        
LIKE      t02-trdat.
DATA:
END OF lt_t02.

  DATA : i_t02_finst LIKE lt_t02 OCCURS 0 WITH HEADER LINE.
DATA : i_t02_linst LIKE lt_t02 OCCURS 0 WITH HEADER LINE.

DATA: tab_lines    TYPE i.

  LOOP AT gt_t02_his.
READ TABLE i_t03s WITH KEY substats = gt_t02_his-stats.

    IF sy-subrc = 0 AND i_t03s-stats <> 0.

      MOVE-CORRESPONDING gt_t02_his TO lt_t02.              "#EC ENHOK
lt_t02-stdes = i_t03s-stdes.
lt_t02-substats = i_t03s-substats.
APPEND lt_t02.
ENDIF.
ENDLOOP.

IF NOT lt_t02[] IS INITIAL.
IF NOT p_fcheck IS INITIAL.
REFRESH i_t02_finst.
LOOP AT lt_t02 WHERE substats IN sstatf.
MOVE-CORRESPONDING lt_t02 TO i_t02_finst.
APPEND i_t02_finst.
ENDLOOP.
ENDIF.
IF NOT p_lcheck IS INITIAL.
REFRESH i_t02_linst.
LOOP AT lt_t02 WHERE substats IN sstatl.
MOVE-CORRESPONDING lt_t02 TO i_t02_linst.
APPEND i_t02_linst.
ENDLOOP.
ENDIF.
ENDIF.

DESCRIBE TABLE lt_t02 LINES tab_lines.
READ TABLE lt_t02 INDEX tab_lines.
p_gt_alv_lsub_status = lt_t02-substats.
p_gt_alv_lsub_stat_date = lt_t02-trdat.
/dol/ap_t02-trtim = lt_t02-trtim.
p_gt_alv_lsub_descrip = lt_t02-stdes.

    ELSE.
SORT i_t02_linst DESCENDING BY trdat trtim.
READ TABLE i_t02_linst INDEX 1.
p_gt_alv_lsub_status = i_t02_linst-substats.
p_gt_alv_lsub_stat_date = i_t02_linst-trdat.
/dol/ap_t02-trtim = i_t02_linst-trtim.
p_gt_alv_lsub_descrip = i_t02_linst-stdes.
ENDIF.

ENDIF.

  1. ENDFORM.
Read only

0 Likes
4,134

hi

i think Zethan_test should be SUBROUTINE POOL, not include.

check with this.

regards.

laxman

Read only

0 Likes
4,134

Nope.. Its an Include only..

Read only

0 Likes
4,134

yeah...change once and check..

i done like that its working..

Read only

0 Likes
4,134

It is working find with other programs and the infocenter.

Its ok . Thanks for your reply.

Read only

Former Member
0 Likes
4,134

Keep break-point at perform statement and also check whether the funcion moudle & include program are in active status before executing.

Read only

0 Likes
4,134

Yes, they are activated .. I cant put breakpoint before the activation itself.. isn`t it

Read only

Former Member
0 Likes
4,134

hi ,

read description well that subroutine is suitable or not , if suitable put break point and go to corresponding tcode in change mode , delete any word and give the  same then clik on save...if subroutine is correct what u choosed that will triggered othewise not suitable subroutine.

Read only

0 Likes
4,134

Ok.

that subroutine is used for different purpose,

I want just the Last substatus of a particular record number when the user gives as input.

I have shared the code of substatus . In that I need last substatus(lsub_stats)

Read only

rosenberg_eitan
Active Contributor
0 Likes
4,134

Hi,

Try "IN PROGRAM"

ABAP Keyword Documentation

Regards.

Read only

0 Likes
4,134

Hi,

In Program is for main program if i want to call in subr..

But I am calling subr which is in Include. So it will be an error if I use the IN PROGRAM for include.

Regards,

EH

Read only

0 Likes
4,134

Hi Ethan,

There are parameters with your form..

FORM get_sub_status  USING    p_gt_alv_recno
CHANGING p_gt_alv_fsub_status
p_gt_alv_fsub_stat_date
p_gt_alv_lsub_status
p_gt_alv_lsub_stat_date
p_gt_alv_fsub_descrip
p_gt_alv_lsub_descrip
p_delete.


Try by adding them with.. perform get_substatus(Zethan_test) if found.




Read only

0 Likes
4,134

Hi Sree,

I am new to this subroutine call in FM.

Can you explain me with brief?

Do i need to declare those parameters in FM?

Read only

0 Likes
4,134

Hi Ethan,

I think your form should be a part of a program(not just a include).

eg: Report ZTEST(Main program name not any include) has form test using a.

You can call this using perform test(ztest) using 1. " 1 value for parameter a.

if you don't mention parameters it leads to dump.

Read only

0 Likes
4,134

Hi,

I did a test and you are right .

Usually we use functions/Class to do something like this we do not like using

external perform .

Maybe you need to include the include in your program .

Regards

Read only

rosenberg_eitan
Active Contributor
0 Likes
4,134

Is the include part of a FUNCTION module ?

Regards.

Read only

0 Likes
4,134

No.. that Include is used for Infocenter.

My requirement is like, I need to display the last substatus value.

my Codes are

If not approvers[] is initial.

     CLEAR msg_ret.

SELECT * FROM t02

    INTO l_t02

     WHERE recno = header-recno order by stats descending.

       EXIT.

     ENDSELECT.

     CONCATENATE 'Y4AP_RTN_ACTION_CONFIRM_' l_t02-stats

      INTO l_var.

Its working fine, but either i want to add the precise select statement or i can use the Include program of infocenter`s subroutine by calling it in Function Module.

Read only

0 Likes
4,134

Hi,

Try to add the include in your function .

Regards.

Read only

0 Likes
4,134

Thanks.. lets see if this works,,

Read only

rosenberg_eitan
Active Contributor
0 Likes
4,134

Hi,

Use the where use for the include to see how it was used by others .

Regards.

Read only

0 Likes
4,134

My bad..

I am the only one who is using this in another.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,134

perform get_substatus(Zethan_test) if found.

The program name "Zethan_test" MUST be an actual program name not an include name (not executable), so either include the include in a pool of module or function group (can be the function group in which you develop the FM)

Regards,

Raymond

Read only

0 Likes
4,134

Hi RG,

The Attributes type is Include Program, (it is an executable program. It will ask a popup to choose for main program)

In that we have a subroutine.

So will that works?

Read only

Former Member
0 Likes
4,134

Hi, Ethan

Did you mention Function-pool in the include file?

I think you are missing something here.

please refer this documentation

ABAP Keyword Documentation