2006 Oct 18 1:19 PM
Hello,
we have a currency field containing e.g. 1000-. An output file requires that a '-' sign is in front e.g. '-1000'.
Of course any empty spaces must be deleted so that it doesn't look like '- 1000'.
We could do with CONDENSE etc but have 70 fields with which to do this change.
is there any customizing that can do this or does anyone know of a neat solution?
Thank you,
Rod
Hello,
we have a currency field containing e.g. 1000-. An output file requires that a '-' sign is in front e.g. '-1000'.
Of course any empty spaces must be deleted so that it doesn't look like '- 1000'.
We could do with CONDENSE etc but have 70 fields with which to do this change.
is there any customizing that can do this or does anyone know of a neat solution?
Thank you,
Rod
2006 Oct 18 1:24 PM
One way is to use the function moduile:
CLOI_PUT_SIGN_IN_FRONT
Regards,
ravi
2006 Oct 18 1:51 PM
hi
good
if all the fields are the currency fields the do for one than automatically it ll come for others also.
i dont think there is any customizing program which can help you in this.
thanks
mrutyun^
2006 Oct 18 2:02 PM
hi,
If you have declared the variable i.e number in your case as type i ,then you can edit the output with '-' mask in front
If you have decared the number as type c. then you can use this FM
CLOI_PUT_SIGN_IN_FRONT and just pass the variable that holds the negative value.
or else,
If number < 0.
sign = '-'.
else.
sign = '+'.
endif.
concatenate sign number into number.
I suggest to go for FM
Let me know if you need anything else.
Thanks
VENKI
2006 Oct 18 3:01 PM
hi dWYER,
I was just trying to know what are the actual limitations to ur query ..
if this works cant we handle this through a zfm ??
im just giving a blinder shot ..
regards,
VIjay.
-
DATA : P1 LIKE VBAK-WAERK VALUE '2300',
P2 LIKE VBAK-WAERK VALUE '3300',
RES LIKE VBAK-WAERK,
RES2(15).
RES2 LIKE VBAK-WAERK.
RES = P1 - P2.
DATA: TEXT1(1) TYPE C.
SEARCH RES FOR '-'.
IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
SPLIT RES AT '-' INTO RES2 TEXT1.
CONDENSE RES2.
CONCATENATE '-' RES2 INTO RES2.
ELSE.
EXIT.
ENDIF.
WRITE RES2.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |