SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Получение актуальных курсов валют



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> FI
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Fri Dec 14, 2007 10:34 am    Post subject: Получение актуальных курсов валют Reply with quote

1. Загрузка курсов из Интернет
http://www.cbr.ru/scripts/XML_daily.asp?date_req=14/12/2007

2. Ведение таблиц TCURR транзакция OB08

3.
Code:
FUNCTION Y_EXCHANGE_RATE_SAP_UPDATE .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(EXC_IN) TYPE  STRING
*"     VALUE(DCURR_IN) TYPE  STRING
*"     VALUE(SCURR_IN) TYPE  STRING
*"  TABLES
*"      EXCH_RATE_LIST STRUCTURE  BAPI1093_0 OPTIONAL
*"----------------------------------------------------------------------
  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   = 'M'.
  EXCH_RATE-FROM_CURR   = SCURR_IN.
  EXCH_RATE-TO_CURRNCY  = DCURR_IN.
  EXCH_RATE-VALID_FROM  = SY-DATUM.
  EXCH_RATE-EXCH_RATE   = EXC_IN.
  EXCH_RATE-FROM_FACTOR = '1'.
  EXCH_RATE-TO_FACTOR   = '1'.
 
  APPEND EXCH_RATE.

 
  CALL FUNCTION 'BAPI_EXCHANGERATE_CREATE'
    EXPORTING
      EXCH_RATE = EXCH_RATE
    IMPORTING
      RETURN    = RETTAB.
 
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    IMPORTING
      RETURN = RET2.
 

CALL FUNCTION 'BAPI_EXCHRATE_GETCURRENTRATES'
  EXPORTING
   DATE                   = SY-DATUM
   DATE_TYPE              = ''
   RATE_TYPE              = 'M'
 
  TABLES
    FROM_CURR_RANGE        = i_from_curr_range
    TO_CURRNCY_RANGE       = i_to_currncy_range
    EXCH_RATE_LIST         = EXCH_RATE_LIST
    RETURN                 = RET3
    .

  ENDFUNCTION.


4. В русском Add-on есть отчет J_3RF_EXCH_LOAD - Программа загрузки курсов валют
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> FI All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.