cancel
Showing results for 
Search instead for 
Did you mean: 

Display input data

former_member991843
Discoverer
0 Kudos

Hello sap community , i m new to abap and i m trying to write a simple program that takes input from the user in selection screen and i want to add a button to the selection screen in a way that when the user click the button the informations entered in the fields will be displayed to him , can i get a little of help on how could i do that .

Here is the code i wrote till now :

TABLES sscrfields.
DATA : matricule type STRING ,
button1 TYPE C ,
button2 TYPE C .

SELECTION-SCREEN BEGIN OF BLOCK PERIODE WITH FRAME TITLE TEXT-001.

PARAMETERS : DATE_DEB TYPE sy-datum .
PARAMETERS : DATE_FIN TYPE sy-datum .

SELECTION-SCREEN END OF BLOCK PERIODE .

SELECTION-SCREEN BEGIN OF BLOCK SALARIE WITH FRAME TITLE TEXT-002.

PARAMETERS : MATRICUL TYPE STRING .
PARAMETERS :NOM TYPE STRING .
PARAMETERS : PRENOM TYPE STRING .

SELECTION-SCREEN END OF BLOCK SALARIE.

SELECTION-SCREEN BEGIN OF BLOCK AFFICHAGE WITH FRAME TITLE TEXT-003 .

PARAMETERS : RESULT TYPE STRING .

SELECTION-SCREEN PUSHBUTTON 2(10) butto1 USER-COMMAND but1.
SELECTION-SCREEN PUSHBUTTON 2(10) butto2 USER-COMMAND but2.

SELECTION-SCREEN END OF BLOCK AFFICHAGE .


AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'BUT1'.
MESSAGE 'Button 1 was clicked' TYPE 'I'.
WHEN 'BUT2'.
MESSAGE 'Button 2 was clicked' TYPE 'I'.
ENDCASE.

INITIALIZATION.
button1 = 'Button 1'.
button2 = 'Button 2'.

Accepted Solutions (1)

Accepted Solutions (1)

harrypressplay123
Discoverer

PUSHBUTTON 2(10) but1 USER-COMMAND cli1

use this statement to create a button ,

then use case ...endcase block within it

write

WHEN cli1.

write: <name of parameter>,

harrypressplay123
Discoverer
0 Kudos

You can also use message statement within the block

Answers (0)