cancel
Showing results for 
Search instead for 
Did you mean: 

doubt on LIST_FROM_MEMORY & WRITE_LIST

Former Member
0 Kudos

Hi Friends,

I ve used a Sumbit (PRG1) statement with "EXPORTING LIST TO MEMORY AND RETURN" and then used a call funtion "LIST_FROM_MEMORY" which has the tables listobject as an internal table "LIST_OUTPUT(Of type ABAPLIST)"

then iam calling another funtion "WRITE_LIST" to write what the program (PRG1) returns .....

My List from PRG1 is like this

A 1

B 3

C 2

But i want to output as

ZX A 1

VB B 3

NJ C 2

How can i do this ?????

Expecting your answers

Thanks in advance

Cheers

R.Kripa.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Oh.....

yeah i ve seen the format it builds up the internal table ;-( ..

But i want to add something extra to that output which i tried but dint succeed ;-(

Anyway thanks -)

Any positive inputs are always welcomed

Cheers

R.Kripa

former_member188685
Active Contributor
0 Kudos

Hi,

this way you can do it...

  data:l_lin  like sy-tabix,
       l_lint like sy-tabix,
       l_date(10),
       it_list like abaplist occurs 0,
       it_asc_temp like it_asc occurs 0 with header line,
       l_newline(2) type x value '0D0A'.
*-Get the report output from memory
  call function 'LIST_FROM_MEMORY'
    TABLES
      listobject = it_list
    EXCEPTIONS
      not_found  = 1
      others     = 2.

  if sy-subrc = 0.
*-Get the report output from memory in ascii format
    call function 'LIST_TO_ASCI'
      TABLES
        listasci           = it_asc
        listobject         = it_list
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        others             = 3.

    if sy-subrc = 0.

      it_asc_temp[] = it_asc[].
      refresh:it_asc.
      clear it_asc.

*-Start of tag
      it_asc-txt = '<pre><code> <Font size=2>'.

      concatenate '' l_newline into it_asc+248(2) ."in byte mode.
*IT_ASC+248(2) = L_NEWLINE.
      append it_asc.
      clear it_asc.
*-List output
      loop at it_asc_temp.
        it_asc  = it_asc_temp.
        concatenate '' l_newline into it_asc+248(2).
        append it_asc.
        clear it_asc.
      endloop.

*-End of tag
      it_asc-txt = '</font></code></pre>'.
      append it_asc.
      clear it_asc.

    endif.

endif.

Regards

vijay

Former Member
0 Kudos

HI kripa,

1. LIST_FROM_MEMORY

This FM extracts the list from memory

in some raw data / compressed format,

which only it can understand.

Same is the case with write_list.

2. so its not possible to directly

extract the data as it is, and

format/merge it with our own data.

regards,

amit m.