SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

String Operations | Управление строками



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Feb 02, 2008 12:13 pm    Post subject: String Operations | Управление строками Reply with quote

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.

  l_text = 'Company Code &1'.
  l_old = '&1'.
  l_new = '1000'.
  call function 'C147_REPLACE'
       exporting
            i_pattern     = l_old
            i_repl_string = l_new
       changing
            x_string      = l_text.
           
WRITE: / l_text.


C147_STRING_TRUNCATE - обрезать строку.

C147_STRING_SHIFT - сдвинуть строку
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.