Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Print dynamic document without viewing it

Former Member
0 Likes
367

Hi Guys,

I have a problem with the class cl_dd_document.

The manual says that it is possible to print a dd_document without viewing it, it says:

1. Build document

2. Merge document

3. Print document

Until step 2 theres no Problem, but when i call the method print_document( ) the report crashes.

The dump information indicates that there's a null-pointer-exception for a html_control.

is it impossible to call this method, without displaying the document in a custom control first?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
335

Hi,

if you are in ECC 5.0 version then check the example <b>DD_STYLE_TABLE</b> there you have option to print in the output , it is working fine.place a button in the screen and when you click on it , in PAI do this code.

MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.
    WHEN 'BACK'.                       "Beenden
      LEAVE PROGRAM.
    <b>WHEN 'PRN'.
      CALL METHOD DO->PRINT_DOCUMENT
              EXPORTING REUSE_CONTROL = 'X'</b>.

regards

vijay

2 REPLIES 2
Read only

Former Member
0 Likes
336

Hi,

if you are in ECC 5.0 version then check the example <b>DD_STYLE_TABLE</b> there you have option to print in the output , it is working fine.place a button in the screen and when you click on it , in PAI do this code.

MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.
    WHEN 'BACK'.                       "Beenden
      LEAVE PROGRAM.
    <b>WHEN 'PRN'.
      CALL METHOD DO->PRINT_DOCUMENT
              EXPORTING REUSE_CONTROL = 'X'</b>.

regards

vijay

Read only

0 Likes
335

Hi vijay,

this report is a good demonstration but it it can't solve the problem.

I have to call the method display_document(parent=...) first, that means i need a custom control filled with the html control. Otherwise the report will crash.

regards

benjamin