‎2007 Jul 18 1:27 PM
Hi,
In my requirement, i have 4 fields in the selection screen which are mandatory as well as the values have to be validated against the standard tables. when i give some wrong value and then press enter, i need all the fields to be greyed out and the particular field only to be in editable stage.
This can be achieved if the case is only 1 field "at selection-screen on <field>".
can anyone suggest me how this can be done for 4 fields?
thanks in advance.
‎2007 Jul 18 1:35 PM
Hi deepti,
1. can anyone suggest me how this can be done for 4 fields
2. Just copy paste this code
3. It will show 4 (1 character fields )
A, B, C D
<b>We need to enter A in A, B in B... and so on.
(Other wise it will give error ,
and ONLY THAT Field will be available for input)</b>
4.
REPORT YAM_TEMP03.
PARAMETERS : A TYPE C.
PARAMETERS : B TYPE C.
PARAMETERS : C TYPE C.
PARAMETERS : D TYPE C.
*----
AT SELECTION-SCREEN ON A.
IF A <> 'A'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON B.
IF B <> 'B'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON C.
IF C <> 'C'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON D.
IF D <> 'D'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
regards,
amit m.
‎2007 Jul 18 1:30 PM
Hi
In module Pool programming we use CHAIN and ENDCHAIN for this purpose.
In AT selection-Screen on field.
write the validation.
select..
if sy-subrc <> 0.
loop at screen.
if screen-name = 'field1' or field2 or field3.
screen-input = 0.
modify screen.
endif.
endloop.
write this code and see
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jul 18 1:32 PM
Hi,
If you do the validation for all the fields.And u enter 1 field wrongly All the other fields will be greyed out if you give the error message after validation of that field.
Reward if helpful..
‎2007 Jul 18 1:33 PM
hi,
In AT selection-Screen on field.
write the validation.
chk in tables ********
if sy-subrc ne 0.
loop at screen.
if screen-name = 'field1' or field2 or field3.
screen-input = 0.
modify screen.
endif.
endloop.
With Regards,
S.Barani
‎2007 Jul 18 1:35 PM
Hello declare all the fields on on a block example B01.
Than use
AT SELECTION-SCREEN ON BLOCK B01.
Regards,
A.Singh
‎2007 Jul 18 1:35 PM
Hi deepti,
1. can anyone suggest me how this can be done for 4 fields
2. Just copy paste this code
3. It will show 4 (1 character fields )
A, B, C D
<b>We need to enter A in A, B in B... and so on.
(Other wise it will give error ,
and ONLY THAT Field will be available for input)</b>
4.
REPORT YAM_TEMP03.
PARAMETERS : A TYPE C.
PARAMETERS : B TYPE C.
PARAMETERS : C TYPE C.
PARAMETERS : D TYPE C.
*----
AT SELECTION-SCREEN ON A.
IF A <> 'A'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON B.
IF B <> 'B'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON C.
IF C <> 'C'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON D.
IF D <> 'D'.
MESSAGE 'EEE' TYPE 'E'.
ENDIF.
regards,
amit m.
‎2007 Jul 18 1:43 PM
Hello,
Check this. It's working :-
REPORT ztest123.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY,
p_werks TYPE werks OBLIGATORY ,
p_vbeln TYPE vbeln OBLIGATORY,
p_date TYPE erdat OBLIGATORY.
AT SELECTION-SCREEN ON p_matnr.
DATA: lv_matnr TYPE matnr.
SELECT SINGLE matnr FROM mara INTO lv_matnr
WHERE matnr = p_matnr.
IF sy-subrc <> 0.
LOOP AT SCREEN .
CASE screen-name.
WHEN 'P_WERKS'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'P_VBELN'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'P_DATE'.
screen-input = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
MESSAGE 'Enter valid Material' TYPE 'E'.
EXIT.
ENDIF.
Regards,
Deepu.K