Application Development 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: 

Sap Scripts : How to pass amount with commas in out_tab structure itcsy?

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

You can use convert, replace or translate statements to convert the dot(.) into commas,

then you can pass that value in the out_tab.

Former Member
0 Kudos

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

0 Kudos

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

satyajit_mohapatra
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

All the values which are calculated are finally passed via ITCSY structure.

This amount are getting printed without commas.

Regards,

Rachel.

Former Member
0 Kudos

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