cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic report output in a webdynpro alv

Former Member
0 Kudos

Hi,

I have created a dynamic report in the R/3 system . In this report, i am creating a report program within the report and subsequently executing this dynamically created report and displaying in the ALV..

Is it possible to handle such a scenario in a webdynpro ALV. One option is to use ITS and display the report in the portal but is there some other way so that i can directly view this report in an alv grid in a view.

all help appreciated!!

regards,

Priyank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Priyank,

This could be one of the solution:

1] Run the report in background mode (using submit statement, dn't forget to give printer as LOCL), get the spool id programatically. Use the FM's CONVERT_OTFSPOOLJOB_2_PDF or CONVERT_ABAPSPOOLJOB_2_PDF.

Which returns the ouput of table tline, convert this to xtring and bind it to xtring attribute.

In view add a interactive form and bind the xstring attribute to the Interactive form.

By following the above steps, we can display the result in the PDF in WD ABAP.

2] The report result is ALV and in most of the cases we generally do not have function modules or any other easy way to get the output.

In such cases the best approach which we follow is, to run this in background mode and generate the spool and display the ouput in PDF.

3] But if intertactive form is not present in your requirement then we need to debug the logic of the report (if no FM or class present) and get the results and display it in the View.

You can create a service which takes the parameters of the report, submits it and

transfers the result to HTML. In a view you use an IFRame which takes the URL of the service and shows the result HTML.

just additionally read this thread,

Here an IFrame is used to display HTML output of report. But as IFRame gets obsolete the Suresh's solution seems to be pretty cool.

Hope this will help you!

Cheers,

Darshna.

Former Member
0 Kudos

Hi ,

Thanks for the response.

I also need the options like "Export to excel" and the likes that are available with the ALV. Also i need to run this online from the portal so i don't think background processing and then displaying spool output are going to work for me.

Let me explain my scenario a bit.

The output of the report is unpredictable, in the sense that i don't know the number of columns in the output ALV until runtime. Will it be possible to create a node in webdynpro in such a scenario that i can bind with the alv table.

Also, the output is produced by a dynamic program which i m creating at runtime, within another report program. Thus, the dynamic program generates the output for me. And since i will have to use an RFC if i want it in webdynpro then it means i need to know the structure of the table which i want to return from the function module. This structure is not known at design time so can't be specified in the RFC. How is it possible to transfer the output generated by dynamic program to the RFC function module, which does not know the structure of the output? and subsequently map this to a node in the context?

any further hints?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Priyank,

Please check this to create a structure dynamically and bind it to a context. If you would know your exact structure name at runtime, you can use the method cl_wd_dynamic_tool=>create_nodeinfo_from_struct to create your structure. If you will not get to know the name of the structure at all, but will get only a set of fields, use Regina's method of adding each attribute to the context node. The binding can be done using field symbols.

Hope this helps.

Regards,

Nithya