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

class cl_dd_document method add_text

Former Member
0 Likes
3,308

Hi,

I add several texts to my document which I display in a container.

Example:


VKORG: 1200 - 1300
SYSTEM_INFORMATION: Productiv System

But what I want is


VKORG:                    1200 - 1300
SYSTEM_INFORMATION:       Productiv System

I have try to use the method add_gap befor I add the values of the text to the document, the problem is that the length of the textfield is different.

Can I solve this with another method of the class or with a paramter ?

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,843

Use quick table


data: r_document type ref to cl_dd_document,
         r_qtable type ref to cl_dd_table_area.  "quick table

call method r_document->add_table
          exporting 
              no_of_columns = 2
          importing 
              tablearea = r_qtable.

"first column
call method r_qtable->add_text
        exporting text = 'VKORG:'.

"second column
call method qtable->add_text
         exporting text = '1200 - 1300'.

"add this new filled row
call method qtable->new_row.


"first column
call method r_qtable->add_text
        exporting text = 'SYSTEM_INFORMATION:'.

"second column
call method qtable->add_text
         exporting text = 'Productiv System'

"add another row
call method qtable->new_row.

More info [here|http://help.sap.com/saphelp_nw70/helpdata/EN/b6/ab3a7803ac11d4a73f0000e83dd863/frameset.htm]

Regards

Marcin

6 REPLIES 6
Read only

MarcinPciak
Active Contributor
0 Likes
1,844

Use quick table


data: r_document type ref to cl_dd_document,
         r_qtable type ref to cl_dd_table_area.  "quick table

call method r_document->add_table
          exporting 
              no_of_columns = 2
          importing 
              tablearea = r_qtable.

"first column
call method r_qtable->add_text
        exporting text = 'VKORG:'.

"second column
call method qtable->add_text
         exporting text = '1200 - 1300'.

"add this new filled row
call method qtable->new_row.


"first column
call method r_qtable->add_text
        exporting text = 'SYSTEM_INFORMATION:'.

"second column
call method qtable->add_text
         exporting text = 'Productiv System'

"add another row
call method qtable->new_row.

More info [here|http://help.sap.com/saphelp_nw70/helpdata/EN/b6/ab3a7803ac11d4a73f0000e83dd863/frameset.htm]

Regards

Marcin

Read only

0 Likes
1,843

How can I control in which column I want to insert the values?

The problem is that I have one textfield and one or more values for this field like


vkorg: 1200 -1300
           1400 - 1500

and so on with other textfields and values.

Read only

0 Likes
1,843

So you have to use standard table instead. Refer [Creating a Standard Table |http://help.sap.com/saphelp_nw70/helpdata/EN/10/24685b055711d4a7410000e83dd863/frameset.htm] and [example coding|http://help.sap.com/saphelp_nw70/helpdata/EN/10/246879055711d4a7410000e83dd863/frameset.htm]

Using it first you can add the column add_column then you work with this column adding text to it column->add_text

Regards

Marcin

Read only

0 Likes
1,843

is it possible to delete the lines of the table? I don't want to have lines wihtin the values.

Read only

0 Likes
1,843

I find it, its the parameter "border" which you can set to 0.

Read only

0 Likes
1,843

CALL METHOD r_document->add_table
   EXPORTING no_of_columns               = 2
              border                      = '0'   "<- disable border
  ...

Regards

Marcin