on 07-30-2008 3:40 PM
Hi,
Below given is the code in the perform.
I am calling this perform from the script. It is giving me dump at the below given place.
************************************************************************************************
FORM convert_currency TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA: i_curr LIKE vbdkr-waers,
v_sysdate(10),
v_date(10),
V_TOTAL_CHAR(255) type C,
v_excgrate type P decimals 5,
v_total type P decimals 5.
Delivery date
READ TABLE in_tab WITH KEY 'VBDKR-WAERK'.
IF sy-subrc IS INITIAL.
i_curr = in_tab-value.
v_sysdate = sy-datum.
CONCATENATE v_sysdate4(2) '/' v_sysdate6(2) '/' v_sysdate+0(4) into
v_date.
ENDIF.
PO date
READ TABLE in_tab WITH KEY 'INVOICE_TOTAL'.
IF sy-subrc IS INITIAL.
********************************************************************************************
Here in_tab- value is char 255. It is having a numerical value passed from script and v_total is type P decimal 5. when I am writing the in_tab-value to v_total it is copying some junk value in v_total.
WRITE in_tab-value to v_total.
*********************************************************************************************
v_total = in_tab-value.
ENDIF.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING
CLIENT = SY-MANDT
DATE = SY-DATUM
FOREIGN_CURRENCY = i_curr
LOCAL_CURRENCY = 'SGD'
TYPE_OF_RATE = 'M'
IMPORTING
EXCHANGE_RATE = v_excgrate
FOREIGN_FACTOR =
LOCAL_FACTOR =
VALID_FROM_DATE =
DERIVED_RATE_TYPE =
FIXED_RATE =
EXCEPTIONS
NO_RATE_FOUND = 1
NO_FACTORS_FOUND = 2
NO_SPREAD_FOUND = 3
DERIVED_2_TIMES = 4
OVERFLOW = 5
OTHERS = 6
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*********************************************************************************************
here proj is giving DUMP. both v_total and v_excgrate are type P decimal 5.
when I am multiplying the total with excahnge rate it is giving dump.
v_total = v_total * v_excgrate.
**********************************************************************************************
WRITE v_total TO v_total_char.
condense v_total_char.
LOOP AT out_tab.
CASE out_tab-name.
WHEN 'CURR'.
MOVE 'SGD' TO out_tab-value.
WHEN 'TOTAL'.
WRITE v_total_char TO out_tab-value.
WHEN 'EXCHRATE'.
MOVE v_excgrate TO out_tab-value.
ENDCASE.
MODIFY out_tab.
ENDLOOP.
ENDFORM. " FORMAT_DATE
Please help.
regards,
Gaurav.
Put this code:
REPLACE ALL OCCURRENCES OF ',' IN IN_TAB-VALUE WITH ' '.
condense IN_TAB-VALUE no-gaps.
v_total = in_tab-value.
Points appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.