Application Development and Automation 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: 
Read only

internal table

Former Member
0 Likes
688

Hi,

In which format the data in the internal table be stored.

Can I extract the internal table as a flat file to the PC. Please do not misunderstand my question as downloading the internal table to the PC using the FM "GUI_DOWNLOAD".

I would like to know in which format or the structure the data will be in the internal table in case of ALV report after the FM "REUSE_ALV_FIELDCATALOG_MERGE" and before the FM "REUSE_ALV_GRID_DISPLAY".

Thanks in advance for your suggestions.

etienne.

Moderator message: please use more descriptive subject lines from now on.

Edited by: Thomas Zloch on Jun 28, 2010 2:53 PM

4 REPLIES 4
Read only

Former Member
0 Likes
620

Hello!

the internal table is stored in the format of the fields of it. For example:

Internal table IT_DATA LIKE wa_data OCCURS 0.

Where wa_data is:

DATA: BEGIN OF wa_data ,

bukrs LIKE bkpf-bukrs,

gjahr LIKE bkpf-gjahr,

belnr LIKE bkpf-belnr,

END OF wa_data.

So, the it_data-gjahr is saved as NUMC4.

Bye!

Read only

Former Member
0 Likes
620

Well dont you get that from the structure reference of the internal table?

Read only

Former Member
0 Likes
620

Hi

the format of your internal table depends on the definition of the table.

If you have mentioned the field/s for your internal table at the time of definition then it will be saved in that format.

or if you have referred to a structure then the format will be according to the structure definition.

example.

data: begin of itab occurs 0,

name(20),

id type i,

address (500.

end of itab.

or

data: itab type standard table of mara with header line.

Read only

Former Member
0 Likes
620

Hi,

The Internal table can be directly downloaded using the FM GUI_DOWNLOAD.

The FM's REUSE_ALV_GRID_DISPLAY and any other FM's related to ALV are just to display the Internal table contents in report format.

The only thing you need to do while passing the Internal table to FM GUI_DOWNLOAD is pass the Filename, file type (ASC or BIN).

You can also use the method from the Class CL_GUI_FRONTEND_SERVICES as below.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename1 -


>Filename with complete path (Presentation server path)

filetype = c_file_type_asc -


> File type (ASCII or Binary)

CHANGING

data_tab = fp_t_download

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

not_supported_by_gui = 22

error_no_gui = 23

OTHERS = 24.

IF sy-subrc <> 0.

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

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

gv_err = c_x.

ENDIF.

Regards,

Santosh Kumar Mukka.