on 11-14-2006 6:15 AM
hi ,
this is the scenario...i have an internal table in which one field is a character...and the records in the internal table field has names in it..and i have to print in form in the way that first letter is capital and rest is small hear is am example.....
internal table....ITAB with fields...X X X Char.
records in Char...
ron
Tom
dany
aron....
these are retrieved from the data base...so there is no garnets that they are maintained in the way i required...
Records should be printed in this fashion in form...
<b>R</b>on
<b>T</b>om
<b>D</b>any
<b>A</b>ron
Thanks in advance
U can try it using the TRANSLATE statement
data : TEXT(10) type C.
data : T type C.
TEXT = 'gopi'.
move TEXT+0(1) to T.
translate T to upper case.
concatenate T TEXT+1(9) into TEXT.
write : TEXT.
Just try the above example.
Regards
- Gopi
Message was edited by:
Gopi Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
look into this program.
report zwa_test2.
data: begin of itab occurs 0,
name(10),
end of itab.
data: a(1).
itab-name = 'ron'.
append itab.
itab-name = 'tom'.
append itab.
itab-name = 'dany'.
append itab.
LOOP AT ITAB.
a = itab-name(1).
translate a to upper case.
itab-name(1) = a.
write:/ itab-name.
ENDLOOP.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is tested workin fine just copy and paste it and run...
DATA: OUTPUT TYPE STRING.
CALL FUNCTION 'SWA_STRING_TO_UPPERCASE'
EXPORTING
INPUT_EXPRESSION = 'KISHAN'
* INPUT_STRING =
PRESERVE_EXISTING_CAPITALS = ''
CAPITALIZE_AFTER_SPACE = 'X'
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT_STRING = OUTPUT
* OUTPUT_EXPRESSION =
EXCEPTIONS
EXPRESSION_TRUNCATED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
kishan negi
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.