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: 

Data download

Former Member
0 Kudos

Hi Folks,

I need to download VBAK & VBAP data based on selection thorough program.

How to add column headers when downloading... Since all columns are getting downloaded, it is difficult to give each and every field name manually. And there are some currency and numeric fields which not allows text (for headers).

I need to do this for both presentation & application servers.. gui_download and open dataset...

Thanks,

Chandra

2 REPLIES 2

Former Member
0 Kudos

Hi,

For column heading u define one structure with all the fields whcihu want to show in output.

Thne use following FM


CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name       = lv_struct
    CHANGING
      ct_fieldcat            = it_fieldcat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

For the Header Heading use this method * CALL METHOD im_ob_dyndoc_id->add_text*

Regards,

Pravin

Former Member
0 Kudos

Hi Chandra,

You can read the all the components in the table using the below code -

lo_struc_descr ?= cl_abap_typedescr=>describe_by_data(  ).
 lt_components = lo_struc_descr->get_components( ).

the field "name" in lt_components will have the name of the table field, which you use for your header.

Refer to the article below which has a sample code snippet -

http://divulgesap.com/blog.php?p=OTQ=

Thanks.

Ravi