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

Extract and display data

Former Member
0 Likes
725

<b>Hi Guys, I am new to abap programming and my requirement is to accept an Employee Number on a screen and display the name and dept of that employee in a non-editable format. (I am using module pool and database tables)</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
660

Hi SARA,

If ur using Module pool then in the PAI section for the module pool write the select query

Select employee_name dept from database_table into table ITAB where employee_number = "the employee number entered on the screen".

emp_number must be an input field in the screen layout so that it can be used in the PAI and the database_table must be a in the top include.

Please reward helpful answers.

Regards,

Shrita.

5 REPLIES 5
Read only

Former Member
0 Likes
661

Hi SARA,

If ur using Module pool then in the PAI section for the module pool write the select query

Select employee_name dept from database_table into table ITAB where employee_number = "the employee number entered on the screen".

emp_number must be an input field in the screen layout so that it can be used in the PAI and the database_table must be a in the top include.

Please reward helpful answers.

Regards,

Shrita.

Read only

0 Likes
660

you have to explore the HR tables

Se11 -> PA0000, PA0001 , PA0002

Also refer the transaction PA20 to get the details in SAP .

regards

vivek

reward points for all the useful answersc

Read only

Former Member
0 Likes
660

Dear sara,

in the PAI of the module pool programming of the screen whichever you are using 'for e.g 0001

you will have some statemenst like

FIELD 'EMP_NUM'

FIELD 'EMP_NAME'

FIELD ' EMP_DEPT'

then you need to insert a module after the code FIELD 'EMP_NAME' and it is as follows

FIELD ' EMP_NAME'

module get_name_dept.

this module can be saved in the ZFUCNGRPI01 include where in the "ZFUNCGRP" is your fucntion group name.

in this module you write a select query to retrieve the date for the employee number to retrieve employee name and dept.

it is as follows -

data: l_name type PA0001-name,

l_dept type PA0001-dept.

select name dept from table PA0001 into (l_name, l_dept)

where num = EMP_NUM.

the screen field below need to be assigned the values as shown below.

EMP_NAME = l_name.

EMP_DEPT = l_dept.

loop at screen.

if screen-name = 'EMP_NAME' or 'EMP_DEPT'.

screen-input = '1'.

modify screen.

endloop.

i hope that this code if written with appropriate screen names and databse tables written.

please do reply back if you have any problems

bye

venugopal

Read only

Former Member
0 Likes
660

Hi,

to display display the name and dept of that employee in a non-editable format after empno is selected you have to write in PBO module of screen

below code

PBO

loop at screen.

if screen-name = 'ITAB-NAME' OR

screen-name = 'ITAB-DEPT' .

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards

Amole

Read only

Former Member
0 Likes
660

<b>THANK YOU ALL.</b>

When enduser enters the employee_Number in the screen field and presses <b>"ENTER"</b> then the employee_Name and employee_Dept should be displayed in a non-editable form.

And I meet the requirement execpt the logic to be use when the enduser presses the <b>"ENTER"</b> key and in which system field the <b>"ENTER"</b> key is stored. <b>PLEASE HELP</b>.

Regards

Sara.