‎2008 Jun 03 7:27 AM
Hi all.
I've implemnted the following soultion for our SAP system.
Go to TCODE CMOD,
Create a new Project like ZSE38 as follows.
Check the 'Enhancements Assignments' Radio button, click create and add SEUED001 ( for Editor )
now SAVE, click on Components and select the User Exit that you want to use.
EXIT_SAPLS38E_001 <-- this is a function module.
inside this FM there is an INCLUDE program ZXSEUU08.
double click on it, when a warning message appears in the status bar below press ENTER
to create the program.
write the code you want inside this program. or add the following code.
code
DATA: it_code(256) TYPE c OCCURS 0.
DATA: wa_code like line of it_code.
DATA: it_new_code(256) TYPE c OCCURS 0.
DATA: lv_linecount TYPE i.
IF OPERATION = 'EDIT'.
read report program into it_code.
DESCRIBE TABLE it_code LINES lv_linecount.
IF lv_linecount LE 10.
read table it_code into wa_code index 5.
if wa_code(9) '*& Author'.
read table it_code into wa_code index 1.
append wa_code to it_new_code.
read table it_code into wa_code index 2.
append wa_code to it_new_code.
read table it_code into wa_code index 3.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&---------------------------------------------------------------------*'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*& Author :'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*& Date :' .
append wa_code to it_new_code.
clear wa_code.
wa_code = '*& Purpose :'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&---------------------------------------------------------------------*'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*& Date Changed by Tag Description'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&---------------------------------------------------------------------*'.
append wa_code to it_new_code.
data: lv_firstline type i.
loop at it_code into wa_code from 4 to 8.
if wa_code = ''.
lv_firstline = sy-tabix.
endif.
endloop.
loop at it_code into wa_code from lv_firstline.
append wa_code to it_new_code.
endloop.
insert report program from it_new_code.
ENDIF.
ENDIF.
ENDIF.
[/code]
After this, activate the include program.
then go back to CMOD transaction and activate the PROJECT that you've just created.
and you're ready to go........Everything is working fine except that i do not want this template to be implemented when I do an include.
What changes do i need to do?
BR
Andreas
‎2008 Jun 03 7:43 AM
‎2008 Jun 03 8:07 PM
Are you saying that you do not want to execute the INCLUDE program ZXSEUU08? If so, why not comment out this line of code.
*---INCLUDE program ZXSEUU08
‎2008 Jun 03 8:34 PM
Hello Andreas
I the same include that you are creating your template(ZXSEUU08) check to see what type of program you are working with.
* Check to make sure program is type 1 before inserting template.
select single * from trdir where name = program.
check: sy-subrc = 0.
if trdir-subc = '1'
... some code here - only executed if program is type 1 (executeable)....
endif.
Of course you can excldue incldudes by checking for subc = 'I'.
Regards
Greg Kern
‎2008 Jun 04 8:24 AM
Thanks Greg.
That's realy helpfull. I solved it in an other way but I give you some points for this solution.
BR
Andreas