Application Development and Automation 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: 
Read only

alv grid control problem

Former Member
0 Likes
556

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.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
527

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

Read only

Former Member
0 Likes
527

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.

Read only

amit_khare
Active Contributor
0 Likes
527

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.

Read only

Former Member
0 Likes
527

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