Changing negative value

can you pls help me on this
we have a strange req. like below
load data
into table TEST_123
append
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
  PRODUCT                 "LTRIM(:PRODUCT,'0')"
  , ORDER_DATE NULLIF (ORDER_DATE='00000000')  "TO_DATE(:ORDER_DATE,'YYYYMMDD')"
  , QTY
  , TIMESTAMP     "TO_DATE(:TIMESTAMP,'YYYYMMDD')"
)following are the data file
00422972,20101209,34-,20101209
00422973,00000000,48,20101209
00426229,20101214,56-,20101207when we have 34- or 56- as QTY from the data file, it should be deleted from loading into test_123 table
Is there anyway we can do this?
as the qty filed is defined as number, it wont accept 34-,
Is there any way we can convert -34 from 34-..?
the table fields are defined as
create table test_123
product varchar2(50),
order_date date,
qty number,
timestamp date
)Many thanks

Hello user12093849.
Your post is a bit contradictory. First you mention "deleting from loading" and then you mention converting. As the records will already reject and therefore not be loaded, I'll address the numeric conversion.
If you want to load a number with a format that can not be implicitly converted, you'll need to specify the format. To specify a trailing minus sign '-', you can use either a format of '99S' or '99MI'. However, the '99S' requires your positive numeric value to be presented with a plus sign '+' and the '99MI' requires a plus sign or single space ' '. Since your sample data doesn't suggest a trailing space or trailing plus sign, you'll need to do a bit more than specifying the correct format and supply your own function. Here is a rough sampleCREATE OR REPLACE FUNCTION  to_number_minus
  ( p_string  VARCHAR2 )
  RETURN  NUMBER
IS
  r_number    NUMBER  := 0;
  r_position  NUMBER  := 0;
BEGIN
  r_position := INSTR(p_string, '-');
  IF  r_position = 0
  THEN
    r_number := p_string;
  ELSE
    r_number := TO_NUMBER(p_string, '99999999MI');
  END IF;
  RETURN  r_number;
END;
FUNCTION TO_NUMBER_MINUS compiled
SELECT  'x'||TO_NUMBER_MINUS('34')||'x' FROM dual;
NUM_VAL                                   
x34x                                      
SELECT  'x'||TO_NUMBER_MINUS('34-')||'x' FROM dual;
NUM_VAL                                   
x-34xHope this helps,
Luke
Please mark the answer as helpful or answered if it is so. If not, provide additional details.
Always try to provide create table and insert table statements to help the forum members help you better.

