Posted: Sat Feb 02, 2008 12:13 pm Post subject: String Operations | Управление строками
FORMAT_TEXT_LINES - форматирует заданный текст с разбиением по словам, и возможностью задания максимальной ширины текста. Текст передается и возвращается в виде внутренней таблицы.
RKD_WORD_WRAP - разбивка одной длинной строки на три строки фиксированной длины.
Code:
*---------------------------------------------------------------------*
* Form split_string
*---------------------------------------------------------------------*
* Split string l_ch1 into strings l_ch2 and l_ch3
*---------------------------------------------------------------------*
FORM split_string USING value(l_ch1) TYPE any
CHANGING l_ch2 TYPE any
l_ch3 TYPE any.
DATA: l_maxlen TYPE i.
* Define length of the first string
DESCRIBE FIELD l_ch2 LENGTH l_maxlen.
* Split string
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = l_ch1
* DELIMITER = ' '
outputlen = l_maxlen
IMPORTING
out_line1 = l_ch2
out_line2 = l_ch3
* OUT_LINE3 =
* TABLES
* OUT_LINES =
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
HR_HK_STRING_INTO_2_LINES
Группа функций: C147
C147_REPLACE - замена подстроки по маске.
Code:
DATA: l_old TYPE STRING,
l_new TYPE STRING,
l_text TYPE STRING.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.