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: 

HR ABAp

Former Member
0 Kudos

Hi Friends,

I need some information regarding MACRO's.

In my selection screen if I am giving an parameter (Eg: p_test) then in my coding I am using the Macro statement as "rp_provide_from_last p0001 p_test pn-begda pn-endda.

In case If I am giving an select option ( EG: s_test from to)

Here how can I use the macro????? If we use 's_test' in the place of subtype its not fetching the records.

so could u plz tell me in case of select options how can we use the macro statement??

Thanks in Advance,

Magesh.S

4 REPLIES 4

Former Member
0 Kudos

There can be only one record in the given date range .. pn-begda pn-endda

If U have a parameter then there is no problem ...

Say U have a select-option for subtype which is not the case in real time scenarios ..

Just call the macro

rp_provide_from_last p0001 space pn-begda pn-endda. < -- get the record irrespective of the

subtype and only on dates ...

and now check as below ..

if p0001-subty in s_test.

*write your coding ...

endif.

0 Kudos

Hi.

change ur micro as it

"rp_provide_from_last p0001 p_test pn-begda = sel_option_mydate-low pn-endda = sel_option_mydate-high."

Former Member
0 Kudos

hi friend ,

when you are using a select-option in your program in thatt case it it makes a internal table with header line.

so to access the contents you have given in select option inside macro...

select-option:

s_carr for w_carr.

define macro.

loop at s_carr.

HERE YOU CAN ACCESS SELECT OPTION CONTENTS.

endloop.

end-of-defintion.

shafiq_rehman3
Active Contributor
0 Kudos

Srinivas is right, you can only get one row if you use this macro and by using a range from selection screen you intend to get multiple records.

If you realy want multiple records then so not use the macro, instead use a loop.