‎2007 Jan 15 5:34 PM
i have tables: zfm_handy, pa0002.
i have total 21 fields in that 19 fields from zfm_handy table and other two fiels(NACHN and VORNA ) i.e first name and last name belongs to table pa0002.
plz tell me any function module which gives the lastname and first name of the employee seperately and use it in the problem .is it any possibility for this?
the output list has to be a alv grid list.
if not plz sent the alternative coding.
‎2007 Jan 15 5:58 PM
Just simply do a select against PA0002 with the employee number.
data: begin of xname,
nachn type pa0002-nachn,
vorna type pa0002-vorna,
end of xname.
Select Single NACHN VORNA into xname
from pa0002
where pernr = p_pernr
and endda = '99991231'.
* Now move the values of XNAME into the fields of your internal table or you can simply move them directly .Regards,
Rich Heilman
‎2007 Jan 15 6:24 PM
thanks for u r reply
but how can i get other 19 fields in the form of alv grid dispaly
i need to write select guery for these 19 fields from the table zfm_handy.
‎2007 Jan 15 6:30 PM
Hi,
create an internal table with all the 19 fields+2fields.
Now pass al required values from PA0002 and Zfm_handy to it.
Pass that internal table to ALV.
Because you cannot use at a time more than one table for ALV Display.
Regards,
Amit
Reward all helpful replies.
‎2007 Jan 15 6:31 PM
hi,
check this:
data: begin of i_zfm occurs 0.
include structure zfm_handy.
data: fname like pa0002-fname,
"Assuming first name is fname, last name is lname
lname like pa0002-lname,
end of i_zfm.
select (19 fields of zfm_handy) pa0002fname pa0002lname
into corresponding fields of table i_zfm from zfm_handy
inner join pa0002
where zfm_handypernr = pa0002pernr
and pa0002~begda <= sy-datum
and pa0002~endda >= sy-datum.
You can then use this internal table in your ALV Function module call.
Regards
Subramanian