‎2009 Jan 31 6:35 AM
Hi,
I want to fetch the function groups and function modules from enlfdir table, then i have to count the number of function modules for each function group and should display the number in output in alv.
by using the describe statement i can able to get the number for one function group, if i use multiple selection of function groups in selection screen it is not giving the correct values(it is giving same values for all the function groups) can any one help me how to write code for this.
Thanks
Alka
‎2009 Jan 31 7:12 AM
Hi ,
Here is the code to fetch the details.
hope this helps !
TABLES : ENLFDIR.
*---- SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS: s_area FOR ENLFDIR-area.
SELECTION-SCREEN END OF BLOCK b1.
types : begin of tp_data,
AREA TYPE RS38L_AREA,
FUNCNAME TYPE RS38L_FNAM,
end of tp_data.
types : begin of tp_final,
AREA TYPE RS38L_AREA,
count type i,
end of tp_final.
data : t_data type standard table of tp_data with header line,
t_final type standard table of tp_final with header line.
data : l_cnt type i,
l_area type rs38l_area.
select funcname
area
from ENLFDIR
into corresponding fields of table t_data
where area in s_area.
if sy-subrc eq 0.
sort t_data by area funcname .
endif .
Loop at t_data.
l_cnt = l_cnt + 1 .
l_area = t_data-area.
at end of area.
t_final-area = l_area.
t_final-count = l_cnt.
append t_final.
clear t_final.
clear : l_cnt,
l_area.
endat.
endloop.
sort t_final by area.
‎2009 Jan 31 7:12 AM
Hi ,
Here is the code to fetch the details.
hope this helps !
TABLES : ENLFDIR.
*---- SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS: s_area FOR ENLFDIR-area.
SELECTION-SCREEN END OF BLOCK b1.
types : begin of tp_data,
AREA TYPE RS38L_AREA,
FUNCNAME TYPE RS38L_FNAM,
end of tp_data.
types : begin of tp_final,
AREA TYPE RS38L_AREA,
count type i,
end of tp_final.
data : t_data type standard table of tp_data with header line,
t_final type standard table of tp_final with header line.
data : l_cnt type i,
l_area type rs38l_area.
select funcname
area
from ENLFDIR
into corresponding fields of table t_data
where area in s_area.
if sy-subrc eq 0.
sort t_data by area funcname .
endif .
Loop at t_data.
l_cnt = l_cnt + 1 .
l_area = t_data-area.
at end of area.
t_final-area = l_area.
t_final-count = l_cnt.
append t_final.
clear t_final.
clear : l_cnt,
l_area.
endat.
endloop.
sort t_final by area.
‎2009 Jan 31 8:21 AM
‎2009 Feb 03 1:20 PM
Hi ,
I got the output. Thanks a lot for your help. i am giving you full points
Thanks
Alka