*사업자등록번호 값 체크
IF sy-tcode = 'FD01'.
*사업자등록번호 값이 중복되는지 검사 ------------------------------
DATA : lt_kna1 LIKE kna1 OCCURS 0 WITH HEADER LINE.
DATA : lv_subrc LIKE sy-subrc,
lv_kunnr LIKE kna1-kunnr,
lv_stcd2 LIKE kna1-stcd1.
CLEAR : lv_kunnr, lv_stcd2, lv_subrc, lt_kna1, lt_kna1[].
*사업자등록번호 들고오기
CLEAR: scr_fields[].
scr_fields-fieldname = 'KNA1-STCD2'.
APPEND scr_fields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = scr_fields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
OTHERS = 9.
CHECK sy-subrc = 0.
READ TABLE scr_fields INDEX 1.
lv_stcd2 = scr_fields-fieldvalue.
*사업자등록번호 체크
IF NOT lv_stcd2 IS INITIAL.
CLEAR : lv_subrc.
SELECT SINGLE * INTO TABLE lt_kna1
FROM kna1
WHERE stcd2 = lv_stcd2.
lv_subrc = sy-subrc.
IF lv_subrc = 0.
MESSAGE e398(00) WITH '동일한 사업자번호가 이미 존재합니다’.
EXIT.
ENDIF.
ENDIF.
ENDIF.
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
311 | Sub DOI_EXCEL_MACRO() | sapjoy | 2008.12.26 | 3312 |
310 | Sub DOI_MACRO() | sapjoy | 2008.12.26 | 2845 |
309 | DOI_002.doc [3] | sapjoy | 2008.12.26 | 2234 |
308 | doi_create [1] | sapjoy | 2008.12.26 | 3049 |
307 | REPORT zsapdoi_001. [2] | sapjoy | 2008.12.20 | 3137 |
306 | REPORT Z07_026 [3] | sapjoy | 2006.12.09 | 2632 |
305 | Include ZXQEVU10 | sapjoy | 2008.12.17 | 2158 |
304 | Include ZXCSAU05 | sapjoy | 2008.12.17 | 2166 |
» | FIELD_EXIT_STCD2_0 | sapjoy | 2008.12.16 | 2797 |
302 | FIELD_EXIT_GSBER_I | sapjoy | 2008.12.16 | 2625 |
301 | Include ZXCSAU05 | sapjoy | 2008.12.16 | 2587 |
300 | INCLUDE ZXF04U01 | sapjoy | 2008.12.16 | 3698 |
299 | INLUCDE ZXAISU02 | sapjoy | 2008.12.16 | 2962 |
298 | REPORT z_userexit_01 | sapjoy | 2008.12.15 | 2656 |
297 | REPORT ZSMARTFORMS_01. | sapjoy | 2008.11.26 | 2677 |
296 | report zunicode_035. | sapjoy | 2008.11.22 | 2541 |
295 | report zunicode_034. [1] | sapjoy | 2008.11.22 | 2737 |
294 | report zunicode_032. | sapjoy | 2008.11.22 | 2634 |
293 | report zunicode_031. | sapjoy | 2008.11.22 | 2684 |
292 | report zunicode_030. | sapjoy | 2008.11.22 | 2416 |