04-26-2010 6:48 AM
Hello,
In my form the along with GBP amount they need amount in INR.
I have used Exchange rate( VBRK-KURRF ) to get amount in INR.
For the above , I have done called calculation in amother program using perform endperform.
Requirement is final amount should contain commas.
How to pass the final amount with commas in out_tab structure itcsy .
LOOP AT out_tab WHERE name = 'TOTAL_INR'. "Total in INR
out_tab-value = TOTAL_INR.
MODIFY out_tab.
ENDLOOP.
Regards,
Rachel
04-26-2010 8:06 AM
You can use convert, replace or translate statements to convert the dot(.) into commas,
then you can pass that value in the out_tab.
04-26-2010 12:13 PM
My question is if amount is 565700.00 how can i insert comma to get 5675,700.00.
the itscy structure is of type char so will it allow commas.
Regards,
Rachel.
Edited by: Rachel on Apr 27, 2010 7:35 AM
04-27-2010 7:04 AM
Hi Use this FM
CALL FUNCTION 'MOVE_CHAR_TO_NUM'
EXPORTING
CHR = IN_TABLE-VALUE
IMPORTING
NUM = TOTAL_INR
EXCEPTIONS
CONVT_NO_NUMBER = 1
CONVT_OVERFLOW = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks & Regards,
Rahul Kanth Reddy
04-27-2010 11:40 AM
I think, you don't need to insert commas explicitly as sapscript handles formatting itself. Pass the field to sapscript through structure ITCSY and check the print preview. The amount should come with commas in print preview.
05-06-2010 7:58 AM
All the values which are calculated are finally passed via ITCSY structure.
This amount are getting printed without commas.
Regards,
Rachel.
05-06-2010 8:10 AM
I hope you are only calculating the value in the perform (Inside the Sapscript). So no need to change the format of the ITCSY value.
Before printing the symbol in the script you can use the command
/: SET COUNTRY 'US'
to format your amount field.
for further reading you can go through this link
[http://help.sap.com/saphelp_40b/helpdata/en/d1/8031f7454211d189710000e8322d00/content.htm]
Regards
Shiba Prasad Dutta