Problem with FIX-Statement in Business Rule

Hello,
ich have a business rule with two nested FIX-Statements.
I calculate depending on the month in the runtime-prompt a forecast for this month. After that i fix on that month an clear some specific accounts. But some of these accounts still have data.
they are in the cleardata section and they are children of FiBuKonten from the first fix. When i leave out the @CHILDREN("FiBuKonten") in the first fix the accounts are cleared as excepted, but i need that fix because not all accounts are part of this forecast.
I changed everything to work as a calc-script and the same problem appears, on dev and prod database.
Why are some accounts cleared while others not ? Really misterious!
Here is the rule
FIX([TEBIT_RTP_Year],[TEBIT_RTP_Version],"IFRS operativ",[TEBIT_RTP_Entity],"Daten brutto","Daten_brutto_P_M",@CHILDREN("FiBuKonten"))
[TEBIT_RTP_Period](
IF(@ISMBR("Jan"))
Actual_kum = Budget_kum;
ELSEIF(@ISMBR("Feb"))
Actual_kum = Budget_kum;
ELSEIF(@ISMBR("Apr"))
Actual_kum = @ROUND(("1HR"->Dec - Actual_kum->Mar)/9 + Actual_kum->Mar,2);
ELSEIF(@ISMBR("May"))
Actual_kum = @ROUND(("1HR"->Dec - Actual_kum->Apr)/8 + Actual_kum->Apr,2);
ELSEIF(@ISMBR("Jul"))
Actual_kum = @ROUND(("2HR"->Dec - Actual_kum->Jun)/6 + Actual_kum->Jun,2);
ELSEIF(@ISMBR("Aug"))
Actual_kum = @ROUND(("2HR"->Dec - Actual_kum->Jul)/5 + Actual_kum->Jul,2);
ELSEIF(@ISMBR("Oct"))
Actual_kum = @ROUND(("3HR"->Dec - Actual_kum->Sep)/3 + Actual_kum->Sep,2);
ELSEIF(@ISMBR("Nov"))
Actual_kum = @ROUND(("3HR"->Dec - Actual_kum->Oct)/2 + Actual_kum->Oct,2);
ENDIF;)
FIX([TEBIT_RTP_Period])
     CLEARDATA "41000000";
     CLEARDATA "41100000";
     CLEARDATA "41200000";
     CLEARDATA "41990000";
     CLEARDATA "41000900";
     CLEARDATA "41096000";
     CLEARDATA "41196000";
     CLEARDATA "41296000";
     CLEARDATA "41940000";
     CLEARDATA "42000000";
     CLEARDATA "42100000";
     CLEARDATA "42200000";
     CLEARDATA "42099000";
     CLEARDATA "42199000";
     CLEARDATA "42299000";
     CLEARDATA "42990000";
     CLEARDATA "41918000";
     CLEARDATA "41100900";
     CLEARDATA "42091000";
     CLEARDATA "42918000";
     CLEARDATA "54000000";
     CLEARDATA "54009000";
     CLEARDATA "54009900";
     CLEARDATA "54009600";
     CLEARDATA "54130200";
     CLEARDATA "93541175";
     CLEARDATA "54001000";
     CLEARDATA "54001900";
     CLEARDATA "54014000";
     CLEARDATA "54019000";
     CLEARDATA "54021000";
     CLEARDATA "54021900";
ENDFIX
ENDFIX
Thx for your help.
Greets
Kevin

