Application Development 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: 

checking whether function module is obsolete or not

Former Member
0 Kudos

hi

i am developing a program that will have a selection screen where we can input name of the report program.

in that report program the program that i am developing has to check if it has any obsolete function modules like upload,download are obsolete function modules.the table that gives this data is RODIR.

so my report program must tel the function modules that are obsolete.

how can i pick the name of the function module used in the program.i have taken the report program in to internal table..so here how can i get the name of the function module.

thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello

Try this code:


REPORT ZSEARCH.
PARAMETERS: P_NAME LIKE D010SINF-PROG.
DATA: PROGTXT(72) TYPE C OCCURS 0 WITH HEADER LINE.
DATA: FUNCT TYPE RS38L_FNAM OCCURS 0 WITH HEADER LINE.

READ REPORT P_NAME INTO PROGTXT.
LOOP AT PROGTXT.
  IF PROGTXT CS 'CALL FUNCTION'.
    SEARCH PROGTXT FOR ''''.
    IF SY-SUBRC = 0.
      DO.
        SHIFT PROGTXT LEFT BY 1 PLACES.
        IF PROGTXT(1) = ''''.
          SHIFT PROGTXT LEFT BY 1 PLACES.
          DO.
            SHIFT PROGTXT RIGHT BY 1 PLACES.
            IF PROGTXT+71(1) = ''''.
              SHIFT PROGTXT RIGHT BY 1 PLACES.
              CONDENSE PROGTXT.
              FUNCT = PROGTXT. COLLECT FUNCT. EXIT.
            ENDIF.
          ENDDO.
          EXIT.
        ENDIF.
      ENDDO.
    ENDIF.
  ENDIF.
ENDLOOP.
LOOP AT FUNCT.
  WRITE: FUNCT. NEW-LINE.
ENDLOOP.

3 REPLIES 3

Former Member
0 Kudos

Use FM 'REPOSITORY_ENVIRONMENT_ALL' to get FM for a program.

Pass Obj_type = PROG

check all the checkbox for ENVIRONMENT_TYPES

object_name = program name

Deep = 1.

You will get FM used inside the program, then goto RODIR table and get whether it is obsolete or not

GauthamV
Active Contributor
0 Kudos

This will help you.

[function module used in the program|https://forums.sdn.sap.com/click.jspa?searchID=24370095&messageID=5842747]

Former Member
0 Kudos

Hello

Try this code:


REPORT ZSEARCH.
PARAMETERS: P_NAME LIKE D010SINF-PROG.
DATA: PROGTXT(72) TYPE C OCCURS 0 WITH HEADER LINE.
DATA: FUNCT TYPE RS38L_FNAM OCCURS 0 WITH HEADER LINE.

READ REPORT P_NAME INTO PROGTXT.
LOOP AT PROGTXT.
  IF PROGTXT CS 'CALL FUNCTION'.
    SEARCH PROGTXT FOR ''''.
    IF SY-SUBRC = 0.
      DO.
        SHIFT PROGTXT LEFT BY 1 PLACES.
        IF PROGTXT(1) = ''''.
          SHIFT PROGTXT LEFT BY 1 PLACES.
          DO.
            SHIFT PROGTXT RIGHT BY 1 PLACES.
            IF PROGTXT+71(1) = ''''.
              SHIFT PROGTXT RIGHT BY 1 PLACES.
              CONDENSE PROGTXT.
              FUNCT = PROGTXT. COLLECT FUNCT. EXIT.
            ENDIF.
          ENDDO.
          EXIT.
        ENDIF.
      ENDDO.
    ENDIF.
  ENDIF.
ENDLOOP.
LOOP AT FUNCT.
  WRITE: FUNCT. NEW-LINE.
ENDLOOP.