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

tracking objects and updating a table

Former Member
0 Likes
452

Hi,

I have 12 programs and whenever i run any of the programs a ztable shoud be updated (created by me) with program name , rundate and no of times it is executed.

This functionality should be written in a separate fumction module.

so could any pls send me some sample code for this

Thanks in advance

Hi,

I have 12 programs and whenever i run any of the programs a ztable shoud be updated (created by me) with program name , rundate and no of times it is executed.

This functionality should be written in a separate fumction module.

so could any pls send me some sample code for this

Thanks in advance

2 REPLIES 2
Read only

former_member435013
Active Participant
0 Likes
426

Hi,

for reports you may use a user-exit.

Transaction code SMOD:

-> enhancement S38MREP1 -> Function module EXIT_SAPLSABE_010.

regards

Walter Habich

Read only

Former Member
0 Likes
426

Hi,

CALL FUNCTION 'z_update_fm'.

EXPORTING

repid = v_repid

check for any entry in table ztab with repid.

IF sy-subrc NE 0. "entry does NOT exist in the table

wa_ztab-rundt = sy-datum.

wa_ztab-repid = v_repid. " prog name

wa_ztab-count = 1.

APPEND wa_ztab TO it_ztab.

CLEAR wa_ztab.

IF it_ztab[] IS NOT INITIAL.

INSERT ztab FROM TABLE it_ztab.

ENDIF.

ELSE.

UPDATE ztab SET rundt = sy-datum

AND count = wa_ztab-count + 1

WHERE repid = v_repid. " prog name

ENDIF.

regards,

teja.