Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function conversion_exit_zphon_input.
- *"----------------------------------------------------------------------
- *"*"Локальный интерфейс:
- *" IMPORTING
- *" VALUE(INPUT) TYPE CLIKE
- *" EXPORTING
- *" VALUE(OUTPUT) TYPE CLIKE
- *"----------------------------------------------------------------------
- *1234567890
- *+7(123)456-78-90
- *1234567890123456
- data: lv_external(16) type c.
- lv_external = input.
- replace all occurrences of '+7' in lv_external with ' '.
- replace all occurrences of '-' in lv_external with ' '.
- replace all occurrences of '(' in lv_external with ' '.
- replace all occurrences of ')' in lv_external with ' '.
- replace all occurrences of '_' in lv_external with ' '.
- if lv_external cn '1234567890 '.
- message 'Недопустимые знаки для номера телефона' type 'E'.
- endif.
- condense lv_external no-gaps.
- if strlen( lv_external ) = 6.
- concatenate '7172' lv_external into lv_external.
- endif.
- if strlen( lv_external ) = 7.
- concatenate '727' lv_external into lv_external.
- endif.
- data: lv_zero type i.
- lv_zero = 10 - strlen( lv_external ).
- do lv_zero times.
- concatenate '0' lv_external into lv_external.
- enddo.
- output = lv_external(10).
- endfunction.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement