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

INCLUDE name for function module

Clemenss
Active Contributor
0 Likes
2,834

Hi,

How to determine the INCLUDE name for the function module name?

Program input: function module name

Program output: INCLUDE name (like SAPLZ....U01)

TIA

regards,

Clemens

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,432

Hi Clemens,

Try this function module FUNCTION_INCLUDE_INFO

Cheers

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,432

Hi, the assumption is that all function groups main programs start with SAPL and then the function group name.

So this would be just a concatenation of the two, to derive the main program for the function group.

To get the include names for a function module, use the following function module to get all functions in a group, and this will also give the include name for each function module.

RS_FUNCTION_POOL_CONTENTS

Regards,

Rich Heilman

Read only

0 Likes
1,432

Here is a sample program.



report zrich_0001.

data: ifunct type table of  rs38l_incl.
data: xfunct type  rs38l_incl.

data: xmain_program type sy-repid.

parameters: p_area type tlibt-area.

call function 'RS_FUNCTION_POOL_CONTENTS'
     exporting
          function_pool           = p_area
     tables
          functab                 = ifunct
     exceptions
          function_pool_not_found = 1
          others                  = 2.


xmain_program = 'SAPL'.
xmain_program+4 = p_area.



write:/ xmain_program.
loop at ifunct into xfunct.
  write:/ xfunct-FUNCNAME, xfunct-include.
endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,433

Hi Clemens,

Try this function module FUNCTION_INCLUDE_INFO

Cheers

Read only

Former Member
0 Likes
1,432

Hi,

Try this.

TABLES: TFDIR.

DATA: V_INCLUDENAME TYPE CHAR50.

PARAMETERS: P_FM LIKE TFDIR-FUNCNAME.

START-OF-SELECTION.

SELECT SINGLE * FROM TFDIR

WHERE FUNCNAME = P_FM.

CONCATENATE TFDIR-PNAME 'U' TFDIR-INCLUDE INTO V_INCLUDENAME.

WRITE: / V_INCLUDENAME..

Thanks,

Naren