메뉴 건너뛰기

SAP 한국 커뮤니티



문자인지 숫자인지 구분

ecbase 2006.12.02 05:41 조회 수 : 10725 추천:35

DATA: STRING_1(20) TYPE C, STRING_1_TYPE(4) TYPE C,
      STRING_2(20) TYPE C, STRING_2_TYPE(4) TYPE C,
      STRING_3(20) TYPE C, STRING_3_TYPE(4) TYPE C.

STRING_1 = '12345678901234567890'.
STRING_2 = 'abcdefg우리나라만세z'.
STRING_3 = 'abcdAAA34557azzidfll'.

CALL FUNCTION 'NUMERIC_CHECK'
     EXPORTING
          STRING_IN = STRING_1
     IMPORTING
          HTYPE     = STRING_1_TYPE.

CALL FUNCTION 'NUMERIC_CHECK'
     EXPORTING
          STRING_IN = STRING_2
     IMPORTING
          HTYPE     = STRING_2_TYPE.

CALL FUNCTION 'NUMERIC_CHECK'
     EXPORTING
          STRING_IN = STRING_3
     IMPORTING
          HTYPE     = STRING_3_TYPE.


WRITE: / STRING_1, ':', STRING_1_TYPE.
WRITE: / STRING_2, ':', STRING_2_TYPE.
WRITE: / STRING_3, ':', STRING_3_TYPE.


* 썬님에 의해서 게시물 이동되었습니다 (2010-03-30 13:09)