Skip to Content
avatar image
Former Member

WD ABAP - ALV data into Xstring

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 03, 2009 at 10:41 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • Dec 03, 2009 at 12:16 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 10, 2009 at 09:48 PM

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

    Add comment
    10|10000 characters needed characters exceeded