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

Doubt regarding print using CL_DD_DOCUMENT class

Former Member
0 Likes
1,021

Hi to All,

I want to use CL_DD_DOCUMENT class to display my internal table contents in special format. i having some doubts regarding this

first- how shall i display contents of internal table into table using this class? i need to add some subcolumns and subrows into

main columns how should i include column within column..what will be the method for that??

second- how shall i display the document into landscape format?? i already tried with PRINT_DOCUMENT method

Kindly help.

Thanks

Edited by: Pranjal11 on Nov 19, 2009 10:35 AM

5 REPLIES 5
Read only

matt
Active Contributor
0 Likes
816

Have you read the online help? http://help.sap.com/saphelp_nw04/helpdata/en/b6/ab3a8103ac11d4a73f0000e83dd863/frameset.htm There are coding examples in there. You need to use cl_dd_table_area or cl_dd_table_element.

For landscape printing, I believe this is handled by choosing the appropriate selection on the print dialog - it's got nothing to do with the CL_DD_DOCUMENT class.

matt

Read only

Former Member
0 Likes
816

Hi Matt,

Thanks for reply. Yes i have read the online documents. But my requirement is that i need to break main columns into subcolumns,

suppose i have 5 main columns with heading then i want to split first column into 4 equal parts, 2nd into 3 equal parts without breaking heading and also i need split 1st row into some equal number of rows. how could i achive this? and for landscape option i already checked in dialog box, but i'm not getting that option.

Thanks

Read only

matt
Active Contributor
0 Likes
816

Well, I can't help you with the landscape printing -that's a basis issue, I believe.

You can nest tables. So you create a tablearea with 5 columns. Then in the first column, you put a tablearea with 4 columns etc.

Read only

Former Member
0 Likes
816

Hi Matt,

Sorry i'm very new to OOP's .Can you give example to me for nested tables? i'm trying with tablearea but i'm getting exact alignment .

Thanks

Edited by: Pranjal11 on Nov 20, 2009 9:53 AM

Edited by: Pranjal11 on Nov 20, 2009 9:54 AM

Read only

matt
Active Contributor
0 Likes
816

Well, you can't always get exactly what you want. But play around a bit.


  DATA: lr_table_area TYPE REF TO cl_dd_table_area,
        lr_table      TYPE REF TO cl_dd_table_element,
        lr_leftcol    TYPE REF TO cl_dd_area,
        lr_rightcol   TYPE REF TO cl_dd_area.

  DATA: lr_leftcoltable_area  TYPE REF TO cl_dd_table_area,
        lr_leftcoltable       TYPE REF TO cl_dd_table_element,

  IF reuse_ref_flag IS INITIAL.
    CREATE OBJECT me->r_header.
  ENDIF.

* Split header into two areas - one for selections,
* one for report specific stuff
  me->r_header->add_table( EXPORTING no_of_columns = 2
                                     border        = '1'
                           IMPORTING table         = lr_table
                                     tablearea     = lr_table_area ).
  lr_table->add_column( IMPORTING column = lr_leftcol ).
  lr_table->add_column( IMPORTING column = lr_rightcol ).

r_header is ref to cl_dd_document. lr_table_area is a table with 2 columns in that document - lr_leftcol and lr_rightcol.

I now add a table inside lr_leftcol.

  lr_left_col->add_table( EXPORTING no_of_columns = 3
                                border        = '0'
                                width         = '100%'
                      IMPORTING table         = lr_leftcol_table
                                tablearea     = lr_leftcol_table_area ).

I can now add information into lr_leftcol_table_area.

I hope that gives you some idea.