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

to split string in sapscript

Former Member
0 Likes
1,639

Hi,

I am new to the sap script and i am facing a problem as i have called subroutine to convert digit amount into number but its missing some words as 57,387,916.20- [Rs. FIVE CRORE SEVENTY THREE LAKH EIGHTY SEVEN THOUSAND NINE HUNDRED SIXTEEN AND P]

and i want to display it as:- FIVE CRORE SEVENTY THREE LAKH EIGHTY SEVEN THOUSAND NINE HUNDRED SIXTEEN AND PAISE TWENTY ONLY.

plzz provide me guidelines to solve this problem.

thank you.

Edited by: Saalim on Jun 2, 2009 9:09 AM

7 REPLIES 7
Read only

Former Member
0 Likes
1,210

Hi,

Check this FM 'HR_IN_CHG_INR_WRDS'

You need to call the perform from sapscript to fetch the text from this FM.

Split the string into two variables and display on the Sapscript. There is restriction of number of chars in the each.

Read only

0 Likes
1,210

yes i called the function module but how to split the variables,i am not getting so please tell me so it can solve my problem.

Thank you.

Read only

Former Member
0 Likes
1,210

Hi,

It is better to declare the variable used to display amount in words as STRING type.

Read only

Former Member
0 Likes
1,210

I think you need to check for the available space for printing this variable is sufficient or not.

And also you can try to see if all the data is populated correctly or not in that variable in debugging mode. Try this and tell me if u need any further help.

Regards,

Akanksha

Read only

Former Member
0 Likes
1,210

hi,

all you have to do is to create a FM which will split the string which you want to do and put a highfen mark in between so that it might not get disformatted. you have can have a view through this FM :-

STRING_SPLIT_AT_POSITION

Just pass the value u want to split and there will be no problem in displaying the string in a formatted way. sapscript does not support the facility of displaying the string or text in it or you can have a look for the CONCATENATE statement in SAPSCRIPT. If it can be used in it?

revert back if you wanna more.

Edited by: ricx .s on Jun 2, 2009 9:19 AM

Read only

Former Member
0 Likes
1,210

Hi Saalim,

I hope number display in words may not fit into the window , try to reduce the font size and check or increase the window size .

Regards,

Sandhya

Read only

prince_isaac
Active Participant
0 Likes
1,210

hie Saalim

try this:


FORM get_amt_words .

  DATA: x_amount TYPE p DECIMALS 2,
        xwords   LIKE spell.

  x_amount = zxx-amount.

  CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
      amount    = x_amount
      currency  = 'ZWD'
    IMPORTING
      in_words  = xwords
    EXCEPTIONS
      not_found = 1
      too_large = 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.

  CONCATENATE xwords-word 'Dhora' xwords-decword 'Senti'
  INTO zxx-amount_in_words SEPARATED BY space.

regards

Isaac Prince