'CURRENCY_AMOUNT_DISPLAY_TO_SAP' 해당 통화의 금액을 DB에 저장할 때의 금액형태로 변경
100 KRW -> 1.00 KRW
100 USD -> 100.00 USD
DATA : g_amt TYPE p,
gr_amt TYPE p.
CLEAR : g_amt, gr_amt.
g_amt = 1000.
WRITE : / g_amt.
CALL FUNCTION 'CURRENCY_AMOUNT_DISPLAY_TO_SAP'
EXPORTING
currency = 'KRW'
amount_display = g_amt
IMPORTING
amount_internal = gr_amt
EXCEPTIONS
internal_error = 1.
WRITE : / gr_amt, 'KRW' .
CALL FUNCTION 'CURRENCY_AMOUNT_DISPLAY_TO_SAP'
EXPORTING
currency = 'USD'
amount_display = g_amt
IMPORTING
amount_internal = gr_amt
EXCEPTIONS
internal_error = 1.
WRITE : / gr_amt, 'USD'.
*******************************************************
'CONVERT_TO_FOREIGN_CURRENCY' : Currency별 환율 컨버젼 함수
해당일의 환율정보를 참조해서 Currency 별 금액을 바꿔주는 함수.
DATA: l_dmbtr LIKE bseg-dmbtr,
l_rate LIKE bkpf-kursf.
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
date = sy-datum
foreign_currency = 'USD' "FORIGN_CURRENCY 에는 결과치로 나올 Currency type
local_amount = '1000'
local_currency = 'KRW' "LOCAL_CURRENCY 에는 입력되는 Currency type
type_of_rate = 'M' " 'M', 'BS', 'PL'
read_tcurr = 'X'
IMPORTING
exchange_rate = l_rate
foreign_amount = l_dmbtr
EXCEPTIONS
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
WRITE : / '1USD =>' , l_rate, 'KRW' .
WRITE : / '1000KRW =>', l_dmbtr, 'USD'.
*l_rate : 1USD가 몇 KRW
*l_dmbtr : 1000 KRW -> 몇 USD
100 KRW -> 1.00 KRW
100 USD -> 100.00 USD
DATA : g_amt TYPE p,
gr_amt TYPE p.
CLEAR : g_amt, gr_amt.
g_amt = 1000.
WRITE : / g_amt.
CALL FUNCTION 'CURRENCY_AMOUNT_DISPLAY_TO_SAP'
EXPORTING
currency = 'KRW'
amount_display = g_amt
IMPORTING
amount_internal = gr_amt
EXCEPTIONS
internal_error = 1.
WRITE : / gr_amt, 'KRW' .
CALL FUNCTION 'CURRENCY_AMOUNT_DISPLAY_TO_SAP'
EXPORTING
currency = 'USD'
amount_display = g_amt
IMPORTING
amount_internal = gr_amt
EXCEPTIONS
internal_error = 1.
WRITE : / gr_amt, 'USD'.
*******************************************************
'CONVERT_TO_FOREIGN_CURRENCY' : Currency별 환율 컨버젼 함수
해당일의 환율정보를 참조해서 Currency 별 금액을 바꿔주는 함수.
DATA: l_dmbtr LIKE bseg-dmbtr,
l_rate LIKE bkpf-kursf.
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
date = sy-datum
foreign_currency = 'USD' "FORIGN_CURRENCY 에는 결과치로 나올 Currency type
local_amount = '1000'
local_currency = 'KRW' "LOCAL_CURRENCY 에는 입력되는 Currency type
type_of_rate = 'M' " 'M', 'BS', 'PL'
read_tcurr = 'X'
IMPORTING
exchange_rate = l_rate
foreign_amount = l_dmbtr
EXCEPTIONS
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
WRITE : / '1USD =>' , l_rate, 'KRW' .
WRITE : / '1000KRW =>', l_dmbtr, 'USD'.
*l_rate : 1USD가 몇 KRW
*l_dmbtr : 1000 KRW -> 몇 USD
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
102 | BAPI function List [3] | sapjoy | 2014.08.19 | 26795 |
101 | 유용한 날짜 펑션들....(펌) [17] | 하늘사랑 | 2007.07.04 | 16766 |
100 | 숫자 왼쪽의 0 없애기 [8] | ecbase | 2006.12.02 | 15242 |
» | 환율관련 함수 [2] | 아밥뽀 | 2014.08.23 | 14579 |
98 | 반올림, 올림, 버림 Function [16] | SSong | 2007.11.20 | 11979 |
97 | 공휴일 체크 및 다음 휴일 구하기 [5] | ecbase | 2006.12.01 | 11129 |
96 | 문자인지 숫자인지 구분 [8] | ecbase | 2006.12.01 | 10698 |
95 | 현재 떠있는 화면에서 특정 필드의 값을 읽어오는 함수 및 방법 [8] | Delight | 2008.04.28 | 10057 |
94 | 유용한 Function 올려봅니다. [30] | 김지성 | 2007.04.17 | 9895 |
93 | 소수점 이하 체크 [5] | ecbase | 2006.12.02 | 9749 |
92 | Amount의 필드 값의 0을 삭제후 Char로 내보내기 [3] | 민버미꺼! | 2007.12.25 | 9622 |
91 | 프로그램실행시간 구하기 [16] | 쥬앙 | 2009.04.06 | 9383 |
90 | 이메일로 파일 보내는 함수 [3] | 열공아밥 | 2009.12.20 | 9286 |
89 | POPUP 함수(팝업) [11] | sapjoy | 2007.05.17 | 8795 |
88 | LDM 파일을 다운로드 하는 Function [1] | 양키 | 2012.08.08 | 8508 |
87 | [Function]오늘은 몇요일일까요? [4] | 양키 | 2010.09.29 | 8455 |
86 | tcode 권한체크 t-code authority check | sapjoy | 2013.05.21 | 8256 |
85 | ALV BUFFER CLEAR [3] | ecbase | 2006.12.02 | 8022 |
84 | [Function] 메세지 박스를 뛰워보자 [10] | 양키 | 2010.09.29 | 7954 |
83 | function 모음입니다. [5] | 양파링 | 2007.11.02 | 7876 |
감사합니다