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: 

displaying amount in small letters

Former Member
0 Kudos

hi,

im using 'HR_IN_CHG_INR_WRDS ' FM to display amount in words.the value is getting displayed as 'TWENTY TWO

Rupees' .but i want it to display as 'Twenty two' only and there should not be 'Rupees' at the end.for this i tried to copy std.FM into ZHR_IN_CHG_INR_WRDS along with new Zfunction group.it's not allowing me to copy like this.it's asking access key.please provide me solution.

Thanks

k srinivas

4 REPLIES 4

Former Member
0 Kudos

It should allows you to copy it to a Z FM. First you have to create a z function group and make sure that it is activated.

Then try to copy it to a Z FM and make sure that the Function Group is your Z FG.

Former Member
0 Kudos

Use TRANSLATE To change to lower case.

Regards,

Satish

Former Member
0 Kudos

hi

translate the text using

translate v_text to lower case

or pass the text to FM to get the first letter of the word in CAPS

Test for function group OLDS

Function module STRING_UPPER_LOWER_CASE

Uppercase/Lowercase

Runtime: 215 Microseconds

Import parameters Value

DELIMITER 10

STRING1 SAP INDIA

Export parameters Value

STRING Sap india

OR THIS

Test for function group JYKE

Function module ISM_CONVERT_TO_LOWER_CA

Uppercase/Lowercase

Import parameters Value

INPUT SHIVA

Export parameters Value

OUTPUT shiva

Former Member
0 Kudos

"After your FM write this code..
DATA :itab TYPE TABLE OF string.
DATA : wa_itab TYPE itab.
DATA : amount(255) VALUE 'TWENTY TWO Rupees'.
DATA : amount_words TYPE string .


SPLIT amount AT space INTO TABLE itab.
LOOP AT itab INTO wa_itab.
  TRANSLATE wa_itab TO LOWER CASE.
  TRANSLATE wa_itab+0(1) TO UPPER CASE.
  IF wa_itab EQ 'Rupees'.
    wa_itab = space.
  ENDIF.
  MODIFY itab FROM wa_itab.
  CONCATENATE amount_words  wa_itab INTO amount_words
  SEPARATED BY space.

ENDLOOP.

WRITE 😕 amount_words.