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

largenumber

Former Member
0 Likes
761

hi this is my code to display the large num but i can only see it but how to display it can u help me out.

tables: zdetails1.

data: begin of i_details occurs 0,

rollno like zdetails1-zrollno,

name like zdetails1-zsname,

end of i_details.

BREAK-POINT.

*data: wa like line of i_details.

data: rno type i.

data: rno1 type i.

data: larg type i.

Select zrollno zsname from zdetails1 into table i_details.

sort i_details by rollno descending.

  • SORT i_details by rollno descending.

  • Read i_details into wa index 1.

*ENDSELECT.

if sy-subrc = 0.

MESSAGE i009(zsms) with 'records fetched'.

endif.

just abov is my code

6 REPLIES 6
Read only

Former Member
0 Likes
741

sort i_details by rollno descending.

Read i_details index 1 INTO wa.

write: wa-rollno.

Read only

Former Member
0 Likes
741

Cross post.

Read only

former_member585060
Active Contributor
0 Likes
741

Try this code

TABLES: zdetails1.

TYPES : BEGIN OF ty_details,

rollno LIKE zdetails1-zrollno,

name LIKE zdetails1-zsname,

END OF ty_details.

DATA: it_details TYPE TABLE OF ty_details,

wa_details TYPE ty_details.

SELECT

zrollno

zsname FROM zdetails1 INTO TABLE it_details.

SORT it_details BY rollno DESCENDING.

READ TABLE it_details INDEX 1 INTO wa_details.

WRITE 😕 wa_details-rollno.

Regards

Bala Krishna

Read only

Former Member
0 Likes
741

HI,

Declair a char type.

Assign that large no to it & display.

Regards

Rajendra

Read only

Former Member
0 Likes
741

Select zrollno zsname from zdetails1 into table i_details.

sort i_details by rollno descending.

if sy-subrc = 0.

MESSAGE i009(zsms) with 'records fetched'.

endif.

loop at idetails into wa.

write:/wa-zroll ,wa-zsname.

endloop.

Hope this helps.

thanks,

Rashmi.

Read only

matt
Active Contributor
0 Likes
741

>

> hi this is my code to display the large num but i can only see it but how to display it can u help me out.

>

>

> tables: zdetails1.

>

> data: begin of i_details occurs 0,

> rollno like zdetails1-zrollno,

> name like zdetails1-zsname,

> end of i_details.

Don't use internal tables with header lines; it's bad programming. Anyway, you don't need one. Use MAX. Something like this (may need tweaking).

DATA: BEGIN OF ls_details,
        rollno LIKE zdetails1-zrollno,
        name LIKE zdetails1-zsname,
      END OF ls_details.

SELECT max(zrollno) zsname FROM zdetails1 INTO ls_details.
IF sy-subrc = 0.
  " zsms(009) defined as: &1 &2 'records fetched'.
  MESSAGE i009(zsms) WITH ls_details-rollno ls_details-name.
  WRITE: / ls_details-rollno, ls_details-name, 'records fetched'.
ENDIF.