on 12-03-2009 10:34 AM
Hello,
In a WD ABAP application, there is a ALV table and on the ALV tool bar I have a new push button, when it is pressed, I need to extract the ALV data(along with column names) into XSTRING, which is similar to the data that comes into PDF when 'Printversion' button is pressed. Is there any way to do this?
Thanks.
Nagendra
Solved the problem. The requirement was to convert ALV into PDF xstring. The sample code is .
DATA: lo_interfacecontroller1 TYPE REF TO iwci_salv_wd_table ,
lo_component TYPE REF TO cl_salv_wd_c_table,
lo_result TYPE REF TO cl_salv_wd_result_data_table,
lo_pdf TYPE REF TO cl_salv_wd_export_pdf,
lv_pdf_content TYPE xstring.
lo_interfacecontroller1 = wd_this->wd_cpifc_alv( ).
lo_component ?= lo_interfacecontroller1->get_services( ).
lo_result = lo_component->r_result_data.
CREATE OBJECT lo_pdf.
CLEAR: lv_pdf_content.
Call the following method to generate the xstring for PDF.
lo_pdf->execute(
EXPORTING
result_data = lo_result
r_component = lo_component
IMPORTING
resultstring = lv_pdf_content ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is easy, you need to have the data in the right structure to be able to display it in the ALV. So you just need to debug the point in code BEFORE your ALV gets displayed. I guess it will be some global variable which you´ll be able to use. Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
to convert DDIC data (that comes to/ from ALV) into XML use CALL TRANSFORMATION ID. ID is a Identity XSLT transformation to convert between DDIC and XML. String to Xstring you can do yourself I hope.
Have a nice day, Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.