Skip to Content

Hierarchial list output to internal table

Hi Folks,

REPORT ZMB51 .

DATA LIST_TAB TYPE TABLE OF ABAPLIST.

<b>DATA: BEGIN OF olist OCCURS 0,

filler1(1500) TYPE c,

END OF olist.</b>

submit RM07DOCS EXPORTING LIST TO MEMORY

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LIST_TAB

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC = 0.

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

LIST_INDEX = -1

TABLES

<b>LISTASCI = oLIST</b>

LISTOBJECT = LIST_TAB

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

*

  • BREAK-POINT.

write:/ sy-subrc.

ENDIF.

The above program is getting the MB51 output into an internal table.So far it is fine but this internal table can't be used for further processing.I want to get the MB51 output into an internal table which can be used for further processing.

data:begin of itab1 occurs 0,

matnr like mara-matnr,

maktx like makt-maktx,

werks like vbrp-werks,

sloc like zmmstoragebin-storage,

bwart like mseg-bwart,

mblnr like mseg-mblnr,

zeile like mseg-zeile,

budat like bkpf-budat,

menge like mseg-menge,

meins like mara-meins,

end of itab1.

If I delcare an internal table as above and given itab1 instead of olist it is going for dump.How to achieve this?

Thanks,

K.Kiran.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 19, 2007 at 10:45 AM

    Hi Kiran,

    You will be getting all the fields in the concatenation form into the string of oLIST.

    Is there any delimitor like space or Tab between the fields or not?

    so try to use Split the oLIST-filler1 into different fields at the delimiter

    or you have to offet oLIST-filler1 to different fields

    like example

    itab1-matnr = oLIST-filler1+0(18)

    itab1-werks = oLIST-filler1+19(4) like that

    based on the fields data in oLIST-filler1 you have to do it

    Regards

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

    • Anji,

      Can you please let me know any example which demonstrates splitting at delimiter.

      split olist at ' ' into table itab1 is giving me a dump saying that it can be used with internal table of character type .....etc.

      Thanks,

      K.Kiran.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.