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

regarding Function Modules

Former Member
0 Likes
401

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
373

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.

3 REPLIES 3
Read only

Former Member
0 Likes
374

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.

Read only

Former Member
0 Likes
373

Hope you ve resolved the problem . Please update .

Read only

0 Likes
373

Hi ,

I got the output. Thanks a lot for your help. i am giving you full points

Thanks

Alka