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

SAP SCRIPTS FORM

Former Member
0 Likes
813

Hi,

In Sap Scriptrs form (SE71) in one of the Element I am doing the validation as below

/: IF &LFA1-NAME1& <> 'RAHUL' AND &LFA1-NAME1& <> 'RAGHU' AND &LFA1-NAME1& <> 'ARUN'

&LFA1-NAME1& <> 'ANIL' AND &LFA1-NAME1& <> 'MOHAN' AND &LFA1-NAME1& <> 'MANU'

/: INCLUDE Z_TEST TEXT ID ST

/: ENDIF

it is not working, please explain me what would be the problem

Previously the code was as below and it was working

/: IF &LFA1-NAME1& <> 'RAHUL' AND &LFA1-NAME1& <> 'RAGHU'

/: INCLUDE Z_TEST TEXT ID ST

/: ENDIF

Edited by: shilpa12 shilpa12 on Feb 21, 2009 1:39 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
779

hi...

make your validation at the time when u r selecting the value in the program

for ex.

select <field name > from table <table name > into internal table

where < field name > in ( values u required).

hope this help you

Regards

Ritesh J

8 REPLIES 8
Read only

Former Member
0 Likes
779

There is error in your code....

It should be have = or EQ

/: IF &LFA1-NAME1& = 'RAHUL' AND &LFA1-NAME1& 'RAGHU' AND &LFA1-NAME1& 'ARUN'

&LFA1-NAME1& 'ANIL' AND &LFA1-NAME1& 'MOHAN' AND &LFA1-NAME1& 'MANU'

/: INCLUDE Z_TEST TEXT ID ST

/: ENDIF

Read only

0 Likes
779

Sorry the code as below

/: IF &LFA1-NAME1& neq 'RAHUL' AND &LFA1-NAME1& neq 'RAGHU' AND &LFA1-NAME1& neq 'ARUN' &LFA1-NAME1& neq 'ANIL' AND &LFA1-NAME1& neq 'MOHAN' AND &LFA1-NAME1& neq 'MANU'

/: INCLUDE Z_TEST TEXT ID ST

/: ENDIF

it is not working, please explain me what would be the problem

Previously the code was as below and it was working

/: IF &LFA1-NAME1& neq 'RAHUL' AND &LFA1-NAME1& neq 'RAGHU'

/: INCLUDE Z_TEST TEXT ID ST

/: ENDIF

Edited by: shilpa12 shilpa12 on Feb 21, 2009 1:46 PM

Edited by: shilpa12 shilpa12 on Feb 21, 2009 1:46 PM

Read only

0 Likes
779

/: IF &LFA1-NAME1& 'RAHUL' AND &LFA1-NAME1& 'RAGHU' AND &LFA1-NAME1& 'ARUN'

/:&LFA1-NAME1& 'ANIL' AND &LFA1-NAME1& 'MOHAN' AND &LFA1-NAME1& 'MANU'

/: INCLUDE Z_TEST TEXT ID ST

/: ENDIF

" Have u checked ur code by tying /: on the second line

Read only

Former Member
0 Likes
780

hi...

make your validation at the time when u r selecting the value in the program

for ex.

select <field name > from table <table name > into internal table

where < field name > in ( values u required).

hope this help you

Regards

Ritesh J

Read only

0 Likes
779

ok good but is there any alternative in the form

Read only

0 Likes
779

Thanks a Lot

Read only

former_member585060
Active Contributor
0 Likes
779

Hi,

Then try this way

/:  IF &LFA1-NAME1& NEQ 'RAHUL' AND &LFA1-NAME1& NEQ 'RAGHU' 
/:  INCLUDE Z_TEST TEXT ID ST
/:  ENDIF
/: IF &LFA1-NAME1& NEQ 'ARUN' AND &LFA1-NAME1& NEQ 'ANIL'
/:  INCLUDE Z_TEST TEXT ID ST
/:  ENDIF
/: IF&LFA1-NAME1& NEQ 'MOHAN' AND &LFA1-NAME1& NEQ 'MANU'
/:  INCLUDE Z_TEST TEXT ID ST
/:  ENDIF

or

/: IF &LFA1-NAME1& NEQ 'RAHUL' AND &LFA1-NAME1& NEQ 'RAGHU' AND 
= &LFA1-NAME1& NEQ 'ARUN' AND &LFA1-NAME1& NEQ  'ANIL'  AND &LFA1-NAME1& NEQ 'MOHAN' 
= AND &LFA1-NAME1& NEQ 'MANU'
/: INCLUDE Z_TEST TEXT ID ST
/: ENDIF

" just check the paragraph format for line feed  = or /

Regards

Bala Krishna

Edited by: Bala Krishna on Feb 21, 2009 8:45 PM

Read only

0 Likes
779

i guess 2nd option will work. bcoz in the 1st option, say, value is MANASA, then, all the 3 times the INCLUDE will trigger.....so, i guess, using ELSEIF is better option.

thanq

Edited by: SAP ABAPer on Feb 21, 2009 4:29 PM