Dynamic lead columns based on chars with compounding

Hi folk,
I have char 0WORKCENTER. This char has componding with 0PLANT. Can I build dynamic lead columns based on 0WORKCENTER in the planning format?

Hi Dmitry,
it should work as long as 0plant is restricted to a single value (in level or header).
Regards,
Marc
SAP NetWeaver RIG

Similar Messages

  • Dynamic Lead column repeats the same value

    Hi, I have a dynamic lead column with reporting groups attached to them. Also, I have date column in the data column which is also dynamic. In the layout the reporting group field shows only the first entry in the variable and repeats itself. When I enter the data and save it, data is saved in the right reporting groups...If I replace day with week(and no further changes in the layout) reporting groups show up...is it something to do with date field?
    Reporting Group       01/01/2008      01/02/2008  01/03/2008
    1                               $100                $ 120          $ 150
    1                               $110                $ 130          $ 160
    In the database it shows the second line reporting group as 2(which I want) but in the layout it shows up as 1.
    How can I make it show the correct value. Thanks,
    Bulusu

    Hi,
    When any of the dynamic lead columns or data columns you select them as dynamic, automatically the Infoobject is filled by the system and it would be greyed out. Copy the same infoobject like 0FISCPER, 0FISCYEAR and paste in the Description of the layout (for that dynamic column). Then it will pick up on its own.
    Otherwise if you put your own description like date, month and year etc. for all the columns or rows, as the case may be, it will give similar description.
    Regards,
    Ravi

  • Dynamic Lead Columns

    We have a requirement where users need to enter 3 Key figure values for 3 periods against 0MATERIAL.  The layout should show as follows:
    MaterailKeyFigureMonth1Month2Month3
    SKU1----KF125--20----20
    SKU1----KF25 USD-5 USD---6 USD
    SKU1----KF32---2-----2
    SKU2----KF150--15----5
    Planning level contains, 0MATERIAL, 0FISCPER3 and the three Key figures.  In the manual planning layout, I have selected "Key Figures in Lead Column" with 0MATERIAL in the lead column and 0FISCPER3 in the data column.  In the additional settings, I have chosen "From Transaction Data" and "Lead Columns Dynamic for" 0MATERIAL - Text Replacement "Key".  In the next step, I have entered the three key figures and checked the "Dynamic" checkbox.  In the data columns I have selected the required 0FISCPER3.  Executing this layout is resulting in a dump with the "MESSAGE_TYPE_X" C "SAPLUPP_PLAN" or "LUPP_PLANU05" "UPP_PLAN_COMPLETE_LAYOUT" and "layout_Corrupt".  What am I doing wrong here?
    I need the layout to show as represented above.  How do I achieve the desired result?  I will assign points for the helpful posts.

    Partially resolved.  It looks like I need to restrict 0MATERIAL in the planning level if I use "Dynamic" option!!  I have used the ROOT node of the hierarchy on 0MATERIAL in the planning level and I am able to open the template.  BUT THE MAIN PROBLEM IS STILL UNRESOLVED.  I want the layout to show
    HeadingMonth1Month2--Month3
    SKU1KF125--20----20
    SKU1KF25 USD-5 USD---6 USD
    SKU1KF32---2-----2
    SKU2KF150--15----5
    SKU2KF21 USD-3 USD---2 USD
    But it show up as follows:
    HeadingMonth1Month2--Month3
    SKU1KF125--20----20
    SKU2KF150--15----5
    SKU1KF25 USD-5 USD---6 USD
    SKU2KF21 USD-3 USD---2 USD
    I need to have the rows ordered by SKU and not by Key figures.  Hope my explanation is clear.  I will assign points to the helpful posts.
    PS - I can move Months into "Lead Columns" and "Key Figures" into Data Columns so that the Key Figures are there all by themselves, but that is not an option either.

  • Dynamic  Lead Columns / Data Columns

    Hi
    I want to use dyanmic data columns restricted by a characteristic relationship of another variable.
    When I use the characteristic as a lead column, it works perfect, I only see the rows for valid lines.
    When I use the characteristic as a data column, I see all possible characteristic values of that characteristics. The ones that are not valid are not ready for input, the ones that are valid are ready for input.
    I would like to use dynamic data columns but only display the columns with a valid characteristic relationships (just the way it works when I put the characteristic in the lead column)
    Should that work?
    Thanks

    Enable Zero-Suppression on your column structure. Then in your Query properties, enable zero-suppresion for columns. That way only characteristic values with data will be shown and not all possible characteristic values present in the master data tables. I should note that there should be some data in the fact table which links the keyfigure to the characteristic value, otherwise it will be suppressed.

  • BUG: Dynamic report column headings not working with some templates

    Using Apex 2.0, we are trying to create a vertical report with dynamic labels like &P26_REF_RECEIVED_DATE_L. based on items populated by PL/SQL.
    This seems to work fine for some templates but not for others. With a horizontal report template we get output like:
    <th class="t4ReportHeader" id="REF_RECEIVED_DATE">Received</th>
    <td  headers="Received" class="t4data">29-MAR-2007</td>But with the vertical template we get:
    <th>&P26_REF_RECEIVED_DATE_L.</th><td>29-MAR-2007</td>Also, if we use "default: vertical report, look 1" we see "&P26_REF_RECEIVED_DATE_L." in the output, but with "default: vertical report, look 2" we see "Received".
    Message was edited by:
    Tony Andrews

    have you checked that your report template has a
    valid value for the "Column Heading Template"
    property?This template has nothing in the "Column Heading Template" because it is designed to show the data in this form:
    Heading1 - Value1
    Heading2 - Value2
    Heading3 - Value3
    Hence both the heading and the data appear in the "Column Template 1" property as follows:
    <tr><th class="t3header">#COLUMN_HEADER#</th><td class="t3data">#COLUMN_VALUE#</td></tr>
    Maybe it is an Apex limitation that the #COLUMN_HEADER# value can't be accessed from this subtemplate? Yet somehow it works with "default: vertical report, look 2" (which I realise isn't a template as such).

  • How can i dynamically select columns based on the input parameter?

    I have an input parameter which takes single numeric value.
    Based on this value i have to dynamically select table-columns .
    For eg: if i have following fields in my table :
    SEM_1
    SEM_2
    SEM_3 and SEM_4.
    And if i give numeric input as 2 , then i have to select "SEM_2" column only.
    if the input is 3 then i have to select "SEM_3" only and leave the rest of the columns.
    how do i achieve this dynamic feature in the "Select .....  From...... table...." statement in the ABAP??

    Hi,
    you should try something like this.
    TYPES: cond(72) TYPE c.
    data: condtab TYPE TABLE OF cond,
             condw type cond.
    data: lv_field(30) type c value 'SEM_'.
    write p_num to lv_field+4(1).
    condw = lv_field.
    append condw to condtab.
    SELECT (CONDTAB) FROM table INTO.....
    Kostas
    Message was edited by:
            Kostas Tsioubris

  • Dynamic Link Column Based on Value

    I'm using Apex version 4.1.
    This is driving me nuts, I can't get it to work. I'm trying to create a dynamic link on a column (in a SQL report) based on the value. Here's my query:
    SELECT STRUCTURE_ENTITY_ID AS "Market ID",
    Structure_entity as "Market Name",
    CASE WHEN NVL2((select 'A' from PC_PAYROLL_DISTRIBUTION PD
    WHERE PROCESSING_YEAR = SUBSTR('2011-08',1,4)
    AND PROCESSING_MONTH = TO_NUMBER(SUBSTR('2011-08',6,2))
    AND PD.OPS_MARKET = SE.STRUCTURE_ENTITY_ID
    AND ROWNUM = 1),'Ready','Not Ready') = 'Ready' THEN '' ||'' ELSE 'Not Ready' END AS Status
    FROM STRUCTURE_ENTITY SE
    So when the value in that CASE statement equals 'Ready' then I need it to show the word Ready (in the Status column) as a hyperlink, otherwise it needs to show 'Not Ready' in normal text that's not clickable.
    The URL string I have in there DOES pick up the correct values for my parameters, but it stilll appears in the report as the whole string, and it's not clickable. Any help would be greatly appreciated!
    Thanks,
    Greg

    I see an a instead of <a and no </a> in this code.
    Oh, I guess your {a is <a ... B-)  Still no end tag, though.
    Edited by: InoL on Oct 7, 2011 2:27 PM                                                                                                                                                                                                                                                                                                                       

  • Reading dynamic table column based on user selection

    Hi there,
    I am having a problem of reading and manipulating the data stored in a standard SAP table. The following example simulates the table and what i am trying to do:
    Table: Storing sales data for sales person
    SALES_PERSON    REGION   YEAR   MTH_S1  MTH_S2  MTH_S3 MTH_S4...
    Richard  S               NORTH    2007     100          200         300        400
    John K                    SOUTH    2007      50           100         100        20
    Brad P                    NORTH    2007     300          100         100        50
    User have have the following selection option:
    1. Month.
    The program will calculate the sales based on the individual month selected
    Example, if user select Month = 3, then program take only MTH_S3 column value
    So total sales = 300100100=500
    2. Month range
    The program will calculate the sales based on the month range selected
    Example, if user select Month 2 to 4, then program take MTH 2 to MTH_S4 columns value
    So total sales = 400 (for MTH_S2) + 500 (for MTH_S3) + 470 (for MTH_S4) = 1370
    How should i write the logic or code for this requirement?
    Hope someone can help.
    Thanks,
    Pang HK

    Try something like this
    TABLES:
    t247.
    SELECT-OPTIONS:
      s_month FOR t247-mnr NO-EXTENSION.
    DATA:
      BEGIN OF fs_data,
        person(30),
        area(10),
        year(4),
        mon1 TYPE kbetr,
        mon2 TYPE kbetr,
        mon3 TYPE kbetr,
        mon4 TYPE kbetr,
        mon5 TYPE kbetr,
      END OF fs_data,
      t_data LIKE STANDARD TABLE OF fs_data,
      w_no_months TYPE i,
      w_kbetr TYPE kbetr,
      w_total TYPE kbetr.
      LOOP AT t_data INTO fs_data.
        CLEAR w_kbetr.
        DO 5 TIMES VARYING w_kbetr FROM fs_data-mon1
                                                          NEXT fs_data-mon2.
        IF sy-index IN s_month.
          w_total = w_total + w_kbetr.
        ENDIF.
        ENDDO.
      ENDLOOP.
    change the value 5, according to the no.of months in ur internal table

  • Dynamic datagrid column based on rowIndex

    I am passing objects into a datagrid that have a rank variable.  Before I place the objects into the datagrid, I sort upon rank so the objects will show in the datagrid sequentially.
    What I am wanting to do is be able to drag-and-drop the rows, and I want the rank variable to change depending on which row the object is in.
    I thought I had this feature working by setting rank to the dataProvider index when a row is dropped. This does work intially, but gets messed up when a user decides to sort any row in the grid.
    Does anyone have any suggestions on how I can get this to work?

    I think you can use a labelFunction that considers listData.rowIndex and
    owner.verticalScrollPosition.

  • Lead Columns in Report Painter

    Hi All
    Is it possible to have two lead columns in a report?  My requirement is that i want to prepare a profit and loss account by using report painter. It should look like
    Expense           Amount           Revenue          Amount
    Exp G/L A/c       XXX             Sale G/L A/c      XXX          (For Example)
    Now i want to define Expense column as lead column and revenue column as a lead column
    Kindly help me with issue
    Regards
    Invin

    Hi Abhijit
    Kindly elaborate it I am new to report painter i would like to tell you again what is my specific design requirement
    LEAD Column                Column 1                              LEAD Column                    Column 2
    Expense                      Amount                                     Revenue                      Amount
    (These four will be my columns under this following will be )
    Salary Exp G/L       1000                                 Sale G/L A/c       2000 (For Example)
    (This salary will be my heading and i will be typing in words and under this i will be assigning my salary Gl A/c same will be the case with Sale)
    Now i want to define Expense column as lead column and revenue column as a lead column so that i can write Salary as heading and sales as heading just like traditional Profit and loss account what earlier we use to prepare by hand.
    Kindly elaborate it how to do it
    Regards
    Invin
    Edited by: sapcofi on Oct 6, 2009 1:37 PM

  • Exclude values of chars in lead columns

    Hi guys.
    I have a task - to exclude some values of characteristic (e.g. 0MATERIAL) from planning layout. I need to exclude them by some attribute of this char (e.g. material group).
    How can I do this?

    Create a variable on char 0Material and replace the values with exit.
    Use this variable in the plng level and in the lead column.
    Ravi Thothadri

  • IP: Dynamic Data and Lead Columns

    Hello,
    In IP, there is not such thing as "Dynamic Data and Lead Columns" which we have used successfully in BPS. We have quite normal case where accounts are on rows and columns are defined as follows:
    Column 1): KF Qty1, Period #, Year "Var Current year (single value)"
    Columns 2-n): KF Amt1, Period "Var periods current year (multiple values)", Year "Var Current year"
    Column n+1): Sum columns 2-n
    Number of periods in variable "Var periods current year" is not fixed and maintained by superuser, so number of columns is somewhere between 3 and 14 (at least one open period, maximum 12, plus the Qty1 and Sum columns).
    How would you fix this in IP?
    Thanks for answers!
    Aki

    Hello Aki,
    you could put the period into the columns as char.
    if you make a selection to value # and the variable you will se as many columns as periods are selected in the variable plus the one column for #.
    regards
    Cornelia

  • View with columns based on function - problem with query

    Hi,
    I'm using Oracle 9i;
    I've created a view which has columns based on a table columns (multiple columns from 1 table) and funtion (multiple columns based on 1 function).
    The function takes ID as the first argument and name of the column to determine which value to return as the second one.
    Here is a sample of such function (simplified):
    FUNCTION my_function
    (in_id IN NUMBER, in_col_name IN VARCHAR2)
    RETURN VARCHAR2
    IS
    c_name VARCHAR2(100);
    c_last_name VARCHAR2(100);
    BEGIN
    SELECT T.NAME, T.LAST_NAME
    INTO c_name, c_last_name
    FROM TABLE_1 T, TABLE_2 Z
    WHERE T.PK = Z.FK
    AND Z.ID = in_id;
    IF in_col_name = 'NAME' THEN
    RETURN c_name;
    ELSIF in_col_name = 'LAST_NAME' THEN
    RETURN c_last_name;
    END IF;
    END;
    For simplicty I've restricted the number of columns.
    CREATE OR REPLACE VIEW my_view
    (ID, NAME, LAST_NAME)
    AS
    SELECT
    T.ID ID
    ,CAST(my_function(T.ID,'NAME') AS VARCHAR2(100)) NAME
    ,CAST(my_function(T.ID,'LAST_NAME') AS VARCHAR2(100)) LAST_NAME
    FROM TABLE T;
    There is no problem with query:
    SELECT * FROM my_view;
    The problem arises when I query the view (regardles of '=' or 'LIKE'):
    SELECT * FROM my_view
    WHERE name LIKE '%some_part_of_name%'
    The query returns rows for same names, for same it doesn't. If I put '=' and the whole name the query returns nothing, but when I put 'LIKE' and the first letter it returns rows in some cases.
    I've tried to debug this situation and I've discovered that the function recives ID not in the proper order and not the same amount of times - in explicit:
    for each ID in (1, 2, 3, 4, 5, 6, ... , 100) the function should be called twice for each ID and in the same order, but it does not.
    I get 1, 1, 2, 3, 3, 6, 20, 20 and so on.
    Help needed.
    Greetings.

    The problem is more complicated than the solutions provided here.
    The reason why I'm using the function is this:
    the original view was constructed using multiple union all selects and the speed was terrible. I've created the index on the base table to obtain a proper sort. For retriving all records at once the view works perfectly, but if one wants to query by columns based on function the results are suprisng - sometimes there are, some times there are none, or if you serch with "like" and only a part of string there are results, but with "=" there are no results.
    Here are real DDLs:
    View:
    CREATE OR REPLACE VIEW V_DOK_ARCH
    (ID_ZDAR, TYP, STAN, DATE_CREATED, CREATED_BY,
    DATE_MODIFIED, MODIFIED_BY, SPRA_ID_SPRA, PODM_ID_PODM, PODM_UMOW_ID_UMOW,
    NR_WFS, WFS_NR_INTER, UWAGI_OPER, FUNDUSZ, NUMER,
    DATA_PODPISANIA, RODZAJ, TYP_PRZY, TYP_UBEZ, NAZWISKO,
    IMIE, IMIE_OJCA, NAZWA_FIRMY, NAZWA_FIRMY_SKR, DANE_KLIE)
    AS
    SELECT /*+ INDEX(Z ZDAR_DATE_CREATED_DESC_I) */
    Z.ID_ZDAR ID_ZDAR
    , Z.TYP TYP
    , Z.STAN STAN
    , Z.DATE_CREATED DATE_CREATED
    , Z.CREATED_BY CREATED_BY
    , Z.DATE_MODIFIED DATE_MODIFIED
    , Z.MODIFIED_BY MODIFIED_BY
    , Z.SPRA_ID_SPRA SPRA_ID_SPRA
    , Z.PODM_ID_PODM PODM_ID_PODM
    , Z.PODM_UMOW_ID_UMOW PODM_UMOW_ID_UMOW
    , Z.NR_WFS NR_WFS
    , Z.WFS_NR_INTER WFS_NR_INTER
    , Z.UWAGI_OPER UWAGI_OPER
    , Z.FUNDUSZ FUNDUSZ
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NUMER') AS VARCHAR2(30)) NUMER
    , F_Rej_Zdar_Date(Z.ID_ZDAR, 'DATA_PODPISANIA') DATA_PODPISANIA
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'RODZAJ') AS VARCHAR2(4)) RODZAJ
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'TYP_PRZY') AS VARCHAR2(4)) TYP_PRZY
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'TYP_UBEZ') AS VARCHAR2(3)) TYP_UBEZ
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWISKO') AS VARCHAR2(30)) NAZWISKO
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE') AS VARCHAR2(30)) IMIE
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE_OJCA') AS VARCHAR2(30)) IMIE_OJCA
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY') AS VARCHAR2(300)) NAZWA_FIRMY
    , CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY_SKR') AS VARCHAR2(100)) NAZWA_FIRMY_SKR
    , CAST(LTRIM(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWISKO')||' '||F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE')||' '||F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE_OJCA')||F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY')||DECODE(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY'),NULL,F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY_SKR'),NULL)) AS VARCHAR2(492)) DANE_KLIE
    FROM T_ZDARZENIA Z
    WHERE F_Rej_Zdar_Char(Z.ID_ZDAR, 'JEST') = 'T';
    and functions:
    CREATE OR REPLACE FUNCTION F_Rej_Zdar_Char
    (WE_ID_ZDAR IN NUMBER
    ,WE_KOLUMNA IN VARCHAR2
    RETURN VARCHAR2
    IS
    c_numer           T_PRZYSTAPIENIA.NUMER%TYPE;--VARCHAR2(30);
    c_rodzaj           T_KLIENCI.RODZAJ%TYPE;--VARCHAR2(1);
    c_typ_przy           T_PRZYSTAPIENIA.TYP_PRZY%TYPE;--VARCHAR2(1);
    c_typ_ubez           T_PRZYSTAPIENIA.TYP_UBEZ%TYPE;--VARCHAR2(3);
    c_nazwisko           T_KLIENCI.NAZWISKO%TYPE;--VARCHAR2(30);
    c_imie                T_KLIENCI.IMIE%TYPE;--VARCHAR2(30);
    c_imie_ojca      T_KLIENCI.IMIE_OJCA%TYPE;--VARCHAR2(30);
    c_nazwa_firmy      T_KLIENCI.NAZWA_FIRMY%TYPE;--VARCHAR2(300);
    c_nazwa_firmy_skr T_KLIENCI.NAZWA_FIRMY%TYPE;--VARCHAR2(100);
    c_jest                VARCHAR2(1) := 'T';
    c EXCEPTION;
    BEGIN
    --dbms_output.put_line('id zdar wykonania '||WE_ID_ZDAR);
    BEGIN
    SELECT p.NUMER, k.RODZAJ,p.TYP_PRZY,p.TYP_UBEZ,k.nazwisko, k.imie, k.imie_ojca, k.nazwa_firmy, k.nazwa_firmy_skr
    INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
    FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D1, T_PODMIOTY D2
    WHERE p.KLIE_ID_KLIE = k.ID_KLIE
    AND z.PODM_ID_PODM = D1.ID_PODM
    AND D1.KLIE_ID_KLIE = p.KLIE_ID_KLIE
    AND Z.PODM_UMOW_ID_UMOW = D2.ID_PODM
    AND D2.PRZY_ID_PRZY = P.ID_PRZY
    AND z.ID_ZDAR = WE_ID_ZDAR;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
         BEGIN
         SELECT p.NUMER, k.RODZAJ,p.TYP_PRZY,p.TYP_UBEZ,k.nazwisko, k.imie, k.imie_ojca, k.nazwa_firmy, k.nazwa_firmy_skr
         INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
         FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D
         WHERE z.PODM_UMOW_ID_UMOW IS NULL
         AND z.PODM_ID_PODM = D.ID_PODM
         AND D.KLIE_ID_KLIE = k.ID_KLIE
         AND p.KLIE_ID_KLIE = k.ID_KLIE
         AND z.ID_ZDAR = WE_ID_ZDAR;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
              BEGIN
              SELECT NULL NUMER, NULL RODZAJ,NULL TYP_PRZY,NULL TYP_UBEZ, I.nazwisko, I.imie, I.imie_ojca, I.NAZWA NAZWA_FIRMY, I.NAZWA_SKR nazwa_firmy_skr
              INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
              FROM T_ZDARZENIA z, T_INSTYTUCJE I
              WHERE Z.TYP IN ('WFS526','WFS542','WFS553','WFS609','WFS611','WYP_KS','WYP_PO','WYP_SB','DI_ZAT')
              AND z.PODM_UMOW_ID_UMOW IS NULL
              AND Z.PODM_ID_PODM = I.ID_INST
              AND z.ID_ZDAR = WE_ID_ZDAR;
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   BEGIN
                   SELECT p.NUMER NUMER, DECODE(a.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(a.TYP_AGENTA,'P','R',a.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,a.nazwisko, a.imie, a.imie_ojca, a.nazwa_firmy, a.nazwa_firmy_skr
                   INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                   FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                   WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                   AND z.PODM_UMOW_ID_UMOW = p.ID_AGUM
                   AND z.ID_ZDAR = WE_ID_ZDAR;
                   EXCEPTION
                        WHEN NO_DATA_FOUND THEN
                        BEGIN
                        SELECT p.NUMER NUMER, DECODE(a.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(a.TYP_AGENTA,'P','R',a.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,a.nazwisko, a.imie, a.imie_ojca, a.nazwa_firmy, a.nazwa_firmy_skr
                        INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                        FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                        WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                        AND z.PODM_ID_PODM = a.ID_AGAG
                        AND z.PODM_UMOW_ID_UMOW IS NULL
                        AND z.ID_ZDAR = WE_ID_ZDAR;
                        EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                             BEGIN
                             SELECT p.NUMER_UMOWY NUMER, DECODE(p.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(p.TYP_AGENTA,'P','R',p.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,p.nazwisko, p.imie_pierwsze, p.imie_ojca, p.nazwa_firmy, p.nazwa_firmy_skr
                             INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                             FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                             WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                             AND z.PODM_UMOW_ID_UMOW = p.TECH_ID_AGUMT
                             AND z.ID_ZDAR = WE_ID_ZDAR;
                             EXCEPTION
                                  WHEN NO_DATA_FOUND THEN
                                  BEGIN
                                  SELECT p.NUMER_UMOWY NUMER, DECODE(p.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(p.TYP_AGENTA,'P','R',p.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,p.nazwisko, p.imie_pierwsze, p.imie_ojca, p.nazwa_firmy, p.nazwa_firmy_skr
                                  INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                  FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                                  WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                                  AND z.PODM_ID_PODM = a.ID_AGKAN
                                  AND z.PODM_UMOW_ID_UMOW IS NULL
                                  AND z.ID_ZDAR = WE_ID_ZDAR;
                                  EXCEPTION
                                       WHEN NO_DATA_FOUND THEN
                                       BEGIN
                                       SELECT k.NUMER_UMOWY NUMER, DECODE(k.TYP_PRZYSTAPIENIA,'P','F','P') RODZAJ,k.TYP_PRZYSTAPIENIA TYP_PRZY,'NPO' TYP_UBEZ, k.nazwisko, k.imie_pierwsze, k.imie_ojca, k.nazwa_firmy nazwa_firmy, k.nazwa_firmy_skr nazwa_firmy_skr
                                       INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                       FROM T_WE_UM_NPO_TAB k, T_ZDARZENIA z
                                       WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                       AND k.TYP_PRZYSTAPIENIA IN ('P','W')
                                       AND z.PODM_ID_PODM IS NULL
                                       AND z.PODM_UMOW_ID_UMOW IS NULL
                                       AND z.ID_ZDAR = WE_ID_ZDAR;
                                       EXCEPTION
                                            WHEN NO_DATA_FOUND THEN
                                            BEGIN
                                            SELECT k.NUMER_UMOWY NUMER, 'F' RODZAJ,'-' TYP_PRZY,'OPS' TYP_UBEZ, k.nazwisko, k.imie_pierwsze, k.imie_ojca, NULL nazwa_firmy, NULL nazwa_firmy_skr
                                            INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                            FROM T_WE_UM_OPS_TAB k,T_ZDARZENIA z
                                            WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                            AND z.PODM_ID_PODM IS NULL
                                            AND z.PODM_UMOW_ID_UMOW IS NULL
                                            AND z.ID_ZDAR = WE_ID_ZDAR;
                                            EXCEPTION
                                                 WHEN NO_DATA_FOUND THEN
                                                 BEGIN
                                                 SELECT NULL NUMER, NULL RODZAJ,NULL TYP_PRZY,NULL TYP_UBEZ, NULL nazwisko, NULL imie_pierwsze, NULL imie_ojca, NULL nazwa_firmy, NULL nazwa_firmy_skr
                                                 INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
                                                 FROM T_ZDARZENIA z
                                                 WHERE z.TYP NOT IN ('UM_OPS','UM_NPO','NPO_OP','UZUP_U')
                                                 AND z.PODM_ID_PODM IS NULL
                                                 AND z.PODM_UMOW_ID_UMOW IS NULL
                                                 AND z.ID_ZDAR = WE_ID_ZDAR;
                                                 EXCEPTION
                                                      WHEN NO_DATA_FOUND THEN
                                                           --dbms_output.put_line('id zdar wykonania '||WE_ID_ZDAR||' ostatni wyjatek');
                                                           NULL;
                                                 END;
                                            END;
                                       END;
                                  END;
                             END;
                        END;
                   END;
              END;
         END;
    END;
    --raise c;
    IF WE_KOLUMNA = 'NUMER' THEN
    RETURN c_numer;
    ELSIF WE_KOLUMNA = 'RODZAJ' THEN
    RETURN c_rodzaj;
    ELSIF WE_KOLUMNA = 'TYP_PRZY' THEN
    RETURN c_typ_przy;
    ELSIF WE_KOLUMNA = 'TYP_UBEZ' THEN
    RETURN c_typ_ubez;
    ELSIF WE_KOLUMNA = 'NAZWISKO' THEN
    RETURN c_nazwisko;
    ELSIF WE_KOLUMNA = 'IMIE' THEN
    RETURN c_imie;
    ELSIF WE_KOLUMNA = 'IMIE_OJCA' THEN
    RETURN c_imie_ojca;
    ELSIF WE_KOLUMNA = 'NAZWA_FIRMY' THEN
    RETURN c_nazwa_firmy;
    ELSIF WE_KOLUMNA = 'NAZWA_FIRMY_SKR' THEN
    RETURN c_nazwa_firmy_skr;
    ELSIF WE_KOLUMNA = 'JEST' THEN
    RETURN c_jest;
    END IF;
    END;
    CREATE OR REPLACE FUNCTION F_Rej_Zdar_Date
    (WE_ID_ZDAR IN NUMBER
    ,WE_KOLUMNA IN VARCHAR2
    RETURN DATE
    IS
    d_data DATE;
    BEGIN
    BEGIN
    SELECT p.DATA_PODPISANIA
    INTO d_data
    FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D1, T_PODMIOTY D2
    WHERE p.KLIE_ID_KLIE = k.ID_KLIE
    AND z.PODM_ID_PODM = D1.ID_PODM
    AND D1.KLIE_ID_KLIE = p.KLIE_ID_KLIE
    AND Z.PODM_UMOW_ID_UMOW = D2.ID_PODM
    AND D2.PRZY_ID_PRZY = P.ID_PRZY
    AND z.ID_ZDAR = WE_ID_ZDAR;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
         BEGIN
         SELECT p.DATA_PODPISANIA
         INTO d_data
         FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D
         WHERE z.PODM_UMOW_ID_UMOW IS NULL
         AND z.PODM_ID_PODM = D.ID_PODM
         AND D.KLIE_ID_KLIE = k.ID_KLIE
         AND p.KLIE_ID_KLIE = k.ID_KLIE
         AND z.ID_ZDAR = WE_ID_ZDAR;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
              BEGIN
              SELECT NULL DATA_PODPISANIA
              INTO d_data
              FROM T_ZDARZENIA z, T_INSTYTUCJE I
              WHERE Z.TYP IN ('WFS526','WFS542','WFS553','WFS609','WFS611','WYP_KS','WYP_PO','WYP_SB','DI_ZAT')
              AND z.PODM_UMOW_ID_UMOW IS NULL
              AND Z.PODM_ID_PODM = I.ID_INST
              AND z.ID_ZDAR = WE_ID_ZDAR;
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   BEGIN
                   SELECT p.DATA_PODPISANIA DATA_PODPISANIA
                   INTO d_data
                   FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                   WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                   AND z.PODM_UMOW_ID_UMOW = p.ID_AGUM
                   AND z.ID_ZDAR = WE_ID_ZDAR;
                   EXCEPTION
                        WHEN NO_DATA_FOUND THEN
                        BEGIN
                        SELECT p.DATA_PODPISANIA DATA_PODPISANIA
                        INTO d_data
                        FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
                        WHERE a.ID_AGAG = p.AGAG_ID_AGAG
                        AND z.PODM_ID_PODM = a.ID_AGAG
                        AND z.PODM_UMOW_ID_UMOW IS NULL
                        AND z.ID_ZDAR = WE_ID_ZDAR;
                        EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                             BEGIN
                             SELECT p.DATA_PODPISU_AGENTA DATA_PODPISANIA
                             INTO d_data
                             FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                             WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                             AND z.PODM_UMOW_ID_UMOW = p.TECH_ID_AGUMT
                             AND z.ID_ZDAR = WE_ID_ZDAR;
                             EXCEPTION
                                  WHEN NO_DATA_FOUND THEN
                                  BEGIN
                                  SELECT p.DATA_PODPISU_AGENTA DATA_PODPISANIA
                                  INTO d_data
                                  FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
                                  WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
                                  AND z.PODM_ID_PODM = a.ID_AGKAN
                                  AND z.PODM_UMOW_ID_UMOW IS NULL
                                  AND z.ID_ZDAR = WE_ID_ZDAR;
                                  EXCEPTION
                                       WHEN NO_DATA_FOUND THEN
                                       BEGIN
                                       SELECT k.DATA_PODPISANIA_UM DATA_PODPISANIA
                                       INTO d_data
                                       FROM T_WE_UM_NPO_TAB k, T_ZDARZENIA z
                                       WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                       AND k.TYP_PRZYSTAPIENIA IN ('P','W')
                                       AND z.PODM_ID_PODM IS NULL
                                       AND z.PODM_UMOW_ID_UMOW IS NULL
                                       AND z.ID_ZDAR = WE_ID_ZDAR;
                                       EXCEPTION
                                            WHEN NO_DATA_FOUND THEN
                                            BEGIN
                                            SELECT k.DATA_PODPISANIA_UM DATA_PODPISANIA
                                            INTO d_data
                                            FROM T_WE_UM_OPS_TAB k,T_ZDARZENIA z
                                            WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
                                            AND z.PODM_ID_PODM IS NULL
                                            AND z.PODM_UMOW_ID_UMOW IS NULL
                                            AND z.ID_ZDAR = WE_ID_ZDAR;
                                            EXCEPTION
                                                 WHEN NO_DATA_FOUND THEN
                                                 BEGIN
                                                 SELECT NULL DATA_PODPISANIA
                                                 INTO d_data
                                                 FROM T_ZDARZENIA z
                                                 WHERE z.TYP NOT IN ('UM_OPS','UM_NPO','NPO_OP','UZUP_U')
                                                 AND z.PODM_ID_PODM IS NULL
                                                 AND z.PODM_UMOW_ID_UMOW IS NULL
                                                 AND z.ID_ZDAR = WE_ID_ZDAR;
                                                 EXCEPTION
                                                      WHEN NO_DATA_FOUND THEN
                                                           d_data := NULL;
                                                 END;
                                            END;
                                       END;
                                  END;
                             END;
                        END;
                   END;
              END;
         END;
    END;
    IF WE_KOLUMNA = 'DATA_PODPISANIA' THEN
    RETURN d_data;
    END IF;
    END;

  • Planning Layout -KP66 with dynamic period column

    Dear experts,
    I would like to create a planning layout for cost center/ cost elements in which we have the different periods in the columns .The periods in the columns should dynamically select according to the planning cycle selected in the excel file.
    Planning Cycle                           Start Period                                End Period                Total Months
    JAN                                         JAN                                           JUN                            6
    FEB                                         FEB                                            JUN                            5
    MAR                                       MAR                                            JUN                           4
    According to planning cycle my period column should change dynamically.Please let us know how to create planning layout with dynamic period columns. I donot want to create the planning layout with 12 period columns to upload the data.
    Thanks & Regards
    Kumar

    NOT ANSWERED

  • Controling Column Order for Report with Dynamic SQL

    Hi,
    I have a report region using Function block returning the SQL.
    The output of the function will look like the following
    SELECT NAME, CLASS1, CLASS2,CLASS3,CLASS4, AVERAGE_SCORE FROM XXXX;
    The number of CLASSn column will be determine by the function based on the data. If the person doesn't have any score on CLASS4, the the SQL would not have CLASS4 column.
    My problem with this is I can't control the order of column appearance.
    For e.g : If my previous SQL is without CLASS4, when I query a person with CLASS4. The CLASS4 column will appear after the AVERAGE_SCORE.
    NAME---CLASS1---CLASS2---CLASS3---AVERAGE_SCORE---CLASS4
    I want it to maintain AVERAGE_SCORE as the last column.
    Can you guys give a suggestion how to handle this?
    Additional info :
    - I am disabling the report header, setting it to None as the first row of the sql returned records is the header.
    Cheers,
    Joel

    Hi all,
    My report seems to be behaving correctly once i set it to "Use Generic Column Names (parse query at runtime only)" :)
    Cheers,
    Joel

Maybe you are looking for

  • How do I set downloads to automatically save instead of prompting me to open them?

    I recently reset Firefox. Before whenever I downloaded a file, it automatically prompted me if I wanted to open the file or save it to my computer, with saving it to my computer preselected. This was fine because I almost never want to open these dow

  • Displaying images stored in blob columns

    I've seen discussions on how to upload and download blob columns but I want to store a blob in the database and be able to display the blob (which is a jpg) as I would any other <img> on my web page. Instead of having to store the jpg on a file syste

  • MacBook has slowed to the point of crashing everytime?

    So, my MacBook Air (Mid 2011, 2GB Ram) has become so slow to the point of it crashing in every app. It's fairly understandable as it's old and the memory is only 2GB. I will be buying the new MacBook on its release, but is there anything I can do to

  • Revaluate material issues in Production order WIP

    hello All We are long cycle time industry and Business would like to revaluate the material issues in the WIP if there are any changes in the standard cost of the issued material. Is it possible w/o ML implementation? regards mahesh

  • OVS in POWL screen

    Hi , I need to create the OVS help for a field in Selection screen in IF_POWL_FEEDER  class in which method do i need to do and help how to do this Thanks, Kalyani