cancel
Showing results for 
Search instead for 
Did you mean: 

Text Formatting Issue

satrajit_chatterjee
Participant
0 Kudos

Hi Expert,

I have to display huge text in different format. I have giving an example here.


+Form can only be submitted if the following checks are successful:+
+1. Check all fields in Step 2 are completed+
+2. If Uploader Checked in Step 1 then step 3 must be populated with valid character	+
+3. If Validator Selected in Step 1 then Step 4 should be checked as follows:+

+	a. If SPU checked then valid selction must have been populated for SPU+
+	b. If BU checked then valid selction must have been populated for BU+
+	c. If BSC checked then valid selction must have been populated for BSC+
+	d. If Function checked then valid selction must have been populated for Function+
+	e. If Department checked then valid selction must have been populated for Department+

+4. If Reporter Checked in step 1 then one of the check boxes in Step 5 must be selected and at least one data selection in Step 7 have been completed.+
+5. If User Checked in step 1 then one of the check boxes in Step 6 must be selected and at least one data selection in Step 7 have been completed.+
+6. The Confidentiaity check box is populated and dated in Step 9+
+Inform the user what is missing and provide links to the appropriate sections which need to be amended.+

+Send confirmation to user to say form has been submitted successfully and should take 5 working days to complete the process once the approver has given their consent. You will be kepyt informed via e-mail that approval has been given	+

In this type, I have to display lot of text in 10 u2013 12 views. I can create text view or text area, but it is very difficult to display this type of formatting. Any one have any idea, Hiw I can display type of format easily.

Thanks in advance

Regards

Satrajit.

Edited by: Satrajit_1982 on Sep 28, 2011 6:19 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

I have excat solution for your problem. first you need to create the Z text object and ID using Tcode SE75. then you may want to develop Z transaction to maintain the long text using CREATE_TEXT FM etc...by this you can apply any formatiing.

Next steps are creating WDA where you can have textview UI element and map the text property to atteribute of type STRING.

then have below coding to set the attribute value,

SELECT tdobject

tdname

tdid

tdspras

INTO TABLE it_stxh

FROM stxh

WHERE tdobject EQ u2018Z_OBJECTu2019

AND tdname EQ v_name

AND tdid EQ u2018ZIDu2019

AND tdspras IN r_langu. "EQ sy-langu.

IF sy-subrc EQ 0.

SORT it_stxh BY tdname tdspras.

ENDIF.

*Read the Welcome text

REFRESH lines_longtext.

READ TABLE it_stxh INTO wa_stxh WITH KEY tdname = v_name

tdspras = sy-langu

BINARY SEARCH.

IF sy-subrc EQ 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = u2018ZIDu2019

language = wa_stxh-tdspras

name = v_name

object = u2018Z_OBJECTu2019

TABLES

lines = lines_longtext.

ELSE.

READ TABLE it_stxh INTO wa_stxh WITH KEY tdname = v_name

tdspras = 'EN'

BINARY SEARCH.

IF sy-subrc EQ 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = u2018ZIDu2019

language = wa_stxh-tdspras

name = v_name

object = u2018Z_OBJECTu2019

TABLES

lines = lines_longtext.

ENDIF.

ENDIF.

DATA: lo_formatted_text TYPE REF TO cl_wd_formatted_text,

longtext TYPE string,

ls_thead TYPE thead,

itf_itab TYPE text_line_tab.

ls_thead-tdobject = u2018Z_OBJECTu2019.

ls_thead-tdname = v_name.

ls_thead-tdid = u2018ZIDu2019.

ls_thead-tdspras = wa_stxh-tdspras.

ls_thead-tdform = 'SYSTEM'.

lo_formatted_text = cl_wd_formatted_text=>create_from_sapscript(

sapscript_head = ls_thead

sapscript_lines = lines_longtext ).

  • Set longtext attributeu2026 Here DISPLAY_LONGTEXT is the attribute of type STRING defined in Context

lo_el_context->set_attribute(

EXPORTING

name = `DISPLAY_LONGTEXT`

value = lo_formatted_text->m_xml_text ).

cl_wd_formatted_text=>__describe_sapscript_tokens( ).

By this approach, user can change the long text using Z transaction as per need and can apply any formatting.

Thanks,

Chandra

Former Member
0 Kudos

Dear Satrajit

Have you tried to run WD:

WDR_TEST_UI_ELEMENTS

It has plenty examples of most of UI elements (if not all of them).

See if there's one that can suit your needs.

Maybe you could also put this inside an OfficeControl UI

[http://help.sap.com/saphelp_nw70/helpdata/en/d1/af8841349e1909e10000000a155106/content.htm]

If would make the text much more user-friendly to read.

Kind Regards

/Ricardo Quintas