Similar Messages

  • Dump when changing the value for a field (of 13 decimals) in alv grid.

    Hi Group,
    Its giving a dump when user is trying to change the value.
    dump description: Unable to interpret "70,000 " as a number.
    what is happening here is, the original value is 50,000 and he is deleting 5 and replacing it with 7, here its throwing the dump.
    If he removes the complete number 50,000 and then gives 70000 its  taking the value.
    I tried to use, the decimals options in alv field catalog but to no joy.
    Please can you give me an advice on this.
    Many Thanks.

    the problem is the comma in the 70,000....that's an alpha character.... Normally, we expect SAP to display numeric fields in a appropriate format, based upon their numeric type, but trying to forcibly insert '70,000' into a true numeric-type field can generate an 'unable to interpret xxx,xxxx  as number' error.
    You could experiment with changing your ALV column to a char17 (or appropriate width) and putting your numeric value into that to display, then converting back to type P, or other field type in the table, in a column that is not displayed, when the user changes the value....  essentially two columns, one not displayed with a routine to copy/convert the numeric field into the alpha field and the reverse when the field is changed.
    But, the better solution is probably for the user to understand that they're seeing a formatted numeric field, and that they need to replace the entire value with the only possible punctuation being a decimal and (if necessary) a negative sign.

  • Stock Posting List - Negative Value when Different Currency in PO

    Hi experts,
    We would like your help on the following scenario.
    A Purchase Goods Receipt PO and a Purchase Invoice are added in SAP 9.0, on the same date, in a different currency from the system's currency; system's is Euro and Purchase documents are added in JPY (Japanese xen), i.e. 300 JPY. When checking the "Stock Posting List" report for a number of goods that were purchased with the above documents, the report presents the line of the Goods Receipt PO with the value of 270 JPY, and the line of the Purchase Invoice with  a negative value, i.e.-15 Euro.
    Has anyone faced the same issue?
    Thank you in advance.
    Kind Regards,
    Vassilis Korolis

    Both queries have the default value of  "Only Posted Values for Navigation".
    As I was looking at this, I did realize the following though.
    Remember, I mentioned that my zcurrency_mand field has a Reference Characteristic of 0currency.
    Query 1:  The key figure that is being converted is tied to 0currency in the back end. (this is the query that works).
    Query 2:  The key figure that is being converted is tied to 0inv_curr in the back end.
    Both of the currency conversions are using zcurrency_mand.  Should query 2 be using a new variable similar to zcurrency_mand, but with a Reference Characteristic of 0inv_curr?
    If the answer is yes, I tried creating ZINV_CURR_MAND with Reference Characteristic of 0inv_curr, but am getting the following error when I try to save the changes to Query 2
    [E117(BRAIN)] Errors: Variable ZINV_CURR_MAND2 is not permitted for the target currency. 
    Thanks,
    Jennifer

  • Service PO Creation With Negative value

    Hi all,
    I am trying to create a Services PO using the BAPI 'BAPI_PO_CREATE1'
    In my scenario, First time PO will create with negative value.
    Then I will remove some conditions in Services line.
    Then PO value will becomes positive.
    When i create the bapi in ME21N, its working fine. Net values of PO become negative.
    But When I try the same using the BAPI, net price of the PO stored as 0(ZERO).
    If I create a PO with positive value using the same BAPI, everything is fine.
    If I change the PO after creation(removing the service line to make bapi value as positive), Net values are doubled since value stored as zero instead of negative value.
    Kindly help me to get out of this issue.
    Note: I need to create a Services PO with negative value using the BAPI
    Thanks in advance.

    Hi,
    No need to create service PO with negative quantity!
    If payment not done for your servicePO, you can cancel invoice document and then revoke SES.
    If any other process involved you can do subsequent debit or subsequent credit  for your service PO in t.code:MIRO.
    Regards,
    Biju K

  • Negative values in inventory

    Hi All,
    I'm negative values in inventory,what all i did is,
    1) At BI side i loaded data for BX and compressed the request with out selecting the NO MARKER UPDATE
    2) After loading BF i compressed the request with selecting the NO MARKER UPDATE
    3) Then i unchecked the NO MARKER UPDATE.
    Now only first two requests are compressed, is it ok? how about delta loads of BF?
    Kindly help me solving the issue,is the above steps are right? if so why im getting negative values?
    Regards,
    Yunus

    Hi Yunus,
    BX is used to initialize the stock not for the historical movements.
    Initialize the stock is mandatory after that anyway you need the delta movements to be happened so BF is also required, if you don't want to load historical movements then you load only Delta loads but for both of them BF is the data source.
    check this link for inventory
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/93ed1695-0501-0010-b7a9-d4cc4ef26d31
    For movements of the material price you use 0processkey,
    Transaction key 51
    Revaluation through a material price change (for example, with transaction MR21) and the debit/credit indicator = DEBIT.
    like that there are some keys 52, 151 and 152
    To know more about these check the OSS note 492828
    Regards
    Pcrao.

  • Negative values in Inventory report

    Dear Guys,
    When we are doing BW Inventory, we are facing one problem. I have searched previous topics. There some guy gave the same problem. But there is no answer. I am giving the details as per his words:
    We have been struggling to reload our Material Movements cube (0IC_C03). We have been following the SAP documentation titled 'How to handle inventory management scenarios in BW'.
    Our initial loads (Stock Opening Balance, Movements Init, Revaluations Init) have all been successful and validation looks good. The problem is that when the first delta UPDATE runs we end up having many negative inventory quantities appearing. We are not sure what we could be doing wrong.
    Compression settings are as follows
    1) Run stock opening balance (2LIS_03_BX)
    2) Run statistical setup for 4/3 only for Revaluations and Movements (2LIS_03_BF, 2LIS_03_UM)
    (Compress with Marker option NOT CHECKED)
    3) Load Stock infoPackage 2LIS_03_BX with 'Opening stock balance checked ' (ie: not full update)
    (Compress with marker option NOT CHECKED)
    4) Run delta init for Movements
    (Compress delta init with marker option CHECKED)
    5) Run delta init for Revaluations
    (Compress delta init with marker option CHECKED)
    6) Setup job control in logistics cockpit
    7) Run delta update for Movements
    Compress delta with marker option NOT CHECKED
    8) Run delta update for Revaluations
    Compress delta with marker option NOT CHECKED
    The issue seems to occur with steps 7 and 8. The initial time we do these steps we get zero records and everything looks good. Then the next day the same steps occur in our nightly process chain and then the data is bad with negative values.
    Any ideas what we could be doing wrong?
    Thanks!
    Regards,
    Vivek.V

    Hi Vivek,
    I had exactly the same problem.
    In my case the issue was with the configuration of material movements in R3
    In the R3 IMG goto Materials Management/IM & Phys Inventory/Movement Types/Copy, Change Movement Types execute
    Select movement type (enter)
    select all Movement Types say 101 to 901
    Look for column header "Stat. Relevant" and make sure they are set to 2 or 3. If they are set blank the movements are not picked up by the extractors

  • Negative values in AIAB, AIBU

    Hi,
    I am tying to post negative values in transactin AIAB & AIBU. System is giving error mesage negative equilance values not allowed. How can I allow negative values.
    The asset on which negative values are posting , have already configured for negative values.
    Help me to resolve the issue.
    Thanks.

    Nitin,
    Goto AS02 -  Asset change - Goto Dep Areas - Double Click on 01 Dep area -  There you can see the Dep Area is in Negative or Positive.
    So for TEMPERORILIY change an do the AIBU/AIAB and make sure to change back once the posting is done.
    Thanks,
    Venkata Raju

  • Negative  values in red and Positive values in black CONDITIONAL FORMATTING

    Hi ... Everyone
    I have to show Negative values in red and Positive values in black in one of my report.
    i tried these conditions
    1. <?if:GAIN<0.00?><?attribute@inlines:color;'red'?><?end if?>
    but it shows negative values only in red ,positive values in black are missing
    2. <?if:GAIN<0.00?><?attribute@incontext:color;'red'?><?end if?><?if:GAIN>0.00?><?attribute@incontext:color;'black'?><?end if?>
    This gives the exact result what i wanted ...but the problem is i have five tables in my report ... so the above condition only allow changes in ONE TABLE ONLY. :(
    Plzzzz anyone who can help me to sort out my problem or else SUGGEST ANOTHER WORKING CONDITION
    Regards
    Subham Mittal

    Subham,
    This should not be difficult and moreover the BI Publisher Desktop installation comes with a set of examples:
    Start -> Programs -> BI Publisher Desktop -> Samples -> RTF Templates -> Advanced -> Conditional
    There you can find two templates with the exact same situation like yours, highlighting either the foreground color or background color.
    regards
    Jorge

  • Balance Sheet negative values

    Hi all,
    I've already implemented the IC 0FIGL_C10 and V10, and the business content queries that are available show negative values for equity and liabilities, but they are positive in the R3 balance and therefore the totals are not correct.
    Any idea about the reason of this ?
    Thanks!

    Hi Pablo,
    First of all, look at the cube content and check if balances have the same sign as in R/3.
    If no, then look at transformation in transfer and/or update rules.
    If yes, then look at the query definition.
    I see here:
    http://help.sap.com/saphelp_nw04/helpdata/en/49/026940c3c7bf49e10000000a1550b0/frameset.htm
    that Balanve is determined as 0DEBIT – 0CREDIT.
    Since in R/3 liabilities and equity are positive, then the formula above will give you negative amounts.
    You either change the query definition or revert the sign for liabilities and equity during a load into the cube.
    Though, there is a certain logic in SAP representation:
    assets are treated as positives while liabilities and equity as negatives.
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov
    Message was edited by: Eugene Khusainov

  • Numeric Integration of positive and negative values in the same signal

    Hello.. I need to perform an evaluation of Area Under Curve of my signal, but it contains positive and negative values. I am using the "Numeric Integration" function, but the result expressed by my VI represent: AREA OF POSITIVE VALUES - AREA OF NEGATIVE VALUES, in other words, my result represent the difference between these two areas. But I want to know the total area, the sum of positive values area and negative values area, and because both values has are "+", my final result should has "+" notation.
    For example:
    Area of positive values: +45.00
    Area of negative values: +34.00
    Total area: +79.00
    How do I modify my VI to obtain the total area value?
    I try to split my values in two parts:
    A) only the positive and zero values
    B) only the negative values
    I calculated the areas of both splits and performed an sum of them, but the final result does not matches with total area (computed by another software to know the real value)
    I attached an picture of my VI
    Thank you
    Daniel
    Attachments:
    Numeric Integration1.png ‏12 KB

    Use an event structure for the boolean value changed. You also did not follow Lynn's advice to insert an "absolute value". It would really simplify everything.
    Here's how it would look in a newer version of LabVIEW (your icons look different because you have an older version. The functions are the similar).
    This is just a draft and the program needs to be improved. Use a state machine with events for read file and another for value change on the sampling rate. Place the data array in a shift so you can change the sampling rate without the need to re-read the file. Modify as needed. 
    Some important pointers in general:
    There is NO need to constantly spin the loop every nanosecond. The only time the loop needs to spin if if one of the inputs has changed.
    If you don't use an event structure, all UI loops need a wait to conserve CPU.
    Never (almost never) use "switch until released". Typically you want to use "latch when released" which makes the terminal true exactly once until the value is read and it will revert to false after that. "switch until released acts like a doorbell, so if it werent for the file dialog, you would execute the case several times in a row.
    You don't need to get the array size and wire N of the FOR loop if you are autoindexing. LabVIEW will spin the loop until it runs out of elements automatically.
    There is an atomic operation for "negate" in the numeric palette. No need to multiply with a "-1" diagram constant.
    There is an atomic operation for ">=0" in the comparison palette. No need to compare with a "0" diagram constant.
    Use a stop button on the loop termination.
    Everything that only needs to be done once after the file is read (e.g. you inner loop, etc. also belongs inside the case structure. Right?
    In general, you would make things much easier for us if you would attach your actual live VI instead of dead images.
    Message Edited by altenbach on 04-19-2008 12:22 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    areaPositive.png ‏9 KB

  • Change item value before commit

    Hello,
    I have a form in which I issue an execute_query from a mouse click to retrieve database values from a data block onto a form. The user is then able to change the values of these items on the form and commit them via a button on the form. What I want to do is make sure that some of the values, based on another item in the block, are negative and if not, change them to a negative value. before the changes are commited. I can't seem to find the right trigger to accomplish this-- has anyone have an idea on how to do this?
    Thanks in advance.
    Jeff

    Hi,
    How about putting your code in :
    1. Pre-Update or
    2. When-Database-Record
    [Block Level trigger]
    The trigger text could be something like :
    If (:block.col is > 0 ) Then
    :block.col := :block.col * -1;
    End If;
    -- Shailender Mehta --

  • Negative value

    If i declare a variable with type p, is it can store a negative value? Thanks!

    Hi,
    Yes.
    data v_num type p decimals 2 value '-234.00'.
    data v_char(20).
    move v_num to v_char.
    write:/ v_num.
    condense v_char.
    write:/ v_char.
    To put the negative sign before the value use the below function module.
    call function 'CLOI_PUT_SIGN_IN_FRONT'
      changing
        value         = v_char.
    write:/ v_char.
    Message was edited by:
            Velangini Showry Maria Kumar Bandanadham

  • Negative values are replaced by postive values

    Dear experts,
                        I got an issue in a query that Negative values are replaced by postive values.... So i checked out the data in the data target i dint found negative values.... I checked out whether there are any formuales... So i checked out the data in RSA3.. I dint found any -ve values... Am having doubt that R/3 is for transactio data.. So will it changes alternately -ve and +ve....

    HI,
    Make sure that in properties your Key figure in Query, +/- reverse is not check out.
    TO find that->Go to your Key figure in Query->Right click-> There you will in left top corner->+/- reverse sign.
    Make sure that it is not checked.
    hope i m clr.
    Regards,
    San!
    if helpful,assign points.

  • Asset MIRO Freight changes changes - Acquitision value negarive in area 01

    Dear Experts,
    Please guide me,  I have one CWIP asset for this i have done PO and GR and freight chages  4500,  for the asset MRO also done except freight charges.  We had capitalised for this CWIP asset (from CWIP to Original asset transfer).   this transcaction was in laster fiscal year (in DEC 2009) Asset current balance is "0".  now we are doing freight miro  that time we are getting error message i.e.,  "Acquisition value negative in area 01".
    While doig PO i had entered freight charges 4500,  GR also  happen with Rs 4500.   My actual freight is 4250/- only.
    In miro i have changed freight  charges to 4250 from 4500/- .  I have to post freight changes with 4250/- only.
    if i change 4500/- to 4250 system throughing error messag.  Please suggest me any possiblities.
    Regards
    Chandu

    Hi Chandu,
    During frieght exp MIRO entry, do not change the GRN values manually.
    Means, when you enter the PO number in MIRO, then the system automatically picks 4500. Becoz GRN was done for that much amount. So do not change the value to 4250 from 4500 in the item level.
    Change the vendor invoice value as 4250 in the header level. So you will have 750 balance on top right corner as RED.
    So charge this 750 to the frieght charges GL account manually in GL account tab.
    Enter the frieght charges GL and choose CREDIT and enter amount as 750 and enter the CO account assignments as per your requirement.
    Then you will be able to post the MIRO entry. By doing this, your frieght charges expense GL account balance will be reduced by an amount of 750 by this MIRO entry.
    This will resolve your issue.
    Thanks,
    Srinu

  • Copying the negative value from 1 base entity to another base entity

    I am trying to copy the negative value from 1 entity to another base entity in rules.
    I am not sure if this can be done
    Example Paris has netinc of 100 dollars I want the other entity ParisNeg to receive the negative value or netinc -100
         If pov_scenario = "Actual" then
              'If pov_entity = "ParisNeg" Then
              If pov_year > "2012" Then
                   If pov_Value = "<Entity Currency>" or pov_Value = "<Entity Curr Adjs>" Then
                        For Each Acc In HS.Account.List("","(Base)")
         HS.EXP "E#Paris" ="E#ParisNeg"
         End If 'default_currency
         End If 'Year
         'End If 'Entity
    End If 'pov_Scenario

    This might work:
    If pov_scenario = "Actual" then
    If pov_year > "2012" Then
    If pov_Value = "<Entity Currency>" or pov_Value = "<Entity Curr Adjs>" Then
    If right(pov_entity, 3) = "Neg" Then
    HS.EXP "A#ALL = -E#" & Left(pov_entity, Len(pov_entity)-3) & ".A#ALL"
    End If 'pov_entity
    End If 'default_currency
    End If 'Year
    End If 'pov_Scenario
    *Did not test this.  You might need a member list or loop to roll through the accounts instead of all.  Another thing to consider would be changing the consolidation percent to -100% or something.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • A never ending series of problems

    I've had my Lenovo 3000 V200 for about a year and a half now.  I have the 3 year on-site warranty so I've got that going for me. Everything was great with the computer for the first 1+ year.  Then, a few months ago the hard drive failed.  I've always

  • Sender Mail Adapter: Java Exception: no mailbox at this server

    Hi experts, we are in the process of moving our PI sytems to different servers. Although this is not an easy task, we are pretty much there. However, also the e-mail (exchange) server moved from server A to server B. We migrated the mailbox to the ne

  • Using 3.6 version, updated this morning no bookmarks, restored them but bring it up and no bookmarks again?

    Using 3.6 version, updated this morning no bookmarks, restored them but bring it up and no bookmarks again? I restarted my computer after re installing my bookmarks from my desktop but the bookmarks are not showing up when I bring up a new browser wi

  • Create a JAVA client calling a proxy...

    Hi, I succeed creating a servlet that calls a web service via a "deployable proxy". Is it possible to create a java class (not a servlet or jsp) that connect to this proxy ? Here is a sample of my client class:                InitialContext ic = new

  • ASP/SAP  integration

    Hi! We would like to extract some data from SAP tables and record this data in another Oracle database. Is it possible for ASP to execute a function (RFC) to extract this data from SAP tables and then record it on Oracle database? I think its a more