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 can I get data which i need after 'SUBMIT Standard Program'?

Former Member
0 Kudos

I want to use a standard report to get data.

Use follow code:

data gt_list like abaplist occurs 0 with header line.

submit rm06ek00 using selection-screen '1000'

with ek_vbeln = '0000012007'

with ek_vbelp = '000010'

with listu = 'BEST'

exporting list to memory

and return.

call function 'LIST_FROM_MEMORY'

tables

listobject = gt_list

exceptions

not_found = 1

others = 2.

But gt_list is a internal table record data with RAW type?

How can i get the correct data?

TKS a million~~

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use the FM



sy-lsind = sy-lsind - 1.

  CALL FUNCTION 'SAVE_LIST'
       EXPORTING
            list_index         = sy-lsind
       TABLES
            listobject         = abap_list
       EXCEPTIONS
            list_index_invalid = 1
            OTHERS             = 2.
  IF sy-subrc <> 0.
    RAISE list_index_invalid.
  ENDIF.

  IF p_ftype EQ 'HTML'.
*   Construct HTML file from output list
    CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
         EXPORTING
              template_name = 'WEBREPORTING_REPORT'
         TABLES
              html          = html_tab
              listobject    = abap_list
              listicons     = icontab.

    DESCRIBE TABLE html_tab LINES lineno.
    DESCRIBE FIELD html_tab LENGTH length.
    size = length * lineno.

    filetype = 'BIN'.
    data_tab[] = html_tab[].
*
  ELSEIF p_ftype EQ 'DAT'.

CALL FUNCTION 'LIST_TO_ASCI'
         EXPORTING
              list_index         = sy-lsind
         TABLES
              listasci           = data_tab
              listobject         = abap_list
         EXCEPTIONS
              empty_list         = 1
              list_index_invalid = 2
              OTHERS             = 3.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Please chnge the declaration of your internal table with the fields you want... Type ABAPLIST is of RAW type..

0 Kudos

Hello,

You have to use the FM: LIST_TO_ASCI after this if you want to manipulate with the data.

If you want to just write the data, then you can use FM: WRITE_LIST.

Please search in SDN for further details.

BR,

Suhas

0 Kudos

Yes...as Suhas mentioned call the below function module



* Convert the data to readable format
    CALL FUNCTION 'LIST_TO_ASCI'
         EXPORTING
              list_index         = -1
              with_line_break    = ' '
         TABLES
              listasci           = gt_asci_tab
              listobject         = gt_abap_list
         EXCEPTIONS
              empty_list         = 1
              list_index_invalid = 2
              OTHERS             = 3.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.

Former Member
0 Kudos

Hi,

Use the FM



sy-lsind = sy-lsind - 1.

  CALL FUNCTION 'SAVE_LIST'
       EXPORTING
            list_index         = sy-lsind
       TABLES
            listobject         = abap_list
       EXCEPTIONS
            list_index_invalid = 1
            OTHERS             = 2.
  IF sy-subrc <> 0.
    RAISE list_index_invalid.
  ENDIF.

  IF p_ftype EQ 'HTML'.
*   Construct HTML file from output list
    CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
         EXPORTING
              template_name = 'WEBREPORTING_REPORT'
         TABLES
              html          = html_tab
              listobject    = abap_list
              listicons     = icontab.

    DESCRIBE TABLE html_tab LINES lineno.
    DESCRIBE FIELD html_tab LENGTH length.
    size = length * lineno.

    filetype = 'BIN'.
    data_tab[] = html_tab[].
*
  ELSEIF p_ftype EQ 'DAT'.

CALL FUNCTION 'LIST_TO_ASCI'
         EXPORTING
              list_index         = sy-lsind
         TABLES
              listasci           = data_tab
              listobject         = abap_list
         EXCEPTIONS
              empty_list         = 1
              list_index_invalid = 2
              OTHERS             = 3.