2010 Sep 29 6:42 AM
Hi All,
In internal table I want to compress the leading space
After searching I found Condense and SHIFT LEFT DELETE leading space commands work it is written...
but when I write code A single space is appreaing in between the two fields...can any body help me where I am going wrong??
Ex:
data: begin of itab occurs 1 ,
PSAtext TYPE CHAR15,
psa type btrtl,
end of itab.
now o/p BEFORE CHANGE IS :
SBI-CT |1023
After condense is SBI-CT |1023
bETWEEN SBI-CT AND | there is a additional space. How can we avoid that?
Sas
Edited by: saslove sap on Sep 29, 2010 7:43 AM
2010 Sep 29 6:46 AM
CONCATENATE filed1 fild2
INTO result.
condens no-gap result.
append it. single line
2010 Sep 29 6:46 AM
CONCATENATE filed1 fild2
INTO result.
condens no-gap result.
append it. single line
2010 Sep 29 6:48 AM
Can you please elobrate a bit....?
What happens if position text(Field1) is "senior office"
Will this also gets mixed as senioroffice???
Sas
2010 Sep 29 7:03 AM
The space after first field in internal table is separator b/w diff. columns.
2010 Sep 29 7:05 AM
Its not coming all the fields:
For example:
SBI-UT |1023|US
Then after condense:
SBI-UT |1023|US
Regards
sas
No space between 1023|us
Edited by: saslove sap on Sep 29, 2010 8:05 AM
2010 Sep 29 7:15 AM
Hi,
You can check the below options,
PACK statement,
CONDENSE WITH NO-GAPS.
Thanks,
Pawan
2010 Sep 29 7:29 AM
Well Condense No-gaps works perfectly....
But when I field which is having internal space that is also supressing as I said above...
Please let me know for any other alternative for this?
Regards
sas
2010 Sep 29 7:30 AM
Hi
i beleive this is because the spacing while defining the fields in the table.
the field will take the space defined during table declaration.
Thanks
lalit
2010 Sep 29 7:32 AM
I can change my field definition also...
What you want me to change to achieve this?
Regards
sas
2010 Sep 29 7:57 AM
Well this is what I am going to solve this
data:begin of STRING OCCURS 1 ,
S1 TYPE STRING,
END OF STRING.
loop at itab.
concatenate itab-f1 itab-f2 into string-s1 seperated by '|'.
append string.
end of itab.
then I can transfer this string to Application server.
Thanks for all the contributions.
Regards
sas
2010 Sep 29 8:06 AM
Hi,
Application server
you should have told this in your question.
2010 Sep 29 8:43 AM
What difference it makes now Keshava?
any good alternative for this?
Sas
2010 Sep 29 7:56 AM
If you move it right justified then you will get a space in beginning. Whatever is happening is correct.
Your internal table field size is larger than the content in it !!!