‎2012 Apr 10 11:55 AM
Hi Abapers,
In PBO i have written a select query which fetches data from Z table. Everything work's fine for me but when am adding or inserting a new record to database
table and fetching it back, in debugging mode it shows that new values added in internal table are with leading space. Due to this my sort functionality is getting this values first.
But when i see the same entry in ztable it's fine.
Please help me in this regard!
Thanks
Sandy.
‎2012 Apr 10 1:19 PM
Hi All,
Thanks for all the Post, I tried checking with internal table and way the select query is written.
But condense or conversion exit alpa fm will work for single entry that is for work area.
But how to condense value in an internal table which the newly inserted value.
‎2012 Apr 10 12:01 PM
Hello Sand,
declare a local variable of type c with length as per your requriement.
Then use the keyword PACK .
eg - Data : l_temp length 5.
PACK gv_xxxx TO l_temp.
BR
Rajesh
‎2012 Apr 10 12:03 PM
Check your select query.
Field order should be same as it is in declaration
Also, check type of the field, should be same as database table (I don't see any issue here, but check it once)
Regards,
Naveen.I
‎2012 Apr 10 12:08 PM
Hi
There is a mismatch in your internal table definition and the table structure in the underlying database.
Use the same data elements as that of the table for your internal table.
Regards
Raj
‎2012 Apr 10 12:13 PM
How are you checking that the data in the z-table is without space? Try putting breakpoint before you are actually inserting entries in z-table. I think you will get spaces at this point too?
Sometimes what appears in se16(n) may not be correct due to various conversion rouintes and ingnoring of space. What you get in select query.is what data is actually is in the database.
‎2012 Apr 10 12:16 PM
Hi Sandeep,
There is a FM 'CONVERSION_EXIT_ALPHA_OUTPUT' which can be used to remove the leading zeros.
Regards,
Shardul P Jitkar
‎2012 Apr 10 12:43 PM
Hi,
You can use the following:
SHIFT <field> LEFT DELETING LEADING space.
Hope it serves useful.
‎2012 Apr 10 12:52 PM
Hi Sandy
What i understood is; you are getting like this "_this is a sentense_". where "_" is space
CONDENSE statement is used to delete unwanted leading spaces in string.
Use CONDENSE statement, when you store data in the table.
Try this sandy this should work. ... Thx Sridhar
‎2012 Apr 10 12:56 PM
Hi Sandy,
You must have declared your database field as integer-type. When you transfer it back to your internal table into a character field, it will have leading zeroes in it.
Regards,
Karl
‎2012 Apr 10 1:19 PM
Hi All,
Thanks for all the Post, I tried checking with internal table and way the select query is written.
But condense or conversion exit alpa fm will work for single entry that is for work area.
But how to condense value in an internal table which the newly inserted value.
‎2012 Apr 10 1:19 PM
Hi All,
Thanks for all the Post, I tried checking with internal table and way the select query is written.
But condense or conversion exit alpa fm will work for single entry that is for work area.
But how to condense value in an internal table which the newly inserted value.
‎2012 Apr 10 1:26 PM
Hi Sandy,
You have to convert it manually after fetching it from the database.
Regards,
Karl
‎2012 Apr 10 1:54 PM
Hi,
Loop at that internal table into workarea like below:
Loop at itab into w_tab.
SHIFT w_tab-field LEFT DELETING LEADING space.
modify itab from w_tab index sy-tabix.
clear: w_tab.
Endloop.
I hope it solves your problem now.
‎2012 Apr 10 3:16 PM
Thanks Akankshi Prasad it worked for me.
Thank you all for all the post.
‎2012 Apr 10 5:16 PM
can we solve this problem by using the conversion_exit_alpha_output function module. if so how can we....
‎2012 Apr 11 12:31 PM