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

implemented user-exits

MariaJooRocha
Contributor
0 Likes
1,512

Hi SCN,

Which is the best way to find user-exits implemented/active with smod without a project - cmod?

Thanks.

Regards,

Maria João Rocha
1 ACCEPTED SOLUTION
Read only

bertrand_delvallee
Active Participant
1,246

Hello,

I don't know how pertinent is my code below but it could give you some ideas. You just copy/paste it in a new local test program :

REPORT  ztest_find_exit LINE-SIZE 1023.

DATA r_name TYPE RANGE OF trdir-name WITH HEADER LINE.
DATA t_name TYPE TABLE OF trdir-name.
FIELD-SYMBOLS <name> TYPE trdir-name.
DATA it_answer TYPE TABLE OF rsfindlst.
DATA it_scope_objects TYPE TABLE OF rsfind .
FIELD-SYMBOLS <answer> LIKE LINE OF it_answer.
DATA w_funcname TYPE tfdir-funcname.
DATA w_name TYPE modsap-name.
DATA w_name2 TYPE modactt-name.
DATA r_pname TYPE RANGE OF tfdir-pname WITH HEADER LINE.
DATA t_mainprograms TYPE TABLE OF char40 WITH HEADER LINE.
DATA w_status TYPE modattr-status.
DATA spacer(40).	
TABLES progdir.


r_name-sign = 'I'.
r_name-option = 'CP'.
r_name-low = 'ZX*'.
APPEND r_name.


SELECT DISTINCT name FROM trdir INTO TABLE t_name WHERE name IN r_name.
CALL FUNCTION 'RS_EU_CROSSREF'
  EXPORTING
    i_find_obj_cls  = 'INCL'
    i_scope_obj_cls = 'P'
  TABLES
    i_findstrings   = t_name
    o_founds        = it_answer
    i_scope_objects = it_scope_objects
  EXCEPTIONS
    OTHERS          = 9.


LOOP AT it_answer ASSIGNING <answer>.
  <answer>-used_obj = <answer>-used_obj+4.
  CLEAR :  r_pname, r_pname[].
  r_pname-sign = 'I'.
  r_pname-option = 'EQ'.
  r_pname-low = <answer>-object. APPEND r_pname.
  CALL FUNCTION 'RS_GET_MAINPROGRAMS'
    EXPORTING
      name         = <answer>-used_obj
    TABLES
      mainprograms = t_mainprograms.


  LOOP AT t_mainprograms.
    r_pname-low = t_mainprograms.
    APPEND r_pname.
  ENDLOOP.


  WRITE : / <answer>-used_obj(20), <answer>-object(20).
  SELECT DISTINCT funcname FROM tfdir INTO w_funcname
                                     WHERE pname IN r_pname.
    CLEAR w_name.
    SELECT SINGLE name FROM modsap INTO w_name
       WHERE  member = w_funcname.
    CLEAR w_name2.
    SELECT SINGLE name FROM modactt INTO w_name2
      WHERE member = w_name.
    CLEAR w_status.
    SELECT SINGLE status INTO w_status FROM modattr WHERE name = w_name2.
    WRITE : / spacer,'|', w_funcname, w_name, w_name2, w_status.


  ENDSELECT.
ENDLOOP.
<br>

Please, don't mind the raw aspect it's just a proof of concept 🙂

Best regards,

Bertrand

4 REPLIES 4
Read only

raghug
Active Contributor
1,246

The prime tables behind it are MODSAPA for SMOD and MODATTR for CMOD - unfortunately I don't know where the activation status is stored. Maybe you can use set a trace and see what tables are hit by activating and deactivating.

Read only

0 Likes
1,246

Hi Raghu Govindarajan,

Thanks for your reply. Already seen that tables. MODSAPA that have the SMOD information but does not provide the ones implemented.

I've tried do look at the transports ... Is there a better way?

Regards,

Maria João Rocha

Read only

bertrand_delvallee
Active Participant
1,247

Hello,

I don't know how pertinent is my code below but it could give you some ideas. You just copy/paste it in a new local test program :

REPORT  ztest_find_exit LINE-SIZE 1023.

