on 2021 Mar 29 4:45 PM
I have a smartform of PO in which I have NETWR field (Net Value, Total amount).
I want to remove zeros after decimal point if there are all zeros. Else display the value as it is.
Like if Net Value = 34566.00 then remove '.00' and display value as 34,566.
And if Net Value = 34566.07 then display as it is '34,566.07'.
Tried 'SHIFT <variable> right deleting trailing '0'."
Also used 'FTR_CORR_SWIFT_DELETE_ENDZERO' but the problem with this FM is that it give Character value.
Any help?
Thankyou all! Solved it by myself. Added the code in smartform
DATA: GV_NETWR TYPE P DECIMALS 2,
CHAR_NETWR TYPE CHAR15.
DATA: LV1 TYPE C LENGTH 15.
DATA: LV2 TYPE C LENGTH 5.
"""NETWR
CLEAR: LV1, LV2.
GV_NETWR = WA_ITEM-NETWR.
WRITE GV_NETWR TO CHAR_NETWR.
CONDENSE CHAR_NETWR NO-GAPS.
CALL FUNCTION 'FTR_CORR_SWIFT_DELETE_ENDZERO'
CHANGING
C_VALUE = CHAR_NETWR.
SPLIT CHAR_NETWR AT '.' INTO LV1 LV2.
IF LV2 IS INITIAL.
CHAR_NETWR = LV1.
ELSE.
CONCATENATE LV1 LV2 INTO CHAR_NETWR SEPARATED BY '.'.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can discuss with ABAPer and do as to view in PO print in case for your scenario but nothing wrong to show as 34566.00 in PO in print as value is clear for all viewer/s.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hI,
i think you may write a code for the smart form with a condition So that it will populate as desired into the form for display or for print .
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hI,
i think you may write a code for the smart form with a condition So that it will populate as desired into the form for display or for print .
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
109 | |
8 | |
8 | |
6 | |
5 | |
5 | |
5 | |
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.