2008 Jun 06 9:59 AM
hi mates,
im having an itab which has int, char, decimal types fields in it. now i need to translate the itab to uppercase. when i use the statement " translate itab to uppercase." im getting error stating itab should be of type char.
how can i make the itab of type char. any help will be appreciated...
regards
mano
hi mates,
im having an itab which has int, char, decimal types fields in it. now i need to translate the itab to uppercase. when i use the statement " translate itab to uppercase." im getting error stating itab should be of type char.
how can i make the itab of type char. any help will be appreciated...
regards
mano
2008 Jun 06 10:05 AM
Hi,
In your case define another internal table of type char having the same structure as itab.Then move the records from itab to new internal table and then apply the statement "translate itab_new to uppercase".
2008 Jun 06 10:37 AM
hi mate,
thanks for ur reply but still im getting the same error as before.
can u guide me ...
regards
mano
2008 Jun 06 10:06 AM
Hi,
Translate the field only which has type char.
if the field f2 in itab has the type c, use the following syntax before the append statement.
***
translate itab-f2 to upper case.
append itab.
********
Regards,
Bhanu
2008 Jun 06 10:08 AM
hi,
take a internal table of single character field of length that equal to other table length
then using loop amd move statemnts populate the new table
regards
mahesh
2008 Jun 06 10:41 AM
hi,
can u just elaborate ur solution with some sample code...
bcoz im not getting the clear picture...
regards
mano
2008 Jun 06 10:47 AM
Hi,
consider you have the workarea of you output table structure.
after assigning all the field value u will do append to internal table.
declare a string type variable
l_string type string.
clear l_string.
l_string = 'abcd'.
translate l_string to uppercase.
wa_output -field1 = l_string.
append wa_output to t_output.
clear wa_output.
2008 Jun 06 10:09 AM
DATA text TYPE string.
text = `Careful with that Axe, Eugene`.
TRANSLATE text TO UPPER CASE
u cant translate a hole itab using this statement...
i think u have go each and every line.....to translate
Reward IF...........
Regards
Anbu
2008 Jun 06 10:09 AM
Hi,
You cannot translate the internal table as a whole to upper case. But you can translate each field in the internal table provided the field is of type Char.
Loop at itab.
translate itab-field to uppercase.
modify itab.
Endloop.
Thanks and Regards,
Lakshmi.
2008 Jun 06 10:09 AM
hi ,
in your case you only need to convert the character field to upper case.
So do this,
loop at itab into wtab.
translate wtab-<char field> to upper case.
modify itab from wtab index sy-tabix transporting <charfield>.
endloop.
If u put this chunk of code i think ur problem will be solved.
2008 Jun 06 10:10 AM
Before appending use one temporary string type variable and do the translation, and assign it back