Skip to Content
0
Former Member
Nov 23, 2011 at 02:53 PM

Problem in AT Selection Screen on field problem.

25 Views

Hello Expert,

I have the problem in AT SELECTION SCREEN ON Field.

I have 2 radio button rad1 and rad2 and 2 parameter matnr and mtart.

if user click first radiobutton that is rad1, the 2 parameter should enable and accept user input.

if user click second radio button that is rad2, the matnr should disable and mtart should enable.

My code working fine for all this. My problem i have writen one validation for mtart ie if iit is empty it should display

error message.

So my problem is if i click on second radion button ie rad2 , first parameter disabling and second parameter it is giving error 'material type not exists'.

i dont want error message when i clicking on the second radiobutton, i need the error message after user clicking second radio button and if dont enter any value in the second parameter ie p_mtart.

here is my code

PARAMETER: p_rad1 RADIOBUTTON GROUP rad1 DEFAULT 'X'  USER-COMMAND f1,
p_rad2 RADIOBUTTON GROUP rad1.

Parameter: p_matnr like mara-matnr.

Parameter: p_mtart like mara-mtart .


AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
if p_rad2 = 'X'.
if screen-name = 'P_MATNR'.
screen-input = 0.
screen-output = 1.
screen-group1 = 'BL1'.
modify screen.
elseif p_rad1 = 'X'.
screen-input = 1.
screen-active = 0.
modify screen.
endif.
endif.
endloop.


AT SELECTION-SCREEN on P_MATNR .
if p_rad1 = 'X'.
if p_matnr is initial.
MESSAGE E999  with 'material doesnt exists'.
endif.
endif.


AT SELECTION-SCREEN on P_MTART .
if p_rad2 = 'X'.
if p_mtart is initial.
MESSAGE E999  with 'material type doesnt exists'.
endif.
endif.

<Added Code tags>

Edited by: Suhas Saha on Nov 24, 2011 10:33 AM