Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Pattern In Abap Editor

Former Member
0 Kudos
1,973

I want to create a pattern in abap editor.

the pattern description is as follows:

when i enter the pattern name in other pattern . the system should ask the table name(ztable). and after entering the table name the system should print all the fields of that ztable.

like below -all the fields of ztable should get printed in abap editor.


fld1
fld2
fld3
fld4
......

can we create such a zpattern in abap editor.

if currently exists such pattern which only prints the list of all fields of ztable (or standard table),

moreover i'll create patthern for statements like


move i_tab1-fld1 to i_tab2-fld1.
move i_tab1-fld2 to i_tab2-fld2.
move i_tab1-fld3 to i_tab2-fld3.

where i_tab1 is like ztable1 and i_tab2 is like ztable2.

suggest some code to implement above.

4 REPLIES 4

Former Member
0 Kudos
415

Hello,

Yes you can. Open ABAP Editor in Change Mode. Go to Utilities->More Utilities->Edit Pattern->Create Pattern.

One point to consider is that you would not be able to dynamically change the Pattern.

Regards,

Debanjan

0 Kudos
415

Go to Utilities->More Utilities->Edit Pattern->Create Pattern.

> One point to consider is that you would not be able to dynamically change the Pattern.

1. i know that we can create a pattern from above menu path.

2. my requirement is to create a pattern which asks for ztable (or standard table name) and prints the list of all fields of DB table.

3. i need the code Or procedure to implement the above and where to put the code suggested.

4. i dont want a dynamic pattern but when i give DB table name that can vary as i might want tp print different table fields.


just like when we press pushbuttuon *PATTERN* in abap editor 
 there is a statement *STRUCTURED DATA OBJECT- WITH FIELDS FROM STRUCTURE*
HERE we privide DB table name and copy fields of DB table and then we give internal table name- say (i_tab).

the statments are inserted like this:
begin of i_tab.
fld1 type ztable-fld1.
...................................
end of i_tab.

0 Kudos
415

seen this?

http://wiki.sdn.sap.com/wiki/display/ABAP/Createdynamicpattern

follow this and add your logic to fetch the fields

kesavadas_thekkillath
Active Contributor
0 Kudos
415

You can refer this blog which gives you a similar example. [Call a function module in the ABAP Editor: Stop Crying - Start Laughing|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21914] [original link is broken] [original link is broken];. You can see a popup being asked to enter the function module name.