Текущее время: Ср, апр 24 2024, 14:25

Часовой пояс: UTC + 3 часа


Правила форума


ВНИМАНИЕ!

Вопросы по SAP Query и Quick View - сюда



Начать новую тему Ответить на тему  [ Сообщений: 5 ] 
Автор Сообщение
 Заголовок сообщения: Функции обработки строк.
СообщениеДобавлено: Сб, дек 18 2004, 15:08 
Специалист
Специалист
Аватара пользователя

Зарегистрирован:
Пт, ноя 12 2004, 11:17
Сообщения: 104
Добрый день. Существуют ли в ABAP 4.0 функция поиска подстроки в строке и функция поиска символа в строке?
Спасибо.

_________________
Верх упорства: набирать неверный пароль, пока компьютер не согласится.
Процесс вдумчивого пережевывания, как ничто другое, успокаивает и стимулирует умственную деятельность.


Принять этот ответ
Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Сб, дек 18 2004, 15:49 
Гость
search 'строка' for 'буква'.
if sy-subrc = 0.
* буква найдена
* пишем набор до буквы
* пишем букву
write: 'строка'+0(sy-fdpos).
write : 'строка'+sy-fdpos(1).

F1 руллит
Processing Byte Strings and Character Strings


Принять этот ответ
Вернуться к началу
  
 
 Заголовок сообщения:
СообщениеДобавлено: Сб, дек 18 2004, 21:12 
Председатель
Председатель
Аватара пользователя

Зарегистрирован:
Чт, сен 23 2004, 18:43
Сообщения: 1554
Откуда: Москва
Также смотри хелп по следующим операторам сравнения:
----------------------------------------------------------------
Operator Meaning

CO Contains Only: True, if operand1 only contains characters from operand2. Upper/lower case and trailing blanks are taken into account for both operands. If operand2 is of type string and is initial, then the logical expression is false, unless operand1 is also of type string and is initial, in which case the logical expression is always true. If the result of the comparison is negative, sy-fdpos contains the offset of the first character in operand1, that is not contained in operand2. If the result of the comparison is positive, sy-fdpos contains the length of operand1.

CN Contains Not Only; True if a logical expression with CO is false, that is, if operand1 contains not only characters from operand2. sy-fdpos is set in the same way as for CO. If the comparison is true, sy-fdpos contains the offset of the first character in operand1 that is not contained in operand2. If the comparison is false, sy-fdpos contains the length of operand1.

CA Contains Any: True, if operand1 contains at least one character from operand2. Upper/lower case and trailing blanks are taken into account for both operands. If operand1 or operand2 is of type string and initial, the logical expression is always false. If result of the comparison is positive, sy-fdpos contains the offset of the first character in operand1 that is also contained in operand2. If the result of the comparison is negative, sy-fdpos contains the length of operand1.

NA Contains Not Any: True if a logical expression with CA is false, that is if operand1 does not contain any characters from operand2. If the result of the comparison is negative, sy-fdpos contains the offset of the first character in operand1 that is also contained in operand2. If the result of the comparison is true, sy-fdpos contains the le of operand1.

CS Contains String: True if the content of operand2 is contained in operand1. Upper/lower case is not taken into account, trailing blanks of the left operand are taken into account. If operand1 is of type string and initial, or of type c and contains only blank characters, the logical expression is false, unless operand2 is also of type string and initial, or of type c and only contains blank characters. In this case the logical expression is always true. If the result of the comparison is true, sy-fdpos contains the offset of operand2 in operand1. If the result of the comparison is negative, sy-fdpos contains the length of operand1.

NS Contains No String: True, if a logical expression with CS is false, that is if operand1 does not contain the content of operand2. If the result of the comparison is negative, sy-fdpos contains the offset of operand2. If the comparison is true, sy-fdpos contains the length of operand1.

CP Covers Pattern: True, if the content of operand1 fits the pattern in operand2. Wildcard characters can be used for forming the operand pattern, where "*" represents any character string, and "+" represents any character. Upper/lower case is not taken into account. If the comparison is true, sy-fdpos contains the offset of operand2 in operand1, whereby leading wildcard characters "*" in operand2 are ignored if operand2 also contains other characters. If the comparison is false, sy-fdpos contains the length of operand1. You can select characters in operand2 for a direct comparison by adding the escape symbol "#" before the required characters. For these characters, upper/lower case is taken into account, wildcard characters and the escape symbol itself do not receive special treatment, and trailing blanks in operands of type c are not cut off.

NP No Pattern: True, if a logical expression with CP is false, that is, if operand1 does not fit the pattern operand2. If the comparison is false, sy-fdpos contains the offset of operand2 in operand1, whereby leading wildcard characters "*" in operand2 are ignored if operand2 also contains other characters. If the

_________________
Hе иди по течению, не иди против течения - иди поперек него, если хочешь достичь берега.
Слова Ванталы. Дела Ванталы


Принять этот ответ
Вернуться к началу
 Профиль  
 
 Заголовок сообщения: Re: Функции обработки строк.
СообщениеДобавлено: Вс, окт 20 2019, 16:53 
Ассистент
Ассистент

Зарегистрирован:
Ср, янв 17 2018, 21:22
Сообщения: 36
Пол: Мужской
Вот два примера работы со строками:
Разбиение на подстроки: https://youcoder.ru/line_separation.html
Замена символа в строке: https://youcoder.ru/replace_line.html
Может будет полезно.


Принять этот ответ
Вернуться к началу
 Профиль Отправить email  
 
 Заголовок сообщения: Re: Функции обработки строк.
СообщениеДобавлено: Пн, окт 21 2019, 21:36 
Почетный гуру
Почетный гуру
Аватара пользователя

Зарегистрирован:
Чт, окт 06 2005, 16:44
Сообщения: 3074
Откуда: Москва
не поздновато? :roll:

_________________
С уважением,
Удав.


Принять этот ответ
Вернуться к началу
 Профиль  
 
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 5 ] 

Часовой пояс: UTC + 3 часа


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Русская поддержка phpBB