Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Macro Definition Problem

How do I pass the <i><b>contents</b></i> of a field to a macro rather than the field name itself?

For example in the SUBT macro below, I want to pass the VALUE of setnode-subsetname to the SUBTOTAL macro, not the field name itself

DEFINE SUBT.

select * from setnode

where setclass = '0101'

and subclass = 'AAAA'.

and SETNAME = '&1'.

SUBTOTAL <b>setnode-subsetname</b> &1.

endselect.

END-OF-DEFINITION

Tags:
Former Member
replied

Parameters can be accessed with &. You don't need to use the single quotes.

DEFINE SUBT.

select * from setnode 
where setclass = '0101'
and subclass = 'AAAA'.
and SETNAME = &1.   " << &1 without quotes

SUBTOTAL setnode-subsetname &1.

endselect.

END-OF-DEFINITION

Use of macro:

SUBT 'TEST40'.

Regards,

Naimesh Patel

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question