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: 

macro programming

Former Member
0 Kudos

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

Peter_Inotai
Active Contributor
0 Kudos

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

Peter_Inotai
Active Contributor
0 Kudos

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:-)

0 Kudos

Yes it help a bit.

But modifying TRMAC is not acceptable for me

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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.