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

check

Former Member
0 Likes
440

Hello,

I have five fields in the screen I want to add logic in such a way that if user enters any one field he has to enter all the remaining field or else should keep all fields empty.

I know the place where i can put the check statement but it require to consider all permutation and combination which is not feasible.Please suggest some other short logic .

Its urgent.

Thanks,

Tanisha

1 ACCEPTED SOLUTION
Read only

praveen_hannu
Contributor
0 Likes
423

use chain and endchain in the Process after output, and write the module

between chain and endchain to that, check any field has value, in the PBO event

make the screen remainig fields are required.

like below.

Global Data

data: flg.

Process Before Output.

module screen_cahnges.

process after output.

Chain.

field f1 module f1_chk.

field f2 module f1_chk.

field f3 module f1_chk.

field f4 module f1_chk.

field f5 module f1_chk.

endchain.

module f1_chk.

if f1 is not initial.

flg = '1'.

elseif f2 is not initial.

flg = '2'.

elseif f3 is not initial.

flg = '3'.

elseif f4 is not initial.

flg = '4'.

elseif f5 is not initial.

flg = '5'.

endif.

endmodule.

module screen_changes.

if flg ne ''.

loop at screen.

case flg.

when 1.

if screen-name = 'F2' or screen-name = 'F3' or screen-name = 'F4' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 2.

if screen-name = 'F1' or screen-name = 'F3' or screen-name = 'F4' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 3.

if screen-name = 'F2' or screen-name = 'F1' or screen-name = 'F4' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 4.

if screen-name = 'F2' or screen-name = 'F3' or screen-name = 'F1' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 5.

if screen-name = 'F2' or screen-name = 'F3' or screen-name = 'F4' or screen-name = 'F1' ..

screen-required = 1.

endif.

endcase.

modify screen.

endloop.

endif.

endmodule.

Hope it works, try this

Regards

Praveen

4 REPLIES 4
Read only

Former Member
0 Likes
423

Hi

in flow logic u can use the below statement for dat field which if entered all other flds also have to be entered.....

field...fld1........module <chk_other_flds>.........on input. check syntax

so chk_other_flds module gets triggered only if user enters input on fld1 field

Cheers,

jose.

Read only

Former Member
0 Likes
423

hi Tanisha,

is it sel screen or Module pool screen..?

if it is Sel screen use loop at screen ... and endloop.

in between add the logic based up on the field entry.

if it is module pool screen:-

validate that field and if it is not initial then only make other fields to get enable mode.

else not..

Regards.,

Chandra

Read only

Former Member
0 Likes
423

in at selection screen output.

count how many fields are initial.

now u need to write if statement

if not (count = 0 or count = 5)

raise an error message

endif

Read only

praveen_hannu
Contributor
0 Likes
424

use chain and endchain in the Process after output, and write the module

between chain and endchain to that, check any field has value, in the PBO event

make the screen remainig fields are required.

like below.

Global Data

data: flg.

Process Before Output.

module screen_cahnges.

process after output.

Chain.

field f1 module f1_chk.

field f2 module f1_chk.

field f3 module f1_chk.

field f4 module f1_chk.

field f5 module f1_chk.

endchain.

module f1_chk.

if f1 is not initial.

flg = '1'.

elseif f2 is not initial.

flg = '2'.

elseif f3 is not initial.

flg = '3'.

elseif f4 is not initial.

flg = '4'.

elseif f5 is not initial.

flg = '5'.

endif.

endmodule.

module screen_changes.

if flg ne ''.

loop at screen.

case flg.

when 1.

if screen-name = 'F2' or screen-name = 'F3' or screen-name = 'F4' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 2.

if screen-name = 'F1' or screen-name = 'F3' or screen-name = 'F4' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 3.

if screen-name = 'F2' or screen-name = 'F1' or screen-name = 'F4' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 4.

if screen-name = 'F2' or screen-name = 'F3' or screen-name = 'F1' or screen-name = 'F5' ..

screen-required = 1.

endif.

when 5.

if screen-name = 'F2' or screen-name = 'F3' or screen-name = 'F4' or screen-name = 'F1' ..

screen-required = 1.

endif.

endcase.

modify screen.

endloop.

endif.

endmodule.

Hope it works, try this

Regards

Praveen