‎2008 Mar 10 4:19 PM
HI,
how this code is working?
Regards
RANGES: r_pernr FOR pa0000-pernr.
DEFINE create_ranges.
&1-sign = 'I' .
&1-option = 'EQ' .
&1-low = &2.
append &1 .
IF pernr IS NOT INITIAL.
create_ranges r_pernr pernr.
ENDIF.Regards
‎2008 Mar 10 4:36 PM
DEFINE create_ranges.
&1-sign = 'I' .
&1-option = 'EQ' .
&1-low = &2.
append &1 .
ENDDEFINE.
The above piece of defines a macro named "create_ranges". As you know, macro acts nothing like a subroutine whereas &1 and &2 are formal parameters passed while calling the macro. &1 is the first parameter passed and &2 is the second parameter passed while calling the macro.
IF pernr IS NOT INITIAL.
create_ranges r_pernr pernr.
ENDIF.
The above code calls the "create_ranges" macro with the parameters r_pernr (&1) and pernr (&2).
DEFINE <marco-name>
<<Set of statements>>
ENDDEFINE.
"The above DEFINE... statement defines a macro named <marco-name>.
Hope this helps.
Thanks,
Balaji
‎2008 Mar 10 4:27 PM
Hi,
If pernr is initial in the selection screen, then it will create a range and will be used in the code.
Thanks,
Sriram Ponna.
‎2008 Mar 10 4:33 PM
IF NOT pernr IS INITIAL.
create_ranges r_pernr pernr.
ENDIF.
if the field pernr is not empty it calls the DEFINEd macro CREATE_RANGES passing the range R_PERNR and the value to add to it, PERNR.
The range would then be used in other statements like:
SELECT * INTO IT_PERSONS FROM PA001
WHERE PERNR in R_PERNR.
‎2008 Mar 10 4:36 PM
DEFINE create_ranges.
&1-sign = 'I' .
&1-option = 'EQ' .
&1-low = &2.
append &1 .
ENDDEFINE.
The above piece of defines a macro named "create_ranges". As you know, macro acts nothing like a subroutine whereas &1 and &2 are formal parameters passed while calling the macro. &1 is the first parameter passed and &2 is the second parameter passed while calling the macro.
IF pernr IS NOT INITIAL.
create_ranges r_pernr pernr.
ENDIF.
The above code calls the "create_ranges" macro with the parameters r_pernr (&1) and pernr (&2).
DEFINE <marco-name>
<<Set of statements>>
ENDDEFINE.
"The above DEFINE... statement defines a macro named <marco-name>.
Hope this helps.
Thanks,
Balaji