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 Issues

Former Member
0 Likes
495

Hi,

I am new into Abap and I have a requirement in my program to set material and material description as select-options in the screen. If I input a value in the material, the material description will not be an obligatory value but if there is no value inputted for material in the selection screen, the material description would be an obligatory value in the selection-screen. Hope that someone knows how to do this.

3 REPLIES 3
Read only

awin_prabhu
Active Contributor
0 Likes
457

Hi Andrei,

Try like below.


SELECT-OPTIONS: s_matnr FOR mara-matnr,
                s_maktx FOR makt-maktx.

AT SELECTION-SCREEN.
  IF s_matnr IS INITIAL AND s_maktx IS INITIAL.
    MESSAGE 'Enter material description' TYPE 'E'.
  ENDIF.

Thanks..

Read only

Former Member
0 Likes
457

Hi,

use the below code...

AT selection-screen.

 if matnr is initial.
           loop at screen.
                 if screen-name eq maktx.
                      message 'Enter Description' type 'E'.
                 endif.
           endloop. 
 endif.

Read only

Former Member
0 Likes
457

You may refer the follwoing.

tables: MAKT, RMMG1.

parameters: pa_matnr type RMMG1-matnr,

pa_MAKTX type MAKT-MAKTX.

AT SELECTION-SCREEN.

if pa_matnr is initial.

if pa_MAKTX is initial.

MESSAGE 'please input the description' type 'E'.

endif.

endif.

start-of-selection.

write: 'report done'.

Hope may help you. Just follow your logic