cancel
Showing results for 
Search instead for 
Did you mean: 

WD ABAP - ALV data into Xstring

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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 ).

OttoGold
Active Contributor
0 Kudos

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

OttoGold
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Otto,

Thanks for the quick response. When I select the Z push button on ALV tool bar, how do I get the ALV data.