Skip to Content
0
Former Member
Oct 22, 2013 at 09:35 AM

Retrieving variables of program

185 Views

Hi all,

I am making a program which checks whether a program uses data declarations and makes a list with the found data elements. For example program below will result in following list.

Name is the name of the variable, objectname is the name of the type and local can be set in case of a like (objname can be a Z without it being a custom data element).

Name
Type/like Objname Local UT_CODE TYPE RSFB_SOURCE
LW_CODE TYPE STRING
LS_RETURN TYPE BAPIRET2
ZV_C NONE

LV_CC LIKE ZV_C X

REPORT ztest2.

DATA: ut_code TYPE rsfb_source
.

data:lw_code TYPE string. data ls_return TYPE bapiret2. "CALL FUNCTION
* lw_objects TYPE gty_objects.

data: zv_c
.
DATA: lv_cc LikE zv_c.

Now I've found FM WB_TREE_GET_OBJECTS but this only results in a list of global data declaration elements. If there is a subroutine it should also be checked.

Is there anything I can use to retrieve a list of variables and its typing?

Kind regards,

Wim van Erp