cancel
Showing results for 
Search instead for 
Did you mean: 

Using FormattedView Element

former_member552974
Participant
0 Kudos

Hello Everyone,

I admit that I am rather new to Abap Web Dynpro and I have a question. I am trying to use the FormattedView element to display a table of text (a few paragraphs actually) and I cannot seem to get this to work. I can get the first line on the screen, but not the entire table. I have searched this forum and tried a few things, but can't seem to get it to work and I am hoping that someone can help.

I have a Node called 'Detail' and an Attribute called 'Line' The Attribute 'Line' has a context as Type BAPIDESC-LINE. The Cardinality of the Node 'Detail' is 0-N.

Below is my latest version of the code that I have.

DATA node_detail TYPE REF TO if_wd_context_node.

DATA elem_detail TYPE REF TO if_wd_context_element.

DATA stru_detail TYPE wd_this->element_detail.

DATA it_detail TYPE TABLE OF wd_this->element_detail.

node_detail = wd_context->get_child_node( name =

wd_this->wdctx_detail ).

MOVE 'this is a test' TO stru_detail.

APPEND stru_detail TO it_detail.

MOVE 'this is a test of a second line' TO stru_detail.

APPEND stru_detail TO it_detail.

node_detail->bind_table( new_items = it_detail

set_initial_elements = abap_true ).

I have also tried the set_attribute method but could not get it to work either. Can anyone offer any advice?

Best Regards,

Scott

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Scott,

Check the mapping of your 'data source' property of the Formatted text view element and the 'text' property. Check the WDR_TEST_MISC WDP component.

Also go through the following documentation for an example:

http://help.sap.com/saphelp_nw04s/helpdata/en/77/3545415ea6f523e10000000a155106/frameset.htm

Go to Reference->User Interface Elements->text Category->FormattedTextView to read the documentation for the same.

Regards,

Wenonah

former_member552974
Participant
0 Kudos

Thank you for the feedback.

I have actually looked at WDR_TEST_MISC in the past and the problem that I have with this is that the format of the text (spacing, indentions, etc) is not kept. The method is using the Set Attribute method to display text.

wd_context->set_attribute( name = 'TEXT' value = text ).

The issue that I am running into with this example is that Text is of type string (not a table). Does anyone know of a way (or an example that I maybe overlooking) where text is displayed on the screen and the format is kept in place?

Best Regards,

Scott