Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

READ CURRENT LINE

Former Member
0 Likes
2,127

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.

6 REPLIES 6
Read only

Vijay
Active Contributor
0 Likes
1,034

hi

just declare the variable ' lv_int' of the same type as the field having data.

regards

vijay

reward points if helpfull

Read only

Former Member
0 Likes
1,034

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..

Read only

Former Member
0 Likes
1,034

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.

Read only

0 Likes
1,034

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?

Read only

0 Likes
1,034

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.

Read only

Former Member
0 Likes
1,034

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