<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Template for ABAP programs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886371#M933658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've implemnted the following soultion for our SAP system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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 &amp;lt;-- 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) '*&amp;amp; 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 = '*&amp;amp;---------------------------------------------------------------------*'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Author :'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Date :' .
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Purpose :'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp;---------------------------------------------------------------------*'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Date Changed by Tag Description'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp;'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp;---------------------------------------------------------------------*'.
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........&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything is working fine except that i do not want this template to be implemented when I do an include.&lt;/P&gt;&lt;P&gt;What changes do i need to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2008 06:27:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-03T06:27:03Z</dc:date>
    <item>
      <title>Template for ABAP programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886371#M933658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've implemnted the following soultion for our SAP system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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 &amp;lt;-- 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) '*&amp;amp; 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 = '*&amp;amp;---------------------------------------------------------------------*'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Author :'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Date :' .
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Purpose :'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp;---------------------------------------------------------------------*'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp; Date Changed by Tag Description'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp;'.
append wa_code to it_new_code.
clear wa_code.
wa_code = '*&amp;amp;---------------------------------------------------------------------*'.
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........&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything is working fine except that i do not want this template to be implemented when I do an include.&lt;/P&gt;&lt;P&gt;What changes do i need to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 06:27:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886371#M933658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T06:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Template for ABAP programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886372#M933659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;  ur query is not so much clear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 06:43:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886372#M933659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T06:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Template for ABAP programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886373#M933660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that you do not want to execute the INCLUDE program ZXSEUU08?   If so, why not comment out this line of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*---INCLUDE program ZXSEUU08&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 19:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886373#M933660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T19:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Template for ABAP programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886374#M933661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andreas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I the same include that you are creating your template(ZXSEUU08) check to see what type of program you are working with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* 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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course you can excldue incldudes by checking for subc = 'I'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg Kern&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 19:34:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886374#M933661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T19:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Template for ABAP programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886375#M933662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Greg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's realy helpfull. I solved it in an other way but I give you some points for this solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 07:24:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/template-for-abap-programs/m-p/3886375#M933662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-04T07:24:52Z</dc:date>
    </item>
  </channel>
</rss>

