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

Selection screen field populate when user press enter button

0 Likes
3,732

I had a requirement like.. ( selection screen report), not an module pool program.

Field 1: personnel number

field 2: first name

field 3: last name

field 4: date of birth

When i enter personnel number and click on enter the below fields value need to be populated.

1 ACCEPTED SOLUTION
Read only

venkateswaran_k
Active Contributor
2,835

Hi

You can write a code to populate in the following event.AT SELECTION-SCREEN.

PARAMETERS : P_pernr type PA0001-pernr,
             P_name1 type nam31,
             p_name2 type name2 .
AT SELECTION-SCREEN.
 select single sname , ename from pa0001 into (p_name1 , p_name2) where pernr = p_pernr 

When you press Enter, AT SELECTION SCREEN event will be fired and you can handle the data populate here


5 REPLIES 5
Read only

venkateswaran_k
Active Contributor
2,836

Hi

You can write a code to populate in the following event.AT SELECTION-SCREEN.

PARAMETERS : P_pernr type PA0001-pernr,
             P_name1 type nam31,
             p_name2 type name2 .
AT SELECTION-SCREEN.
 select single sname , ename from pa0001 into (p_name1 , p_name2) where pernr = p_pernr 

When you press Enter, AT SELECTION SCREEN event will be fired and you can handle the data populate here


Read only

0 Likes
2,835

Thanks for answer @Venkat

But here i am facing different issue that is, when i click enter the data is populating but when i click on execute button (F8) also data is populating but this should not happen, when i click on enter the fields data should be populated and when i click F8 different screen need to be execute.

Read only

2,835

Okay, then you add the IF statement as below

AT SELECTION-SCREEN.
 IF SY-UCOMM NE 'ONLI'.
 select single sname , ename from pa0001 into (p_name1 , p_name2) where pernr = p_pernr 
 ENDIF.
Read only

former_member1716
Active Contributor
0 Likes
2,835

manideep31,

You can also handle this solution using F4. When you select the value for the first field using F4, subsequent fields will be filled during the same action.

Recommend you to go through the event:

AT SELECTION-SCREEN ON VALUE-REQUEST ON PERNR.

* Call the below FM for the required field to be populated along with other fields.

CALL FUNCTION F4IF_INT_TABLE_VALUE_REQUEST.

Its own documentation will have a detailed information on how the FM can be used.

Regards!

Read only

0 Likes
2,835

Thanks for Answer @satish kumar,

yeah we can handle but business is expecting different mode 🙂 .