Does it make a difference when a dimension has dynamic calc members and i dont fix on that dimension to fix on the Level 0 members of that dimension ? The result should be the same in my eyes.
SGF is dense. I found out that everytime i the fix includes that first member M_124100 the error occoured.
I changed the rule in the form that i split the FIX Statement. And now it works without the error and with all data cleared. Even when i don`t reorder the dimension SGF.
Again thanks for your help.
Greets
Kevin
FIX([TEBIT_RTP_Year],[TEBIT_RTP_Version],"IFRS operativ",[TEBIT_RTP_Entity],"Daten brutto","Daten_brutto_P_M")
FIX(@CHILDREN("FiBuKonten"))
[TEBIT_RTP_Period](
IF(@ISMBR("Jan"))
Actual_kum = Budget_kum;
ELSEIF(@ISMBR("Feb"))
Actual_kum = Budget_kum;
ELSEIF(@ISMBR("Apr"))
Actual_kum = @ROUND(("1HR"->Dec - Actual_kum->Mar)/9 + Actual_kum->Mar,2);
ELSEIF(@ISMBR("May"))
Actual_kum = @ROUND(("1HR"->Dec - Actual_kum->Apr)/8 + Actual_kum->Apr,2);
ELSEIF(@ISMBR("Jul"))
Actual_kum = @ROUND(("2HR"->Dec - Actual_kum->Jun)/6 + Actual_kum->Jun,2);
ELSEIF(@ISMBR("Aug"))
Actual_kum = @ROUND(("2HR"->Dec - Actual_kum->Jul)/5 + Actual_kum->Jul,2);
ELSEIF(@ISMBR("Oct"))
Actual_kum = @ROUND(("3HR"->Dec - Actual_kum->Sep)/3 + Actual_kum->Sep,2);
ELSEIF(@ISMBR("Nov"))
Actual_kum = @ROUND(("3HR"->Dec - Actual_kum->Oct)/2 + Actual_kum->Oct,2);
ENDIF;)
ENDFIX
FIX([TEBIT_RTP_Period])
CLEARDATA "41000000";
CLEARDATA "41100000";
CLEARDATA "41200000";
CLEARDATA "41990000";
CLEARDATA "41000900";
CLEARDATA "41096000";
CLEARDATA "41196000";
CLEARDATA "41296000";
CLEARDATA "41940000";
CLEARDATA "42000000";
CLEARDATA "42100000";
CLEARDATA "42200000";
CLEARDATA "42099000";
CLEARDATA "42199000";
CLEARDATA "42299000";
CLEARDATA "42990000";
CLEARDATA "41918000";
CLEARDATA "41100900";
CLEARDATA "42091000";
CLEARDATA "42918000";
CLEARDATA "54000000";
CLEARDATA "54009000";
CLEARDATA "54009900";
CLEARDATA "54009600";
CLEARDATA "54130200";
CLEARDATA "93541175";
CLEARDATA "54001000";
CLEARDATA "54001900";
CLEARDATA "54014000";
CLEARDATA "54019000";
CLEARDATA "54021000";
CLEARDATA "54021900";
ENDFIX
ENDFIX

Similar Messages

  • Problem with two of my business rule triggers

    Good morning every one,
    I have a small problem with two of my business rule triggers.
    I have these tables:
    pms_activity
    csh_cash
    csh_integrate_leh
    csh_integrate_led
    and my process goes like this:
    upon approval of a row in my pms_activity table I have a trigger that insert a row in my csh_cash - and in the csh_cash table I have a trigger that will insert in the csh_ingerate_leh and csh_integrate_led.
    my problem is pms_activity does generate a row in csh_cash but the trigger in the cash does not fire to generate a row in the csh_integrate_leh and led tables.
    I have generated in the following order after I created my business rule:
    I have generated the table from the designer (server module tab)
    I have generated the CAPI from the head start utility
    I have generated the API from the designer
    I have generated the CAPI from the designer
    I have run the recompil.sql
    I have checked that my business rule trigger is enabled and should run on insert and no where restriction
    === this is my business rule logic ======
    l_rule_ok boolean := true;
    begin
    trace('br_csh001_cev (f)');
    csh_gl_pkg.csh_gen_integ_jvs(p_id
    ,p_ref_num
    ,p_own_id
    ,p_trt_id
    ,p_value_date
    ,p_description
    ,p_amount
    ,p_cur_id
    ,p_gla_dr
    ,p_gla_cr
    ,p_gla_pl
    ,p_gla_rev
    ,p_gla_eqt);
    return l_rule_ok;
    exception
    when others
    then
    qms$errors.unhandled_exception(PACKAGE_NAME||'.br_csh001_cev (f)');
    end br_csh001_cev;
    ==== end =======================
    Any help will be appreciated as I have struggled with this for two days.
    Thanks

    hmmm...
    Try resetting it again and restoring with the same backup file...
    Does the phone work properly once you've reset it before you try restoring? A lot of people here have experienced problems restoring from backups... could be worth forgetting about it and starting from scratch.
    You could try contacting your nearest Nokia Service Centre (www.nokia.com/repair) and see if they can do anything - it may need the firmware reinstalling or upgrading... possibly... give them a call though and see.
    Nokia History: 3110, 5110, 7110, 7110, 3510i, 6210, 6310i, 5210, 6100, 6610, 7250, 7250i, 6650, 6230, 6230i, 6260, N70, N70, 5300, N95, N95, E71, E72
    Android History: HTC Desire, SE Xperia Arc, HTC Sensation, Sensation XE, One X+, Google Nexus 5

  • Problem with balance carry forward business rule and automatic adjustments

    Hi All,
    I faced with issue when run BCF business rule and consolidation process. According sap courses BPC440 members with A(automatic adjustments) type should carry forward automatically, and I(imputable), M (adjustments) members should carry forwarded by bcf business rule.
    When I set up my BCF business rule I use property "Category_for_ope" in Category dimension. But this rule not work properly, then I use notes:
    1784365 - Category_for_ope property should not effect Consolidation.
    1902677 - The property category_for_ope shall work for consolidation
    After applying those notes, system work as I aspect. After i run consolidation first time system carry forward my automatic adjustment from Category "Expected" to "PLAN_Y0" and this is correct!!!. But when i run consolidation process second and third time system duplicated automatic adjustments in Category "PLAN_Y0".
    Someone can help me with this Issue?
    And sorry for my english

    Hi,
    Can you try as follows :
    *RUN_PROGRAM COPYOPENING
    CATEGORY = %C_CATEGORY_SET%
    CURRENCY = %RPTCURRENCY_SET%
    TID_RA = %TIME_SET%
    *ENDRUN_PROGRAM
    hope it helps...
    regards,
    Raju

  • Problem with READ Statement in the field routine of the Transformation

    Hi,
    I have problem with read statement with binary search in the field routine of the transformation.
    read statement is working well when i was checked in the debugging mode, it's not working properly for the bulk load in the background. below are the steps i have implemented in my requirement.
    1. I selected the record from the lookuo DSO into one internal table for all entried in source_packeage.
    2.i have read same internal table in the field routine for each source_package entry and i am setting the flag for that field .
    Code in the start routine
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
         and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp <> 3.
    delete it_zcam where end_dt initial.
    sort it_zcam by surce accno.
    endif.
    field routine code:
    read table it_zcam with key source = source_package-source
                                                 accno  = source_package-accno
                                                 binary search
                                                 transportin no fields.
    if sy-subrc = 0.
    RESULT  = 'Y'.
    else.
    RESULT = 'N'.
    endif.
    this piece of code exist in the other model there its working fine.when comes to my code it's not working properly, but when i debug the transformation it's working fine for those accno.
    the problem is when i do full load the code is not working properly and populating the wrong value in the RESULT field.
    this field i am using in the report filter.
    please let me know if anybody has the soluton or reason for this strage behaviour.
    thanks,
    Rahim.

    i suppose the below is not the actual code. active table of dso would be /bic/azcam_o1100...
    1. is the key of zcam_o11 source and accno ?
    2. you need to get the sortout of if endif (see code below)
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
    and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp 3.
    delete it_zcam where end_dt initial.
    endif.
    sort it_zcam by surce accno.
    field routine code:
    read table it_zcam with key source = source_package-source
    accno = source_package-accno
    binary search
    transportin no fields.
    if sy-subrc = 0.
    RESULT = 'Y'.
    else.
    RESULT = 'N'.
    endif.

  • Problem with create universe on Business Objects XI 3.1 base on SAP Query

    Hello,
    I have a problem with create universe on Business Objects XI 3.1 base on SAP Query.
    The problem is hierarchy. Massage on Busines Objects is :
       OWBS_ELEMT__ISTKOSZT(cube ICPC01/BEX_ICOC01):Exception condition  "HIERARCHY NOT FOUND" raised.(WIS 10901) 
    Query in BEX run OK.
    Best regards.
    Ela.

    Hello,
    Thanks for response.
    When I run BEX QUERY, all works OK.
    All hierarchies was created and activated  on system BW.
    This situation appears after upgrade BW to SAP NetWeaver 7.3.
    Before upgrade I created universe without any problems.
    Regards Ela

  • File to RFC/IDOC with a set of business rules applied on every record

    Hi experts,
    i have a scenario where the following happens
    checks need to be performed
    1. Technical validations on the file picked up (Can be done through java programs)
    2. Business rules to be applied on every record (Am not sure if this can be done in PI)  Sample business rules - record id already present in the SAP system, check if some manadatory fields are missing in the record etc..quite a lot to be applied
    I assume we use the File>PI>IDOC/RFC scenario for this..
    However am not sure on how we apply the complex business rules on every record in file using PI.
    Any suggestions??
    Regards,
    Kalyan

    Hi My requirement as follow,
    ELEMICA(CIDX)--->sap xi->SAP ECC,i receive CIDX Ordechange document from source system,when it is order change , the similr Order Chnage document available in DATA BASE,i need to retrive it from data base using some key fileds, i need to compare some of the fileds like PO Number,Buyer sequence number..like many fileds.if there is any change while validating then i need to send it SAP ECC Orders IDOC,IF TEH Values are same then i need to exit the process with mail to admin .
    How i done my requiremnet i already explained,if you looking for any info let me know,but i never faced any problems like perfromace issues ...but writing JAVA Maping code is bit tough.
    Regards,
    Raj

  • Ruge problem with bank statement

    Hello Gurus,
    Sorry for my bad english, i know i need to imrpove it. So if something sounds really odd, sorry.
    Let´s go, here's my problem.
    We have here a non-standard program wich establish a connection with the bank via Business Connector, and do the download of the bank statement to the SAP and process the bank statement automatically, do the entries in G/L account and other stuff of the process. This process was working perfectly, but a month ago, maybe more, the bank statement stopped to be automatically processed, and becomes avaible only for manual processing in FEBA.
    I think it could might be something envolving the KUKEY field of FEBKO table, i dont know. And something strange is happening sometimes the bank statement is processed automatically, so i was wondering if the KUKEY numbers are not repeating or something like that.
    So here is my question is there any standard TCODE wich i can manager this KUKEY numeration? Or any TCODE to manage the bank statements? Or see any diagnoses for this non automatic importation?
    I hope you have understood my scenario.
    Waiting for advices.
    Regards
    Rafael Valim

    Hi, I have the same problem when working with local Sap B1 client and DB on the local computer (and connecting as a superuser). Can anyone help?
    May be this additional info will help to determine the problem:
    when working with SAP-client on the terminal server via remote desktop (and DB is on another server) and when I try to update FormatFilePath (in File Formats Setup window), SAP-clinet hangs on (for approximately 10 minutes ) and then I see that no changes were saved (I see button "Update" again, while expect to see "OK", and no changes were saved to DB). There are no error or warning messages..
    When I am updating FileFormat without setting FormatFilePath-column - everything is ok. (info about FileFormat is updated)
    Regards,
    Katrine

  • Syntax for using AND with a variable in Business Rule Source

    I've never fully gotten my head around the AND/OR syntax of calc scripts. What I'd like to do is as follows in some basic pseudo code:
    FIX( ("A97" AND [Selected_Entity]) OR ("B76" AND [Selected_Entity]) OR ("C63" AND [Selected_Entity]) ).
    I want my webform's business rule to execute on the selected Entity in the form (eg. A97) ONLY if that entity is part of a restricted list of members (in this case, 3 entities out of 200).
    Thanks for any advice!

    Hi,
    I am not sure if I have totally understood what you are trying to achieve so sorry if I have misread it.
    But what you could do is set up a variable in the Bus Rule, lets call EntVar.
    It is set up as a local variable of type member and dimension Entity with a run time prompt "Enter Entity"
    Now in your script it could look something like this....
    FIX(&CurrentYr, "Working".......)
    "AccMember"(
    IF(@ISMBR(&#91;EntVar]) AND (&#91;EntVar]=="A97" OR &#91;EntVar]=="B76" OR &#91;EntVar]=="C63") )
    AccMember=.......;
    ENDIF
    ENDFIX
    Once you have tested the business rule, you can get your form to pass through the entity into the variable.
    Is this what you are trying to do?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Am I likely to recieve problems with these stats?

    Hi
    Just recently ordered BT vision and even tho its not due to arrive for a few weeks, BT have kindly enabled the Assured Rate/QOS already ;-)
    Now the wife is a bit pessemestic as to whether it will work on our line as she has heard horror stories from our neighbours.. THese are my just posted stats from the BT speed tester. Can anyone see any problem with these?
    FAQ
    Test1 comprises of two tests
    1. Best Effort Test: -provides background information.
    Download  Speed
    3757 Kbps
    0 Kbps
    7150 Kbps
    Max Achievable Speed
     Download speedachieved during the test was - 3757 Kbps
     For your connection, the acceptable range of speeds is 600-7150 Kbps.
     Additional Information:
     Your DSL Connection Rate :5312 Kbps(DOWN-STREAM), 448 Kbps(UP-STREAM)
     IP Profile for your line is - 4000 Kbps
    2. Assured Rate Test: -provides background information.
    Download Speed
    666 Kbps
    0 Kbps
    600 Kbps
    Max Achievable Speed
     Download speedachieved during the test was - 666 Kbps
     For your connection, the acceptable range of speeds is 576-600 Kbps.
     Additional Information:
     Assured Rate IP profile on your line is - 600 Kbps
    THis test was done over a BT Business Hub and if these results are decent, im reluctant to change it for the BT Home hub that i will be getting for free....

    looks pretty perfect you should have no problems at all
    Life | 1967 Plus Radio | 1000 Classical Hits | Kafka's World
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Helpful Post?
    If a post has been helpful, say thanks by clicking the ratings star.

  • Problem with bank statement processing

    Hello,
    I have problem with BSP. When I try to add file formats to bank statement I have error - "You are not authorized to change the folder path [message 10003520-34]". I try to add file SAPBPESIB_CSB43.bfp from SAP portal. Path to file is C:\Program Files\SAP\SAP Business One\Attachments\. I have full permissions to group "Everyone" to that folder.
    Do you have any idea what can it be?
    Regards,
    Bartek
    Edited by: Darius Heydarian on Mar 28, 2008 11:22 AM.

    Hi, I have the same problem when working with local Sap B1 client and DB on the local computer (and connecting as a superuser). Can anyone help?
    May be this additional info will help to determine the problem:
    when working with SAP-client on the terminal server via remote desktop (and DB is on another server) and when I try to update FormatFilePath (in File Formats Setup window), SAP-clinet hangs on (for approximately 10 minutes ) and then I see that no changes were saved (I see button "Update" again, while expect to see "OK", and no changes were saved to DB). There are no error or warning messages..
    When I am updating FileFormat without setting FormatFilePath-column - everything is ok. (info about FileFormat is updated)
    Regards,
    Katrine

  • Problem in setting participant in business rule

    Hi All,
    I am facing problem while setting the target participant in business rule. I want to route the task to the target participant for the adhoc routing in serial process .It's not taking the value as participant name.
    I have 5 participant for approve d task .But when I am writing
    If PreviousOutcome.outcome=="'REJECT'"
    then
    call GOTO(participant:"CTU")
    as CTU is one of the participant in the process.
    But it gives the error while deploying the application as unknown participant .Please tell me how come I route to different participant as per the condition in serial routing.
    please help me.
    Thanks & Regards
    Aseet

    Multi-post:
    http://forum.java.sun.com/thread.jspa?threadID=727161&tstart=0

  • Problem with connecting to Small Business server 2011 on Z10

    I cannot connect  my Z10 on Vodafone to my small business server 2011 to receive or send email. No problem with my IOS device. I understand this may be an active sync issue. Can anybody point me in the direction of some sensible advice /guidance to resolve this issue please.

    For qeustions regarding RDC, you should post them on Microsoft's own forums for their Mac software:
    http://answers.microsoft.com/en-us/mac

  • Problem with Stacked Columns in Business Graphics

    Hi,
    Has anyone used the stacked columns chart type in business graphics?  Am facing a problem with this.
    I am using the SimpleGraphics example demo with 2 dataseries, the values ranging from 0-10.  It works fine if the chart type is Columns (this is default).  When I change the chart type to stacked_columns, the graph goes for a toss.  The y-axis range automatically changes to 0-1 (values as 0, 0.2, 0.4 ... 1.0) and it does not display stacked columns as expected.
    Is there any specific property(s) that need to be set for this chart type?
    Appreciate any quick response.
    cheers,
    Vittal

    Hi friend,
    See the link below it is having the solution of hiding the columns in smart forms
    Hide table columns in smart form?
    Create a table to display your values with 12 col and hide the columns based on the idea provided in the link above.
    I think this will solve your issue if you still have queries please revert back to me i will help you.
    Thanks,
    Sri Hari

  • Problem with PIVOT statement and ORA-56901

    Hi,
    I am having a problem with PIVOT in Oracle.
    I have a view in an oracle 11g database
    that returns me data in the format:- (... indicates left out text)
    DefinitionID ... AttributeValue FieldID
    ============ ============== =======
    ... 3000 X30a9...
    ... JohnN X4674...
    I am then trying to use a PIVOT statement to hopefully give me data
    in the format
    COLUMN1 COLUMN2
    ======= =======
    JohnN 3000
    The PIVOT statement I am trying is
    SELECT X4674... AS Column1,
    X30A9... AS COLUMN2
    FROM (SELECT instanceid, definitionid, attributevalue, FIELDID
    FROM PI_ENTITY_INSTANCE_VIEW) up PIVOT (MAX(ATTRIBUTEVALUE)
    FOR FIELDID IN (X4674...,X30A9... ) )
    where definitionid = hextoraw('7353C67A56C74B5A8234CD16064399E8')
    I have used a very similar VIEW and PIVOT statement for sql server
    (with necessary changes for Oracle applied) and the
    data returns in SQL Server as expected.
    Unfortunately I am getting the Oracle error
    ORA-56901: non-constant expression is not allowed for pivot|unpivot values
    Is there anyway to get a PIVOT working on Oracle where I use the
    fieldid's like I do above or is there some other way to supply the vales to the
    IN clause to overcome this error?
    Thank you for any help you can provide
    John Nugent

    Hi, John,
    Welcome to the forum!
    X4674, X30A9 and os on are the literal values that you're looking for, right?
    In Oracle, string literals need to be enclosed in single-quotes, like this:
    FOR FIELDID IN ('X4674', 'X30A9') You might find it more convenient to assign column aliases in the PIVOT clause, like this:
    PIVOT   (     MAX (attributevalue)
         FOR     fieldid       IN ( 'X4674'     AS column1
                        , 'X30A9'     AS column2
         ) Remember that anything inside quotes is case-sensitive, so 'X30A9' is not equal to 'X30a9'. Use UPPER (or LOWER) to do case-insensitive string comparisons.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    If you can use commonly available tables (such as those in the scott or hr schemas) to show your problem, then you don't have to post any sample data; just the results and explanation.
    Always say which version of Oracle you're using. You did say you were using Oracle 11g, but there's no 11f or 11h, and sometimes the difference between, say 11.1 and 11.2 can be significant. Why not say exactly what you're using, e.g. 11.1.0.7.0?
    You'll get better answers faster if you always supply this information whenever you post a question.
    Edited by: Frank Kulash on Sep 22, 2011 2:09 PM
    Added allliterative alias alternative
    Edited by: Frank Kulash on Sep 22, 2011 4:04 PM

  • Emergency: problem with update statement!

    hello guys, i have a very serious problem with an update statement in pl/sql.
    i had an application written in sybase, where i had the following update statement:
    update mis_dik_adeia
    set trexon_etos_days = days_per_year
    from mis_dik_adeia, mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    and mis_dik_adeia.adeia_id between :aapo and :aews
    and mis_dik_adeia.employee_id = :erg
    and mis_dik_adeia.etos = :etos
    and mis_plafon_adeivn.years_yphr = ( select max( a.years_yphr ) from mis_plafon_adeivn a where a.adeia_id = mis_plafon_adeivn.adeia_id and a.years_yphr <= :eth ) using sqlca;
    This is working properly in sybase. When i copied this code in pl/sql it displayed me error and it's impossible to work. Then i thought to make a nested select statement like this:
    update mis_dik_adeia
    set trexon_etos_days = (select days_per_year
    from mis_dik_adeia, mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    and mis_dik_adeia.adeia_id between aapo and aews
    and mis_dik_adeia.employee_id = erg
    and mis_dik_adeia.etos = etos1
    and mis_plafon_adeivn.years_yphr = (
    select max( a.years_yphr )
    from mis_plafon_adeivn a
    where a.adeia_id = mis_plafon_adeivn.adeia_id
    and a.years_yphr <= eth )
    but as you can understand, it is working, but it doesn't produce the same results as the update statement in Sybase!
    It is very important for me to solve this problem , which is a very big trouble for me for a long time.
    Please if anyone can help me i would appreciate it a lot!
    Regards ,
    Bill...

    Bill,
    folowing the logic of your original query by Sybase
    (it's embedded SQL in Power Builder, isn't it ?):
    update mis_dik_adeia
    set trexon_etos_days = (select days_per_year
    from mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    and mis_plafon_adeivn.years_yphr = (
    select max( a.years_yphr )
    from mis_plafon_adeivn a
    where a.adeia_id = mis_plafon_adeivn.adeia_id
    and a.years_yphr <= eth )
    where
    mis_dik_adeia.adeia_id between aapo and aews
    and mis_dik_adeia.employee_id = erg
    and mis_dik_adeia.etos = etos1
    and
    exists (select 1
    from mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    and mis_plafon_adeivn.years_yphr = (
    select max( a.years_yphr )
    from mis_plafon_adeivn a
    where a.adeia_id = mis_plafon_adeivn.adeia_id
    and a.years_yphr <= eth )
    In 9i you can also try the following:
    megre into mis_dik_adeia
    using (
    select
    days_per_year,
    mis_dik_adeia.rowid rid
    from mis_dik_adeia, mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    mis_dik_adeia.adeia_id between aapo and aews
    and mis_dik_adeia.employee_id = erg
    and mis_dik_adeia.etos = etos1
    and mis_plafon_adeivn.years_yphr =
    (select max( a.years_yphr )
    from mis_plafon_adeivn a
    where a.adeia_id = mis_plafon_adeivn.adeia_id
    and a.years_yphr <= eth)
    ) src
    on (mis_dik_adeia.rowid = src.rid)
    when matched then
    update set mis_dik_adeia.trexon_etos_days = src.days_per_year
    when not matched then
    insert (mis_dik_adeia.adeia_id) values(0);
    In 10G it can be easily:
    megre into mis_dik_adeia
    using (
    select
    days_per_year,
    mis_dik_adeia.rowid rid
    from mis_dik_adeia, mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    mis_dik_adeia.adeia_id between aapo and aews
    and mis_dik_adeia.employee_id = erg
    and mis_dik_adeia.etos = etos1
    and mis_plafon_adeivn.years_yphr =
    (select max( a.years_yphr )
    from mis_plafon_adeivn a
    where a.adeia_id = mis_plafon_adeivn.adeia_id
    and a.years_yphr <= eth)
    ) src
    on (mis_dik_adeia.rowid = src.rid)
    when matched then
    update set mis_dik_adeia.trexon_etos_days = src.days_per_year;
    I have to notice I didn't check it carefully, so I can miss...
    Rgds.
    Corrected a mistake in the table name
    Message was edited by:
    dnikiforov

Maybe you are looking for

  • Error when running SWN_SELSEN as background job.

    Hello Gurus, I am facing a typical problem these days. The background job for program SWN_SELSEN is scheduled in every 5 mins. It has started to fail intermittently with the error message 'An instance of the report SWN_SELSEN is still active'. But th

  • Passing variables from TestStand

    I appologise for another probably stupid question: I would like to use a variable / parametre (which ever you choose to call it) within my method. It appears that all of the templates are configured for outputs only. eg:- public void DummyFunctionNam

  • Recommendations for a Docking station for Classic?

    I'm looking for recommendations: I have a Ipod classic and would like to connect it to my Onkyo home stereo receiver; I basically want to replace my old 200 disc CD changer Note: The docking station must also charge the ipod. Any assistance will be g

  • Compatability with Kaspersky PURE

    I recently installed Kaspersky PURE and have issues with web sites fully loading or working correctly on Mozilla. Things work fine on Internet Explorer, but not Firefox, which is what I prefer. Please help...thank you.

  • Can i transport the repair Request?

    hi, We have a data osurce enhance with Two fields and is tranported to Production. Now again we enhanced the same data source for the Third Field and wriitemn code for tit in Cmod. When enhanceing , it is asking  a request  and we have given it . Now