05-06-2009 11:46 AM
Hello everybody,
is is possible to change permanent the default setting of report layout when you create a new one?
When I create a new report I get the following layout:
&----
*& Report XYZ
*&
&----
*&
*&
&----
But I would like to change this default setting for every new report from every user/programmer like this:
&----
*& Report: Name
*& Company:
*& Date:
&----
*& Description:
*&
&----
and so on.
Can anybody tell me how to realize?
Thanks in advance.
05-06-2009 11:58 AM
Yes , you can do it.
create a project for this user exit SEUED001 - EXIT_SAPLS38E_001 and add this code in CMOD.
*&---------------------------------------------------------------------*
*& Include ZXSEUU08 *
*&---------------------------------------------------------------------*
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'. " only if the user edits / creates the program
READ REPORT program INTO it_code.
DESCRIBE TABLE it_code LINES lv_linecount.
IF lv_linecount LE 10. " ensures that this happens only for new programs
READ TABLE it_code INTO wa_code INDEX 5.
IF wa_code(9) <> '*& Author'. " ensures that it doesnt happen again once already done
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.
* you can put your customizing here
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 = '*& 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 = '*& Modification History '.
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.
* till here
DATA: lv_firstline TYPE i.
* find out from where to continue adding the rest of the program
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.
*After this, activate the include program.
*then go back to CMOD transaction and activate the PROJECT that you've just created.
05-06-2009 11:50 AM
This is based on the client requirement and standards in coding.
if u hve some coding standards please follow that. u can change it wrt the coding standards that u r told.
05-06-2009 11:50 AM
05-06-2009 11:51 AM
Hi,
Although you cannot make it as default.
But one option is to use the patterns.
In SE38 Go to Utilities>More Utitlies>Edit Pattern-->Create new pattern.
Create a new pattern in which you can put your requirement.
Next time when you create a new program always call this pattern.
This is the better method to achieve your requirment.
Regards,
Ankur Parab
05-06-2009 11:53 AM
There is a suer exit SEU00001 for SE38.
See if there is a way to enhance the se38 editor.
Regards,
Ravi
05-06-2009 11:57 AM
05-06-2009 11:58 AM
Yes , you can do it.
create a project for this user exit SEUED001 - EXIT_SAPLS38E_001 and add this code in CMOD.
*&---------------------------------------------------------------------*
*& Include ZXSEUU08 *
*&---------------------------------------------------------------------*
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'. " only if the user edits / creates the program
READ REPORT program INTO it_code.
DESCRIBE TABLE it_code LINES lv_linecount.
IF lv_linecount LE 10. " ensures that this happens only for new programs
READ TABLE it_code INTO wa_code INDEX 5.
IF wa_code(9) <> '*& Author'. " ensures that it doesnt happen again once already done
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.
* you can put your customizing here
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 = '*& 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 = '*& Modification History '.
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.
* till here
DATA: lv_firstline TYPE i.
* find out from where to continue adding the rest of the program
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.
*After this, activate the include program.
*then go back to CMOD transaction and activate the PROJECT that you've just created.