Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg: Currency

Former Member
0 Likes
1,348

hii all,

Is there any table where we can get the for example

if we mention INR(Indian Rupee) : we get rupees for whole amount and Paise for the decimals amt

or USD(US dollar) : we get dollars for whole amount and cents for the decimals amount.

In table TCURC we can get the whole amt text but i can not get that text for decimals part.

with regards,

sandeep akella.

Edited by: sandeep akella on Nov 11, 2008 1:25 PM

hii all,

Is there any table where we can get the for example

if we mention INR(Indian Rupee) : we get rupees for whole amount and Paise for the decimals amt

or USD(US dollar) : we get dollars for whole amount and cents for the decimals amount.

In table TCURC we can get the whole amt text but i can not get that text for decimals part.

with regards,

sandeep akella.

Edited by: sandeep akella on Nov 11, 2008 1:25 PM

10 REPLIES 10
Read only

Former Member
0 Likes
1,215

if you are looking in sales then this is function module

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

EXPORTING

Client = sy-mandt

Date = is_bil_invoice-hd_gen-bil_date

Foreign amount = gv_gross_tot

Foreign currency = is_bil_invoice-hd_gen-bil_waerk

Local currency = 'SGD'

type_of_rate = 'M'

IMPORTING

local amount = GV_VALUE1.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

0 Likes
1,215

hii,

if we give the currency do we get as for example

20.20(in indian currency) as twenty rupees and twenty paise likewise

20.20(USD) as twenty dollars and twenty cents.

With regards,

sandeep akella.

Read only

0 Likes
1,215

For INR, Use FM HR_IN_CHG_INR_WRDS,

For the rest of the currencies use FM SPELL_AMOUNT

Hope this helps!

Regards,

Prashant

Read only

0 Likes
1,215

hii ,

Using function Module HR_IN_CHG_INR_WRDS we get for indian currency in words, like wise do we have a generalised function module or If we use func module 'spell_Amount' we get the amount in words and using the table 'TCURC' we can get the word like Rupees or Dollars etc for whole amount but in that table we can not get the wordings like Paise or cents or shellings etc...so do we have any table from where we can get these when we can specify the currency code.As my form requries me to print in that way , so i can not hardcode it for 30 countries.

With regards,

sandeep akella.

Edited by: sandeep akella on Nov 12, 2008 6:59 AM

Read only

GauthamV
Active Contributor
0 Likes
1,215

hi,

This will solve your problem.

[https://forums.sdn.sap.com/click.jspa?searchID=18520174&messageID=316716]

Read only

Former Member
0 Likes
1,215

Hi,

use this customized FM..


FUNCTION zconvert_amnt_to_words.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(AMOUNT) TYPE  KONV-KAWRT
*"     REFERENCE(CURRENCY) TYPE  CHAR3
*"  EXPORTING
*"     REFERENCE(WORDS) TYPE  C
*"----------------------------------------------------------------------
  DATA: w_amount(255)  TYPE c,
          w_out_amt(255) TYPE c,
          amt_in_inr TYPE pc207-betrg.
 
  amt_in_inr = amount.
  IF currency = 'INR'.
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
      EXPORTING
        amt_in_num         = amt_in_inr
      IMPORTING
        amt_in_words       = w_amount
      EXCEPTIONS
        data_type_mismatch = 1
        OTHERS             = 2.
    IF sy-subrc  0.
*    RAISE data_type_mismatch.
    ENDIF.
 
    IF w_amount CS 'Rupee' AND w_amount NS 'Rupees'.
      IF w_amount CS 'Paise'.
        REPLACE 'Rupee' WITH 'And' INTO w_amount.
      ELSE.
        REPLACE 'Rupee' WITH space INTO w_amount.
      ENDIF.
      CONCATENATE  w_amount ' Only' INTO w_amount.
    ELSEIF w_amount CS 'Rupees'.
      IF w_amount CS 'Paise'.
        REPLACE 'Rupees' WITH 'And' INTO w_amount.
      ELSE.
        REPLACE 'Rupees' WITH space INTO w_amount.
      ENDIF.
      CONCATENATE  w_amount ' Only' INTO w_amount.
    ELSE.
      CONCATENATE w_amount ' Only' INTO w_amount.
    ENDIF.
 
    TRANSLATE w_amount TO UPPER CASE.
 
    words = w_amount.
  ENDIF.
 
 
 
ENDFUNCTION.

Arunima

Read only

0 Likes
1,215

hii Arunima,

In the func. module you have used it is hardcoded as 'Paise' and 'Rupees' , My situation is that it can be Dollars or pounds or peso etc insted of rupess and cents or shellings etc instead of Paise.

help me out in this regards,

with regards,

sandeep akella.

Read only

Former Member
0 Likes
1,215

hi sandeep....!

If your Problem is with the table fields for currency..... it has separate data type .......[ CURR ] and it expects a dependency data type key which is Currency Key [ CUKY ]. It's simillar to the Quantity fields too, data type for the quantity is [ QUAN ] and the dependency key is [ UNIT ].

Read only

0 Likes
1,215

hii ravindra,

My doubt is that when we use func. module ' HR_IN_CHG_INR_WRDS' , if we give input as

AMT_IN_NUM = 229.29

we get out put as

AMT_IN_WORDS = TWO HUNDRED TWENTY NINE Rupees TWENTY NINE Paise

now the words 'Rupees' and 'Paise' are for indian currency , in the same way for US it is 'Dollar' and 'Cents' similarly for britan it is 'Pound' and 'shellings' . Using the func. module mentioned above i can get for indian currency, but not for other currencies .I found a table 'TCURC' in that table from field 'KTEXT' we can get the words like 'Rupees' , 'Dollars' , 'Pounds' i.e in the amount i mentioned 229.29 for 229 we can get it. for 0.29 i.e.. words like 'Paise' or 'cents' or 'shellings' ( i want currencies text for denomination lessthan 1 )are what i want ,hope i explained it much clearly.help me in solving it.

with regards,

sandeep akella.

Edited by: sandeep akella on Nov 12, 2008 10:32 AM

Edited by: sandeep akella on Nov 12, 2008 11:05 AM

Edited by: sandeep akella on Nov 12, 2008 11:21 AM

Read only

Former Member
0 Likes
1,215

nil