06-29-2007 6:45 AM
Cd u plz tell me how to write this program in abap-
.to arrange given strings in ascending order like ( zenat, Raj, Pawan) o/p sd be
pawan, raj, zenat..
thanks
06-29-2007 6:48 AM
Hi,
Here are those
String Operations
Concatenate
Split
Shift
Replace
Translate
Offset
String length
String comparision
Concatenate
data : a(10),b(10),c(10),d(40).
A = Apple. B = Orange. C = Banana.
Concatenate A B C into D.
Write:/ d.
Concatenate A B C into D separated by /.
Write:/ d.
Split
data : a(10),b(10),c(10),d(40).
D = Apple/Orange/Banana.
Split d at / into a b c.
Write:/ a
/ b,
/ c.
Shift
Data : a(6) value ABCDEF.
Shift a.(by default shifts to left by one place)
write: / a. BCDEF
A = ABCDEF.
Shift a by 2 places.
Write:/ a. CDEF
Data : a(6) value ABCDEF.
Shift a right.
Write:/ a. ABCDE
A = ABCDEF.
Shift a right by 2 places.
Write:/ a. ABCD
Data : a(6) value ABCDEF.
Shift a up to C. Write:/ a. CDEF
a = ABCDEF.
Shift a circular. Write:/ a. BCDEFA
Replace
Data p(6) value ABCABC.
Replace ABC with DEF into p.
Write:/ p. DEFABC
(Replaces first occurrence only)
Translate
Data p(11) ABC ABC ABC.
Translate p using ADBECF.
WRITE:/ P. DEF DEF DEF
Offset
Data p(6) value ABCDEF, q(3).
q = p+2(3).
Write 😕 q. CDE
q = p+0(1).
Write:/ q. A
String Length.
Data: a(50) value PQRPQRPQRXYZ,
b type i.
b = strlen( a ). 15
String Comparison
Contains any ca
Contains only co
Contains string cs and
Contains pattern cp.
Contains any (ca) [ case sensitive ]
If SAP ca ABAP/4.
Write:/ True.
Else.
Write:/ False.
Endif.
True
Contains only (co) [ case sensitive ]
If SAP co ABAP/4.
Write:/ True.
Else.
Write:/ False.
Endif.
False
Contains string (cs) [ not case sensitive ]
If ABAP/4 cs Ab.
Write:/ True.
Else.
Write:/ False.
Endif.
True
Contains pattern (cp) [ not case sensitive ]
If ABAP/4 cp *aP++.
Write:/ True.
Else.
Write:/ False.
Endif.
True
AND SOME MORE...........................
CLEAR ... WITH
CONCATENATE
CONDENSE
CONVERT TEXT ... INTO SORTABLE CODE
OVERLAY
REPLACE
SEARCH
SHIFT
SPLIT
TRANSLATE ... TO UPPER/LOWER CASE
TRANSLATE ... USING
http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c55479b3dc11d5993800508b6b8b11/content.htm
Regards
Kishi.
06-29-2007 6:49 AM
Hi Ajay,
Take all these strings into ine internal table and sort the internal table.
Award points if useful or getback,
aleem.
06-29-2007 6:59 AM
Hi,
Declare one internal table and place all the strings in to that,
Sort the internal table by
SORT ITAB by ASCENDING/DESCENDING.
Reward points if it is helpful.
Regards,
Sangeetha.A
06-29-2007 7:18 AM