Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Tuesday, December 21, 2010

ABAP Patterns

Pattern is a feature provided by SAP to enable developers to insert Standard or Customized code templates.  SE38 and SE80 can be used to insert and create new templates.

Usage
Program history can be designed and created as pattern; this pattern can be used during the new report generation or in change document history. Pattern can be called ‘n’ number of times in different reports.
SAP provided an option to create Pattern as both, constant and dynamic.
Advantages
 Program history format can be designed as project based, country based or language based and developer can use this pattern accordingly.
 It will reduce the typing effort.

Procedure
Constant Pattern
Step 1 : Open any report in SE38 and click 'Create Pattern' , follow the menu path as shown in below screen shot

Step 2 : Give the Pattern name in appeared pop-up screen



Step 3 : Enter the text which you want to appear when you select the pattern once it is created, then press save button. Once the text is saved exit this screen.



Step 4: Pattern is created and it is ready to use. In SE38, this can be called by selecting the Button 'Pattern'. (As below)


Step 5 : Select the option 'Other Pattern' and enter pattern name ( here its ‘YG_CONST_PAT’)



Now the pattern text is available in our program.


Dynamic Pattern
When login language is considered for calling the pattern text, dynamic pattern will be used. Also this can be used depends on project scenarios.

Step 1: The creation of the pattern remains same for dynamic

Give the pattern name for creation

Step 2: Here create a pattern with only one line that contains with text ‘ *$&$EXIT ’ (without quotes).


Step 3: Now go to Tcode ‘CMOD’ . create a project and include enhancement SEUED001 in it.

 
Step 4: Use the button ‘Components’ to get the exit name. And select the exit
EXIT_SAPLLOCAL_EDT1_001’ and click the button in the application toolbar.


 Go to exit.


Double click the include ‘zxseuu26’ to introduce our customized code along with the pattern text format (check the below screen shots)




Activate include and project without failure.
Step 5: Go to program editor and select the button ‘pattern’ to introduce the
pattern text in the report .


Give the pattern name in selection
Here we can see our pattern format in the report as below
Here we can see our pattern format in the report as below

 NOTE: Pattern should not exceed more than 100 lines.

Inserting Statement Patterns
The pattern function allows you to insert various source code templates in your program. This feature is particularly useful for complex ABAP statements because it reduces the typing effort and ensures that the syntax of the statement is always correct.

Example
Pattern is created with the complex DATA statement. And this pattern can be called in any of our report, when the above DATA statement is needed.





No comments: