on 05-26-2009 5:27 AM
Hi,
I have 4 quantity fields - example MCHB-CLABSthe value comes in the form of 1234.000 to smartforms.
Now my requirement is:
Display of quantity should be use UoM as a reference field .
E.g. 1000 PC => should be dispalyed like 1,000 PC
1000 KG => should be dispalyed like 1,000.000 KG
Please advice!
regards
Mohan
Hi,
Create the reference field for the quantity you want to display in the tab currency/Quantity fields in the GLOBAL DATA. Before you display that value use a program line node and transfer the value to the reference field and then format it as you like using the options like
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
and display them.
Refer this link for more details about the currency and quantity fields
[Quantity/Currency fields|https://help.sap.com/saphelp_nw04/helpdata/en/0b/5da4e42cf511d5b692006094192fe3/frameset.htm]
Thanks&Regards
Sarves
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Still
&symbol(C)& Compress Spaces doesnt work.
My output is 1234.000 but i want 1,234.
Thanks
Mohan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohan,
I had a same situation for JPY & USD currency problem in smart forms,,
No difference in Curr & Quan fields,,, Both work on same principle,,, so modify accordingly from below code...
DATA: LV_AMOUNT_TXT TYPE STEXT.
IF GS_HD_GEN-BIL_WAERK EQ 'JPY'.
WRITE: GS_HD_GEN-BIL_NETWR CURRENCY GS_HD_GEN-BIL_WAERK TO LV_AMOUNT_TXT.
ELSE.
WRITE: GS_HD_GEN-BIL_NETWR CURRENCY GS_HD_GEN-BIL_WAERK DECIMALS 2 TO LV_AMOUNT_TXT.
ENDIF.
Sample for Quantity...
DATA: LV_QUANTITY_TXT TYPE STEXT.
IF GS_HD_GEN-BIL_MEINS EQ 'PC'.
WRITE: GS_HD_GEN-BIL_MENGE QUANTITY GS_HD_GEN-BIL_MEINS TO LV_AMOUNT_TXT.
ELSE.
WRITE: GS_HD_GEN-BIL_MENGE QUANTITY GS_HD_GEN-BIL_MEINS DECIMALS 3 TO LV_AMOUNT_TXT.
ENDIF.
You add this in the program lines, just above to the text where you want to display..!
Thanks & regards,
Dileep .C
Hi Mohankumar,
I see that the check table for the MATNR field in the table MCHB is the MARA table, you can do a join and select the MATNR field from MCHB table and the MEINS field from the MARA table and then pass it to the smartform and dispaly it as follows
&mchb-matnr(c)& &mara-meins&
This would display it along with the UoM (Base Unit of Measure). If you want the decimals to be present, then you can go for any conversion routines or type casting.
Regards,
S.Dakshna nagaratnam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.