rs_dd_check is a great function to check ddic objects. But the function module does not fit me that i can call it directly because i need to use it on older systems which only have the dialog and you can not export the messages out of the fm.
so i extracted some code out of it (out of perform check_object subroutine) which should be sufficient, and it is, for tables and structures it works!!! But for every other element it's not working. :(
Basically im creating a log and then doing check and then importing from memory id 'CHE' for example CHETABLSFLIGHT into variable/table lt_log
Im sure that for other elements it is creating logs but im not sure if it fill them up...Because lt_log stays empty.
report report name.
data: objname type rsedd0-ddobjname value 'object_name', eg sflighs
eutype type rsdxx-eutype value 'object_type', eg T
enqtype type rsdeo-objtype,
protid type sy-tabix,
titletxt TYPE sprot_i-prot,
actmode TYPE ddrefstruc-mode VALUE 9,
act_res type STANDARD TABLE OF dctablres,
lt_log type STANDARD TABLE OF trlogm .
*TRANSLATE T INTO TABL ETC
call function 'INTERN_TRANSL_EUTYPE' "Sperrtyp
exporting
eutype = eutype
importing
enqueue_type = enqtype.
*CREATING LOG?
call function 'DD_OBJ_PROT_OPEN'
exporting
objectname = objname
objecttype = enqtype
level = 1
device = 'M' "Memory with report RSPUTPRT as frontend
ddfunc = 'CHE'
importing
prid = protid
exceptions
others = 01.
*CHECKING SYNTAX
case eutype .
when 'T'.
titletxt = 'CHECKING TABLES'.
call function 'DD_TABL_ACT'
exporting
device = 'M'
path = ' '
tabname = objname
timer_on = ' '
prid = protid
act_mode = actmode
protname = ''
tables
act_res_tab = act_res
exceptions
others = 03. "Abbruch -> Protokoll anzeigen
when 'V'. "View
titletxt = 'CHECKING VIEWS'.
call function 'DD_VIEW_ACT'
exporting
viewname = objname
get_state = 'M'
act_mode = actmode
prid = protid
protname = ''
exceptions
others = 03.
when others.
endcase.
TRANSLATE OBJNAME USING '/-\-'.
data lv_mem_id(200) type c.
CONCATENATE 'CHE' enqtype objname into lv_mem_id. "EX CHETABLTABLE_NAME
IMPORT lt_log FROM MEMORY ID lv_mem_id.