on 07-21-2005 7:25 PM
hi folks,
I have two questions.
Here is the code.
select knumv kposn kschl krech kawrt kbetr kwert
from konv into table cdata for all entries in adinvoiceitab where konv~knumv = adinvoiceitab-knumv and
konv~kposn = adinvoiceitab-kposn.
loop at cdata into wac where knumv = wa-knumv.
case wac-kschl.
when 'ZRAT'.
if wac-kbetr = ' ' AND wac-kwert = ' '.
continue.
else.
p = p / 10.
if p < 1.
rate+0(1) = '-'.
endif.
i = p.
c = i.
shift c right deleting trailing '-'.
concatenate rate c '%' into rate.
condense rate no-gaps.
MOVE rate to w_accitab-zrate.
clear rate.
MOVE wac-kwert to w_accitab-zsubtotal.
endif.
Here I loop the data (numeric value) and convert it to character, concatenate % to the number.
My question is if the numeric value is 0 the internal table value should be blank because the value '0' is displaying in the form and I do not want that value.
How to do that?
Second question : From the query it is clearly evident that I am getting the records for various condition types from table KONV the important fields for me is 'kbetr' 'kschl' and 'kwert'.
For this Statement I only want records that have values in 'kbetr' and 'kwert' and how can i modify the query to get only these records and remove the other.
Thanks in advance.
Santhosh
1) you can check to make sure that you have something other than 0 before building the ZRATE.
<b> if i = 0.
clear w_accitab-zrate.
else.</b>
i = p.
c = i.
shift c right deleting trailing '-'.
concatenate rate c '%' into rate.
condense rate no-gaps.
move rate to w_accitab-zrate.
clear rate.
<b> endif.</b>
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check this out...
when 'ZSED'.
if wac-kbetr = ' ' AND wac-kwert = ' '.
continue.
else.
p = wac-kbetr.
p = p / 10.
if p < 1.
rate+0(1) = '-'.
endif.
if i = 0.
clear w_accitab-zrate.
else.
i = p.
c = i.
shift c right deleting trailing '-'.
concatenate rate c '%' into rate.
condense rate no-gaps.
MOVE rate to w_accitab-zrate.
clear rate.
MOVE wac-kwert to w_accitab-zsubtotal.
endif.
when 'ZAC1'.
The error: 'when' is allowed only after the case statement.
User | Count |
---|---|
103 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.