cancel
Showing results for 
Search instead for 
Did you mean: 

Calling WD within a report

former_member210563
Participant
0 Kudos

Hi,

I have a made a report that shows data in ALV and that is fine as it is.

However, I now want to enhance the report with an option to show the data in a WD View.

I would like to make it optional to the user; either they use the ALV Grid output or they show the data in WD.

How can I use the data from my report in a WD and view it afterwards ? Is it possible ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have the same exact requirement and I adopted this method.

First, you will need to EXPORT the final ITAB to the memory in your custom report.



    EXPORT t_data[] TO MEMORY ID sy-uname.

Lastly, SUBMIT the report and IMPORT the ITAB[] in your WDPA. Don't forget to bind the ITAB[] to your CONTEXT.



      wd_assist->m_submit_report(
        EXPORTING
          iv_cprog     = 'YP40_ZRHRHE08A'
          iv_param     = 'X'
          iv_begda     = iv_begda
          iv_endda     = iv_endda
          it_pernr     = it_pernr
          it_bukrs     = it_bukrs
          it_stat2     = it_stat2
          it_werks     = it_werks
          it_btrtl     = it_btrtl
          it_persg     = it_persg
          it_persk     = it_persk
          it_abkrs     = it_abkrs
        CHANGING
          et_table_t   = et_table_t ).

      lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
      lo_nd_table->bind_table( et_table_t ).

I won't say this is the best way of doing it but at least this works for me flawlessly.

Hope this helps.

former_member210563
Participant
0 Kudos

What requirements are there to the WD Component.

One windows with one view and a table layout with the number of columns from the ALV ???

Edited by: Peter C. Sandgaard on Sep 7, 2011 12:05 PM

Former Member
0 Kudos

Hi,

as I understand it, you have a regular ABAP report that shows an ALV. You want to call a WDA from within this report, right? This can be done by assigning your WDA to a transaction: Create a transaction in SE93, make it call transaction WDYID with the application name as one of the parameters. Here's a link to a blog showing how it's done:

http://help.sap.com/saphelp_nw04s/helpdata/en/43/27ca50d51e0b19e10000000a1553f6/content.htm

You'd need to pass the data somehow. One way would be to store the ALV data in a Z* table... then have the WDA show an ALV based on the retrieved data.

Regards,

Trond

saravanan_narayanan
Active Contributor
0 Kudos

Hello,

To pass the data from report to webdynpro, you can create a subroutine in the same report and call the same from webdynpro

PERFORM <subroutine name> IN PROGRAM <report name.>

BR, Saravanan