Round FM always INPUT_INVALID
Hi!
I need to do conversion from/to JPY currency for updating prices. Since the currency does not allow decimal places, I though of rounding off the amount first with 0 decimal places if JPY is the currency.
I am testing FM ROUND in SE37 and I always get INPUT_INVALID Message: Please use a number field for the input value.
I should place a number in the input field, right? I expect that when I put
Decimals 0
Input 24.6
Sign
I will have output
25.
But then I always get the input:invalid error no matter what I enter in the decimals and input field.
Can someone help? Thanks!
Hi ,
It works inside the code, even though getting error in SE 37 .It is because function module picks import and export parameter based on the variable you are passing to it .
DATA : lv_in TYPE F VALUE '410.73' ,
LV_P TYPE P DECIMALS 2 ,
LV_OUT TYPE p DECIMALS 0 .
move LV_IN TO LV_P .
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 2
input = LV_P
SIGN = '+'
IMPORTING
OUTPUT = LV_OUT
* EXCEPTIONS
* INPUT_INVALID = 1
* OVERFLOW = 2
* TYPE_INVALID = 3
* OTHERS = 4
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
Try this sample code its working fine .
Regards ,
Juneed Manha
Similar Messages
-
Hallo,
I´m looking for a function in DIAdem to always round up or down. I build myself some but they are old and slow... and they also work only almost perfect, some cases Just wont work right.
The aim is to round figures to 1/100, 5/100, 1/10, 5/10, to numbers, X mod 5 = 0, to x mod 10 = 0, to x mod 50 = 0 and so on.
I want to use it for scalling Report-Diagramms automatically, but with fixed and round scales - also for same scales of one meassurement in different Messures.
Therefor i need the funktion to Round Up always or in Minus Round down always.
If someone has a nice Solution for it i would be very thankfull.
Thanks already for ur surport.
STGI'm not sure I fully understand the question, but hopefully this helps:
Frac = Return decimal portion of a number
Trunc = Return Integer portion of a number
intMyResult = Frac(Pi) 'intMyResult = 0.14159265358979
intMyResult = Trunc(-75.5109) 'intMyResult = -75
So a combination of these could give you:
Always Round Up:
If Frac(Val) > 0 then MyResult = Trunc(Val) + 1
Example:
Var =Pi
If Frac(Var) > 0 then
MyResult = Trunc(Var) + 1
Else
MyResult = Var '4
end if
Always Round Down:
MyResult = Trunc(Val)
Example:
Var =Pi
MyResult =Trunc(Var) '3
You can also combine this with multiplying&dividing by 10/100/1000 to round to specific numbers of decimal places
Example:
Var =10.12345
Var = Var *100
Var =Trunc(Var)
Var = Var /100
MyResult = Var '10.12
-Josh
Engineering Technician
John Deere Power Systems -
JMOD condition type value should be always rounded up instead of commercial
Hi Helpers,
I need one clarification from you all based on your expertise,
1. JMOD condition type value should be always rounded up instead of commercial.
2. i have been already made rounding up in the condition type JMOD in the transaction V/06. but unfortunatly not working.
3. after that we found that there is configuration change in spro (company code setting in the indai taxation-CIN) in the Logistic general> tax on goods movement>india> basic setting> company code setting for the commercialrounding, but the same is already ennabled with SD rounding IND.
Need your expertise on this.How shall we make it round up always for JMOD condition value. below is an example for your further analysis.
Example: if values UTXJ is : 8,913.40 and JMOD will be calculated based on UTXJ as 10% thats is 891.34.
Actually this should be 892 as per the requiremen.tI just recently rolled off a project in Europe that had an issue similar to this. We were having rounding issues as a result of % discounts.
However, we did come up with a solution that is provided by SAP.
Please review OSS note 80183 on SAP rounding and the solutions provided within the note.
I hope this helps.
Kind Regards,
Jason -
Inspection rounds with PM integration QM
Hi gurus,
We need to design a plan for one area of the company that matches the needs for inspection round:
● Planned on a regular basis for each shift.
● The inspection round is always completed within one day, or within one shift.
● The duration of the inspection round includes the work and the round itself within one plant.
One of the principal needs is also being able to asign measuring points to particular task lists.
We tried using the option creating our equipments as PRT and assigning it task list in PM but not sure this is the best way.
Any idea? integration PM-QM? the thing is that in QM TX-QP01...inspection plans...use materials instead of Equipments.
Thanks,
VLVL,
I am not sure about the need to integrate QM with inspection rounds.However have you looked at the "Inspection Round" Functionality avaalable from [EHP4|http://help.sap.com/erp2005_ehp_04/helpdata/en/42/fbded750e61febe10000000a422035/frameset.htm]? It looks like it might just solve your problem.
If you are in lower version, another way is to to accomplsih this is by following the below steps
1) create a Measurement point list to identify all the measurement points to be captured in each inspection
2) creating a separate Maintenance plan for this activity that would generate a Notification object on a daily basis.
3) Enhancing the Maintenance plan using user exit ( IPRM0003 User fields: Maintenance plan) to assign the above mentioned Measurement point list to the maintenance plan.
4) Assign the Measuremnt point list to the notification on create of the notification so that the measuremnet docuemnts could be recorded.
Hope it helps.
Regards
Narasimhan -
Hi, can somebody tell me why the following generates this output it looks like ROUND_HALF_EVEN but should round up always.
import java.math.BigDecimal;
public class TestDecimal {
public static void main(String[] args) {
System.out.println(new BigDecimal(1.45).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());
System.out.println(new BigDecimal(1.55).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());
System.out.println(new BigDecimal(1.65).setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue());
}1.4 => Should be 1.5
1.6 => Should be 1.6
1.6 => should be 1.7
Am I completely mistaken? This is java-1.5. How can I achive what I want rounding up starting with >= 0.5 like we learned in school and is documented in javadoc of ROUND_HALF_UP.System.out.println("1.44 => 1.4 => " + new BigDecimal(1.44).setScale(1,RoundingMode.HALF_UP).doubleValue());
System.out.println("1.45 => 1.5 => " + new BigDecimal(1.45).setScale(1,RoundingMode.HALF_UP).doubleValue());
System.out.println("1.54 => 1.5 => " + new BigDecimal(1.54).setScale(1,RoundingMode.HALF_UP).doubleValue());
System.out.println("1.55 => 1.6 => " + new BigDecimal(1.55).setScale(1,RoundingMode.HALF_UP).doubleValue());
System.out.println("1.64 => 1.6 => " + new BigDecimal(1.64).setScale(1,RoundingMode.HALF_UP).doubleValue());
System.out.println("1.65 => 1.7 => " + new BigDecimal(1.65).setScale(1,RoundingMode.HALF_UP).doubleValue());Produces:
1.44 => 1.4 => 1.4
1.45 => 1.5 => 1.4
1.54 => 1.5 => 1.5
1.55 => 1.6 => 1.6
1.64 => 1.6 => 1.6
1.65 => 1.7 => 1.6
The same result is with:
MathContext context = new MathContext(2,RoundingMode.HALF_UP);
new BigDecimal(1.44).round(context).doubleValue(); -
Rounding issue in delivery document
Hi All,
We have some requirement with rounding screnario in delivery document. The Base unit of measure in material master is EA, there is no sales unit of measure maintained. All sales and deliveries in EA's. We maintained the UOM conversion with CAR. 12EA = 1 CAR.
We use Scheduling agreement for our customers, the system is not rounding the quantity in SA seems it is standard system behavior. That is ok, but the requirement is the delivery quantity should be rounded like below.
schedule line qty in Scheduling agreement is 38 EA, when i create delivery the system copying 38 EA as delivery quantity. here how do we get the delivery qty as 36 EA. If it gives 36 EA, they can send 3 CAR to customer.
I tried maintained 1CAR in material master delivery unit field, but it did not help us in rounding to 36 EA.
Regards,
LakshmikanthThanks for the update. Actually we don't use the sales unit of measure. We use only BOM and mintained alternative uom with conversions. Now we can not introduce using sales unit of measure. Customer gives order in EA, but shipments physically done in cartons, no partial cartons allowed in shipment.
So, i have to try using some userexits in delivery for rounding down always.
Order qty: 100 EA, 12EA = 1CAR. The available qty is only 74. In this case we can delivery only 72 which is equal to 6 CAR.
I think we can use USEREXIT_AVAILABILITY_IN, USEREXIT_AVAILABILITY_OUT in program RV03VFZZ. Can you tell me which userexit is correct for this scenario. And we need to maintain delivery unit in material master.
Regards,
Lakshmikanth -
Handling Tab Delimited File generation in non-unicode for multi byte lang
Hi,
Requirement:
We are generating a Tab Delimited File in different languages (Single Byte and Multi Byte) and placing the files at application server.
Problem:
Our system is a Non-unicode system so we are facing problems with generation of Tab delimited file for multibyte languages like Russian, Japanese, Chinese etc.,
I am actually using data: d_tab TYPE X value '09' but it dont work for multi byte. I cant see tab delimited file at application server path.
Any thoughts about how to proceed on this issue?Please let me know.
Thanks & Regards,
Pavan>
Pavan Ravikanti wrote:
> Thanks for your answer but do you reckon cl_abap_char_utilities will be a work around for data: d_tab type X VALUE '09' .
> Pavan.
On a non-unicode system the X Variant is working, but not on a unicode system. Here you must use the class. On the other hand you can use the class on a non-unicode system und your char var will always be correct (one byte/twobyte depending on which system your report is running).
What you are planning to do is to put a file with an amount of possible characters into a system with has a less amount of characters. Thats not working in no way.
What you can do is to build up a multi-code-page system where the codepage is bound to the user or bound to the logon-language. Here you you can read and process textfiles in several codepages - but not a textfile in unicode. You have to convert the unioce textfile into a non-unicode textfile before processing it.
Remember that SAP does not support multi-code-page Systems anymore and multi-code-page systems will result in much more work when converting the system to unicode.
Even non-unicode system will not be maintained by SAP in the near future.
What you encounter here are problems for what unicode was developped. A unicode system can handle non-unicode textfiles, but the other way round will always lead to problems which cant be solved. -
Why budget check does not work with account assigment distrib. by quantity?
Hi Gurus,
I have an issue in the budget check for Purchase Order (PO).
I'm using the FM B31I_ACC_PURCHASE_ORDER_CHECK.
The case is next:
1 Item with 21 account assignment type AS and distribution by quantity:
ASSET_NO QUANTITY
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
All account assignment are for the same G/L account, fund, functional area...
The price for each item is $2,499.14, then total price is $52,481.94 (2,499.14 * 21).
I debugged the FM B31I_ACC_PURCHASE_ORDER_CHECK and found that in FM BBP_PD_COMMITMENT_FILL_BAPI it's making a rounding with percentage:
The system assume next:
Each item is 4.76% of total (result of divide 100% / 21 = 4.76190476...) but the percentage is rounded to 2 decimals.
Then it makes the conversion by the amount corresponding to each item:
($52,481.94 * 4.76) / 100 = $2,498.1403
Finally the budget is checked by $52,460.95 (2498.1403 * 21).
But available budget is $52,481.90, the check pass, but really there are 4 cents missing (total price is $52,481.94).
Can somebody say to me if this is a standard behavior?
It can be fixed with configuration?
The problem is for multiple account assignment with distribution by quantity and:
(100 / quantity) = not integer (or have more than 2 decimals)
For example: with quantity 20 it works because 100% / 20 = 5.00%, then the budget is check exactly.1503317 - System Behavior for Account Distribution between SRM and R/3 system
When using distribution by Value in a SRM document this value is not correct and a rounding occurs once this document is transferred to ERP system.
Cause
It is not possible transfer documents to the back end system with distribution by value, due to a back end restriction.
Resolution
The following information is the system behavior in R/3 / ERP:
in R/3, there is accounting distribution only by quantity or percentage. So when distribution by value is used, a rounding will always take place.
in R/3, the use of value based distribution in SRM will lead to rounding differences.
Distribution by quantity is allowed in SRM and MM side. However MM do not accept is distribution by value. This is internally converted to distribution percentage based.
Keywords
Distribution by Quantity, Distribution by Percentage, Distribution by Value -
hello ABAP gurus,
i am a fresh ABAper, technically very sound, but not getting job as a fresh ABAPer. So i am showing +2 years fake exp.
I usually clear the ABAP tech round, but always being rejected because of the lack of real time ABAP questions those r usually put/asked by the interviewers to trap the fake candidates.
If anybody having such question and answers, plz open to the SAP community.
it will be really the most rewardable help to all ABAP freshers.You'd think so, but in some countries it can be very messy and costly to get rid of someone even if they did get the job dishonestly or under false pretences.
It also means that the person who made the decision to hire them has to admit he was wrong ...
I once saw a guy who'd been on two projects with a consulting firm - kicked off both within a few weeks and spenmt a year on the bench - get hired as develpment manager. Now there were three guys from his ex-firm already on site and the dork who hired him didn't even think to informally ask them. When the penny dropped they tried demoting him and he threatined to sue.
You think Dilbert is fiction? -
Function module CS_BOM_EXPL_MAT_V2 Documentation
I cannot find any documentation for function module CS_BOM_EXPL_MAT_V2. It is a very powerful function module, however, it is not useful without documentation. I know that it can do single level boms as well as multi level and a host of other things, but I can only guess without documentation. Do you know where I can get documentation for this function module.
thank you in advance, Leonard Getz, Dy4 Systems Inc. Ottawa, Ontario, Canada.This is what I found:
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2' "BOM explosion for material
EXPORTING
ftrel = SPACE " csdata-xfeld Limited multi-level - stop explosion at items not relevant to production
aufsw = SPACE " csdata-xfeld Determine and enter order level and channel
aumgb = SPACE " csdata-xfeld Calculate scrap quantity
aumng = 0 " stko-bmeng Scrap quantity
auskz = SPACE " csdata-xfeld Scrap
bagrp = SPACE " mara-matnr Assembly restriction
beikz = SPACE " stpo-beikz Material provision indicator
bessl = SPACE " csdata-xfeld Material provision selection indicator
bgixo = SPACE " csdata-xfeld Load assembly information for exploded assemblies only
brems = SPACE " csdata-xfeld Limited explosion
capid = 'STD1' " tc04-capid Application ID
cospr = SPACE " csdata-xfeld Internal: (CO) order-spec. MatPreRead
cuobj = 000000000000000 " marc-cuobj Configuration
datuv = 00000000 " stko-datuv Validity date
delnl = SPACE " csdata-xfeld Delete items not kept in stock from list
emeng = 0 " stko-bmeng Required quantity
erskz = SPACE " stpo-erskz Spare part indicator
erssl = SPACE " csdata-xfeld Spare part selection indicator
fbstp = SPACE " csdata-xfeld Limited multi-level - stop explosion at externally procured item
mbwls = SPACE " csdata-xfeld Read material valuation
mdmps = SPACE " csdata-xfeld Limited multi-level - explode phantom assemblies at least
mehrs = SPACE " csdata-xfeld Multi-level explosion
mkmat = SPACE " csdata-xfeld Limited multi-level; explode KMAT
mmaps = SPACE " csdata-xfeld Limited multi-level - explode at least M assembly (M order)
mmory = SPACE " csdata-xfeld Memory use ('1'=on;'0'=off;' '=no reaction)
mtnrv = SPACE " mara-matnr Material
postp = SPACE " stpo-postp Item category
rndkz = SPACE " csdata-xfeld Round off: ' '=always, '1'=never, '2'=only levels > 1
rvrel = SPACE " stpo-rvrel Relevant to sales
sanfr = SPACE " stpo-sanfe Production
sanin = SPACE " stpo-sanin Maintenance
sanka = SPACE " stpo-sanka Costing
sanko = SPACE " stpo-sanko Engineering/design
sanvs = SPACE " stpo-sanvs Shipping
schgt = SPACE " stpo-schgt Bulk material
stkkz = SPACE " stpo-stkkz PM assembly
stlal = SPACE " stko-stlal Alternative BOM
stlan = SPACE " stzu-stlan BOM usage
werks = SPACE " marc-werks Plant
mdnot = SPACE " csdata-xfeld Restriction on MDMPS: do not explode M phantom
panot = SPACE " csdata-xfeld Restriction on MDMPS: no parallel discontinue
IMPORTING
topmat = " cstmat Data for start material
dstst = " csdata-xfeld Structure destroyed by filter
TABLES
stb = " stpox Collective item data table
matcat = " cscmat Material catalog (sub-assemblies)
EXCEPTIONS
ALT_NOT_FOUND = 1 " Alternative not found
CALL_INVALID = 2 " Incorrect parameter combination
MATERIAL_NOT_FOUND = 3 " Material not found
MISSING_AUTHORIZATION = 4 " No authorization (bill of material)
NO_BOM_FOUND = 5 " No BOM for this material
NO_PLANT_DATA = 6 " Material not maintained in plant
NO_SUITABLE_BOM_FOUND = 7 " BOM does not exist
. " CS_BOM_EXPL_MAT_V2 -
I am trying to find a way to always round up to the next whole number. For example if I have 2.08 I need it to return 3. If I try this SELECT ROUND(2.08) FROM DUAL; it rounds to 2. I am using Oracle 11g. Any help would be appreciated. Thank you.
Hi,
sb92075 wrote:
add 0.5 before applying ROUND() function
Please do no use that!
with t as
(select 2.08 num from dual union all
select 2.00 num from dual
select
num
,CEIL(NUM) CEIL_NUM
,ROUND(NUM + 0.5) ROUND_NUM
FROM
T
NUM CEIL_NUM ROUND_NUM
2.08 3 3
2 2 3 Regards,
Peter -
Always round up to nearest whole in APO DP
Hi
there is a requirement to always round up data to nearest whole number. number should be always rounded above and not rounded down.
Example a value of 0.07 should be rounded to 1
a value of 1.25 should be rounded to 2
a value of 1.75 should be rounded to 2
a value of 1.07 should be rounded to 2
and so on
Is there a way i can achieve in APO DP by some settings/paramater/config/macro/exit etc etc - i am on SCM 7.0
Thanks,
TJTejinder
Try using the CEIL() function in a macro.
Rishi Menon -
Hi All,
Is there a way in T-SQL using the round command to always round up regadless of the value.
For example:ROUND(normal_hours * pay_rate * 52, - 3) AS Expr3
normal_hours = 36
pay rate = 23.64
weeks in year = 52
(36 * 23.64) * 52 = 44,254.08
It rounds to 44,000. I want 45,000. Is this possible. Am I overlooking the obvious?
Thanks in Advance and Happy Holidays!!!!!!!!AdamUSE CoreDB
GO
--================================================================================
--Name: TIM SMOLKA
--Date: 2014.08.05
--Description: Round factional pennies
--================================================================================
CREATE FUNCTION FN_ROUND_UP_PENNY
@AMOUNT DECIMAL(18,6)
RETURNS DECIMAL(18,2)
AS
--DECLARE @AMOUNT DECIMAL(18,6) = 1560891.00015445
BEGIN
DECLARE @RV DECIMAL(18,2)
DECLARE @FACTOR INT = 100
DECLARE @TMP DECIMAL(18,6) = (@AMOUNT * @FACTOR)
SELECT @RV = CEILING(@TMP) / @FACTOR
--SELECT @RV
RETURN @RV
END -
Using Facebook the pointer on the screen has a circle by it that is rotating when I play games. Acts like it is doing something, I would like to know if there is a fix for this?
Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
"Remove Cookies" from sites causing problems:
*Tools > Options > Privacy > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.org/kb/Safe+Mode
Do a malware check with some malware scanning programs on the Windows computer.<br />
You need to scan with all programs because each program detects different malware.<br />
Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
*http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
*http://www.superantispyware.com/ - SuperAntispyware
*http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
*http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
*http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
*http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
See also:
*"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked -
Hi experts,
data: field1 type [currency field of size 15, decimals 2].
field1 = 25.87.
I want the value of field1 to be always rounded to 25.
Please suggest a way.
Pts will be rewaurded.Hi,
Use ceil( ) function.
Ex. a = ceil ( 398.98).
wreite:/ a.
or
Call 'ROUND' Method as below
DATA: WA_INPUT TYPE P DECIMALS 8,
WA_OUTPUT TYPE P DECIMALS 2.
WA_INPUT = '123.6581'.
CALL FUNCTION 'ROUND'
EXPORTING
INPUT = WA_INPUT
IMPORTING
OUTPUT = WA_OUTPUT
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE: WA_OUTPUT.
Hope it helps you.
Maybe you are looking for
-
How do I make it so users can log in and sign up on my adobe muse website
How do I make it so users can log in and sign up on my adobe muse website?
-
Hp laserjet pro won't print ,low memory ?
Hi I am trying to print from a chromebook ,it worked before now it gets an error saying low meomry and i cannot find how to fix it. how do I fix this ? every hp product i owe i had the worst luck wit. I already tired rest defult settings did not wor
-
Hello All, When we execute a .sql file in CMD prompt using oracle client, the generated log file will be created in the file execution path. e.g., C:\Users\xxx\Desktop> But when a .sql file is executed in Pentaho tool as a transformation, I am unable
-
NWDS does not open Webdynpro Component's Data Modeler
Hi, All of a sudden my kindly Tool does not open any of the Component's Data Modeler for Mapping attributes. It happened all of a sudden. I cleaned everything and reinstalled from a proper software. If any one has a solution kindly let me know or if
-
MacBook Pro EFI Firmware Update 2.0 failed
Hi, I just updated my macbook pro but the System Profiler gives me this version MBP71.0039.B05. When the computer is rebooted did a beep. Maybe I've done something wrong. I made a new control with Software Update, but it still offers the EFI update 2