2007 Mar 28 5:13 AM
Hello Friends,
How can I remove leading zeros in an Internal Table Value. I am writing a BDC for User Defined Transaction. Here BDCDATA-Fval contains length of 132 chars. When I append a value to BDCDATA, it is appending as right justified. when we try to populate a value in to Screen field(CURRENCY FIELD), it is taking first 10 chars(from leftside) which are Zeros(leading zeros). for that, I would like to remove leading zeros for internal table BDCDATA. How can I do it?
Thanks & Regards
Sathish Kumar
2007 Mar 28 5:18 AM
you can use the following statement to remove leading zeros from a char field.
shift BDCDATA-FVAL left deleting leading '0'.
-Kalyan
2007 Mar 28 5:15 AM
hi Sathish,
maintain the internal table field type as char.
Hope this helps,
Sajan Joseph.
2007 Mar 28 5:17 AM
Hi satish.
use this:
matnr = '000000000000001111'.
call function 'CONVERSION_EXIT_MATN1_OUTPUT'
exporting
input = matnr
importing
output = matnr.
or you can try out this way also:
shift matnr left deleting leading '0'.
opr this helps,
keerthi
2007 Mar 28 5:20 AM
My Requirement is with Currency Field. It's not numeric field. it relates with cost. Is that FM, works with Currency field.
Thanks & Regards
Sathish Kumar
2007 Mar 28 5:17 AM
Hi Satish,
To remove leading zeros and leading blanks
Please use FM
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
Hope this resolves your query.
Reward all the helpful answers.
Regards
2007 Mar 28 5:22 AM
Here I have to deal with Internal Table BDCDATA. for Individula fields, it is working fine, but with Internal table it is not working. Is there any other alternatives.
Thanks & Regards
Sathish Kumar
2007 Mar 28 5:18 AM
you can use the following statement to remove leading zeros from a char field.
shift BDCDATA-FVAL left deleting leading '0'.
-Kalyan
2007 Mar 28 5:58 AM
Hello Kalyan
Thanks for ur solution, Now it is working fine.
Thanks & Regards
Sathish Kumar
2007 Mar 28 5:21 AM
Hi Sathish ,
Once you move the data into the work area of the BDC table , use the condense command (since the bdctable is char ) , this will remove all leading spaces so your value will be the one you actually want .
Hope this helps.
In case id does not please revert back.
Reagards
Arun