Monday, May 18, 2009

Create Dynamic Patterns

By Joyjit Ghosh

Step1
. Create a pattern with only one line that contains *$&$EXIT.

Put this above expression and press save button.

Step2. Now from CMOD create a project and include enhancement SEUED001 in it.

Now select the user exit EXIT_SAPLLOCAL_EDT1_001 and create the include program in it.

Now insert the following code block in the include program and activate it.

*&---------------------------------------------------------------------*
*& Include ZXSEUU26 *
*&---------------------------------------------------------------------*
DATA: w_buffer TYPE string.
CASE keyword.
  WHEN 'DYNAMIC_PATTERN'.
    w_buffer =
'*********************************************************************'.
APPEND w_buffer TO buffer.
w_buffer = '*& Program :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Module :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Sub-Module :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Functional Contact:'.
APPEND w_buffer TO buffer.
w_buffer = '*& Funct. Spec. Ref. :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Developer(Company):'.
APPEND w_buffer TO buffer.
w_buffer = '*& Create Date :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Program Type :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Project Phase :'.
APPEND w_buffer TO buffer.
w_buffer = '*& Description :'.
APPEND w_buffer TO buffer.
w_buffer =
'*********************************************************************'.
APPEND w_buffer TO buffer.
  WHEN OTHERS.
* Do nothing
ENDCASE.

Lastly activate the project



Step3. Insert this newly created pattern in a program and test whether it is displaying the dynamic pattern or not.

SAP code to call the user-exit.

User-exit call

Dynamic pattern



No comments: