‎2010 Apr 08 3:55 AM
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.
‎2010 Apr 08 4:08 AM
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..
‎2010 Apr 08 4:14 AM
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.
‎2010 Apr 08 4:20 AM
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