Application Development 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: 

how to move "write statements" to a internal table...

Former Member
0 Kudos

hi experts.

i did "write statement" as follows

----


| a | b | c | d |

----


and then i want to insert to internal table after the screen contents as above.

the internal table exist only one field as follows.

data: begin of gt_itab,

line type char255,

end of gt_itab.

can i do this one?

i wish your answer.

thanks.

Regards

FM.

Edited by: yuntae kim on Jun 4, 2009 3:07 PM

1 ACCEPTED SOLUTION

former_member555112
Active Contributor
0 Kudos

Hi,

do you want the contents in the internal table as follows:

-


a

b

c

d

-


I mean with the horizontal lines and vertical lines??

Please try as follow:-

data : wa like line of gt_itab.

wa-line = '--------------------'
append wa to gt_itab.

concatenate '|' 'a' '|' 'b' '|' 'c' '|' 'd' '|' into wa-line.
append wa to gt_itab.

wa-line = '--------------------'
append wa to gt_itab.

Regards,

Ankur Parab

4 REPLIES 4

former_member555112
Active Contributor
0 Kudos

Hi,

do you want the contents in the internal table as follows:

-


a

b

c

d

-


I mean with the horizontal lines and vertical lines??

Please try as follow:-

data : wa like line of gt_itab.

wa-line = '--------------------'
append wa to gt_itab.

concatenate '|' 'a' '|' 'b' '|' 'c' '|' 'd' '|' into wa-line.
append wa to gt_itab.

wa-line = '--------------------'
append wa to gt_itab.

Regards,

Ankur Parab

Former Member
0 Kudos

Hi, you can try to export the list to memory. Like the code below:

DATA: tg_str TYPE TABLE OF listzeile,

tl_mem TYPE TABLE OF abaplist,

ilist TYPE TABLE OF abaplist WITH HEADER LINE.

      • EXPORT LIST TO MEMORY

CALL FUNCTION 'LIST_TO_MEMORY'

EXPORTING

list_index = 0

TABLES

listobject = ilist

EXCEPTIONS

empty_list = 1.

      • READ THE LIST

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = tl_mem

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

EXIT.

ENDIF.

      • CHANGE LIST TO ASCII

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

listasci = tg_str

listobject = tl_mem

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

IF sy-subrc <> 0.

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

EXIT.

ENDIF.

On table tg_str you gonna have the:

-


a

b

c

d

-


I hope it helps.

0 Kudos

thanks Bruno.

how can i to do if i don't display to the write-screen?

Regards.

FM

0 Kudos

HI,

If you do not want to display then just append the values in an internal table.

Regards,

Ankur Parab