Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 4th, 2006, 02:06 PM
JDP220 JDP220 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 2 JDP220 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 56 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > ABAP Programming Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway