Application Development and Automation 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: 
Read only

macro programming

Former Member
0 Likes
805

do you know if there is a way to call a macro dynamically...

I have thought to generate a program but this is not a good solution to mE...

Please let me know if you have any idea

1 ACCEPTED SOLUTION
Read only

Peter_Inotai
Active Contributor
0 Likes
758

Try update table TRMAC dynamically in your program, and call the macro from there.

Check this weblog:

/people/scott.barden/blog/2004/07/22/abap-breakpoints-and-system-macros

Regards,

Peter

PS: If it helped, press the star button at the subject:-)

6 REPLIES 6
Read only

Peter_Inotai
Active Contributor
0 Likes
759

Try update table TRMAC dynamically in your program, and call the macro from there.

Check this weblog:

/people/scott.barden/blog/2004/07/22/abap-breakpoints-and-system-macros

Regards,

Peter

PS: If it helped, press the star button at the subject:-)

Read only

0 Likes
758

Yes it help a bit.

But modifying TRMAC is not acceptable for me

Read only

0 Likes
758

I cannot agree with Peter. Donnot use TRMAC, those definitions effect all programs on your system. You might invalidate some of them and thus doing severe harm.

Kind Regards

Klaus

Read only

Former Member
0 Likes
758

Macros can't be dynamical, because they are used during compiling. Perhaps you can generate a coding and use GENERATE SUBROUTINE-POOL. And several ABAP-command allows dynamized codings: SELECT, ASSIGN, etc.

Read only

0 Likes
758

Try something like the below code:

REPORT XXX .

define m1.

write :'M1'.

end-of-definition.

define m2.

write :'M2'.

end-of-definition.

define call1.

&1.

end-of-definition.

call1 m1.

call1 m2.

Read only

Former Member
0 Likes
758

Can you help us understand what you are trying to accomplish by calling a Macro dynamically? As already stated, Macros are decoded at activation time, very similar to how INCLUDES are resolved.

If you can provide an example of what you are trying to accomplish, we should be able to come up with some ideas.