on 07-10-2008 9:11 PM
I am trying to remove the trailing zeros from the parameter lbbil_it_gen-fkimg. This variable is of type P instead of a decimal or character, which is why I don't think it's working. Variable quantity is of type string and gs_it_gen is of type lbbil_it_gen in my global variables.
I have tried both SHIFT RIGHT and the FM CONVERSION_EXIT_ALPHA_OUTPUT and both have failed. I am missing a minor detail somewhere.
This is what I have tried:
quantity = gs_it_gen-fkimg.
shift quantity right deleting trailing '0'.
shift quantity right deleting trailing '.'.
and...
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = gs_it_gen-fkimg
IMPORTING
export = quantity.
I will respond quickly and reward points for helpful/right answers.
Hi,
Just move to a variable which has decimals..
Ex..
data: v_input type p decimals 3 value '10.000',
v_output type p decimals 0.
v_output = v_input.
write: / v_output.
Thanks
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you really want to use the SHIFT, then quantity would need to be a character based fields I think(type c, or string) and then I think there will be a space on the far right, to hold the "sign" value, so you would need to get rid of that first.
shift quantity right deleting trailing ' '.
shift quantity right deleting trailing '0'.
shift quantity right deleting trailing '.'.
Regards,
Rich Heilman
Hi,
Check this:
data: a1 type p DECIMALS 2 value '64.54'.
data: a2 type i,
a3 type i,
a4 type i.
a2 = a1.
a3 = floor( a1 ).
a4 = ceil( a1 ).
write:/ 'A1 = ',a1,
/ 'A2 (Direct assignment) = ', a2,
/ 'A3 (Floor) = ', a3,
/ 'A4 (Ceil) = ', a4 .
Output:
A1 = 64.54
A2 (Direct assignment) = 65
A3 (Floor) = 64
A4 (Ceil) = 65
Regards,
Subramanian
Hi,
have a look,
quantity = gs_it_gen-fkimg.
REPLACE ALL OCCURRENCES OF '.000' IN quantity WITH space.
regards.
sriram.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Are you trying to round the value..by removing the decimal and the zeros..Please give me an example..of what you are trying..
Thanks
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.