07-22-2010 4:10 AM
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
07-22-2010 5:22 AM
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
07-22-2010 5:38 AM
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