‎2007 Dec 19 8:05 AM
Hi,
I am reading one line from classical report using READ CURRENT LINE statement.
If i select one line then the value gets stored in entire row. I have one variable(lv_int) having data type INTEGER.
If the value of variable(lv_int) 100,236 then i m getting dump but if the value of variable lv_int = 60 then I am getting desired result.
How I can solve the problem so that I can read the value of variable LV_INT = 100,236.
‎2007 Dec 19 8:10 AM
‎2007 Dec 19 8:22 AM
Hi,
Integer variable doesnt store decimal values.
so declare your variable should be packed or it should be the same data type from where you are getting this value.
open database table and see data type of that variable i.e. you are getting 103.26 from some data base field na.
your variable also same type as dat base field type and length.
Thanks
Sivaparvathi
Please reward points if helpful..
‎2007 Dec 19 8:39 AM
Hi neha,
Are you using this statement along with FILED value or not?
reason I'm asking
If you use READ CURRENT LINE FIELD VALUE var
gives you dump. but if you use only READ CURRENT LINE.
it's not giving any dump. check this below statments.
DATA : var TYPE i VALUE '5034234'.
AT LINE-SELECTION.
READ current LINE field value var. "error
READ current LINE. "OK
WRITE 😕 var.
START-OF-SELECTION.
WRITE 😕 var.
HIDE var.
‎2007 Dec 19 9:14 AM
Hi Perez,
I wanted to read the one field of selected row.
How I can write the read current line statement for above mentioned problem.
could you pls elobrate?
‎2007 Dec 19 9:37 AM
Hi Neha
there are 2 ways.
READ CURRENT LINE FIELD VALUE <fieldname>.
READ CURRENT LINE.
first statement does'nt work on numeric type fields especially when there are commas ',' like 5,600,00.
it'll give you dump.
but always works on CHAR type.
so in your case use second statement. though you're reading entire row but use only single field what ever you want.
check this example.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE eban-matnr,
menge LIKE eban-menge,
END OF itab.
AT LINE-SELECTION.
READ CURRENT LINE.
WRITE 😕 itab-menge.
START-OF-SELECTION.
SELECT matnr menge INTO TABLE itab FROM eban UP TO
10 ROWS WHERE matnr NE space.
LOOP AT itab.
WRITE 😕 itab-matnr, itab-menge.
HIDE : itab-matnr, itab-menge.
ENDLOOP.
‎2007 Dec 19 10:40 AM
Hi,
declare lv_int as :
data: lv_int type p decimals 4.
If you declare like this you will get value with decimals.
thanks
venkat