Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
249

First to get an idea how this solution works, please read the article: Text-Editing with Notes - Logic.

The solution is based on set of several objects which make use of an interface to accommodate the different editor types SAP supports. The first step is to create the interface Z_I_SYT_EDITOR in se24. Just create the interface as the picture is below and save it. We will come back after we created the required data elements, domains and structures we need.

The interface needs several predefined domains. Please use the same name for the data element as for the domain. You can define these in se11. You can use the table below to copy the information into SE11:

Name

Description

Data Type

  1. No. Characters

Decimal Places

ZSTATUS_BAR_TEXT

Status bar Text

CHAR

256

ZZNOTES_POSITION

Notes position in text object

CHAR

1

ZZSORT_ORDER

Sort Order

NUMC

1

ZZTEXTCONV

Data Conversion types for text object

CHAR

1

The value table for each of the domains ( only three have a value table assigned)  are shown here:

ZZNOTES_POSITION

Fix val.Short description
TTop
BBottom
LLext
RRight
ZZSORT_ORDER
Fix val.Short description
1Oldest to Newest
2Newest to Oldest
3Newest to Oldest not first
ZZTEXTCONV
Fix val.Short description
' ' Plain text
SSnippet (mainly HTML: text without header/body )

Be aware that you can copy the values directly from the screen.

In addition you need to create the following Structures in se11. First you hace to create ZSYT_S_TEXT_DISP_OPT_BOX. Also use the table below to copy the data into se11. Thesecond structure you need is below and is called ZSYT_S_TEXT_DISP_OPT.

ZSYT_S_TEXT_DISP_OPT_BOX

Text Object Display Options Box
ComponentRTypeComponent typeData TypeLengthDecimal PlShort Description
NO_TOOLBAR_DISPFLAGCHAR10General Flag
NO_STATUSBAR_DISPFLAGCHAR10General Flag
STATUS_BAR_TEXTZSTATUS_BAR_TEXTCHAR2560Status Bar Text
DISPLAY_ONLYFLAGCHAR10General Flag
DISPLAY_NOTES_TOOLBARFLAGCHAR10General Flag
NOTES_POSITIONZZNOTES_POSITIONCHAR10Notes position for text object
SASH_POSITIONINT4INT4100Natural Number
TABMODEINT4INT4100Natural Number
ZSYT_S_TEXT_DISP_OPTText Object Display Options
ComponentRTypeComponent typeData TypeLengthDecimal PlShort Description
.INCLUDEZSYT_S_TEXT_DISP_OPT_BOX00Text Object Display Options Box
USERTITLETDUSERTITLCHAR10Text editor: User-defined title for title bar

Now let's go back to se24 and finish the interface. On the methods tab please copy the following methods for the interface Z_C_SYT_EDITOR. You should be able to use the table as displayed:

Method

LevelDescription
INITIALIZEInstance MethodCreate editor and set everything up
FREEInstance MethodFree
FILL_DESCRIPTIONInstance MethodGet two lines of description
GET_IS_MODIFIEDInstance MethodCheck if text has been changed
GET_LINE_COUNTInstance MethodGet line count of text
REFRESH_TEXTInstance MethodUpdate text with newer lines
SET_DISPLAY_OPTIONSInstance MethodSet toolbar and status bar mode
GET_TEXT_FROM_EDITORInstance MethodGet the updated text
ADD_HISTORYLINEInstance MethodAdd the history line for notes logic
SET_DISPLAY_OPTIONS_NOTESInstance MethodSet toolbar and status bar mode
CONVERT_TEXTInstance MethodConvert text to required format and table type

Now we go to the attributes tab. Here the Interface Z_I_SYT_EDITOR has the following attributes. Again, just copy from the table below:

Attribute

LevelTypingAssociated typeDescriptionInitial value
W_LINES_STARTInstance AttributeTypeI                                                           
C_NORMALConstantTypeZZTEXTCONVConversion types for text object' '
C_SNIPPETConstantTypeZZTEXTCONVConversion types for text object'S'

Now we go back to the method tab and enter for the following methods parameter informetion. For each method you have to click first on the method name, then on the parameter button. Cope the correct table section of the method and then go back to the method overview. The Interface Z_I_SYT_EDITOR has the following parameters:

INITIALIZE

ParameterTypePOTyping MethodAssociated TypeDefault ValueDescription
IS_THEADERImportingTypeTHEAD

SAPscript: Text Header
IC_PARENTImportingType Ref ToCL_GUI_CONTAINER

Container for Custom Controls in the Screen Area
IT_LINESImportingTypeTSFTEXT

 

SAPscript: Text Lines
FILL_DESCRIPTION
ParameterTypePOTyping MethodAssociated TypeDefault ValueDescription
IT_TEXTImportingTypeTSFTEXTSmart Forms: Text
IS_HEADERImportingTypeTHEADSAPscript: Text Header
E_PART1ExportingTypeSTRINGFirst line of Text
E_PART2ExportingTypeSTRINGSecond line of Text
GET_IS_MODIFIED
ParameterTypePOTyping MethodAssociated TypeDefault ValueDescription
I_FLUSHImportingXTypeFLAG'X'General Flag
R_IS_MODIFIEDReturningXTypeIText has been modified

As this is only the interface. We are done no code has to be added. Please try to activate the interface.

Let me know if I have missed anything for the interface Z_I_SYT_EDITOR.

Hope it works for you.

2 Comments