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: 

Automatically fill fields

Former Member
0 Kudos

I have 2 fields

Employee No. _________

Employee Name

I want the following, when the user fill the Employee No. and press Enter the Employee must appear automatically.

Where can I find info. about this?

Thanx

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In a selection screen?



data: xpa0002 type pa0002.

parameters: p_pernr type pa0002-pernr.
parameters: p_name(30) type c.

at selection-screen output.

select Single * from pa0002 into xpa0002
           where pernr = p_pernr.
if sy-subrc = 0.
concatenate xpa0002-vorna xpa0002-nachn into p_name 
        separated by space.
endif.

Regards,

Rich Heilman

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In a selection screen?



data: xpa0002 type pa0002.

parameters: p_pernr type pa0002-pernr.
parameters: p_name(30) type c.

at selection-screen output.

select Single * from pa0002 into xpa0002
           where pernr = p_pernr.
if sy-subrc = 0.
concatenate xpa0002-vorna xpa0002-nachn into p_name 
        separated by space.
endif.

Regards,

Rich Heilman

Former Member
0 Kudos

Hiii Jose,

What u have to do

*****************************************************

Suppose the dbtable is like this

emp_no "Employee_no.

emp_name "Employee Name

***********************************************

data: e_name type <dbtable-emp_name>.

case sy-ucomm.

when 'ENTER'.

Select emp_name into e_name from <dbtable> where emp_no = field1.

field2 = e_name.

endcase.

Hope this work 4 u.

Do reward if it works.

Regards

-


Sachin Dhingra