Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- abap #initial #null #abap inital vs null
- abap #abap_move
- abap #sap #conversion #currency #cfield #waers
- open sql #sap #abap #where exists #where not exists
- grave #abap #sap #backquote
- abap #sap #free #alv #clear #refresh
- abap #정규표현식 #regular expression
- sap #abap #data exists #read table #xsdbool #line exists
- abap #동적 where #동적 select
- abap #sap #sy-index #sy-tabix #syst
- abap #sql #sap #query 실행 순서 #query 작성 순서
- sap #abap #화폐단위 #sap conversion #inr conversion
- abap move corresponding #abap data이동 #abap correspond mapping
- sap #cts #abap #release #merge cts #request no
- abap #sap #layout #layout 설정
- abap #sap #sy-datlo #sy-datum #syst #system variable # 시스템변수
- abap #wildcard #와일드카드 #sql #select #where조건
- abap #se39 #srepo #sap #development #compare code
- abap #sap #conversion #currency #conversion_currency
- sap #abap #cl_gui_alv_grid #function code #alv
- #apostrophe
- abap #sap #se16h #data #tcode
- abap #sap #hotspotclick #do_sum
- abap #sap #color #row #layout
- abap #sap #search hlep #f4 #f4if_int_table_value_request #change column name
Archives
- Today
- Total
0v0__DEV
[04] Currency Conversion SQL Func 본문
728x90
프로그램 개발하면서, 환율 등에 시달리다 보니 새롭게 알게 된 SQL func도 있다
오늘 알게 된 sql function은 'Currency conversion'과 관련한 구문이다
SELECT 할 때, 금액을 특정 통화로 변환하여 가지고 올 수 있다.
Abap document에서는 아래와 같이 currency conversion sql을 소개하고 있다!
- 매개변수 금액으로 전달된 값에 대해 통화 변환을 수행함
- 금액은 변환 전 소수점 두자리로 반올림 됨
- 매개변수
구분 | Parameter | 의미 |
필수 | Amount | 변환할 금액 |
source_currency | 소스 통화 키 (변환 전) | |
target_currency | 대상 통화 키 (변환 할) | |
exchange_rate_date | 환율 기준 날짜 | |
선택 | exchange_rate_type | tcurr-kurst : 기본 M |
client | 클라이언트 별 규칙이 반영됨 | |
round | 기본 'X' : 변환 값 반올림 | |
decimal_shift | 기본 'X' 소스 값에 대해 소수자리 이동 | |
decimal_shift_back | 기본 'X' : 결과 값에 대해 소수자리 이동 | |
error_handling | 오류 발생 관련 제어 |
[ 예시 코드 ]
- amount = 금액 필드
- source_currency = 통화 필드
- target_currency = 'KRW'
- exchange_rate_date = sy-datum (20240724)
=> converted_amount
결과
TCURR의 환율 기준으로 실제 계산을 해봤다!
TCURR에 저장된 1274.2058 환율로 계산한 결과는 위와 같음!
이와 유사한 function으로는 Unit Conversion 이 있음!
728x90
'ABAP project' 카테고리의 다른 글
[06] FREE 구문 (0) | 2024.08.07 |
---|---|
[05] CL_GUI_ALV_GRID 의 Attributes (0) | 2024.07.29 |
[03] do_sum 필드 & hotspot_click Event (2) | 2024.07.22 |
[02]Search Help - Column 명 변경 (How to change the column title for custom F4 help) (0) | 2024.07.17 |
[01] 타 시스템과 코드 비교 ( Compare code with other servers : SE39, SREPO) (1) | 2024.07.09 |