Skip to Content
0
Dec 10, 2007 at 11:03 AM

ALV Report

25 Views

Hi friends,

I am using the below code now i want the result in ALV Grid. is it possible? please giv the solution.

DATA BEGIN OF itab_list OCCURS 0.

INCLUDE STRUCTURE abaplist.

DATA END OF itab_list.

DATA: BEGIN OF vlist OCCURS 0,

field1(1000) TYPE c,

END OF vlist.

SUBMIT rahafa01 EXPORTING LIST TO MEMORY VIA SELECTION-SCREEN AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = itab_list

EXCEPTIONS

not_found = 4

OTHERS = 8.

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

list_index = -1

  • with_line_break = ' '

TABLES

listasci = vlist

listobject = itab_list

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF sy-subrc NE '0'.

WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.

ELSE.

LOOP AT vlist.

WRITE:/ vlist-field1.

MOVE vlist-field1 TO i_main.

APPEND i_main.

ENDLOOP.

CLEAR vlist. REFRESH vlist.

WRITE: ' success '.

ENDIF.

Thanks & Regards,

Vallamuthu.M