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

mapping problem

Former Member
0 Likes
728

Hi Friends,

I have one query.

My condition is like

In selection screen there are 4 fields like A, B, C & D.

Now requirement is like

I have to ensure that field A, C or D having some value i.e. if none of these selections were entered then display the error message.

Suppose i have to do some conditions like X & Y.

In condition X(Consider as first subroutine)

Do not allow A and C selection to both be selected.

display an error message if both are selected.

Do not allow C & D selection to both be selected.

display an error message if both are selected.

B & C selection is ok.

Then further processing.

Now in condition Y(consider as second subroutine)

Do not allow A & D selection to both be selected.

display an error message if both are selected.

Do not allow C & D selection to both be selected.

display an error message if both are selected.

B & D selection is ok.

Then further processing.

I did my coding but I m not getting my desired result.

Anybody will tell me the pseudo coding for this??????

6 REPLIES 6
Read only

Former Member
0 Likes
699

Hi salil,

Coding for validation in ON SELECTION SCREEN event :-

*****************************************************

if A = ' ' and C = ' ' and D = ' '.

message 'A C D are blank' type 'E'.

endif.

if A = 'X' and C = 'X'.

message 'A & C both selection not allowed' type 'E'.

endif.

if A = 'X' and D = 'X'.

message 'A & D both selection not allowed' type 'E'.

endif.

    • if necessary ***

    • if B = ' '.

    • message 'B must be selected' type 'E'.

    • endif.

Pl.reward if satisfied.

Thanks & regards

Prammenthiran (Prem)

Read only

0 Likes
699

hi,

try that:

REPORT zzzz111 .

PARAMETERS: a,b,c,d.


AT SELECTION-SCREEN.
*1
  IF a = space AND c = space AND d = space.
    MESSAGE e001(00) WITH 'E1'.
  ENDIF.

*A/C
if a <> space and c <> space.
    MESSAGE e001(00) WITH 'X1'.
  ENDIF.

*C/D
if d <> space and c <> space.
    MESSAGE e001(00) WITH 'X2'.
  ENDIF.

*A/D
if a <> space and d <> space.
    MESSAGE e001(00) WITH 'Y1'.
  ENDIF.

*C/D
if d <> space and c <> space.
    MESSAGE e001(00) WITH 'Y2'.
  ENDIF.

A.

Read only

rahulkavuri
Active Contributor
0 Likes
699

hi can u give us the coding which u have done instead of us simulating the whole scenario, we can just help where you have gone wrong

Read only

Former Member
0 Likes
699

U can try and use the below logic.

AT SELECTION-SCREEN.

PERFORM CHECK_CONDITION using cond a b c d.

FORM check_condition using icnd ia ib ic id.

if ia = space and ic = space and id = space.

Error.

endif.

if ia = Space.

if ic <> space and id <> space.

Error.

endif.

else.

case icnd.

when 'X'.

if ic <> space. Error. Endif.

when 'Y'.

if id <> space. Error. Endif.

endcase.

endif.

ENDFORM.

Read only

0 Likes
699

Hi,

I am sending my coding..

Plz let me know where I am wrong...

At selection-screen.

If A NE ' ' OR C NE ' ' OR D NE ' '.

ELSE.

ERROR.

ENDIF.

IN FORM DATA.

PERFORM M.

PERFORM N.

FORM M.

IF A NE ' ' AND C NE ' '.

ERROR.

ELSEIF C NE ' ' AND D NE ' '.

ERROR.

ELSE.

PROCESSING.

ENDIF.

ENDFORM.

FORM N.

IF A NE ' ' AND D NE ' '.

ERROR.

ELSEIF C NE ' ' AND D NE ' '.

ERROR.

ELSE.

PROCESSING.

ENDIF.

ENDFORM.

I am getting problem in form N. Whenever i run my prog it will not work properly for for form N.

Will u suggest me what i have to do??

Read only

0 Likes
699

What is the problem you encounter and secondly please let us know which values you are populating in A/B/C and D.

Regards

Anurag