‎2009 Nov 19 9:35 AM
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
‎2009 Nov 19 3:18 PM
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
‎2009 Nov 20 5:23 AM
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
‎2009 Nov 20 6:38 AM
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.
‎2009 Nov 20 8:53 AM
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
‎2009 Nov 20 9:46 AM
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.