on 05-24-2007 4:55 AM
I have to make some changes in the PO Script.
one of the change is to round off the figure of unit price to 3 decimal places instead of 2.
The command on the script for unit price is &IMP_UPRICE(C)&.when I am changing this to &IMP_UPRICE(3)&, it shows nothing on the document , just empty space.
How can i do that??
Regards,
Aisha Ishrat.
HI check the type of the field IMP_UPRICE is ithink it is a Character field so ur declration wont work, define a field of type QUAN inside the script and pass the value inside the variable. Print the variable using (.3) prefix.
This will work only if the number of original field has 3 decimals that is at the first place otherwise it will display 2 decimals that are avialble.
Hope that helps
Anirban M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
&IMP_UPRICE(3)&, means printing the first 3 characters in the variable!
So since IMP_UPRICE may be longer, it is displaying just first 3 characters .
What you need to do is write a perform for this translation like <b>(paying attention to the number of decimal places you need</b>):
/:PERFORM f_truncate_value in <b>PROGNAME</b>
/:USING &IMP_UPRICE&,
/:CHANGING &NEW_VARIABLE&
/:ENDPERFORM
Then display &NEW_VARIABLE& in place of &IMP_UPRICE&.
In se38, program <b>PROGNAME</b>
FORM f_truncate_value TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
FIELD-SYMBOLS: <fs_out_tab> TYPE itcsy.
DATA: p_ancien_kebtr(6) TYPE c,
p_nouveau_kbetr(5) TYPE c,
temp_kebtr1 TYPE n LENGTH 6,
temp_kebtr2 TYPE p LENGTH 5 DECIMALS 4,
temp_kebtr3 TYPE p LENGTH 4 DECIMALS 3.
READ TABLE in_tab INDEX 1.
IF sy-subrc EQ 0.
p_ancien_kebtr = in_tab2-value.
ENDIF.
MOVE p_ancien_kebtr TO temp_kebtr1.
temp_kebtr2 = temp_kebtr1 .
WRITE temp_kebtr2 TO p_nouveau_kbetr DECIMALS 3.
READ TABLE out_tab ASSIGNING <fs_out_tab> INDEX 1.
IF sy-subrc EQ 0.
<fs_out_tab>-value = p_nouveau_kbetr.
ENDIF.
ENDFORM. "F_TRUNCATE_VALUE
Regards,
Sooness.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not working, its still showing 2 decimal places.
currently it is written as &IMP_UPRICE()& and it shows 2 decimal places.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you want &IMP_UPRICE(C.3)&.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
not working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try something like this &IMP_UPRICE(3.2)&.
regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
please go through this thread this may help you.
also go thru below
program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
Syntax
&symbol(.N)&
The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
&EKPO-MENGE& -> 1,234.560
&EKPO-MENGE(.1) -> 1,234.6
&EKPO-MENGE&(.4) -> 1,234.5600
&EKPO-MENGE&(.0) -> 1,235
for more informaton above
http://wiki.ittoolbox.com/index.php/HOWTO:Sap_script
Regards
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
&IMP_UPRICE(.2)&.
reward points if it is useful
Thanks
Seshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.