|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ABAP Programming Help
I am writing a program using a table that is already in SAP. The table is VBAK and I'm trying to run an internal function "convert_to_local_currency" and I can't seem to get this to run correctly. There seems to be a problem with the loop statement, the convert function does not have conversion information for 'DEM' currency so there is an exception for that. The program initiates the sy-subrc = 5 and runs that output, but when the sy-subrc isn't 5 it should go onto the next output, however no conversions are ever done..
Below is the code that I've been working on I have commented out the loop and endloop statement.. can anyone offer me any help?? Thanks! Jeff(MIS Student) --------------------------------------------------- REPORT ZDCA10FINAL MESSAGE-ID ZD10 . TYPES: TYP_vbak TYPE VBAK, paymentsum type vbak-netwr, CURRENCY TYPE VBAK-waerk. DATA: WA_VBAK TYPE TYP_VBAK, COLOR TYPE I VALUE 1, LOCAL_AMOUNT TYPE VBAK-NETWR, ivbak type standard table of typ_vbak, CURRENCY TYPE VBAK-waerk. *Array Fetch of the data into work area. SELECT * FROM VBAK INTO WA_VBAK. *Line colors. IF color = 4. color = 2. ELSE. color = 4. ENDIF. FORMAT COLOR = COLOR. *LOOP AT IVBAK INTO WA_VBAK. CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY' EXPORTING DATE = SY-DATUM FOREIGN_AMOUNT = WA_VBAK-NETWR FOREIGN_CURRENCY = WA_VBAK-WAERK LOCAL_CURRENCY = CURRENCY IMPORTING LOCAL_AMOUNT = LOCAL_AMOUNT EXCEPTIONS NO_RATE_FOUND = 5. if sy-subrc = 5. write: / WA_VBAK-ERNAM , 15 WA_VBAK-AUDAT , 30 WA_VBAK-NETWR, 60 wa_VBAK-WAERK, 80 local_amount color 6. Else. *Writing Output. WRITE: / WA_VBAK-ERNAM , 15 WA_VBAK-AUDAT , 30 WA_VBAK-NETWR, 60 wa_VBAK-WAERK, 80 local_amount. endif. *endloop. ENDSELECT. CLEAR WA_VBAK-ERNAM. *Error check. IF SY-SUBRC <> 0. MESSAGE i001. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > ABAP Programming Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|