환율 생성 BAPI

1321 단어
 DATA: EXCH_RATE  LIKE BAPI1093_0   OCCURS 1 WITH HEADER LINE,
        RETTAB       LIKE BAPIRET2   OCCURS 1 WITH HEADER LINE,
        RET2         LIKE BAPIRET2   OCCURS 1 WITH HEADER LINE,
        RET3         LIKE BAPIRET2   OCCURS 1 WITH HEADER LINE.
  DATA:
       I_FROM_CURR_RANGE TYPE TABLE OF BAPI1093_3 WITH HEADER LINE,
       I_TO_CURRNCY_RANGE TYPE TABLE OF BAPI1093_3 WITH HEADER LINE.
 

  EXCH_RATE-RATE_TYPE = 'B'.
  EXCH_RATE-FROM_CURR = 'JPY'.
  EXCH_RATE-TO_CURRNCY = 'KRW'.
  EXCH_RATE-VALID_FROM = SY-DATUM.
  EXCH_RATE-EXCH_RATE = 888.
  EXCH_RATE-FROM_FACTOR = '100'.
  EXCH_RATE-TO_FACTOR   = '1'.
  APPEND EXCH_RATE.
  EXCH_RATE-RATE_TYPE = 'B'.
  EXCH_RATE-FROM_CURR = 'USD'.
  EXCH_RATE-TO_CURRNCY = 'KRW'.
  EXCH_RATE-VALID_FROM = SY-DATUM.
  EXCH_RATE-EXCH_RATE = 5555.
  EXCH_RATE-FROM_FACTOR = '1'.
  EXCH_RATE-TO_FACTOR   = '1'.
  APPEND EXCH_RATE.
  LOOP AT EXCH_RATE.
    CALL FUNCTION 'BAPI_EXCHANGERATE_CREATE'
      EXPORTING
        EXCH_RATE = EXCH_RATE
        UPD_ALLOW = 'X'            "UPDATE  X
      IMPORTING
        RETURN    = RETTAB.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      IMPORTING
        RETURN = RET2.
  ENDLOOP.

좋은 웹페이지 즐겨찾기