Skip to Content

We’ll create a header program pattern like this:

/wp-content/uploads/2012/05/10_98199.png

1) To create a header program pattern, enter the menu as indicated:

/wp-content/uploads/2012/05/02_98200.png

2) Put the pattern name:

/wp-content/uploads/2012/05/03_98204.png

3)  Put code *$&$EXIT, Click in save and return(F3).

4) Go to CMOD transaction, and create a new project:

/wp-content/uploads/2012/05/05_98205.png

5) After you put the required field, you click in:

/wp-content/uploads/2012/05/06_98206.png

6) Put SEUED001 for enhancement field.

/wp-content/uploads/2012/05/07_98210.png

7) Click in components.

8) Now select the user exit EXIT_SAPLLOCAL_EDT1_001.

/wp-content/uploads/2012/05/08_98211.png

9) Create a EXIT and create a include:

/wp-content/uploads/2012/05/09_98212.png

10) Put this code:

*&———————————————————————*

*&  Include           ZXSEUU26

*&———————————————————————*

DATA: w_buffer TYPE string.

DATA l_cprog TYPE string.

DATA l_title TYPE string.

DATA l_value TYPE c LENGTH 10.

CASE keyword.

   WHEN ‘Z001’.

     PERFORM f_get_cprog

       USING sytitle

    CHANGING l_cprog.

     PERFORM f_get_prog_title

       USING l_cprog

    CHANGING l_title.

     PERFORM f_concatenate

       USING ‘* ==================================’

             ‘================================== *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

       USING ‘* Program…..: #SY_CPROG#          ‘

             ‘                                   *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

       USING ‘* Title…….: #PG_TITLE#          ‘

             ‘                                   *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* Author……: #PG_AUTHO#          ‘

               ‘                                   *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* Date……..: #PG_DATE# – #PG_TIME#’

               ‘                                  *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* ———————————-‘

               ‘———————————- *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* Description.: #PG_TITLE#          ‘

               ‘                                   *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* ———————————-‘

               ‘———————————- *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* Modification list.:               ‘

               ‘                                   *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* Date      Author        Descriptio’

               ‘n                                  *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

         USING ‘* –/–/–  ——-       ———-‘

               ‘–                                 *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     CLEAR w_buffer.

     PERFORM f_concatenate

       USING ‘* ==================================’

             ‘================================== *’ CHANGING w_buffer.

     APPEND w_buffer TO buffer.

     PERFORM f_replace

       TABLES buffer

        USING ‘#SY_CPROG#’

              l_cprog.

     PERFORM f_replace

       TABLES buffer

          USING ‘#PG_TITLE#’

                  l_title.

     PERFORM f_replace

       TABLES buffer

         USING ‘#PG_AUTHO#’

           syuname.

     WRITE sydatum TO l_value.

     PERFORM f_replace

      TABLES buffer

       USING ‘#PG_DATE#’

             l_value.

     WRITE syuzeit TO l_value.

     PERFORM f_replace

       TABLES buffer

       USING ‘#PG_TIME#’

             l_value.

   WHEN OTHERS.

* Do nothing

ENDCASE.

11) Codes from Forms:

*———————————————————————-*

***INCLUDE ZXSEUF01 .

*———————————————————————-*

*&———————————————————————*

*&      Form  f_concatenate

*&———————————————————————*

FORM f_concatenate USING p_string1

       p_string2

CHANGING c_string TYPE string.

   CONCATENATE p_string1 p_string2

   INTO c_string.

ENDFORM.                    “f_concatenate

*&———————————————————————*

*&      Form  f_replace

*&———————————————————————*

FORM f_replace

   TABLES buffer TYPE table

USING p_replace TYPE c

       p_value TYPE any.

   FIELD-SYMBOLS <fs_buffer> TYPE string.

   LOOP AT buffer ASSIGNING <fs_buffer>.

     IF <fs_buffer> CS p_replace.

       REPLACE p_replace IN <fs_buffer> WITH p_value.

     ENDIF.

   ENDLOOP.

ENDFORM.                    “f_replace

*&———————————————————————*

*&      Form  F_GET_CPROG

*&———————————————————————*

FORM f_get_cprog  USING    p_title TYPE any

CHANGING p_string TYPE string.

   DATA l_prog_name TYPE string.

   DATA l_value TYPE TABLE OF i WITH HEADER LINE.

   DATA l_count TYPE i VALUE 0.

   DATA l_str_len TYPE i.

   DATA l_char TYPE c.

   p_string = p_title.

   l_str_len = STRLEN( p_string ).

   DO l_str_len TIMES.

     IF p_string+l_count(1) EQ ‘:’.

       EXIT.

     ENDIF.

     ADD 1 TO l_count.

   ENDDO.

   ADD 2 TO l_count.

   p_string = p_string+l_count.

   l_count = 0.

   l_str_len = STRLEN( p_string ).

   DO l_str_len TIMES.

     l_char = p_string+l_count(1).

     IF l_char IS INITIAL.

       EXIT.

     ENDIF.

     ADD 1 TO l_count.

   ENDDO.

   ADD 1 TO l_count.

   p_string = p_string+l_count.

   l_count = 0.

   l_str_len = STRLEN( p_string ).

   DO l_str_len TIMES.

     l_char = p_string+l_count(1).

     IF l_char IS INITIAL .

       EXIT.

     ENDIF.

     ADD 1 TO l_count.

   ENDDO.

   p_string = p_string(l_count).

ENDFORM.                    ” F_GET_CPROG

*&———————————————————————*

*&      Form  F_GET_PROG_TITLE

*&———————————————————————*

FORM f_get_prog_title  USING   p_prog

CHANGING p_title.

   SELECT SINGLE text FROM trdirt

   INTO p_title

   WHERE name = p_prog.

ENDFORM.                    ” F_GET_PROG_TITLE

12) Active all, and active project.

13) Go to se38 transaction and click in Pattern -> Select Other pattern, and digit zrmn01.

Thank you for reading this post. =)

Reference: here

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply