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

Hi making fields mandatory?

Former Member
0 Likes
1,531

Hello Friends,

I want to make the fields mandatory i have used the dictionary table name and field name as my input output field name of my screen input/out fields. The code that i am writing is like....Where ZSINGLE is my table name Tdate is date and Patno - Picture number and Vdate is also one date. Can anyone correct themistake in my code.

IF ZSINGLE-TDATE = SPACE.

else.

IF ZSINGLE-PATNO = SPACE.

else.

IF ZSINGLE-VDATE = SPACE.

MESSAGE I002.

CALL SCREEN 500.

ELSE.

CALL SCREEN 100.

ENDIF.

ENDIF.

ENDIF.

I am able to make only one field mandatory even though if i am not giving the other 2 fields it is passing to the next screen wht it should not happen.

Thks

Hello Friends,

I want to make the fields mandatory i have used the dictionary table name and field name as my input output field name of my screen input/out fields. The code that i am writing is like....Where ZSINGLE is my table name Tdate is date and Patno - Picture number and Vdate is also one date. Can anyone correct themistake in my code.

IF ZSINGLE-TDATE = SPACE.

else.

IF ZSINGLE-PATNO = SPACE.

else.

IF ZSINGLE-VDATE = SPACE.

MESSAGE I002.

CALL SCREEN 500.

ELSE.

CALL SCREEN 100.

ENDIF.

ENDIF.

ENDIF.

I am able to make only one field mandatory even though if i am not giving the other 2 fields it is passing to the next screen wht it should not happen.

Thks

14 REPLIES 14
Read only

Former Member
0 Likes
1,505

Hi,

ur requirement is not clear,

when u need to go to screen 100,

and when to go to screen 500.

regards,

muralidhar.

Read only

0 Likes
1,505

With out giving the input in all the three fields like PATNo, TDATE and VDATE i should not go to 100 screen.

Even if they are not entering anyone field then also it should not go to 100 screen.

Read only

Former Member
0 Likes
1,505

Hi,

If those fields are input/output fields in the layout of your screen just tick the required check box. Y do u need to write any code

for it?

regds

Seema

Read only

0 Likes
1,505

I didnt get check box actually i have doudble clicked on input/output field but i didnt got the require check box please help .

Read only

Former Member
0 Likes
1,505

Hi,

Suppose PATNO & VDATE are blanks & first field TDATE contain some value. Now since you are first checking IF TDATE = SPACE & since it contains some value it will enter the 'else' of the first IF .Then as per your logic it will check IF PATNO SPACE, which in this case is satisfied & hence will getout via Second ENDIF, thus it doesn't encounter any Message statement, hence the result.Instead you should check for ( Feild1 is initial ) or ( Field2 is initial ) or ( Field3 is initial ) 'Give the error message.

Else

Endif.

I hope this helps,

Regards

Raju Chitale

Read only

0 Likes
1,505

Can you please give me syntax for your procedure...

Read only

0 Likes
1,505

hi,

try this.

IF ZSINGLE-TDATE = SPACE and ZSINGLE-PATNO = SPACE and ZSINGLE-VDATE = SPACE.

CALL SCREEN 100.

ELSE.

MESSAGE I002.

CALL SCREEN 500.

ENDIF.

reward points if useful,

regards,

muralidhar.

Read only

0 Likes
1,505

hi,

try this.

IF ZSINGLE-TDATE <> SPACE and ZSINGLE-PATNO <> SPACE and ZSINGLE-VDATE <> SPACE.

CALL SCREEN 100.

ELSE.

MESSAGE I002.

CALL SCREEN 500.

ENDIF.

reward points if useful,

regards,

muralidhar.

Read only

0 Likes
1,505

Hi Venkatesh,

Just double click the input/output field, U will see a tab named program in attributes(Downward side), there is a field with dropdown in front of input default value would be possible just change it to required.

Hope I am clear.

Regds

Seema.

Read only

0 Likes
1,505

hI MURALI,

I have implemented your suggestion but i am not getting the actual mandatory field my code is..

IF ZTAPDSINGLE-PATNO = SPACE OR ZTAPDSINGLE-PATNO = SPACE OR ZTAPDSINGLE-VDATE = SPACE.

MESSAGE I002.

CALL SCREEN 500.

ELSE.

CALL SCREEN 100.

ENDIF.

endif.

*ENDIF.

ENDCASE.

But it is working only for ZTAPDSINGLE-PATNO = SPACE even though if i am not giving value in ZTAPDSINGLE-PATNO = SPACE OR ZTAPDSINGLE-VDATE = SPACE.

then also it is going to next screen which i dont want...i have seen even by using AND also but it is not working.

Read only

Former Member
0 Likes
1,505

Hi,

Write this way.

IF ZSINGLE-TDATE = SPACE OR

ZSINGLE-PATNO = SPACE OR

ZSINGLE-VDATE = SPACE.

MESSAGE I002.

CALL SCREEN 500.

ELSE.

CALL SCREEN 100.

ENDIF.

Read only

Former Member
0 Likes
1,505

Hi,

As far as I understood from Your question , You Have to do the following :

Check out the code as follows .... copy-paste and run..then.

parameter : vbeln type vbeln OBLIGATORY.

data : it type standard table of vbak,

wa type vbak.

select * from vbak into table it where vbeln = vbeln.

loop at it into wa.

write : wa-vbeln.

endloop.

.....see that you can not skip the intial screen without giving input. This is because of keyword 'OBLIGATORY'.

Try this keyword while declaring the data in your code.

If you are doing a module-pool program and have designed the screen.

double-click on the parameter on the screen........

a screen-properties window (painter attribute window )will come..................

go down in the 'attributes frame' ....click on the tabstrip with heading 'program........

check it as input field........

use the drop-down beside input..........

select 'required'.....

Reward points if helpful............

Edited by: Akashdeep Basu on May 8, 2008 6:51 AM

Read only

Former Member
0 Likes
1,505

hi

In the field attributes -> program-> Input ->required.

(you have four options -possible/not possible/required/recommended).

No Need to give an explicit code check.. but either way you can do..

IF ZSINGLE-TDATE = SPACE.

else.

IF ZSINGLE-PATNO = SPACE.

else.

IF ZSINGLE-VDATE = SPACE.

MESSAGE I002.

CALL SCREEN 500. "Why you want to call this after passing message?

ELSE.

CALL SCREEN 100. "

ENDIF.

ENDIF.

ENDIF.

Reward points if useful.

I Think , It may resolve.

Read only

0 Likes
1,505

I want to call this after passing message because util they enter all the fields they should not go to 100 screen. I have checked with your code but still it is not working. Imean even though if i am not entering Vdate and Tdate also it is going to 100 screen which it should not.