cancel
Showing results for 
Search instead for 
Did you mean: 

OTR long texts

Former Member
0 Kudos

Hello,

I must display several popup windows with help texts. These texts are longer than 255 characters for an OTR short text. I find no way to create and assign an OTR long text to any text-type UI element in my web dynpro application.

Can someone suggest how to work with long texts ??

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

the following code snippet is an example for binding the SAP script text to a FormattedTextView UI element:

data:

wa_thead type thead,

lt_tline type table of tline,

lo_formatted_text type ref to CL_WD_FORMATTED_TEXT,

l_theadname type THEAD-TDNAME,

l_text type string.

data:

Node_Tip_Text type ref to If_Wd_Context_Node,

Elem_Tip_Text type ref to If_Wd_Context_Element,

Stru_Tip_Text type If_Tips=>Element_Tip_Text ,

Item_FORMATTED_TEXT like Stru_Tip_Text-FORMATTED_TEXT.

  • get message manager

data: l_current_controller type ref to if_wd_controller,

l_message_manager type ref to if_wd_message_manager.

l_current_controller ?= wd_This->Wd_Get_Api( ).

CALL METHOD l_current_controller->GET_MESSAGE_MANAGER

RECEIVING

MESSAGE_MANAGER = l_message_manager.

  • Get the text element from the context

Node_Tip_Text = wd_Context->get_Child_Node( Name = IF_TIPS=>wdctx_Tip_Text ).

Elem_Tip_Text = Node_Tip_Text->get_Element( ).

move wd_assist->C_TIP_ENVIRO to l_theadname.

  • Read the Standard Text defined for this Tip in the logon language

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'ST'

LANGUAGE = sy-langu

NAME = l_theadname

OBJECT = 'TEXT'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

IMPORTING

HEADER = wa_thead

TABLES

LINES = lt_tline

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

IF SY-SUBRC <> 0.

" If Standard Text couldn't be read for this language or another reason, display

" error message

CALL METHOD l_message_manager->REPORT_T100_MESSAGE

EXPORTING

MSGID = SY-MSGID

MSGNO = SY-MSGNO

MSGTY = SY-MSGTY

P1 = SY-MSGV1

P2 = SY-MSGV2

P3 = SY-MSGV3

P4 = SY-MSGV4

  • MSG_USER_DATA =

.

ELSE.

" Convert the Standard text into Web Dynpro Formatted Text

CALL METHOD CL_WD_FORMATTED_TEXT=>CREATE_FROM_SAPSCRIPT

EXPORTING

SAPSCRIPT_HEAD = wa_thead

SAPSCRIPT_LINES = lt_tline

RECEIVING

FORMATTED_TEXT = lo_formatted_text.

" Set the Formatted Text in the context for displaying in view

Elem_Tip_Text->set_Attribute(

exporting

Name = `FORMATTED_TEXT`

Value = lo_formatted_text->m_xml_text ).

ENDIF.

Former Member
0 Kudos

Hi,

Yes,you can use SO10 transaction to create your own text.

And use function module READ_TEXT to read your text in tline table format.

Then you can use it to display in pop up window.

Regards,

Divya.S

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

If text which is longer than 255 characters, or needs to be formatted into paragraphs, u need to create a standard SAP script text using transaction SO10. Once u hve saved and hv the text name, binding the SAP script text to a FormattedTextView UI element .

regards ,

Amit Saini