Get settlement data for an order - Recursive

Hi Experts,
I have a peculiar requirement. For an internal order, determine its FERC indicator.
If the FERC Indicator for the internal object is 0000, then read the settlement rules
of the object for the period(s) being processed and re-perform the logic for the FERC
Indicator not equal to 0000 for each object in the settlement rule.
If the FERC Indicator is 0000 again, keep drilling down through the settlement rules until
an object is obtained where the FERC Indicator is not 0000 or the settlement object is a cost center.
For the above requirement i need to get order data from AUFK first,
and check the FERC indicator. If it is 0000 i need to get settlement rule data
from COBRB table,in these settlement rule data i will get some more orders. Again i need to
hit AUFK. This is like recursive action and may hamper the performance .How can i do
this without writing a SELECT query in a loop and hitting the same tables several times. 
Thanks,
Bhanu.
Edited by: bhanu23 on Nov 26, 2010 1:37 PM

Did you find the solution?

Similar Messages

  • Unable to get tha data for Residual Order Plan query-0PS_C04_Q0008

    Hi Xperts,
    i have activated  standard query-0PS_C04_Q0008.
    But when i am executing the query i am unable to get the data for "Residual order plan" in the report output..
    As i  checked the transformation and the queries for this, every thing seems ok.
    Could please suggest me the best way to check further or How can i get the data for this field?
    Regards,
    SAP

    Check whether you have data for "Residual order plan" in 0PS_C04.

  • BAPI commit without using Wait? need to get the data for created order

    I am using BAPI to create or change sales order and by using 'BAPI_TRANSACTION_COMMIT' updating the database.
    Immediately after that there is some requirement to fetch VBAP with the created order number, but there is no data found.
    If i use call function 'BAPI_TRANSACTION_COMMIT'
                 exporting
                   wait          =  'X'.
    then i am able to fetch data from VBAP, but its impacting the performance. Is there any alternative way to get data without fetching or without using wait.
    Can i use ABAP memory or SAP memory to get the details?
    Please help...........

    Hi Tapas379,
    Yes technically you can:
    set data before commit
    DATA memory_id(20) TYPE c.
      CONCATENATE 'VBAP_01_' sy-uname INTO memory_id.
      DELETE FROM DATABASE indx(as) ID memory_id.
      EXPORT vbap_tab = vbap_tab "<-input
        TO DATABASE indx(as)
        CLIENT sy-mandt
        ID memory_id.
    Get data from anywhere after setting it.
      data memory_id(20) type c.
      concatenate 'VBAP_01_' sy-uname into memory_id.
      import vbap_tab = vbap_tab " ->output
        from database indx(as)
        client sy-mandt
        id memory_id.
      delete from database indx(as) id memory_id.
    Thanks,
    Duy

  • How to get the pricing hierarchy based on the delivery date for sales order

    Hi,
    How to get the pricing hierarchy based on the delivery date for sales order other than system date.
    My requirement is to get the Pricing hierarchy based on the delivery date other than system date.
    Waiting for kind response.
    Best Regards,
    BDP

    HI Sai,
    please refer teh document already how to write FM based extration on generic extractors.
    and here  the logic to find the latest records values:-
    -> get the data in an internal table
    ->Sort the internal table data based from date descending
    -> Using READ statement , we can read the first record of the table which is nothign but your latest record.
    Regards.
    Sakthi

  • How to get change date in Production Order ?

    Dear Friends,
    I want to know it, how to get change date in Production Order "Administration-TAB".
    F1-Help, It is displayed with "Change date for Order Master". and Structure table "CAUFVD".
    But, CAUFVD is not Transp. Table.
    Which table should I read ?
    Thanks in advance
    Yamazaki-H

    Dear Friend
    Thank you for an answer.
    It was settled.
    Best regards.

  • How to Get Missing Dates for Each Support Ticket In My Query?

    Hello -
    I'm really baffled as to how to get missing dates for each support ticket in my query.  I did a search for this and found several CTE's however they only provide ways to find missing dates in a date table rather than missing dates for another column
    in a table.  Let me explain a bit further here -
    I have a query which has a list of support tickets for the month of January.  Each support ticket is supposed to be updated daily by a support rep, however that isn't happening so the business wants to know for each ticket which dates have NOT been
    updated.  So, for example, I might have support ticket 44BS which was updated on 2014-01-01, 2014-01-05, 2014-01-07.  Each time the ticket is updated a new row is inserted into the table.  I need a query which will return the missing dates per
    each support ticket.
    I should also add that I DO NOT have any sort of admin nor write permissions to the database...none at all.  My team has tried and they won't give 'em.   So proposing a function or storable solution will not work.  I'm stuck with doing everything
    in a query.
    I'll try and provide some sample data as an example -
    CREATE TABLE #Tickets
    TicketNo VARCHAR(4)
    ,DateUpdated DATE
    INSERT INTO #Tickets VALUES ('44BS', '2014-01-01')
    INSERT INTO #Tickets VALUES ('44BS', '2014-01-05')
    INSERT INTO #Tickets VALUES ('44BS', '2014-01-07')
    INSERT INTO #Tickets VALUES ('32VT', '2014-01-03')
    INSERT INTO #Tickets VALUES ('32VT', '2014-01-09')
    INSERT INTO #Tickets VALUES ('32VT', '2014-01-11')
    So for ticket 44BS, I need to return the missing dates between January 1st and January 5th, again between January 5th and January 7th.  A set-based solution would be best.
    I'm sure this is easier than i'm making it.  However, after playing around for a couple of hours my head hurts and I need sleep.  If anyone can help, you'd be a job-saver :)
    Thanks!!

    CREATE TABLE #Tickets (
    TicketNo VARCHAR(4)
    ,DateUpdated DATETIME
    GO
    INSERT INTO #Tickets
    VALUES (
    '44BS'
    ,'2014-01-01'
    INSERT INTO #Tickets
    VALUES (
    '44BS'
    ,'2014-01-05'
    INSERT INTO #Tickets
    VALUES (
    '44BS'
    ,'2014-01-07'
    INSERT INTO #Tickets
    VALUES (
    '32VT'
    ,'2014-01-03'
    INSERT INTO #Tickets
    VALUES (
    '32VT'
    ,'2014-01-09'
    INSERT INTO #Tickets
    VALUES (
    '32VT'
    ,'2014-01-11'
    GO
    GO
    SELECT *
    FROM #Tickets
    GO
    GO
    CREATE TABLE #tempDist (
    NRow INT
    ,TicketNo VARCHAR(4)
    ,MinDate DATETIME
    ,MaxDate DATETIME
    GO
    CREATE TABLE #tempUnUserdDate (
    TicketNo VARCHAR(4)
    ,MissDate DATETIME
    GO
    INSERT INTO #tempDist
    SELECT Row_Number() OVER (
    ORDER BY TicketNo
    ) AS NROw
    ,TicketNo
    ,Min(DateUpdated) AS MinDate
    ,MAx(DateUpdated) AS MaxDate
    FROM #Tickets
    GROUP BY TicketNo
    SELECT *
    FROM #tempDist
    GO
    -- Get the number of rows in the looping table
    DECLARE @RowCount INT
    SET @RowCount = (
    SELECT COUNT(TicketNo)
    FROM #tempDist
    -- Declare an iterator
    DECLARE @I INT
    -- Initialize the iterator
    SET @I = 1
    -- Loop through the rows of a table @myTable
    WHILE (@I <= @RowCount)
    BEGIN
    --  Declare variables to hold the data which we get after looping each record
    DECLARE @MyDate DATETIME
    DECLARE @TicketNo VARCHAR(50)
    ,@MinDate DATETIME
    ,@MaxDate DATETIME
    -- Get the data from table and set to variables
    SELECT @TicketNo = TicketNo
    ,@MinDate = MinDate
    ,@MaxDate = MaxDate
    FROM #tempDist
    WHERE NRow = @I
    SET @MyDate = @MinDate
    WHILE @MaxDate > @MyDate
    BEGIN
    IF NOT EXISTS (
    SELECT *
    FROM #Tickets
    WHERE TicketNo = @TicketNo
    AND DateUpdated = @MyDate
    BEGIN
    INSERT INTO #tempUnUserdDate
    VALUES (
    @TicketNo
    ,@MyDate
    END
    SET @MyDate = dateadd(d, 1, @MyDate)
    END
    SET @I = @I + 1
    END
    GO
    SELECT *
    FROM #tempUnUserdDate
    GO
    GO
    DROP TABLE #tickets
    GO
    DROP TABLE #tempDist
    GO
    DROP TABLE #tempUnUserdDate
    Thanks, 
    Shridhar J Joshi 
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Settlement Rule for Internal Order

    Hi All
    I have Maintained Settlement rule for Internal order as under
    CAT - FXA
    Settlement Receiver - Asset
    % - 100
    Settlement type - Full
    Now after settlement of above Order in KO88 . I want again use above internal order. Hence i have trying to put Settlement rule 50% for some anther asset but system gave me following error. Please guide on this issue.
    Total = 50.00%, ( Set.Type PER / Version / Actual settlement ), period 010/2011
    Message no. KD042
    Diagnosis
    You have entered distribution rules which settle 50.00% in total. This applies for settlement view ( Set.Type PER / Version / Actual settlement ) in period 010/2011.
    When checking the percentage total, the system found one of the following errors:
    The total percentage for the distribution rules is more than 100%
    The total percentage for the distribution rules is less than 100% and this is a rule for full settlement.
    The total percentage for the distribution rules is less than 100% and the 100% check is switched on in the settlement profile.

    Hi:
            Please refer to the contents of OSS Note 45612 - IM: pre-settlement does not work, or KD042... which states
    "Symptom
        1. If a preliminary settlement rule (for example, to cost center) is entered for individual items of capital investment measures with line item management, this rule is not considered during periodic settlement. There is no settlement to cost centers.
        2. If you enter a final settlement rule for individual line items of investment measures with line item management for a partial capitalization (that is, the percentage rate is less than 100%), then you receive the unjustified error message KD042 "Total percent = xx%".
    Additional key words
    KOB5, CJ70, CJ88, CJ8G, KO88, KO8G, preliminary settlement, partial settlement, partial capitalization
    Cause and prerequisites
        1. You did not enter the settlement type ACT in the preliminary settlement rule.
        You can check this in the Line Item Apportionment transaction by choosing the menu option "Goto" -> "Overview dist. rules" to display the distribution rule groups entered so far.
        The system displays rules which have no entry in the "SetTyp" field (settlement type, field name PERBZ).
        2. The check of the percentages is incorrect.
    Solution
        1. Install the following correction. Afterwards reverse the incorrect settlement, re-enter the preliminary settlement rule and settle again.
        2. Install the following correction. Afterwards, you can maintain the settlement rule for the partial settlement.
        Note: If you want to use a default settlement rule (maintaining the settlement rule from the master data maintenance transaction), then you are required to distribute the line items at 100%. In order to carry out a partial capitalization (settlement of less than 100%), you have to use menu path "Actual postings -> Period-end closing -> Settlement -> Line item "
    Regards

  • Error-M2O-Settlement rule for assembly order for item...could not be genera

    Hi,
    When I am creating Sales Order (VA01) for M2O, I am able to do the costing and copy the EK02 condition type. I have verified the the incompletion log, it indicates that document is complete.
    But while saving the sales order, the below error message is displaed:
    Settlement rule for assembly order for item 000010 could not be generated. Should the order still be saved?
                    Yes/No
    1. If No is choosen the following error message is displayed
           Error when processing Production order
          Error when processing Production order
          Message no. V1380
          Diagnosis
            A technical error has occurred. On calling up the assembly interface, exception 5 was triggered. The exceptions have the  following meanings:
    1 = External block,  2 = General error,  3 = Insufficient data for the interface,  4 = Order was not found, 5 = Update has been rejected, 6 = Final document number for Production order is not issued.  Procedure: Inform your system administrator.
    2. If Yes is choosen, it is creating Production Order without settlement rule. Able to perform GI & Gr. If I try to enter settelement rule (Settlement receiver SDI - Sales document item) in production order (CO02), the belwo error message is displayed
    "Distribution rule for Sales document item can only be created automatically Message no. KD063"
    We are using the requierement class with below details:
    Reqmts class: ZSO- for M2O
    AAC = E, Valuation = A, Settlement profile =SD1, RAKey = 000004, Assembly type = 3.
    Settlement profile contain:
    Allocation structure, PA structure, Default object type = SDI. Valid receivers: Optional -Sales Order / Prof. seg.
    If I make the Valuation field as blank in Reqmts class, there is no error while creating Sales order. And also Settelemnt rule with sales document item as receiver is successfully creating for the production order. Since the Valuation is blank in requirement class, it is Non valuated Sales order stock. All GIs & GR are non valuated
    The business requirement is it should be valuated sales order stock and the production varinaces has to be settled to Sales order. Then Sales order has to be settled to COPA.
    Need your valuable inputs to meet this requirement.
    Let me know if you need any further details.
    Thanks in advance.
    Regards,
    ADI

    Dear SAP PP Consultant ,
    What is the strategy group you are maintained in the material master ?

  • How to see archive data for Sales order

    Hi all,
            I am working on PS , network is created with sales order 10911. the components are added while sales order created, but after that someone deletes the sales order, because now it is showing oder does not found, where i get the entreis for sales order.
    Regards,
    Khushi.

    Hi Khushi,
    To see the archived data for sales order , go to transaction code SARA.
    Choose object name as SD_VBAK.Click READ.
    It will show a screen giving a name of program and option to execute in background or foreground.
    It will help you to get information about archived sales order data.
    Hope it helps you.
    Thanks,
    Sarita singh Rathour
    Edited by: Sarita Rathour on Aug 28, 2009 7:46 AM

  • I have just reinstalled Adobe Acrobat X1 and I can't save any PDF's that are emailed to me. I just get "This document could not be saves. There is a problem reading this document (21)" and then when I click OK i get "insufficient data for image"  Help!

    I have just reinstalled Adobe Acrobat X1 and I can't save any PDF's that are emailed to me. I just get "This document could not be saves. There is a problem reading this document (21)" and then when I click OK i get "insufficient data for image"  Help!

    More information about this issue can be found here:
    https://forums.adobe.com/thread/1672655
    A "quick" fix that worked for me was to uninstall Adobe... then download the base install for Adobe Reader 11.0.
    Then download each of the individual updates and run them sequentially. 
    I've installed back up to the last security update which is version 08 and have been able to do normal Save As operations.
    You will have to disable automatic updates in order to stay at version 08 until Adobe resolves this issue in a later release.
    http://www.adobe.com/support/downloads/product.jsp?product=10&platform=Windows
    Adobe Reader 11.0 - Multilingual (MUI) installer    AdbeRdr11000_mui_Std
    Adobe Reader 11.0.01 update - Multilingual (MUI) installer    AdbeRdrUpd11001_MUI.msp
    Adobe Reader 11.0.02 update - All languages    AdbeRdrSecUpd11002.msp
    Adobe Reader 11.0.03 update - Multilingual (MUI) installer    AdbeRdrUpd11003_MUI.msp
    Adobe Reader 11.0.04 update - Multilingual (MUI) installer    AdbeRdrUpd11004_MUI.msp
    Adobe Reader 11.0.05 security update - All languages    AdbeRdrSecUpd11005.msp
    Adobe Reader 11.0.06 update - Multilingual (MUI) installer    AdbeRdrUpd11006_MUI.msp
    Adobe Reader 11.0.07 update - Multilingual (MUI) installer    AdbeRdrUpd11007_MUI.msp
    Adobe Reader 11.0.08 security update - All languages    AdbeRdrSecUpd11008.msp

  • Is there a way to get historical data for an AP that is no longer online via Prime?

    I am running a wireless network with about 130 AP's connected to a 8510 controller and using Prime for management.  I am trying to get AP utilization for an AP that is no longer connected and when I try to run the report Prime reports that it cannot pull the report because the AP is offline.
    Is there some way to get historical data for this AP?  Does Prime store this type of data?
    Seth

    I believe that all devices need to be up in order to pull any information current or historically.  If the AP is down, I don't think that a report in Prime will show info for that given device even if you set the date/time to when it was up. Never really looked into that as I've never tried to look at info if the access point was down. If you run a report on channel changes, does the AP show up?
    -Scott

  • Data for production order

    hi all,
    We want to get the classification(configuration)  data from the production order.
    We are presently using VC_I_GET_CONFIGURATION and passing the instance as CUOBJ from AFPO. But the data we get is from the sales order.
    Require help as to waht instance to pass to get the data from Prod Order and not from sales order.
    any pointers???

    I make a sales order first -
    XYZ
    Then i make a prod order with reference to sales order -
    ABC
    The CUOBJ -
    LMN is same for both the orders in AFPO and VBAP
    I go to VC_I_GET_CONFIGURATION and pass LMN and I get the charac values.
    Now i change the sales order. I get a information message that a prod order is already available, but the system allows me to change the configuartion values
    Now, the config values are different in sales order and prod order
    I want the details from the prod order, but since the CUOBJ is same- when i run the FM, i get the changed values from the sales order
    I need the previous unchanged data from the prod order and not from the sales order

  • How will get stoppage hours for PM02 orders

    Hello Guru,
    I want to find out stoppage hours for PM02 orders according to PM Act Type (eg. PM, predictive maint., TPM, etc). Background is that, our PM02 process schedules maint order as per maint plan & it wont triggers Notification in background so users are unable to enter work details ie. work start date/time & End date/time.
    In this situation, how will get stoppage hours for PM02 orders?
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    Regards,
    Amol
    Edited by: Rob Burbank on Jan 17, 2011 4:25 PM

    Hi PMAmol,
    As Babu suggest,  You can use Act Start and Act End date and time  from Order Header for your requirement , Now how to use those ?
    Once you do Order Confirmation via IW41 , for first operation mention date and time in  Work Starts on date and time when you start your work,
    Then this date and time will reflect in Act Start in Order Header, after that when you finish your work , then in IW41 along with final Confirmtn tick mention the date and time in Work Start on and Ends on field , when CNF status set on order you can check in order header , this date and time will reflect in Actual End date and time.
    For report you can use Iw39.
    Riyaj

  • How to get the date for the first monday of each month

    Dear Members,
    How to get the date for the first monday of each month.
    I have written the following code
    SELECT decode (to_char(trunc(sysdate+30 ,'MM'),'DAY'),'MONDAY ',trunc(sysdate+30 ,'MM'),NEXT_DAY(trunc(sysdate+30 ,'MM'), 'MON')) FROM DUAL
    But it look bith complex.
    Abhishek
    Edited by: 9999999 on Mar 8, 2013 4:30 AM

    Use IW format - it will make solution NLS independent. And all you need is truncate 7<sup>th</sup> day of each month using IW:
    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    CURRENT_D FIRST_MON
    08-MAR-13 04-MAR-13
    SQL> Below is list of first monday of the month for this year:
    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    FIRST_OF_ FIRST_MON
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    FIRST_OF_ FIRST_MON
    01-DEC-13 02-DEC-13
    12 rows selected.
    SQL> SY.

  • Upload the data for sales order using BAPI

    hi experts,
    how to upload the data for sales order using BAPI.
    what is the FM?
    it would be much helpful if i have the sample code as i am very new to BAPI.
    thanks and Regards
    Shyam

    Hi  Shyam
    Its very useful for u
    BAPISDORDER_GETDETAILEDLIST
    BAPI_ACC_SALES_ORDER_CHECK
    BAPI_ACC_SALES_ORDER_POST
    BAPI_ACC_SALES_QUOTA_CHECK
    BAPI_ACC_SALES_QUOTA_POST
    Reward all the helpful answers..
    With Regards
    Navin Khedikar

Maybe you are looking for