on 11-16-2010 5:32 PM
Dear All
I tried to take a clue from a thread posted before but not working for me
I want. 1,000 is printed as 1. But even after coding below in smartforms it gives me 1,000.
GS_FKIMG is of type BDMNG
GS_ITEM-FKIMG is of type FKIMG of type QUAN (13,3)
In %CODE program lines for Element I am using
GS_FKIMG = GS_ITEM-FKIMG.
I am printing &GS_FKIMG(.0)& but not working
I also tried using &GS_FKIMG(C.0)& but in vain.
could you guide if I am writing program lines wrong or at wrong place.
Hi,
Delcare a field of type i and move qty field to type i field.
or
give proper qunatity reference field to quantity field
and try your syntax qty(.0).
Thanks,
Challa Sridhar Reddy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Smartforms will link your quantity with unit then print out. It also take the configuration of decimal of each unit.
If you want to archive your goal, I think you have to convert your quantity to string then delete right zero if needed. Please try this:
Write [QUANTITY] TO TEXT UNIT [UNIT].
"and use form routine below to delete the right zero
FORM delete_right_zero USING p_text.
IF p_text CP '*,*'.
SHIFT p_text RIGHT DELETING TRAILING space.
SHIFT p_text RIGHT DELETING TRAILING '0'.
IF p_text+69(1) EQ ','.
SHIFT p_text RIGHT BY 1 PLACES.
ENDIF.
ENDIF.
ENDFORM.
Best regards,
Thien
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amol,
The syntax you have used seems to be right.
I similarly faced problems using &Var(.0)&. It often fails to work, but not always. The work-around for this is to move this field into a field of desired type, and then display that field.
Regards,
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What did you accomplish by putting 13,3 into another variable (type BDMNG 13,3)? If you used &var_name(.0)& and you got 1,000, then the original value is 1,000.000, isn't it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can't you just move your variable to a variable of the type i ?
and print that integer-variable?
I also checked the wiki-page on this issue and as you can read there, you are doing it correctly.
Strange that it doesn't work...
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I've tried your code and works fine: &GS_FKIMG(.0)&
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.