‎2008 Jul 04 2:33 PM
Hi,
I have these 3 fields in my selection-screen:
S_EBELN
S_KDATB
S_KDATE
The last 2 fields are Valid to and from fields. They are only to be obligatory if s_ebeln is empty.
How can I control that ?
‎2008 Jul 04 2:36 PM
hi,
something like this:
AT SELECTION-SCREEN.
IF s_ebeln[] IS INITIAL.
IF s_kdatb[] IS INITIAL AND[] s_kdate IS INITIAL.
* error message
ENDIF.
ENDIF.hope this helps
ec
‎2008 Jul 04 2:36 PM
In the AT SELECTION-SCREEN event, validate the fields S_KDATB
S_KDATE
AT SELECTION-SCREEN.
if s_vbeln is initial.
select ...
from table ----
where kdatb in s_kdatb
and kdate in s_kdate.
if sy-subrc ne 0.
message e000.
exit.
endif.Regards
Kannaiah
‎2008 Jul 04 2:36 PM
hi,
something like this:
AT SELECTION-SCREEN.
IF s_ebeln[] IS INITIAL.
IF s_kdatb[] IS INITIAL AND[] s_kdate IS INITIAL.
* error message
ENDIF.
ENDIF.hope this helps
ec
‎2008 Jul 04 2:37 PM
Hello.
Check this code:
START-OF-SELECTION.
READ TABLE s_ebeln TRANSPORTING NO FIELDS INDEX 1.
IF sy-subrc NE 0.
READ TABLE s_kdatb TRANSPORTING NO FIELDS INDEX 1.
IF sy-subrc NE 0.
MESSAGE 'Fill field kdatb' TYPE i.
EXIT.
ENDIF.
READ TABLE s_kdate TRANSPORTING NO FIELDS INDEX 1.
IF sy-subrc NE 0.
MESSAGE 'Fill field kdate' TYPE i.
EXIT.
ENDIF.
ENDIF
Regards.
Valter Oliveira.
‎2008 Jul 04 2:37 PM
Hi
U need to insert a control in AT SELECTION-SCREEN event:
AT SELECTION-SCREEN.
CHECK S_EBELN[] IS INITIAL.
IF S_KDATB[] IS INITIAL.
MESSAGE E208(00) WITH 'Insert Valid To date'.
ENDIF.
IF S_KDATE[] IS INITIAL.
MESSAGE E208(00) WITH 'Insert Valid From date'.
ENDIF.Max
‎2008 Jul 04 2:38 PM
it is better to use like this..
in the at selection screen output please pop up the error message for all the field to be mandatory.. .then it is possible otherwise it is not possible
‎2008 Jul 04 2:39 PM
Don't set them as obligatory when you define them.
You could then instead use the AT SELECTION-SCREEN code event to check if S_EBELN is empty, e.g.
AT SELECTION-SCREEN.
if S_EBELN is initial.
if s_kdatb is initial.
message etc etc.
endif.
endif.
‎2008 Jul 04 2:45 PM
Hello Peter,
you can do it in the LOOP AT SCREEN.. ENDLOOP.
IF ( S_EBELN IS NOT INITIAL ) .
IF ( S_KDATB IS INITIAL AND
S_KDATE IS INTIAL ).
SCREEN-INPUT = 1.
ENDIF.
ENDIF.
Hope it helps you
Regards
Indu.