Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

maodule pool

HI,

i have an uegent requirement, iam working on table controls.

i have the below requirement, please suggest me the code.

If the FIELD1 is x - then the FIELD3 field should be mandatory. If the FIELD1 is Y

- then the FIELD4 field should be mandatory.

DO NOT ALLOW THE USER TO FILL IN BOTH FIELD 3 AND FIELD4 - only one or the other,

based on the FIELD1.

Thanks in advance.

bye,

kirthi

Former Member
Former Member replied

Hi,

In the PAI of that screen, write the below logic,

You will have LOOP AT ITAB and ENDLOOP in the PAI, there write a Moduel, in that one

IF FIELD1 = 'X'.
  IF FIELD3 is initial.
    Give a Success message.
     EXIT.  " This is Mandatory
 Endif.
ELSEIF Field1  = 'Y' .
  IF FIELD4 is initial.
    Give a Success message.
     EXIT.  " This is Mandatory
 Endif.
ENDIF.

IF NOT FIELD3 is initial AND
    NOT FIELD4 is initial.
 Give the Success mesage
 EXIT

.

ENDIF.

Regards

Sudheer

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question