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 validation.

Former Member
0 Likes
725

hi all,

this my selection screen

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_ebeln FOR ekko-ebeln,

s_lifnr FOR ekko-lifnr,

s_bedat FOR ekko-bedat OBLIGATORY,

s_bukrs FOR ekko-bukrs OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

if i enter EBELN in selection screen, bedat shoulnot be mandatory.

if EBELN field is blank BEDAT should be mandatory..

how to do tat,please help me out

Regards

Suprith

5 REPLIES 5
Read only

Former Member
0 Likes
665

Remove obligatory for BEDAT...

Add below code in ur program...

TABLES: SSCRFIELDS. " Fields on selection screens

Form to Validate data specified on Selection Screen

CHECK SSCRFIELDS-UCOMM EQ 'ONLI'.

PERFORM SELECTIONSCREEN_VALIDATIONS.

In this perform check whether EBELN is passed, then check whether BEDAT is passed or empty and don't trigger any message.

if EBELN is not passed check whether BEDAT has a value and if there exists no value, trigger a message.

Form looks as below...

FORM SELECTIONSCREEN_VALIDATIONS .

IF P_PCUPLD = C_PC_SELECTED.

IF SY-BATCH EQ C_PC_SELECTED.

CLEAR SSCRFIELDS-UCOMM.

MESSAGE E001(ZZ) WITH TEXT-014.

" File cannot be upload from presentation server when execute in

" Batch Mode.

ENDIF.

ENDFORM. " SELECTIONSCREEN_VALIDATIONS

Don't create multiple threads for same post...

Read only

Former Member
0 Likes
665

hi

try this...

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_ebeln FOR ekko-ebeln,

s_bedat FOR ekko-bedat OBLIGATORY,

SELECTION-SCREEN END OF BLOCK b1.

at selection-screen on block b1

if s_ebeln is initial.

if s_bedat is initial.

message 'Enter date' type 'E'.

endif.

endif.

regards

padma

Read only

Former Member
0 Likes
665

Use event

AT SELECTION SCREEN on s_bedat.

if bedat is empty.

message type E

endif.

Hope this helps!

Regards,

Prashant

Read only

Former Member
0 Likes
665

Use AT SELECTION SCREEN on field.

for more help press F1 on same.

Amit.

Read only

Former Member
0 Likes
665

closed