Regarding string operations
Hi All,
i've a string holding the value as given below.
AA,17,2/19/2003,"9,999.00",USD,00,10,318,"193,275.31"
by performing some string operations i want the result string in the format as given below:
AA,17,2/19/2003,"9999.00",USD,00,10,318,"193,275.31"
i.e., i want to remove all the commas(,)that are included in between a pair of " " only.
can anyone provide me a sample code for the same
Hi vijay,
A bit complex but works for sure, check the following logic,
REPORT zsritest.
DATA: gs_string TYPE string.
gs_string = 'AA,17,2/19/2003,"9,999.00",USD,00,10,318,"193,275.31"'.
WRITE: / gs_string.
PERFORM string_trim CHANGING gs_string.
* FORM string_trim *
* --> LS_STRING *
FORM string_trim CHANGING ls_string.
DATA: lt_string TYPE string OCCURS 0 WITH HEADER LINE,
lv_tabix TYPE i,
lv_start.
SPLIT gs_string AT '"' INTO TABLE lt_string.
CHECK sy-subrc EQ 0.
CLEAR gs_string.
LOOP AT lt_string.
lv_tabix = sy-tabix MOD 2.
IF lv_tabix EQ 0.
TRANSLATE lt_string USING ', '.
CONDENSE lt_string NO-GAPS.
ENDIF.
IF lv_tabix EQ 0 OR lv_start EQ 'X'.
CONCATENATE gs_string lt_string INTO gs_string SEPARATED BY '"'.
IF lv_start EQ 'X'.
CLEAR lv_start.
ELSE.
lv_start = 'X'.
ENDIF.
ELSE.
CONCATENATE gs_string lt_string INTO gs_string.
ENDIF.
ENDLOOP.
IF lv_start EQ 'X'.
CONCATENATE gs_string '"' INTO gs_string.
ENDIF.
WRITE: / gs_string.
ENDFORM.
Hope this helps..
Sri
Similar Messages
-
Regarding string operations and value alignment below heading
Hi all,
I have a requirement of sending the data in the form of table in mail thought me program.
Am sending the mail content form int table.
The issue is the table getting displayed like this(I used internal table of strings for this)-
Name | Old value | New value -->Heading string
Description | Material for production of tractors | Material for tractors -->value string1
weight | 123 | 124 -->value string2
Value 124 should have been well below New value.
In short am not able to arrange the values (Because of variable length of values)well below table field so that i can distinguish various values in same row.Please guide me for this issue .
Thank you,
Edited by: sanu debu on Mar 22, 2009 1:43 PMhi,
use UNDER option.
like
write:
/ 5 text-001(give text ele as carrid)
10 text-002(give as connid)
loop at itab into fs_itab.
write: / fs_itab-carrid under text-001,
fs_itab-connid under text-002.
endloop.
Regards,
jaya -
String operations on internal table text....
Original table is consists of 2 columns:
E
RFC error(SM_DHTCLNT010_READ): Error when opening connection
E RFC error(SM_DHLCLNT010_READ): Error when opening connection
E RFC error(SM_DHKCLNT010_READ): Error when opening connection
E RFC error(SM_E10CLNT000_READ): 'tdhtci00.emea.gdc:sapgw02' E No read RFC FOR SM_B72CLNT003_READ
E No read RFC FOR SM_B71CLNT003_READ
S Clients for system 'E21' found in RFC 'SM_E21CLNT001_READ'
S Clients for system 'E22' found in RFC 'SM_E22CLNT001_READ'
S Clients for system 'E23' found in RFC 'SM_E22CLNT001_READ'
Now we need to apply string operations such that result table is 3 columns with new refined message:
status sid
Message NEW_TEXT
E DHT
RFC error Error when opening connectionE DHL RFC error Error when opening connection
E DHK RFC error Error when opening connection
E E10 RFC error tdhtci00.emea.gdc:sapgw02
E B72 No RFC LINK
E B71 No RFC LINK
S E21 DATA READ
S E22 DATA READ
S E23 DATA READ
String conditions to arrive at new table is:
1) to get SID column : the conditions are
If the Status is RFC Error then next 3 Characters after the _ must be extracted as SID
Else the SID is between the first and the second inverted comma
Example: Clients for system 'E21' found in RFC 'SM_E21CLNT001_READ'extracts E21 as SID
2) for message column
· message RFC Error if the message text
starts with RFC Error
· message no RFC Link if the message text starts with No read RFC*
· message Data Read if the Substring found in RFC</b> was found in the Message
3) If the Status is RFC Error then the whole Textstring behind the : must be Extracted
For example if message is RFC error(SM_DHLCLNT010_READ): Error when opening connection NEW_TEXT will be Error when opening connection
Need ur inputs on these.
Bset regards,
SubbaHi,
this u can acheive simply using offset:
var_name+off(len). "
e.g. wa_message-fld+0(3) = first threee characters
wa_message-fld(3) same as above first three characters
wa_message-fld+2(2) " will display second and third characte of wa_message-fld
this u can use to set condtions like :
if wa_message-fld(9) = 'RFC Error'.
"process here
endif.
Hope this will help u...
Jogdand M B -
String operations in internal table
Dear friends..
Good morning.
I wish to know.. how i segregate the field from a database table to internal table into two different internal table field. say for example.
i have db table tab1 which has field number
tab1 -> number
and i have another internal table itab1 whic has two fields numa and numb
tab1 -> numa
-> numb
i have value in tab1->number is 001 and 0001
i wish to segregate this two values in to internal table
if the value is 001 then it should be into 001 -> numa
if the value is 0001 then it should be into 0001-> numb
i dont know how to perform the string operations in internal table.. would you like to tell me how i fix this problem any suggetion, article, code will be great help of mine..
thanking you
Regards
NaimHi,
what u can do is check the lenth
lit_data_tab.
lit_data_3
lit_data_4.
lv_char3 type char3.
lv_char4 type char4.
lv_length type i.
loop at lit_data_tab.
lv_length = STRLEN ( lit_data_tab-value ).
if lv_length = 3.
lv_char3 = lit_data_tab-value .
append lv_char3 to lv_char3 type char3.
else.
lv_char4 = lit_data_tab-value .
append lv_char4 to lv_char3 type char4.
endif.
endloop.
if u want
numa numb
003 0003.
then u have to loop in one table and modify other.
that is any one table should contains both the field.
read the table with one field
mark helpfull answers
Regards
Message was edited by: Manoj Gupta -
Efficiency of Java String operations
Hi,
for an Information Retrieval project, I need to make extensive use of String operations on a vast number of documents, and in particular involving lots of substring() operations.
I'd like to get a feeling how efficient the substring() method of java.lang.String is implemented just to understand whether trying to optimize it would be a reasonable option (I was thinking of an algorithm for efficient string pattern matching such as the Knuth-Morris-Pratt algorithm, but if java.lang.String already applies similarly efficient algorithms I would not bother).
Can someone help?
JThanks for your comment. Yes of course you're right, I
mean indexOf(). If so (thanks DrClap), let me enter the discussion.
The indexOf() implements a so called "brute force algorithm".
The performance is O(n*m), where n is the length of the text, and
m is the length of the pattern, but is close to n on the average.
The KMP is O(n), so the performance gain should be hardly noticeable.
To get a real performance gain you should look at the BM (Boyer-Moore,
O(n/m)) algorithm or some of its descendants.
As for java.util.regex package, as far as i understand it should be
several times slower than indexOf(), because it reads EACH character through an interface method (as opposed to direct array access in indexOf()).
Though it's still to be proved experimentally. -
To use Character string operator in ABAP
HI,
I have a problem with joining the two fields with different data length i.e
OBJKY has length (30).
tknum has length (10).
the above read table i_nast works as long as both has the records not greater than 10 and I do have some records with greater than 10 for OBJKY in the database and my read is failing at that scenario, I need to use a charater string operator, as I am new to ABAP, can any one suggest me how to do .
...SQL..
select OBJKY DATVR from nast
into corresponding fields of table i_nast
where KSCHL = 'ZBOL'.
sort i_nast by OBJKY.
LOOP at i_ship_data.
read table i_nast with key
OBJKY = i_ship_data-tknum binary search.
if sy-subrc = 0.
move: i_nast-datvr to i_ship_data-datvr.
endif.
modift i_ship_data.
ENDLOOP.HI,
Since OBJKY and TKNUM are with different lengths the Read statement works only
when OBJKY has a 10 character value identical to TKNUM.
but if we can assume that only first 10 characters of OBJKY are to be comapred with TKNUM then we can try the under mentioned approach:
Create a new field in the Internal table I_NAST with length 10 characters.(I_NAST-OBJKY_TEMP).
now assign the first 10 characters of OBJKY to this new field :
LOOP AT I_NAST.
MOVE I_INAST-OBJKY+0(10) TO OBJKY_TEMP.
MODIFY I_NAST.
ENDLOOP.
Now you can Modify your READ STATEMENT :
LOOP at i_ship_data.
read table i_nast with key
OBJKY_TEMP = i_ship_data-tknum binary search.
if sy-subrc = 0.
move: i_nast-datvr to i_ship_data-datvr.
endif.
modift i_ship_data.
ENDLOOP.
Hope this will help.
Note: You can pick up any 10 characters starting from 1 to 20 th character of the field
I_INAST-OBJKY.
Reward Points if found helpfull..
Cheers,
Chandra Sekhar. -
Regarding String Replacing ....
Hi Friends,
I have some problem regarding String replacing.
ex.
I have following string ::
=================================================
This is the java manager the main purpose for the jasper is used to create reports.
And the Java language is very extensible.
Is this the proper string functions provided by java isn't it ?
*================================================*
*i want to replace word "is" with "IS". but that word is not connected to word like Th{color:#ff00ff}is{color}*
*differ from simple separate "{color:#ff0000}is{color}" so Word should not be replaced in This only separate "is"*
*must be replaced. ?*
*Any Idea ?*
*{color}*
Edited by: Ghanshyam on Sep 14, 2007 4:27 PMHow about just searching for and replacing
" is "
instead of
"is"
So, using this code from the Java Developers Almanac 1.4 (2002 Addison-Wesley):-
static String replace(String str, String pattern, String replace) {> int s = 0;> int e = 0;> StringBuffer result = new StringBuffer();> > while ((e = str.indexOf(pattern, s)) >= 0) {> result.append(str.substring(s, e));> result.append(replace);> s = e+pattern.length();> result.append(str.substring(s));
return result.toString();
}Your would use:-
String newStr = replace(originalStr, " is "," IS ");
Edited by: mad_scientist on Sep 14, 2007 4:16 AM (Sorry about all the edits, just getting used to the formatting on here)
Edited by: mad_scientist on Sep 14, 2007 4:22 AM
Edited by: mad_scientist on Sep 14, 2007 4:24 AM -
Perl versus other "scripting" languages when doing string operations
I've been told that perl is a "scripting" language like the other languages mentioned in this forum.
If that's true, can these other languages handle the following spec as well as perl can? (See spec at end of this post.)
Or is perl stronger in string operations than the other scripting languages mentioned here?
Here's the spec:
1. I give your program a twenty-letter alphabet (any twenty letter alphabet)
For example:
ABCDEFGHIJKLMNOPQRST
2. I also give your program four groups (any four groups) of letters in this alphabet:
For example:
s: A,B,C,D,E
p: F,G,H,I,J
d: K,L,M,N,O
e: P,Q,R,S,T
3. I also give your program a sequence over the twenty-letter alphabet that I gave you in Step (1) above:
For example:
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
4. Given this sequence,you search for pairs of adjacent letters (x,y) where X and y are from different groups (the groups defined in Step (2) above.)
Also, you return the results of this search by giving me back the following two strings:
ABCD(EF)GHI(JK)LMN(OP)QRSTSRQ(PO)NML(KJ)IHG(FE)DCBA
ABCD(sp)GHI(pd)LMN(de)QRSTSRQ(ed)NML(dp)IHG(ps)DCBA
5. Note: if I give you a sequence that contains "overlapping" ordered pairs like:
...EFK...
then you ignore the second ordered pair. That is, you return:
...(EF)KOK - here is the final stuff on the "C" side.
To execute the program, the command line is:
20let.exe file1.txt file2.txt file3.txt > fileout.txt
Below, I've provided:
a) source code 20let.c
b) sample input file1.txt
c) sample input file2.txt
d) sample input file3.txt
e) output fileout.txt generated from these input files.
As soon as Bill finishes the perl version of the source code, I'll post that also.
source code of 20let.c
// 20let.c5
#include <stdio.h>
#include <stdlib.h>
int T[333],A[99999],G[333],B[99999],C[99999],N[299999],P[99999];
int n1,n2,f,p,x1,x2,n,m,a,b,c,i,j,k,x,y,z;
int E[233][233];
FILE *file;
int substrings(int x1,int x2);
int main(int argc, char*argv[]) {
if(argc<3){
printf("\nusage:20let protein-file nucleotide-file pairs-include-file\n\n");
printf("marks amino-acid-pairs from different groups in protein-file\n");
printf("iff they are in the include-file\n");
exit(1);
//----------------define the groups G['I'] = 's', e.g.
x='s'; G['I']=x;G['M']=x;G['V']=x;G['A']=x;G['G']=x;
x='p'; G['F']=x;G['L']=x;G['P']=x;G['W']=x;G['W']=x;
x='d'; G['H']=x;G['Q']=x;G['D']=x;G['E']=x;G['E']=x;
x='t'; G['S']=x;G['T']=x;G['Y']=x;G['N']=x;G['C']=x;G['K']=x;G['R']=x;
//----------------the 4 bases T['a'] = 0 thru 3
for(x=0;x<222;x++)
T[x]=-999;
T['a']=0;T['c']=1;T['g']=2;T['t']=3;
T['A']=0;T['C']=1;T['G']=2;T['T']=3;
for(i=65;i<70;i++)G<i>='s';
for(i=70;i<75;i++)G<i>='p';
for(i=75;i<80;i++)G<i>='d';
for(i=80;i<85;i++)G<i>='t';
//---------------- read include-file file3 xxxyyy pairs E[x][y] of interest
f=0;
for(x=0;x<222;x++)
for(y=0;y<222;y++)
E[x][y]=0;
if((file=fopen(argv[3],"rb"))==NULL){
printf("\ncan't open exclude-file %s\n",argv[1]);exit(1);
mq1: if(feof(file))
goto mq3;
x=fgetc(file);y=fgetc(file);x=fgetc(file);
x=T[fgetc(file)]*16+T[fgetc(file)]*4+T[fgetc(file)];
y=T[fgetc(file)]*16+T[fgetc(file)]*4+T[fgetc(file)];
if(x<64 && x>=0 && y<64 && y>=0){
E[x][y]=1;
f++;
mq2: if(feof(file))
goto mq3;
a=fgetc(file);
if(a!=10)
goto mq2;
goto mq1;
mq3: fclose(file);
//------------------read amino-acid file file1 == P array
if((file=fopen(argv[1],"rb"))==NULL){
printf("\ncan't open file %s\n",argv[1]);exit(1);}
p=0;
m1p: if(feof(file))
goto m2p;
p++;
P[p]=fgetc(file);
if(G[P[p]]==0)
p--;
goto m1p;
m2p:;
fclose(file);
//------------------read nucleotide file file2 == N array
if((file=fopen(argv[2],"rb"))==NULL){
printf("\ncan't open file %s\n",argv[1]);exit(1);
n=0;
m1n: if(feof(file))
goto m2n;
n++;
N[n]=fgetc(file);
if(N[n]!='a' && N[n]!='c' && N[n]!='g' && N[n]!='t')
n--;
goto m1n;
m2n:;
fclose(file);
//for(i=1;i<=p;i++)printf("%c",P<i>);printf("\n");
//for(i=1;i<=n;i++)printf("%c",N<i>);printf("\n");
//printf("%i include-pairs %i nucleotides %i proteins\n",f,n,p);
//------------1st line------------------ B<i> = result
m=0;
for(i=1;i<=p;i++){
n1=T[N[i*3-2]]*16+T[N[i*3-1]]*4+T[N[i*3]];
n2=T[N[i*3+1]]*16+T[N[i*3+2]]*4+T[N[i*3+3]];
//printf("\ni=%i p=%i n1=%i n2=%i\n",i,p,n1,n2);
if(E[n1][n2]<1 || G[P<i>]==G[P[i+1]] /* || i==n */){
printf("%c",P<i>);
m++;
B[m]=P<i>;
goto m3;
printf("(%c%c)",P<i>,P[i+1]);
i++;
m++;
B[m]='(';
m++;
B[m]=P[i-1];
m++;
B[m]=P<i>;
m++;
B[m]=')';
//printf("(%c)%c",G[A<i>],G[A[i+1]]);i++;
m3:;
printf("\n");
//------------2nd line------------------ C<i> = result
m=0;
for(i=1;i<=p;i++){
n1=T[N[i*3-2]]*16+T[N[i*3-1]]*4+T[N[i*3]];
n2=T[N[i*3+1]]*16+T[N[i*3+2]]*4+T[N[i*3+3]];
if(E[n1][n2]<1 || G[P<i>]==G[P[i+1]] /* || i==n */){
printf("%c",P<i>);
m++;
C[m]=P<i>;
goto m4;
printf("(%c%c)",G[P<i>],G[P[i+1]]);
i++;
m++;
C[m]='(';
m++;
C[m]=G[P[i-1]];
m++;
C[m]=G[P<i>];
m++;
C[m]=')';
//printf("(%c)%c",G[A<i>],G[A[i+1]]);i++;
m4:;
printf("\n");
//for(i=1;i<=m;i++)printf("%c",B<i>);printf("\n");
//------------3rd line------------------ printf only
m=0;
for(i=1;i<=p;i++){
n1=T[N[i*3-2]]*16+T[N[i*3-1]]*4+T[N[i*3]];
n2=T[N[i*3+1]]*16+T[N[i*3+2]]*4+T[N[i*3+3]];
if(E[n1][n2]<1 || G[P<i>]==G[P[i+1]] /* || i==n */){
printf("%c%c%c",N[i*3-2],N[i*3-1],N[i*3]);
goto m33;
printf("(%c%c%c%c%c%c)",N[i*3-2],N[i*3-1],N[i*3],N[i*3+1],N[i*3+2],N[i*3+3]);
i++;
m33:;
printf("\n");
//--------------substrings------------
substrings(20,29);
substrings(30,39);
substrings(40,49);
substrings(50,59);
substrings(60,69);
return 0;
int substrings(int x1,int x2)
printf("\n");
printf("lengths %i - %i : \n",x1,x2);
for(i=1; i<p; i++)
for (j=i+x1; j<i+x2; j++) {
if (C<i>>95 && C[j]>95) { // if lc letter in line2
for(x=i;x<=j;x++)
printf("%c",C[x]);
printf("|");
for(x=i;x<=j;x++)
if(B[x]>44) // if not () in line 1
printf("%c",B[x]);
printf("|");
for(x=i;x<=j;x++)
if(C[x]>95) // if lc letter line2
printf("%c",C[x]);
printf("\n");}
input file1.txt
MKKHTDQPIADVQGSPDTRH
IAIDRVGIKAIRHPVLVADK
DGGSQHTVAQFNMYVNLPHN
FKGTHMSRFVEILNSHEREI
SVESFEEILRSMVSRLESDS
GHIEMTFPYFVNKSAPISGV
KSLLDYEVTFIGEIKHGDQY
GFTMKVIVPVTSLCPCSKKI
SDYGAHNQRSHVTISVHTNS
FVWIEDVIRIAEEQASCELF
GLLKRPDEKYVTEKAYNNPK
FVEDIVRDVAEILNHDDRID
AYVVESEBFESIHNHSAYAL
IERD
input file2.txt
atgaaaaaacatactgatcaacctatcgctgatgtgcagggctcaccggataccagacat
atcgcaattgacagagtcggaatcaaagcgattcgtcacccggttctggtcgccgataag
gatggtggttcccagcataccgtggcgcaatttaatatgtacgtcaatctgccacataat
ttcaaagggacgcatatgtcccgttttgtggagatactaaatagccacgaacgtgaaatt
tcggttgaatcatttgaagaaattttgcgctccatggtcagcaggctggaatcagattcc
ggccatattgaaatgacttttccctacttcgtcaataaatcagcccctatctcaggtgta
aaaagcttgctggattatgaggtaacctttatcggcgaaattaaacatggcgatcaatat
gggtttaccatgaaggtgatcgttcctgttaccagcctgtgcccctgctccaagaaaata
tccgattacggtgcgcataaccagcgttcacacgtcaccatttctgtacacactaacagc
ttcgtctggattgaggacgttatcagaattgcggaagaacaggcctcatgcgaactgttc
ggtctgctgaaacggccggatgaaaaatatgtcacagaaaaggcctataacaatccgaaa
tttgtcgaagatatcgtccgtgatgtcgccgaaatacttaatcatgatgaccggatagat
gcctatgttgttgaatcagaaaactttgaatccatacataatcactctgcatacgcactg
atagagcgcgac
input file3.txt
FA tttgcc
FA ttcgcc
FA tttgct
FA ttcgct
LK ttaaaa
LK ttgaaa
LK ttaaag
LK ttgaag
LS ctgctc
LS ctgctt
LS ctactc
LS ctactt
LT ctcacc
LT ctcact
LT cttacc
LT cttact
LY ctctac
LY ctctat
LY ctttac
LY ctttat
LG ctcggc
LG ctcggt
LG cttggc
LG cttggt
IP attccc
IP attcct
IP atcccc
IP atccct
IP attcca
IP attccg
IP atccca
IP atcccg
ML atgctc
ML atgctt
ML atgctc
ML atgctt
VL gtgctg
VL gtgcta
VL gtactg
VL gtacta
VS gtgtcc
VS gtatct
VS gtgtcc
VS gtatct
VT gtcacc
VT gtcact
VT gttacc
VT gttact
VS gtcagc
VS gtcagt
VS gttagc
VS gttagt
SL tcgctg
SL tcgcta
SL tcactg
SL tcacta
SP tctcca
SP tctccg
SP tcccca
SP tccccg
PV ccggtg
PV ccggta
PV ccagtg
PV ccagta
PG cccggc
PG cccggt
PG cctggc
PG cctggt
TL acgctg
TL acgcta
TL acactg
TL acacta
TP acgccg
TP acgcca
TP acaccg
TP acacca
AL gcttta
AL gctttg
AL gcctta
AL gccttg
AP gcgccg
AP gcgcca
AP gcaccg
AP gcacca
AP gctcca
AP gctccg
AP gcccca
AP gccccg
AN gctaat
AN gctaac
AN gccaat
AN gccaac
AS gccagc
AS gccagt
AS gctagc
AS gctagt
YP tatccg
YP tatcca
YP tacccg
YP taccca
HP catccg
HP catcca
HP cacccg
HP caccca
QR cagcga
QR cagcgg
QR caacga
QR caacgg
DL gatttg
DL gattta
DL gacttg
DL gactta
EN gaaaat
EN gaaaac
EN gagaat
EN gagaac
EK gaaaaa
EK gaaaag
EK gagaaa
EK gagaag
ER gagcga
ER gagcgg
ER gaacga
ER gaacgg
WR tggcga
WR tggcgg
RV cgggtg
RV cgggta
RV cgagtg
RV cgagta
RW cggtgg
RW cgatgg
SG agtgga
SG agtggg
SG agcgga
SG agcggg
GF ggtttt
GF ggtttc
GF ggcttt
GF ggcttc
GL gggctg
GL gggcta
GL ggactg
GL ggacta
GY gggtat
GY gggtac
GY ggatat
GY ggatac
GY ggttat
GY ggttac
GY ggctat
GY ggctac
GK ggaaaa
GK ggaaag
GK gggaaa
GK gggaag
GK ggcaag
GK ggcaaa
GK ggtaag
GK ggtaaa
GW ggctgg
GW ggttgg
GR gggcgg
GR gggcga
GR ggacgg
GR ggacga
GS ggcagc
GS ggcagt
GS ggtagc
GS ggtagt
output fileout.txt
MKKHTDQPIADVQGSPDTRHIAIDRVGIKAIR(HP)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(VS)RLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVP(VT)SLCPCSKKISDYGAHNQRSH(VT)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(EK)YVT(EK)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(EF)ESIHNHSAYALIERD
MKKHTDQPIADVQGSPDTRHIAIDRVGIKAIR(dp)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(st)RLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVP(st)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(dp)ESIHNHSAYALIERD
atgaaaaaacatactgatcaacctatcgctgatgtgcagggctcaccggataccagacatatcgcaattgacagagtcggaatcaaagcgattcgt(cacccg)gttctggtcgccgataaggatggtggttcccagcataccgtggcgcaatttaatatgtacgtcaatctgccacataatttcaaagggacgcatatgtcccgttttgtggagatactaaatagccacgaacgtgaaatttcggttgaatcatttgaagaaattttgcgctccatg(gtcagc)aggctggaatcagattccggccatattgaaatgacttttccctacttcgtcaataaatcagcccctatctcaggtgtaaaaagcttgctggattatgaggtaacctttatcggcgaaattaaacatggcgatcaatatgggtttaccatgaaggtgatcgttcct(gttacc)agcctgtgcccctgctccaagaaaatatccgattacggtgcgcataaccagcgttcacac(gtcacc)atttctgtacacactaacagcttcgtctggattgaggacgttatcagaattgcggaagaacaggcctcatgcgaactgttcggtctgctgaaacggccggat(gaaaaa)tatgtcaca(gaaaag)gcctataacaatccgaaatttgtcgaagatatcgtccgtgatgtcgccgaaatacttaatcatgatgaccggatagatgcctatgttgttgaatca(gaaaac)tttgaatccatacataatcactctgcatacgcactgatagagcgc
lengths 20 - 29 :
st)SLCPCSKKISDYGAHNQRSH(s|VTSLCPCSKKISDYGAHNQRSHV|sts
st)SLCPCSKKISDYGAHNQRSH(st|VTSLCPCSKKISDYGAHNQRSHVT|stst
t)SLCPCSKKISDYGAHNQRSH(s|TSLCPCSKKISDYGAHNQRSHV|ts
t)SLCPCSKKISDYGAHNQRSH(st|TSLCPCSKKISDYGAHNQRSHVT|tst
lengths 30 - 39 :
st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(d|VTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDE|std
t)ISVHTNSFVWIEDVIRIAEEQASCELFGLL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LCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEK|ststdt
t)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(d|TSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDE|tstd
t)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt|TSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEK|tstdt
t)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(d|TSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEKYVTE|tstdtd
Edited by: David Halitsky on Mar 18, 2008 4:21 AM
Edited by: David Halitsky on Mar 18, 2008 4:22 AM -
Need help in String operations
HI all,
I need help in String operations.I am getting file path of an image as
c:\test\img\abc.gif"
I need to convert it in to c:/test/img/abc.gif".
Can any one suggest the solution for this.
Thanks,
Durga.[email protected] wrote:
I used String replace method but I am not able to do it because "/" is a special character."/" is not a special character, "\" is a special character, which needs to be escaped by "\" itself. -
Problem regarding Bit operation
I am currently trying new approach to speed up my current operation, for this I have to know the bit operations :-( but I am having trouble in finding the references for that.
Can you please send me some references regarding bit operation.
Thanks for taking keen interest in this post.By default, commit operation will save all rows to db. You can write update query in a button
by taking jdbc connection reference from environment. After updating row in db you should
refresh your ADF UI to see changes.
You can use this code for creating db connection.
InitialContext initialContext = new InitialContext();
DataSource ds = (DataSource)initialContext.lookup("java:comp/env/jdbc/conDS");
-- -
Performance tuning for String operation in Field routine
Dear Experts,
I am writing a ABAP routine in field level for capturing an occurence of a string.
The string may occur in anny of the values in itab. The ITAB has around 100 thousand records and the source package 400 thousand records.
My coding goes as
LOOP AT INV_ITAB INTO INV_WA.
IF SOURCE_FIELDS-/BIC/X_ASSIGNM CS INV_WA-XFIELD3(7).+
RESULT = INV_WA-PO_NO.
EXIT.
ELSE.
RESULT = 'NA'.
ENDIF.
ENDIF.
Now the coding takes more than 15 hours and still running. (It is working fine for small number of records) .
I beleive the problem is in the LOOP statement (goes around 400000*100000 times). Is it possible for me to somehow improve this code so as to decrease the load time.
Kindly help on this.
Thanks,
Rajarathnam.SHi,
I think you can use this code in your start routine instead of field level it will speed up your process.As it checks on datapacket level instead of checking records one by one.
I am just putting some logic
LOOP AT INV_ITAB INTO INV_WA.
IF Datapackage-/BIC/X_ASSIGNM CS INV_WA-XFIELD+3(7).
Datapackage-targetfield = INV_WA-PO_NO.
EXIT.
ELSE.
Datapackage-targetfield = 'NA'.
ENDIF.
ENDIF.
Regards,
Ravi -
String Operations which contain the special character '#' in BDC Session
Hi
Iam getting a file from the application server, It is having the field seperator # .So i worked with SPLIT statement. Here i found that SPLIT is not working for # . Also i have tried with REPLACE ,It is also not working for # . But i found that both the statements are working for , and space also. So can anyone give me with any other alternative.
Your help is highly appriciated. Below is the code Iam working with.
1) replace '#' with ',' into string-string.
2) split string-string at '#' into
wa_vbak-auart wa_vbak-vkorg wa_vbak-vtweg wa_vbak-spart wa_vbak-kunnr.Hi meshack prasan appikatla,
If a character is non printable character then the SAP display that character as '#', But this # is not a real character that is the reason you are not getting the perfect answer. I thins your application file is tab de eliminater file.
Instid of declaring horzantal tab call you can use the follwoing logic.
(I think this is the better one)
use the following method.
create a hexa decimat variable.
Data:
c_hextab(1) TYPE x VALUE '09'.
use this hexadecimal character in your program
FORM fetch_header .
CLEAR fs_bbkpf.
SPLIT t_itab
AT c_hextab
INTO fs_bbkpf-tcode
fs_bbkpf-comp_id
fs_bbkpf-seq_no
fs_bbkpf-date
fs_bbkpf-rec_type_code
fs_bbkpf-rec_count
fs_bbkpf-tot_amt
fs_bbkpf-file_format
fs_bbkpf-iss_id
fs_bbkpf-proc_id
fs_bbkpf-reg_id
fs_bbkpf-proc_platform.
IF fs_bbkpf IS NOT INITIAL.
CASE fs_bbkpf-rec_type_code.
WHEN '28'.
w_header_28 = t_itab.
WHEN '05'.
w_header_5 = t_itab.
WHEN OTHERS.
w_header_ignr = w_header_ignr + 1.
TRANSFER t_itab TO p_file4.
ENDCASE. "CASE fs_bbkpf-rec_type_code
APPEND fs_bbkpf TO t_bbkpf.
ENDIF. "IF fs_bbkpf IS NOT INITIAL
ENDFORM. " fetch_header
Regards. -
We have a probrem; our program crashes due to SIGABRT.
Our program is multithreaded (about 40 thread total),and uses libmtmalloc for more performance.
By stack trace , when handling of '==' operator of STL string ,
free() and abort() is called like this:
(dbx) lwp l@25
Current function is WorkSessionCollection::findBySessionId
207 if (session->getSessionId() == sessionId)
t@null (l@25) stopped in (unknown) at 0xfedbd7fc
0xfedbd7fc: PROCEDURELINKAGE_TABLE_+0x0820 [PLT]: bcc,a,pt %icc,_PROCEDURE_LINKAGE_TABLE_+0x830 [PLT] ! 0xfedbd80c
(dbx) where
[1] 0xfedbd7fc(0x6, 0x0, 0xfeda1d04, 0x42568, 0xfede4280, 0x6), at 0xfedbd7fb
[2] getopt(0x0, 0x1, 0xff39403c, 0xa652c, 0xfede7298, 0x0), at 0xfed3de58
[3] free(0x3bc6e00, 0x3bc7020, 0x0, 0x10, 0x0, 0x10000000), at 0xff380b00
[4] libC_errors::get_msg(0x3bc7020, 0xfffb, 0x0, 0xffffffff, 0xa, 0xfc00), at 0xfeef62e0
[5] std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string(0x294, 0x0, 0x3bc7020, 0x3bc7048, 0x3bc7048, 0xf82fa638), at 0xfdb4cccc
=>[6] WorkSessionCollection::findBySessionId(this = 0xbe4750, msgId = CLASS), line 207 in "WorkSessionCollection.cpp"
[7] BusinessProxy::process(this = 0xc18ff8, message = CLASS), line 159 in "BusinessProxy.cpp"
[8] TcpProtocolControl::handleMessage(this = 0x3eaff28, message = 0x3f16270), line 221 in "ProtocolControl.cpp"
[9] SocketHandler::handle_input(this = 0x3871860, _ARG2 = 200), line 229 in "SocketHandler.cpp"
[10] 0xff2e6c90(0x2aa44b8, 0xf82fbc28, 0x0, 0x0, 0x1, 0x0), at 0xff2e6c8f
[11] 0xff2e6640(0x2aa44b8, 0xf82fbcb0, 0xf82fbd2c, 0x0, 0x0, 0x0), at 0xff2e663f
[12] 0xff2e61ac(0x2aa44b8, 0x0, 0xf82fbd2c, 0x0, 0x0, 0x0), at 0xff2e61ab
[13] 0xff2e5e10(0x2aa44b8, 0x0, 0xfede8bc0, 0xfda95800, 0x1e99410, 0x0), at 0xff2e5e0f
[14] 0xff2af7c0(0x281fda0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xff2af7bf
[15] event_loop(arg = 0x281fda0), line 40 in "FrontEnd.cpp"
[16] 0xff2d4610(0x1ea82b8, 0x8f0798, 0x0, 0x0, 0x0, 0x0), at 0xff2d460f
[17] 0xff2d44ec(0x1ea82b8, 0x0, 0x0, 0x0, 0x0, 0x1), at 0xff2d44eb
[18] 0xff21c590(0x1ea82b8, 0xf82fc000, 0x0, 0x0, 0x7e3f9c, 0x1), at 0xff21c58f
(dbx) list
207 if (session->getSessionId() == sessionId)
208 break; // for loop
209 session = NULL;
210 }
211
(dbx) print sessionId
dbx: cannot access address 0xfdf68f10
(dbx) print *session
dbx: cannot access address 0xfdf68f10
and here is the compiler environment:
versionMachine hardware: sun4u
OS version: 5.9
Processor type: sparc
Hardware: SUNW,Sun-Blade-1500
The following components are installed on your system:
Sun Studio 11
Sun Studio 11 C Compiler
Sun Studio 11 C++ Compiler
Sun Studio 11 Tools.h++ 7.1
Sun Studio 11 C++ Standard 64-bit Class Library
Sun Studio 11 Garbage Collector
Sun Studio 11 Fortran 95
Sun Studio 11 Debugging Tools (including dbx)
Sun Studio 11 IDE
Sun Studio 11 Debugger GUI
Sun Studio 11 Performance Analyzer (including collect, ...)
Sun Studio 11 X-Designer
Sun Studio 11 VIM editor
Sun Studio 11 XEmacs editor
Sun Studio 11 Native Connector Tool
Sun Studio 11 LockLint
Sun Studio 11 Building Software (including dmake)
Sun Studio 11 Documentation Set
version of "/apps/studio_11/SUNWspro/bin/./../prod/bin/../../bin/cc": Sun C 5.8 Patch 121015-04 2007/01/10
version of "/apps/studio_11/SUNWspro/bin/./../prod/bin/../../bin/CC": Sun C++ 5.8 Patch 121017-10 2007/02/21
version of "/apps/studio_11/SUNWspro/bin/./../prod/bin/../../bin/f90": Sun Fortran 95 8.2 2005/10/13
version of "/apps/studio_11/SUNWspro/bin/./../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.5 2005/10/13
version of "/apps/studio_11/SUNWspro/bin/./../prod/bin/../../bin/analyzer": Sun Performance Analyzer 7.5 2005/10/13
version of "/apps/studio_11/SUNWspro/bin/./../prod/bin/../../bin/dmake": Sun Distributed Make 7.7 2005/10/13
could you please help us?
Thanks in advance.This kind of crash can be due to referencing a string object after its lifetime has ended, or due to heap corruption.
The most common sources of heap corruption are
- using an invalid pointer
- uninitialized
- dangling (points to object that no longer exists)
- incremented or decremented outside object bounds
- points other than to an object start address
- deleting an object more than once
- reading or writing outside object bounds
- failing to guard a shared object in multithreaded code
- race condition in multithreaded code
The program failure usually occurs far away in space and time from the actual error condition.
You might also have run into a bug in the compiler or in system libraries. (You do not have the current Studio 11 patches.)
First, try running under the dbx with Run-Time Checking enabled:
% dbx myprogram
(dbx) check -all
(dbx) run
RTC will report many of the error conditions listed above.
Sun Studio 12 has a thread analyzer, which can help find race conditions in multithreaded code. You could download Studio 12 and try it out. If you do not need to run on Solaris 8, you can upgrade to Studio 12.
Whether you stay with Studio 11 or upgrade to Studio 12, you can get all the current patches here:
http://developers.sun.com/sunstudio/downloads/patches/
At minumum, get the current C++ compiler patch, the Common compiler patch, and the C++ Runtime LIbrary patch.
By following the links to the patches, you can see a list of bugs fixed since the patch levels you currently have. -
Question regarding container operations in BPM
Hi there,
i used a container operation to retreive a value from an Idoc, later in the process i need to put that value to a different message on a specified field, the thing is the container operation box only allows me to set a container as the target, any ideas how can i do this?, or if this should be done in a message mapping??, thanks!!
Roberto.Hi if you can use a variable in a mapping use this code and write and UDF function
Set the Variable
import com.sap.aii.mappingtool.tf3.rt.*
public static void setGlobalVar(String gvName , String gvValue , Container container) {
GlobalContainer gc = container.getGlobalContainer();
gc.setParameter(gvName, gvValue);
Get the variable
public static String getGlobalVar(String gvName , Container container) {
GlobalContainer gc = container.getGlobalContainer();
String output = "";
if (gc.getParameter(gvName) != null)
output = String.valueOf(gc.getParameter(gvName));
return output; -
Dear Friends..
How are you... I m facing little problem in string oprations. I wish to search given character from the Name and display on those name who has the given charecter. say, i have search term as A, then it should display the names who has A in the spelling, please help me to short out this problem i have given you the code of it,
thanking you regards.
Naim
<table>
<TH>First Name</TH>
<TH>Last Name</TH>
<%
Loop at tests into test.
%>
<%
Search selname for 'A'.
" if sy-subrc = 0 .
%>
<tr>
<td><%= test-name_last %></td>
<td><%= test-name_first %></td>
</tr>
<%
"endif.
Endloop.
%>
</table>
select * from U_11104
into corresponding fields of table tests up to 100 rows
where NAME_LAST = 'A'.Hi,
Your question is more about SQL in fact...
Try this :
select * from U_11104
into corresponding fields of table tests up to 100 rows
where NAME_LAST LIKE '%A%'.
That should solve your problem.
Best regards,
Guillaume
Maybe you are looking for
-
In Ical/delegate issue, Please help
In Ical, I have several calendars I maintain for others. I currently maintain about 8 calendars. All of the calendars when added under the delegate tab pop up on Ical under their email address, excep two and they pop up under my email address. Any
-
How to backup MacBook Pro without AirPort Time Capsule or External hard drive
How to backup MacBook Pro without AirPort Time Capsule or External hard drive
-
I have no idea what I am doing? can you read my question? Thank you
-
I have selected both photos and event separately in several attempts to change date and time in Photos/Adjust Date and Time without success. Each time I have attempted to do so another date and time has replaced the previous one but each has been inc
-
I have a problem with my dv7 6100er notebook on Win7. Camera TrueVision HD is not detected in YouCam or skype or device&printers, but in device manager it determined and show that work fine. TrueVision HD camera drivers contains two files: usbvideo.s