DATA r_name TYPE RANGE OF trdir-name WITH HEADER LINE.
DATA t_name TYPE TABLE OF trdir-name.
FIELD-SYMBOLS <name> TYPE trdir-name.
DATA it_answer TYPE TABLE OF rsfindlst.
DATA it_scope_objects TYPE TABLE OF rsfind .
FIELD-SYMBOLS <answer> LIKE LINE OF it_answer.
DATA w_funcname TYPE tfdir-funcname.
DATA w_name TYPE modsap-name.
DATA w_name2 TYPE modactt-name.
DATA r_pname TYPE RANGE OF tfdir-pname WITH HEADER LINE.
DATA t_mainprograms TYPE TABLE OF char40 WITH HEADER LINE.
DATA w_status TYPE modattr-status.
DATA spacer(40).	
TABLES progdir.


r_name-sign = 'I'.
r_name-option = 'CP'.
r_name-low = 'ZX*'.
APPEND r_name.


SELECT DISTINCT name FROM trdir INTO TABLE t_name WHERE name IN r_name.
CALL FUNCTION 'RS_EU_CROSSREF'
  EXPORTING
    i_find_obj_cls  = 'INCL'
    i_scope_obj_cls = 'P'
  TABLES
    i_findstrings   = t_name
    o_founds        = it_answer
    i_scope_objects = it_scope_objects
  EXCEPTIONS
    OTHERS          = 9.


LOOP AT it_answer ASSIGNING <answer>.
  <answer>-used_obj = <answer>-used_obj+4.
  CLEAR :  r_pname, r_pname[].
  r_pname-sign = 'I'.
  r_pname-option = 'EQ'.
  r_pname-low = <answer>-object. APPEND r_pname.
  CALL FUNCTION 'RS_GET_MAINPROGRAMS'
    EXPORTING
      name         = <answer>-used_obj
    TABLES
      mainprograms = t_mainprograms.


  LOOP AT t_mainprograms.
    r_pname-low = t_mainprograms.
    APPEND r_pname.
  ENDLOOP.


  WRITE : / <answer>-used_obj(20), <answer>-object(20).
  SELECT DISTINCT funcname FROM tfdir INTO w_funcname
                                     WHERE pname IN r_pname.
    CLEAR w_name.
    SELECT SINGLE name FROM modsap INTO w_name
       WHERE  member = w_funcname.
    CLEAR w_name2.
    SELECT SINGLE name FROM modactt INTO w_name2
      WHERE member = w_name.
    CLEAR w_status.
    SELECT SINGLE status INTO w_status FROM modattr WHERE name = w_name2.
    WRITE : / spacer,'|', w_funcname, w_name, w_name2, w_status.


  ENDSELECT.
ENDLOOP.
<br>

Please, don't mind the raw aspect it's just a proof of concept 🙂

Best regards,

Bertrand

Read only

1,246

Hi Bertrand DELVALLEE,

Thanks for your answer.

Inspired by your code I followed this steps to achieve my goal: (so far for function modules)

1 - D010INC - ZX*

2 - TADIR to check if the include exists

3 - WBCROSSI with D010INC-include to get WBCROSSI-include

4 - FM FUNCTION_INCLUDE_INFO with the WBCROSSI-include to get funcname

5 - MODSAP with funcname to get MODSAP-name

6 - MODACT to chek if exists MODSAP-name. If exists there is CMOD if not it's SMOD.

Thanks.

Maria João Rocha

Draft version of the program:

report zbcrsmod.
tables: d010inc,
trdir,
modact,
modsapa,
modsap,
wbcrossi.

data: wa_name type rs38l-name,
wa_include type rs38l-include.

start-of-selection.
select * into d010inc
from d010inc
where include like 'ZX%'.
select count(*)
from trdir
where name = d010inc-include.
check sy-dbcnt > 0.
clear wbcrossi.
select single * from wbcrossi
where name = d010inc-include.
check wbcrossi-include is not initial.
wa_include = wbcrossi-include.
clear wa_name.
call function 'FUNCTION_INCLUDE_INFO'
changing
funcname = wa_name
include = wa_include
exceptions
function_not_exists = 1
include_not_exists = 2
group_not_exists = 3
no_selections = 4
no_function_include = 5
others = 6.

check wa_name is not initial.
select single * from modsap
where member = wa_name.

select single * from modact
where member = modsap-name.
if sy-subrc is initial.
write:/ modact-name, ' ', modsap-member, ' ', modsap-name.
else.
clear modact-name.
write:/ 'No CMODE', ' ', modsap-member, ' ', modsap-name.
endif.
endselect.