on 09-14-2009 6:50 AM
hi,
i written like this in my form. my requirement is also below.
my issue is how for item level how ti i write the condition. means for one material supppose there are 5 to 6 line items and so there 5 to 6 differet material types.codition whatever i written same but for item level how to write the logic???
please help me..
/: IF &KNA1-SPRAS& = 'EN'
/: IF &VBDKR-FKART& EQ 'L2' AND &VBDPR-MTART& NE 'DIEN'.
TR Debit Memo
/: ELSEIF &VBDPR-MTART& EQ 'DIEN'.
/: INVOICE
/: ENDIF
Hi,
You can do like below, call the writ_form FM and create elements based on the condition in drvier program then call the elements in the respective window of the script, bcaz sometimes script fails to check the conditions..
Eg:
In Driver Program:
IF &KNA1-SPRAS& = 'EN'
IF &VBDKR-FKART& EQ 'L2' AND &VBDPR-MTART& NE 'DIEN'.
call function 'WRITE_FORM'
EXPORTING
element = 'DEBIT'
window = 'GIve the window name'.
ELSEIF &VBDPR-MTART& EQ 'DIEN'.
call function 'WRITE_FORM'
EXPORTING
element = 'INVOICE'
window = 'GIve the window name'.
INVOICE
ENDIF.
In Script Form:
/E DEBIT
P1 TR Debit Memo
/E INVOICE
P1 INVOICE
or
try by putting (C) in all the variables::
/: IF &KNA1-SPRAS(C)& = 'EN'
/: IF &VBDKR-FKART(C)& EQ 'L2' AND &VBDPR-MTART(C)& NE 'DIEN'.
P1TR Debit Memo
/: ELSEIF &VBDPR-MTART(C)& EQ 'DIEN'.
P1 INVOICE
/: ENDIF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
You cant write any loop kind of statements in scripts( loop..endloop, do..enddo or while..endwhile), you can use conditional statements - if..else, endif in scripts.
But the funcationlaity you can achieve by using performs in the script.
You can refer the below links for this info.
Hope this helps.
Rgds,
Sripal
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 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.