Guest User

function conversion_exit_zphon_output

a guest
Feb 19th, 2013
3,098
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function conversion_exit_zphon_output.
  2. *"----------------------------------------------------------------------
  3. *"*"Локальный интерфейс:
  4. *"  IMPORTING
  5. *"     VALUE(INPUT) TYPE  CLIKE
  6. *"  EXPORTING
  7. *"     VALUE(OUTPUT) TYPE  CLIKE
  8. *"----------------------------------------------------------------------
  9. *+7(123)456-78-90
  10. *1234567890123456
  11.  
  12.   data: lv_internal(16) type c.
  13.  
  14.   lv_internal = input.
  15.  
  16.   if strlen( lv_internal ) = 6.
  17.     concatenate '7172' lv_internal into lv_internal.
  18.   endif.
  19.   if strlen( lv_internal ) = 7.
  20.     concatenate '727' lv_internal into lv_internal.
  21.   endif.
  22.  
  23.   case lv_internal(3).
  24.     when '700' or '701' or '702' or '707' or '777' or '727'.
  25.       concatenate '+7(' lv_internal(3) ')' lv_internal+3(3) '-' lv_internal+6(2) '-' lv_internal+8(2) into  output.
  26.     when others.
  27.       concatenate '+7(' lv_internal(4) ')' lv_internal+4(2) '-' lv_internal+6(2) '-' lv_internal+8(2) into  output.
  28.   endcase.
  29.  
  30. endfunction.
RAW Paste Data