2010 Apr 20 7:45 AM
Hi,
Good day day.
Ive got a problem with concatenate..
in the billing the discount looks like 21.000- %.
In my programme level,iam pullling the discount value from standard stracture one which is ls_bill_invoice-it_kond. ive got the 210.00% from standard stracture.
Instead of 21%..now my result shows like 210 %. Plz can any one check where i am wrong
Loop at gs_it_kond into gs_kond where kschl = 'RA00'.
IF gs_kond-kbetr < 0.
gs_kond-kbetr = gs_kond-kbetr * -1.
ENDIF.
gv_perc = gs_kond-kbetr.
endloop.
WRITE gv_perc TO gv_disc LEFT-JUSTIFIED.
concatenate gv_disc '%' into gv_disc separated by space.
Regards
2010 Apr 20 7:50 AM
hi,
take gv_disc as character type and take first two digits by offset i e +0(2) and then u can con catenate it as discount will probably be of two digit so this will hold good for all.
Thanks,
Gaurav.
hi,
take gv_disc as character type and take first two digits by offset i e +0(2) and then u can con catenate it as discount will probably be of two digit so this will hold good for all.
Thanks,
Gaurav.
2010 Apr 20 7:50 AM
hi,
take gv_disc as character type and take first two digits by offset i e +0(2) and then u can con catenate it as discount will probably be of two digit so this will hold good for all.
Thanks,
Gaurav.
2010 Apr 20 7:55 AM
DATA: gs_kond like line of gs_it_kond,
gv_kbetr like konv-kbetr,
gv_disc type char10,
gv_perc TYPE i.
Ive declared the gv_disc type cha10.
Regards
2010 Apr 20 8:01 AM
hi,
ok fine then in concatenate in palce of gv_disc jst write gv_disc+0(2) this will only take 21 rest will not be displayed.
Thanks.
Gaurav.
2010 Apr 20 8:53 AM
Hi,
sorry..in future, if the value is like 10.50% then
Regards
2010 Apr 20 8:58 AM
Sir@ That's what i'm saying change the data decleration.Whats the error?
Edited by: Mishra.Manas on Apr 20, 2010 9:58 AM
2010 Apr 20 9:00 AM
Hi balaji,
Thats nice question i have the same doubt, what happens if 20.5 %
so here offset will not work, you have to findout the ways specified above.
Regards and Best wishes.
2010 Apr 20 9:09 AM
sorry..
If declare the gv_disc type p decimals 2. then
ive got the error..gv_disc must be chartecter-type field(data type c,n,d or t)
thank you
2010 Apr 20 7:51 AM
Hi,
KBETR is of type CURR with 2 decimals. define a variable with 3 decimals and use it.
Regards,
Srini.
2010 Apr 20 7:56 AM
hI,
Declare gv_perc as type of gs_kond-kbetr.
And remove left-justified and try i think it will work.
Regards and Best wishes.
2010 Apr 20 7:57 AM
Declare gv_disc of 2 decimals.
Change the decleration of
gv_kbetr like konv-kbetr,
gv_disc type char10,
gv_perc TYPE ias per your requirement.
The issue lies in data decleration.
data: gv_disc type p length <n> decimals 2Edited by: Mishra.Manas on Apr 20, 2010 8:58 AM
2010 Apr 20 8:12 AM
Thank you for reply.
If i take gv_disc type p. then sys gives error.
Regards
2010 Apr 20 8:14 AM
2010 Apr 20 8:27 AM
Hi ,
data : L_KWERT type KWERT.
Loop at gs_it_kond into gs_kond where kschl = 'RA00'.
IF gs_kond-kbetr < 0.
gs_kond-kbetr = gs_kond-kbetr * -1.
l_KWERT = gs_kond-kbetr / 10 .
clear l_kwert.
ENDIF.
gv_perc = gs_kond-kbetr.
endloop.
WRITE gv_perc TO gv_disc LEFT-JUSTIFIED.
concatenate gv_disc '%' into gv_disc separated by space.
Regards.
Rajesh
2010 Apr 20 9:24 AM
hi,
nice point then do one thing seperate the value after piont in another variable and then concatenate it seperately with gv_disc. once u got xact value then concatenate it again with all other things by checking if fter point variable i intial then +0(2)
else +0(4) . here u have to concatenate 3 times thats it.
try it.
Thanks Gaurav.
2010 Apr 20 9:43 AM
hi,
Ive solved the problem. As Mr.Rajesh S told
lv_kwert = gv_kond-kbetr / 10.
gives the solution.
Thank you very much for every one..
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |