‎2014 Oct 28 5:25 AM
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
‎2014 Oct 28 5:30 AM
hi
put break point in FM at perform statement and check whether it is goin in that perform or not.
regards.
laxman
‎2014 Oct 28 5:38 AM
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.
‎2014 Oct 28 5:39 AM
‎2014 Oct 28 5:48 AM
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.
‎2014 Oct 28 5:51 AM
hi
i think Zethan_test should be SUBROUTINE POOL, not include.
check with this.
regards.
laxman
‎2014 Oct 28 5:56 AM
‎2014 Oct 28 5:57 AM
yeah...change once and check..
i done like that its working..
‎2014 Oct 28 6:01 AM
It is working find with other programs and the infocenter.
Its ok . Thanks for your reply.
‎2014 Oct 28 5:34 AM
Keep break-point at perform statement and also check whether the funcion moudle & include program are in active status before executing.
‎2014 Oct 28 5:39 AM
Yes, they are activated .. I cant put breakpoint before the activation itself.. isn`t it
‎2014 Oct 28 5:38 AM
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.
‎2014 Oct 28 5:55 AM
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)
‎2014 Oct 28 6:02 AM
‎2014 Oct 28 6:14 AM
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
‎2014 Oct 28 6:28 AM
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.
‎2014 Oct 28 6:39 AM
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?
‎2014 Oct 28 6:47 AM
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.
‎2014 Oct 28 6:48 AM
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
‎2014 Oct 28 6:52 AM
‎2014 Oct 28 7:01 AM
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.
‎2014 Oct 28 7:06 AM
‎2014 Oct 28 7:09 AM
‎2014 Oct 28 7:12 AM
Hi,
Use the where use for the include to see how it was used by others .
Regards.
‎2014 Oct 28 7:19 AM
‎2014 Oct 28 7:32 AM
‎2014 Oct 28 7:38 AM
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?
‎2014 Oct 28 7:46 AM
Hi, Ethan
Did you mention Function-pool in the include file?
I think you are missing something here.
please refer this documentation