cancel
Showing results for 
Search instead for 
Did you mean: 

Print PDF without viewing

Former Member
0 Kudos

Hi all,

I have spent the entire day searching and I see many posts about embedding Adobe forms in WD4A but no one gives an answer on how to print without seeing the PDF first. This seems like it is a standard feature many would want.

I have built an application that displays project forecasting data. When the user presses print it jumps to a view containing an interactive form (XML interface). This is perfect. Now the user has informed me that they would like to print the forecasting of all WBS elements on a project in one go. I.E. not pressing print on the screen each time.

First I thought I'd write a SAPGUI program to do it but then realised I have no way to write the XML for the interface.

Secondly I built a new WD4A application for mass printing. This has the potential to work as I start with a selection screen then once 'EXEC' is pressed I collect all the data. For each WBS I can call the view containing the PDF element and somehow print it without displaying.

Does anyone have any idea's on this one?

I have tried calling the PDF view and returning straight back to the main view hoping that the XML of the PDF including the data would be in my context so that I could then use the standard OPEN/CLOSE JOB way of sending it to the printer. This does not load any XML into the context (yes it is bound). The reason for this probably that my outbound plug is in the initialization method.

Any thoughts?

Thanks all!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ok, sorted it out myself.

For furure reference, here is the code:


  DATA: lo_node       TYPE REF TO if_wd_context_node,
        lv_xml          TYPE xstring.

    lo_node = wd_context->get_child_node( name = wd_this->wdctx_detail_pdf_data ).

    CREATE OBJECT lo_adobe
      EXPORTING
        i_form_name = 'FORM NAME'.

    lv_xml = lo_adobe->get_wd_context_as_xml( data_source = lo_node ).
    wd_this->print_pdf( xml_data = lv_xml ).

ashish_shah
Contributor
0 Kudos

Thanks for sharing the solution.

What should be type of lo_adobe?

Regards,

Ashish Shah

rub_alfonso
Explorer
0 Kudos

Hi ChrisOrme,

I´m not sure about what "wd_this->print_pdf( xml_data = lv_xml )" is.

Is a method created by yourself ? -->>in that case, could you write some code please ?

or ... is an standard method ?.

Thank you !!

Regards !!

Former Member
0 Kudos

Hi,

It's a method I wrote. Within it I just call the normal function modules for printing a form passing the XML to the form function. By normal functions, I'm talking about:

OPEN_JOB

(the one to get the dynamically generated function from the form name)

Call the dynamic function

CLOSE_JOB

Sorry I can't be more helpful, I'm not at work at the moment.

Cheers

Answers (3)

Answers (3)

mdkaleel
Explorer
0 Kudos

How to print the PDF raw data

   wd_this->print_pdf( xml_data = lv_xml )

Thanks,

Kaleel

Former Member
0 Kudos

Hi,

Sorry about missing that off. It's kind of important:

lo_adobe type ref to cl_wd_adobe_services,

Former Member
0 Kudos

No one???