on 09-17-2012 6:47 AM
Hi All
I have an issue.
data : w_netpr type text18.
Using below logic in smartform.
data: moff ,W_LENGTH_NODECIMAL type i.
SHIFT w_netpr RIGHT DELETING TRAILING space.
W_LENGTH_NODECIMAL = strlen( w_netpr ).
find '.' in w_netpr MATCH OFFSET moff.
SUBTRACT moff FROM W_LENGTH_NODECIMAL .
I have this below code in text field :
<C5> &w_netpr(&W_LENGTH_NODECIMAL&.0C)&
But the statement don't works . I have suppress the blanks and also runtime have to determine no. of numbers before decimal.
If i use :
<C5> &w_netpr(5.0C)& : this works fine.
Please let me how can use both supress as well as value to display no. of characters.
Thanks in advance.
Hi,
If your requirement is just to take out the decimals then we have function module .
first declare w_netpr1 as a string and now assign w_netpr1 = w_netpr.
use this function module.
CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
EXPORTING
STRING = w_netpr1
* DECIMAL_SEPARATOR =
* THOUSANDS_SEPARATOR =
* WAERS = ' '
* IMPORTING
BETRG = w_netpr
* EXCEPTIONS
* CONVERT_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Mahipal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear,
Use CIZ.0 after variable in SF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharat
Sorry for replying late.
I have used a program line in that i have written following code:
data: moff type i.
W_LENGTH_NODECIMAL = strlen( w_netpr ).
find '.' in w_netpr MATCH OFFSET moff.
SUBTRACT moff FROM W_LENGTH_NODECIMAL .
Finally in text node below to it im writting :
<C5>&ekko-waers&</><C5> &w_netpr(15.0)& &'/ 'w_ekpo-PEINH(C)&
&w_ekpo-bprme(C)&</>
Can you give any advice.
try concatenating W_LENGTH_NODECIMAL & 0.C into another variable & pass to
<C5> &w_netpr(&W_new_variable&)&
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.