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: 

CALL FUNCTION 'LIST_TO_ASCI'

Former Member
0 Kudos

Hi i have written the code as

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

LIST_INDEX = -1

WITH_LINE_BREAK = ' '

TABLES

listasci = it_asc

LISTOBJECT = it_list

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3

Now have to fetch only one value stored in the table it_list.How to fetch it.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The ASCII list will be in the internal table "it_asc". You need to loop and identify the row you need.

Loop at it_asc into wf_asc.

...

if sy-index = 1.

Print "Row I want".

Exit.

endif.

.

Endloop.

Thanks and Best Regards,

Dinesh.

4 REPLIES 4

Former Member
0 Kudos

Hi,

The ASCII list will be in the internal table "it_asc". You need to loop and identify the row you need.

Loop at it_asc into wf_asc.

...

if sy-index = 1.

Print "Row I want".

Exit.

endif.

.

Endloop.

Thanks and Best Regards,

Dinesh.

Former Member
0 Kudos

Hi, the listasci table of FM list_to_asci remains empty to me, although the contents of listobject table can be displayed correctly using FM DISPLAY_LIST. I can even see when debugging FM list_to_asci that when it scrolls through the lines of listobject, it is able to convert data into listasci, however, at the end this last variable is empty!

The way I call list_to_asci is:

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

LIST_INDEX = -1

  • WITH_LINE_BREAK = ' '

  • IMPORTING

  • LIST_STRING_ASCII = asci_string

  • LIST_DYN_ASCII =

TABLES

LISTASCI = asci_tab

LISTOBJECT = mem_tab

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3

.

By the way, the list object is from spool.

Can anyone help, pls??

-- Adam

0 Kudos

Hi,

try to use follwing TYPE for your tables:

DATA asci_tab TYPE text180.
DATA mem_tab TYPE abaplist.

      CALL FUNCTION 'LIST_TO_ASCI'
        TABLES
          listasci           = asci_tab 
          listobject         = mem_tab 
        EXCEPTIONS
          empty_list         = 1
          list_index_invalid = 2
          OTHERS             = 3.

Regards,

David

0 Kudos

Yesss! It works now.

Thanks a lot, David

Ádá