Logic for negative amount

I have a money field which is 10 in character
The requirement is for example
-365.67. 
should come out
-0000036589
presently my result is 
0000-36589 because I am using the following
+ convert(char(10), replicate('0',10-len(replace(convert(varchar,t.AllowedAmount),'.','')))
+replace(convert(varchar,t.AllowedAmount),'.',''))
 which adds 0000000000 to the value 
How do I work around this to me give the desired result.
-0000036589
Thanks

The below example works but returns a character length of 11 when a negative value appears hear by shifting the final output to exceed the expected number of bytes how can this be modified to have 10 characters for positive integer as well as 10 character length for a negative integer.Thankscreate table test(AllowedAmount money)
Insert into test values(-365.67), (0),(365.67)
select AllowedAmount
,Case when AllowedAmount<0 Then '-' Else '' End + Right('0000000000'+Replace( Cast (abs(AllowedAmount) as varchar(10)),'.',''),10)
from test
drop table test

Similar Messages

  • Paymont form via fpl9 for negative amount

    Hi,
    our customer wants to generate a payment form also when the account balance of the customer is negative.
    however, I'm getting an error message that:
    Creation of payment form not possible, amount is negative
    Message no. >6397
    Thanks,
    Vered

    Hi Vered,
    If I'm not mistaken (and I don't think I am ), that message comes from Function module FKK_SAMPLE_0756 - "FI-CA Correspondence - Sample Module for Payment Form Request".
    To override this bit of SAP standard logic, to the very least you'd have to program and assign in FQEVENTS own function module (without the check on negative Amount) to FI-CA Event 0756. We don't have payment forms for negative amounts in our system, but I believe it's doable - the rest of standard logic should function OK with negative payment amount.
    cheers,
    Janis

  • Purchase order approvals for Negative amount

    Hello All,
    Want your assistance on the above mentioned topic.
    We have a business requirement to have Purchase order approvals for Negative amount. I understand from the Below SAR that JD Edwards 9.1  doesn't support PO approvals on Negative amount
    Bug 11022294 : APPROVAL ROUTES FOR DEBIT MEMO - SAR: 8940968
    Appreciate if you can suggest best practice or workaround to meet this requirement.
    Thanks & Regards
    Nikhil M. Pawar.

    Dear Ashutosh,
    Couple of points from my side. We have a similar scenario at a client where I am working. In construction, there are three stages.
    a) Practical Completion
    b) Partial Completion and
    c) Final Completion.
    In the case above, you are not deducting an amount from existing PO, you would be applying a penalty on the Vendor for Failure for not meeting the Practical/Final Completion Certificate requirements. Based on the legal understanding, usually the penalty may vary above and beyond of 10% of value of work not done/ delivered. (This is company to company)
    So we establish that the scenario above is not a case for PO, but for Penalty. Now penalty in construction business again is of three types (My understanding again from experiences)
    a) Time/Schedule based penalty - Levied on vendor due to delays (Ranging for 100 SAR/ Day to 400 SAR/Day - if you are in Saudi)
    b) Cost/ Quantity Based penalty - Deviation from Standard Plan/ over consumption against budgeted quantity in Bill of Ladding
    c) KPI/ Quality Based Penalty - This can be a levied for number for reasons, including non completion of agreed deliverable in Contract. (This can be even 150% of contract value)
    Now, penalty is a revenue to the Organization so this needs to be accounted differently. You apply a Penalty against a PO and create a Debit memo and show the penalty as revenue in the books. This cannot be done if this is entered as a PO.
    So, my point is, you need a customization to capture the penalty and apply it against the PO and account it as a debit memo in Finance side.
    Please let me know your thoughts, I will be glad to hear if I need to be corrected.
    Rgds,
    Abhi

  • Unable to enter a negative amount for payment

    I am trying to enter a negative amount for payments under order items, but I keep getting this error message:
    "The minimum accepted payment amount for 'Financing' is '0'. Please enter an amount greater than '0' to continue.(SBL-SFS-00167)".
    The payment method & type I'm using here is "Financing" & "CareCredit". But, when I enter the payment method & type as "Credit Card" & "Visa", I can enter a negative amount without any errors.
    I think this requires some configuration to override. Can anyone help me with this issue?
    Thanks,
    Raghu

    Hi,
    It's known bug.
    Bug number is 10499290.
    Visit/contact oracle support for more information.
    Good luck
    T.Abed

  • I need to add the logic for posting key,

    I need to add the logic for posting key, if posting key = 50 then amount is credit (add negative sign in amount field).
    I creadted this scenario in mapping, We wanted to make sure that the negative sign was placed in the amount field if the posting key was = 50.  So it seems we are good.  We will just need to test.
    How i can test this case?
    Please do needful.
    Thanks in advance.

    Hi,
    You need to use an IfElse node function in your mapping in which the input should be the posting key from the source structure.
    You need to check in the IfElse statement whether the posting key=50, if it is true, then use concat node function to concat the negative sign("-") along with the original value to be passed to the amount field on the target side. Else, if the condition is false(i.e posting key!=50), then simply pass the value to the amount field as it is without adding the negative sign.
    After the mapping is done, go to the test tab and then insert the values in the source fields and then execute from the lower left button showing start transformation.  You need to test with the value of posting key=50 once and with the value not equal to 50 once.In the first case, the output amount field should have the negative sign, which should not be present in the second case.
    You will find your target structure in the righter half of your screen. That's it mate
    Thanks
    Biswajit

  • Issue in PE51 form with negative amount

    Hi experts,
    Im developing employee payslip in HRFORMS transaction by referring the existing PE51 form. Now i face one problem with the payments and deduction amount displayed in the existing PE51 form.
    That is, a particular wagetype displayed under deduction column is displayed as +ve amount. But when i checked the corresponding wagetype amount in PC_PAYRESULT, the amount is in negative.
    So i want to know whether any logic is written in PE51 form to chnage the negative symbol.
    When i checked the rule, i see the below rule.
    01  1 XRT     BETRG N NE     ' 0
    Can anyone tell me where the logic for PE51 form is written?

    Andrejus, I just tried this in OTN4 build and it works ok for me.
    Can you try the following testcase I built?
    http://www.oracle.com/technology/products/jdev/tips/muench/temp/lovdoesnotfiremandatoryattributestest.zip
    Run the TestPage.jspx in adfc-config.xml
    Click the button to start the "create-employee" task flow.
    In the new row, I click the Deptno lov button and pick a department (say, 30) from the LOV.
    No mandatory attribute errors are thrown.
    NOTE: Notice that in TP4 there is no longer an "ADF Create Form" and that we're encouraging you to create a create form using a method activity that declaratively invokes the create operation, then forwards to a page with a regular ADF Form on it. This is due to the numerous confusions that have always surrounded the ADF "invokeAction" now that we have a visual, declarative mechanism to model this type of initialization activity, we will prefer users adopting that.
    Also, notice that the page definition for the method activity has the new "SkipValidation" property set to true.
    Can you evolve my testcase into one that still reproduces the problem so I can file a new bug for the remaining problem?

  • Import format for two amount columns in different currencies

    Hello,
    I am working on FDM 11.1.1.3 and will be getting the trial balance containing amounts in two currencies (both local and USD). I need to load data in both the currencies. The extract has two columns for the amount rather than having two different rows for different currencies. Any ideas how to define this format and how to load data. We are not using the translation logic and hence the amounts in both currencies are required.
    Thanks for your help in advance.

    Hi Tony,
    Thanks a lot for the input. Any idea, how should I go about doing this else if you have any documentation, let me know. Also, what are the cons of doing it this way over requesting the customer to get the file with amounts in different rows than in different columns

  • Advance payment - TDS deducted but cheque printed for full amount

    Hello SAPians,
    Advance payment to vendor - TDS is applicable - SAP entry shows about TDS Deduction but the cheque printed for full amount.
    Cheque needs to be printed after TDS deduction.
    Please suggest.
    JK

    Hi in REGUH and REGUP tables there is no tds amount if you want to deduct the tds amount then while printing the cheque give the logic as in regup document you need to pass into WITH_ITEM table and if the document is matched then get the value against WT_QBSHH field and deduct this valu into your invoice amount.
    i have done this job in current client it will work properly.
    Let me know if you need further claification

  • Negative amount in sales order

    Dear experts,
    We are in support project,
    ours is order related billing,
    we get a error message in a sales order, when we enter a base value is "zero", and add a discount in the same sales order with absolute amount which is a negative value,
    this displays a error message as "negative amount is not allowed", then sales order is terminates, we do not able to save the sales order,
    however the user forwards me a successful case, the  sales order created with negative value and subsequent invoice for that sales order,
    when i check it from my side,the same error flows, when i tend to go item level,when i view document floe the sales order and invoice is created.
    Please guide me to control this error message.
    Regards
    baalakrushnan.da

    Hi,
    In the condition type for price,there is a field for pricing procedure check which pricing procedure is assigned there.In the standard condition PR00 there will be PR0000,check in ur pricing condition,i think the terminating of the sales order and negative value may be bacause of that,or if due to the validity date of the pricing condition.
    Regards,
    Ramesh.

  • How do I Credit Note negative amount line item in Invoice

    Hi Experts,
    I have an AP Invoices that have a negative line item total.
    Now that I realize there is something wrong with this AP Invoice, I will like to CN it. But I was stopped by SAP, because I cannot CN a negative amount line item.
    Can anyone advice me how can I Credit Note (in any sense) this negative line item?
    Much Thanks!
    Warmest Regards,
    Chinho

    Hi Chinho,
    I believe this functionality is to be made available in version 8.8. The SAP workaround for 2007 is:
    To cancel an invoice with negative line, please use the workaround as
    per below:
    1. For the rows with the positive Row Total, create an "independent"
    Credit Memo (not based on an Invoice).
    2. For the rows with the negative Row Total, create another Invoice
    with a positive Row Total opposite to the original negative Row,
    and reconcile between the two rows manually via Internal
    Reconciliations. (This option is available in Banking module in
    2005 version and in Business Partner module in 2007 version.)

  • Sort negative amount in webdynpro ABAP (EHP5)

    Hello,
    We ahve recently installed EHP5. We are now re-implementing Enterprise Compensation Management (ECM) with the new WebDynpro ABAP MSS iViews.
    We have the following issue: one of our column in the compensation planing iView displays positive and negative amounts. the problem is that when we sort this column (ascending or descending), the negative amounts do not appear in the correct order. This is an example how it comes:
    6,050.05
    7,159.59
    8,910.65
    8,980.85
    1,707.10-
    10,110.90
    13,644.30
    16,645.69
    17,135.79
    2,013.95-
    anyone having the same issue?
    Many thanks
    Lucas

    Hello Lucas,
    the numeric content of the relevant columns is interpreted as 'String-like' and sorted in that way, i.e.
    the digits of a number are compared to the digits of another number from left to right. This leads to wrong sorting results as the amount of digits a number consists of is not equal for each number within the same column. Usually issues like this occur if the function module which supplies the content marks the column as sortable (COLTYPE = 'SORTABLE'  but only table COLUMN_CONTENT is filled. Columns marked as SORTABLE which don't contain content that can be sorted 'straight foreward' by
    comparing the characters of one column entry to another from left to right MUST supply a second table SORT_COLUMN_CONTENT which contains the content converted in a sortable way. In your case table SORT_COLUMN_CONTENT must be filled with the numbers enriched with leading zeros, i.e. 000009270000 instead of 92,700.00 which is the 'display value'. please check if correct SORT_COLUMN_CONTENT is provided.
    If this is the case,
    Otherwise please provide correct SORT_COLUMN_CONTENT Further Information about sorting of columns can be found in the Configuration Guide for the Object- and Dataprovider on the Service Market Place (http://service.sap.com/mss).
    Best Regards,
    Deepak.

  • BAdI for negative numbers

    Hello All,
      I am downloading data from an Infocube into a flatfile.
    It downloads the negative amounts as 100.00- as the InfoSpoke downloads it in the internal format. I read note 856619 which is exactly for my case. But I can't get the code to work.
    My InfoSpoke is called ZSINF_CO.
    Could anyone help me on how to apply this note to this InfoSpoke. I have two key figures ZAMT and ZPROF in this InfoSpoke for which I have to convert the amounts from say 100.00- to -100.00
    Any help is appreciated.
    Thanks in advance.

    Under the 'Data' menu in Excel you can use data validation to control what is entered, use a range 0 to 999999... You can add a message to explain the validation.
    Cheers,
    G.

  • Posting logic for stock shortage

    Hi there,
    I m workiing in SAP R/3 ECC 6.0 version CO module.
    We are trying to find a solution for posting logic for stock shortage. Regarding this SAP Note 362037 have also been referred.
    We have purchased vide PO a certain item say ferro alloy 100 kgs. @ 5000 INR each (Clearing & Forwarding charges Rs.50000 credited) at which GR was made. Now at the time of bill passing of clearing & forwarding at a later date the amount passed was Rs. 20000 when the stock quantity of ferro alloy was only 40 kgs. The system adjusted the entire Rs. 30000 with the balance inventory available reducing the inventory cost instead of transferring to Price difference account the required proportionate amount.
    Whether this can be rectified in the system.
    Regards,
    Divraj Agarwal
    Edited by: Divraj Agarwal on Feb 22, 2010 12:32 PM

    Hi,
    Create a Formula variable with Replacement Path for Batch, and replace with Attribute and attribute is Date OF Manufacturing, so using this you get Date Of manufacture. And next create a Formula variable with Custome Exit and select Dimenstion ID = Date.
    And write the following code to get Current day.
    WHEN 'ZVCURDAY'.
          CLEAR: l_s_range.
          l_s_range-low = sy-datum.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    so by using you get current date. So create Formula and do Substraction, i.e. Curday-Dateof Manufacture (above Replcement variable), so you get number of days from Manufacturing.
    Then you csan create conditions, i.e. <30 days, <60 days like that.
    Thanks
    Reddy

  • Processing Logic for custom fields to CRMD_OPPORT_H

    Hi all,
    I have a requirement to add two new custom fields to the Opportunity Table in CRM. I was able to successfully add these fields using EEWB and the fields are displayed in the corresponding PC-UI in the portal.
    I have an additional requirement of performing a  calculation based on these new added fields and updating or refreshing the "Expected Sales Vol" field in the Forecast tab on "Opportunity" Business Transaction
    Can anyone provide some inputs on how we can add the processing logic for acheiving? Is this possible via the BADI? Or Do we require to modify the BSP?
    Thanks

    Thanks for providing the solution. I have awarded you the points as it helped me to solve my problem. thanks once again.
    I have implemented the BADI and the corresponding PCUI displays the calculated amount when i enter values in the custom fields and hit ENTER.
    I just wanted to understand why we require to use function module CRM_ORDER_MAINTAIN_SINGLE_OW?. In my BADI implementation i did not have to use it so additional details would be useful for me to determine if i am missing anything.
    implemented BADI code:
    method IF_EX_CRM_OPPORT_H_BADI~CRM_OPPORT_H_MERGE .
    Constant Declarations
      CONSTANTS :
        c_BOX      TYPE CRMC_OPPT_TYPE-TYPE             VALUE '0001'.
    Processing Logic
      IF IS_OPPORT_H_WRK-TYPE EQ c_BOX.
    Perform the calculations for the Expected Sales Volume field
        CS_OPPORT_H_BADI-EXP_REVENUE = IS_OPPORT_H_WRK-ZZNOOFUNITS *
                                       IS_OPPORT_H_WRK-ZZPRICE .
      ENDIF.
    endmethod.

  • Negative amount in the open deliveries field

    Hi All
    Iu2019ve also come across a negative amount in the open deliveries field on the business partners master data screen but there are no open deliveries no orange arrow to click on and it's grayed out for this selected business partner could anybody help with how to fix this issue.
    Regards
    Ronald

    Hi,
    Please run the detect query mentioned in the Note No. : 999124 and if it returns and result, you need to open a support ticket on the portal to get the issue investigated.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

Maybe you are looking for

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword. ContactInfo c = new ContactInfo(

  • HP Simplepass not working with Windows 8.1

    Hi everyone, I'm not sure if I'm in the right section, so please tell me if I'm not. First of all, here are my specs: System Model: HP ENVY TS 15 Notebook PCProcessor: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz, 2401 Mhz, 4 Core(s), 8 Logical Processo

  • In my library disc 2 comes before disc 1

    i imported a 2 disc cd to my itunes library but disc 2 is positioned before disc 1 in the sequence order of albums. How can I correct this?

  • Database data corrupted upon retrieval?

    Hi All, this question regards an issue I'm having with the Database Connectivity Toolkit, 1.0.1. I'm retreiving a record (a bunch of records actually) from a Jet database and creating a 2-D table that SHOULD be sorted by time, as that is how the data

  • TOMTOM XL mancata connessione con internet

    Espongo un problema che mi assilla da oltre 4 mesi.Ho il navigatore indicato in oggetto che, con Windows XP precedentemente utilizzato, mi permetteva di collegarmi con internet per l'acquisto oneroso di mappe aggiornate. Dopo l'acquisto di un iMAC 21