on 10-22-2007 4:45 AM
Hi everyone,
I'm still new at using sapscript. I want to use IF....ENDIF but i confused how to use it in my sapscript. Here is the logic that i get from my functional designer :
IF t8jvb03-ceind = 'C' THEN
<E>JIBCL_N /* Element JIBCL_N */
&t8jvb11-jibcl& &t8jv11-cltext&
IF t8jvb11-jibsa <> '99999' THEN
<E>JIBSA_N
&t8jvb11-jibsa& &t8jvb11-satext&
ENDIF
<E>COBJT_E
&t8jvb11-cotype& &t8jvb11-cobject& &t8jvb11-fcmamt& &t8jvb11-fydamt& &t8jvb11-fidamt&
<E>JIBCL_E
Total: &t8jvb11-jibcl& &t8jvb11-cltext& &t8jvb11-fcmamt& &t8jvb11-fydamt& &t8jvb11-fidamt&
ELSEIF t8jvb03-ceind = 'O' THEN
IF t8jvb11-jibsa <> '99999' THEN
<E>JIBCL_N
&t8jvb11-jibcl& &t8jv11-cltext&
<E>JIBSA_N
&t8jvb11-jibsa& &t8jvb11-satext& &t8jvb11-fcmamt& &t8jvb11-fydamt& &t8jvb11-fidamt&
ENDIF
<E>JIBCL_E
Total : : &t8jvb11-jibcl& &t8jvb11-cltext& &t8jvb11-fcmamt& &t8jvb11-fydamt& &t8jvb11-fidamt&
ELSEIF t8jvb03-ceind = 'W' THEN
......
When i activate this logic, it's said that there is double element written(example JIBCL_N in IF t8jvb03-ceind = 'C' and in ELSEIF t8jvb03-ceind = 'O' THEN). Is this ok ? or is there any better way to do this ? For your information i copy the form from standard form ''JV_IN_EXP_JIB". Thank you.
Hi
have to use the commands before the lines as below
/: IF t8jvb03-ceind = 'C' THEN
/E JIBCL_N /* Element JIBCL_N */
/ &t8jvb11-jibcl& &t8jv11-cltext&
/: IF t8jvb11-jibsa <> '99999' THEN
/E JIBSA_N
/ &t8jvb11-jibsa& &t8jvb11-satext&
/: ENDIF
/E COBJT_E
/ &t8jvb11-cotype& &t8jvb11-cobject& &t8jvb11-fcmamt& &t8jvb11-fydamt&
= &t8jvb11-fidamt&
/E JIBCL_E
/ Total: &t8jvb11-jibcl& &t8jvb11-cltext& &t8jvb11-fcmamt& &t8jvb11-fydamt&
= &t8jvb11-fidamt&
/: ELSEIF t8jvb03-ceind = 'O' THEN
/: IF t8jvb11-jibsa <> '99999' THEN
/E JIBCL_N
/ &t8jvb11-jibcl& &t8jv11-cltext&
/E JIBSA_N
/ &t8jvb11-jibsa& &t8jvb11-satext& &t8jvb11-fcmamt& &t8jvb11-fydamt&
= &t8jvb11-fidamt&
/: ENDIF
/E JIBCL_E
/ Total : : &t8jvb11-jibcl& &t8jvb11-cltext& &t8jvb11-fcmamt& &t8jvb11-fydamt& = &t8jvb11-fidamt&
/: ELSEIF t8jvb03-ceind = 'W' THEN
Regards
Anji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no need to put the elements in the conditioon block...
define only one element... and the data that you want to print put it in the conditional block...
so when you call your element SAPScript will print the data based on the current condition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.