Unable to reference item value in report region cursor

I've worked on this for a couple of days now and cannot figure out what is going wrong. I have a report that I have created, using database links. Below is the code for my report:
declare
v_sql varchar2(32000) := null;
v_curr_sql varchar2(32000) := null;
v_full_sql varchar2(32000) := null;
cursor c1 is select distinct fiscal_year from fiscal_year where db_cc_id = v('G_DB_ID') order by 1;
begin
for r1 in c1 loop
v_curr_sql := 'sum(decode(fiscal_year,'''||r1.fiscal_year||''',visit_count,0)) as "'||r1.fiscal_year||'V", '||
'sum(decode(fiscal_year,'''||r1.fiscal_year||''',patient_count,0)) as "'||r1.fiscal_year||'P", ';
v_sql := v_sql ||v_curr_sql;
end loop;
v_full_sql := ' select name,'||v_sql||' sum(visit_count) visits, sum(patient_count) patients from visit_trends
where ehs_cc = :f109_client and visit_type = :p45_visit_type and ( (:g_fg = 0 and fg_id in (select fg_id from db_user_fg where ehs_cc = :f109_client and db_user_id = :f109_db_user_id)) or fg_id = :g_fg) group by name';
return v_full_sql;
end;
When I run the page, I get no data found. When I check my session state for the application variables, it tells me that the value for G_DB_ID is 24. If I plug in 24 to to the cursor instead of using the bind variable, it works. I've also tried the :G_DB_ID and nv('G_DB_ID') calls in the cursor. The strange thing is if I use a different bind variable (G_FG), which has a session state value of 0, it will at least return the two columns in the report not created by the sql loop. I must be able to use a bind variable in this report to make sure I'm getting the correct accounting periods for this client. I've even gone as far as to delete and recreate the page. Any suggestions?

Hi Harry,
We are also facing the same issue, has the issue has been resolved. For some users we are able to select the lov and for few we are unable to select the lov but data is fetched in lov. Only select or quickselect is not working.
If so, please provide.
Regards
Raman
[email protected]

Similar Messages

  • How do I reference items in a report region

    I've created a report. You can view the region attributes at http://i3.tinypic.com/wcn59h.jpg.
    I've changed the "Display As" attribute of one of the items (QUAN_ID) to 'Select List (query based LOV)'. I've set the "LOV Query" attribute on this item to the following.
    select quan.answer_txt
    , quan.id
    from vug_question_answers quan
    , vug_survey_questions suqu
    where suqu.id = quan.suqu_id
    and suqu.surv_id = :p33_surv_id
    --and    suqu.id = :suqu_id
    order by quan.question_answer_seq_no
    The purpose of this LOV is to return QUESTION_ANSWERS that have a foreign key to the SURVEY_QUESTIONS record identified by the sufu_id. The bind-variable ":p33_surv_id" is a page item. I THOUGHT the bind-variable ":suqu_id" (referenced in the commented-out line) would be the name of a column item in my report region. However, the LOV doesn't return correct values if I uncomment the line containing :SUQU_ID.
    How do I determine the name of the report region column item so that I can reference it within the LOV of another item in the same region?
    Thanks,
    -Ken

    Ivo,
    That's it!
    My original tabular form query read as follows.
    select rean.id,
    rean.resp_id,
    suqu.surv_id,
    suqu.question_txt,
    quan.suqu_id,
    rean.quan_id, --this is the column I was adding an LOV to
    rean.entered_by,
    rean.entered_on,
    rean.updated_by,
    rean.updated_on
    from vug_respondent_answers rean
    , vug_question_answers quan
    , vug_survey_questions suqu
    where rean.resp_id = :p33_resp_id
    and quan.id = rean.quan_id
    and suqu.id = quan.suqu_id
    and suqu.surv_id = :p33_surv_id
    I've changed it to the following.
    select rean.id,
    rean.resp_id,
    suqu.surv_id,
    suqu.question_txt,
    quan.suqu_id,
    htmldb_item.select_list_from_query
    ( 6
    , rean.quan_id
    , 'select quan.answer_txt, quan.id from vug_question_answers quan, vug_survey_questions suqu where suqu.id = quan.suqu_id and suqu.surv_id = :p33_surv_id and suqu.id = '|| suqu.id ||' order by quan.question_answer_seq_no') quan_id,
    rean.entered_by,
    rean.entered_on,
    rean.updated_by,
    rean.updated_on
    from vug_respondent_answers rean
    , vug_question_answers quan
    , vug_survey_questions suqu
    where rean.resp_id = :p33_resp_id
    and quan.id = rean.quan_id
    and suqu.id = quan.suqu_id
    and suqu.surv_id = :p33_surv_id
    My screen now looks as found at http://i3.tinypic.com/wgq4g9.jpg. (Note that I've also changed the question since a previous post.)

  • How to replace a table name with an item value in report region SQL query?

    I've got a SQL query in a report region that goes like this:
    SELECT :P30_HIDDEN FROM v_dms_dataset
    GROUP BY :P30_HIDDEN
    P30_HIDDEN is populated from a textfield input. Why doesn't this work, and is there a way to achieve what I'm trying to do here? I really need the ability to dynamically generate SQL queries in this way.

    Ben - you could either:
    1. case when :P30_HIDDEN = 'COL1' then col1 else ... end
    in order to determine which column to select (only really useful if you have a small number of predetermined columns to select from), or
    2. generate the SQL dynamically.
    Set the report region to SQL Query (PL/SQL function body returning SQL query), then have something like:
    declare
    l_sql VARCHAR2(4000);
    begin
    l_sql := 'SELECT ' || :P30_HIDDEN || ' FROM v_dms_dataset
    GROUP BY ' || :P30_HIDDEN;
    return l_sql;
    exception
    etc.
    end;
    John.

  • Reference Item value in URL

    I want to use a URL to branch from one application/page to a 2nd application/page and pass a value from an item on the 1st application/page to an item on the 2nd application/page - and within the URL also submit the 2nd application/page.
    The first application/page reflects an employee's detail, with a button to go to the 2nd app to view that employees asset detail.
    The 2nd application/page has two regions, one for a parameter field for Employee ID and a 'run' button; the second is an asset report using the parameter field as a filter for the report. The report runs on page load - when the button is pressed - a branch back to the same page happens to reload the page, this time with a filter to show the filtered report.
    On the 1st app, I am using a button and branch to page/url before processing.
    I am able to craft the URL to be able to pass a value to a page item in the 2nd application if I hard code the 'value' for the item:
    f?p=106:1:&SESSION.:RUNQUERY:::P1_EMPL_ID:12:
    This will go to page one in app 106, retain Session ID and put the value 12 into the page item (parameter field) P1_EMPL_ID.
    Question:
    1) How do I (or can I) reference an item value from app 1 in the URL instead of passing the actual value? v(P2_ID) instead of 12 ??
    2) Even when using a hard coded value like above, using 12... the parameter field gets the value, the page submit seems to run - but the report does NOT get refreshed until I press the button again. The button is - Submit as "RUNQUERY" - there is a branch back to page 1 on submit after processing when button pressed: RUNQUERY (Submit).
    So 2 questions:
    how do I reference an item value in a URL?
    am I referencing the submit part of the URL correctly?
    Thanks in advance...
    Rich

    Matt,
    The URL created when selecting the button on the first app/page is:
    http://xx.xx.xx.xx:8080/apex/f?p=106:1:3605812006071032:RUNQUERY:::P1_EMPL_ID,P1_UNASSIGNED:1%2C0
    The first app/pg button branches to this URL. I don't think the branch or REQUEST that this button makes has anything to do with the desitination app/pg REQUEST that that page is supposed to act on... That REQUEST value is also supposed to be in the URL (for me it is 'RUNQUERY').
    The desitination page is picking up the values for P1_EMPL_ID and P1_UNASSIGNED... and if I hit the button with the REQUEST value of RUNQUERY the report runs and is filtered by the values.
    I looked at the different branches there are on the destination page - and there are two that branch back to the same page.
    One is a Before Computation branch, that resets the fields back to defaults, clears cache for pg1 and is conditionally called by the 'RESET' button that resides next to the SUBMIT button... and then branches back to itself (pg 1).
    One is an After Processing branch that does no setting values or clearing cache - just branches back to itself (pg 1) and is called conditionally by the 'SUBMIT' button (RUNQUERY).
    Additional detail:
    1- When first logging into a session - and opening page 1 of the destination app - the values for the parameters are blank and the report result is 'no data found'.
    2- When first logging into a session and opening page of the 1st app, then hitting the button to branch using the URL to the destination page... the parameters are filled in, and the report result is 'no data found'
    3- In both cases - if you press the submit button (RUNQUERY) the report results show data. (either unfiltered due to no parameter values, or filtered with parameter values)
    4- if you press the submit button (RUNQUERY) on the destination page and remain in the same session, go back to the 1st app/pg, select a record... then the branch using the URL works, reflecting a filtered report. The session state for the Destiniation page is not reset - the values remain in state.
    So I don't think that an unexpected branch is happening. It seems like the RUNQUERY in the URL is not being passed or picked up and acted on.
    Rich
    Edited by: rdarlin2 on Oct 27, 2010 9:27 AM

  • How to refresh list item values before report is run?

    We have two SELECT LIST items (drop boxes) on our report. One SELECT LIST has values of "World Region" (e.g. NORTH AMERICA, SOUTH AMERICA, EUROPE, ASIA)
    the other SELECT LIST has values of "Subregion" (e.g. NORTHERN EUROPE, SOUTHERN EUROPE, SOUTHEAST ASIA etc...)
    The values in the Subregion list are dependent on the value that is chosen from the "World Region" List. Can someone tell up how to update the values in the Subregion list BEFORE we submit the page? We can get these values to update (via sql query) when the page is submitted but that is only happening after the report gets run- which is not what we want. We want the user to select a Region from one SELECT LIST and then see all the qualifying Subregions for that Region in the Subregion SELECT LIST. Only after both Region and Subregion have been selected do we want to run the report. Thank for any help on this.

    hey john--
    john) things like Scott's reference to "The name of the LOV Item". What does this really mean?
    raj) in htmldb there's a concept of items at the page and at the app level. page level items have ui component associated with them. in scott's explanation above, he's talking about using a page-level item with a "Display as" type of "select list w/submit" for your first select list. in that case, he's suggesting you have one select list item drive the values of another. when the self-submitting select list submits the page, it sets an htmldb built-in variable called :REQUEST to the name of the self-submitting select list item. in your follow-up post's example, that'd be "REGION_LIST". scott was explaining how you could control the functionality on your page by adding conditions to things like...
    :REQUEST = 'REGION_LIST'
    ...or using declarative Condition options like "Request = Expression 1" and then putting the string "REGION_LIST" in that Expression1 field. so in your case, you have a report region that you don't want displayed until the user's done selecting from your Subregion list. an easy way to handle that would be to add a hidden item (where "Display as" is set to "Hidden") to your page, for example :P1_LAST_REQUEST, to store the last value of :REQUEST. put a Computation on your page that populates :P1_LAST_REQUEST with :REQUEST each time the page is submitted. then put a Condition on your report region that makes it only render when :P1_LAST_REQUEST != 'REGION_LIST'. so this way your users can select a Region and have the page submit itself. the page will then redraw with the values of subregion list correctly populated (you'd presumably use :REGION_LIST in your subregion LOV query to achieve the filtered values) w/o your report region displayed. the user would then select a correct subregion and click some sort of "run my report" button. this time when the page redraws, :P1_LAST_REQUEST would be set so something other than "REGION_LIST" (it'd be set to whatever you named your "run my report button") and so your report region would display as desired.
    hope this helps,
    raj

  • How to combine Submit value and item values in report condition?

    What I have is a report with some input parameters, one of which is a Select List with Submit that forces population of a second Select List. There is also a GO button. Depending on the combination of the two drop-downs, one of three report regions then gets displayed. This all works fine, but the users would like the report NOT to show UNTIL they click on the GO button. I'm trying to figure out how to tweak my conditions to include a Submit value along with item values. Can someone suggest a solution?
    (PS. I'm using dependent selects because I'm still using APEX 3.2)

    Hello
    When your page is submitted due to the the parent select list's value getting changed the APEX 'REQUEST' variable is set to the name of the select list item.
    You could perhaps use this to perhaps set a hidden item on the page whose value can then be checked in the conditions that control the display of your report regions.
    varad

  • How to display the items in a Report Region

    Is it possiable to have the fields in a report region based on an sql query be display in somthing other than a row? For example if I have a Report Region with four columns it will look something like:
    <Field 1, row 1 value> <Field 2, row 1 value> <Field 3, row 1 value> <Field 4, row 1 value>
    <Field 1, row 2 value> <Field 2, row 2 value> <Field 3, row 2 value> <Field 4, row 2 value>
    <Field 1, row 3 value> <Field 2, row 3 value> <Field 3, row 3 value> <Field 4, row 3 value>
    etc
    Is it possiable to tell ApEx to display the Report Region like:
    <Field 1, row 1 value> <Field 2, row 1 value>
    <Field 3, row 1 value> <Field 4, row 1 value>
    <Field 1, row 2 value> <Field 2, row 2 value>
    <Field 3, row 2 value> <Field 4, row 2 value>
    <Field 1, row 3 value> <Field 2, row 3 value>
    <Field 3, row 3 value> <Field 4, row 3 value>
    etc
    Maybe there is a nother way to do this that uses somthing other than an sql based report region. Thanks very much for the help.

    This can be done using a SQL query report region with a [custom report template|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/themes.htm#sthref1744].
    Unfortunately the documentation is not particularly helpful on this topic, and as use cases tend to be very specific, reusable solutions are rarely shared in the community ("custom" reports after all...) See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=1569996] for a good discussion of the technique, with a link to an example on apex.oracle.com.
    A response to [another recent thread|http://forums.oracle.com/forums/thread.jspa?threadID=1012690] showed another example on page 1 of the [Online Store demo app|http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#STORE], which you can download, install and examine. This uses a custom report template in conjunction with the report HTML Expression feature.
    (I'm not totally clear on the display you're after: it might help to repost it using some example data rather than the abstract <Field 2, row 1 value> approach. Wrap the sample in \...\ tags to get fixed width characters that can be made to align, if that will help.)

  • Set focus to a report region after select value (user) report region

    Hello,
    On my page I have 4 report SQL Query report regions (among themselves). After selecting (user) of a value (report region number 3 with column link), the result shown in report region number 4. However, the focus is on report region number 1. The user sees the results do need to scroll down to see the answer(in report region number 4).
    Does anyone have a solution for me with an example. Thanks.

    Hi Varad,
    sorry for the delayed response.
    Please check the page:- 9999 of App:-964
    I have made 2 simple reports with a button in each region.
    SUCCESS MESSAGE of first one:- first process run by first report
    SUCESSS MESSAGE of second one:- Saved Data..process run for second report
    when first process is run by clicking the <b>SUBMIT</b> button in the first region, we will see the same first region back. But, when we click the <b>SAVE</b> button of second region, page submits and we will see the first region and user should scroll down to see the second region.
    so, I am trying to see if I can have user see the same region back[second region,when SAVE button clicked, in this case] if he has done any operations on second region. My actual page has around 6 regions where scrolling down might be pain full for a end user.
    Have created this page in a hurry .. My actual pages and processes are doing some use full job, the page I have given here is only for our testing purpose. please do not mind.
    Thanks a lot for helping me..
    Chaitu..
    Edited by: Chaitu_Apex on Apr 14, 2010 9:51 AM

  • Using page items in a report region

    Hi all,
    I am attempting to query a database table using values from two page items.
    SEARCH_FIELD is the field in which a query constraint is being applied
    SEARCH_CONDITION is the the query constraint condition being applied
    So, for example, I tried setting SEARCH_FIELD to AMOUNT and SEARCH_CONDITION to %22%.
    When I put the line 'AMOUNT LIKE :SEARCH_CONDITION' at the end of the query it returns the rows that do match the constraint.
    When I put the line ':SEARCH_FIELD LIKE :SEARCH_CONDITION' it displays "no data found."
    The debug shows it parse query, bind SEARCH_FIELD, bind SEARCH_CONDITION, determine column headings, then parse and bind again, and print column headings, and row loop: 15 row(s). Then the message "no data found." It should return a single row, but it does not.
    Any reason why apex doesn't like this?
    Thanks in advance,
    T.

    Sorry for the reply delay...
    The region is an SQL Query. The source is:
    Select NUMBER, DATE_LOGIN, DATE_LOGOUT, FORM.FORM_NAME as "Form", Person.L_Name||', '||Person.F_Name as "REQUESTER", DEPARTMENT.DEPARTMENT_NAME, ACCOUNT#, SUBCODE.SUBCODE as "Subcode", AMOUNT, DESCRIPTION, SENTTO.LOCATION as "Sent To", (Select Person.L_Name||', '||Person.F_Name from PERSON WHERE AUTHORIZED_BY=PERSON.ID) as "Authorized By" from SIGNATURETBL, PERSON, DEPARTMENT, FORM, SENTTO, SUBCODE WHERE REQUESTER=PERSON.ID AND DEPARTMENT=DEPARTMENT.ID AND FORM=FORM.ID AND SENT_TO=SENTTO.ID AND SIGNATURETBL.SUBCODE=SUBCODE.ID AND :SEARCH_FIELD LIKE :SEARCH_CONDITION
    If :SEARCH_FIELD has the value of 'AMOUNT' and :SEARCH_CONDITION has the value of '%22%' the regions says that no data was found. If :SEARCH_FIELD, in the query, is replaced by AMOUNT then the query does return the proper rows.
    Can you not reference an item to determine a column constraint?
    Thanks for any input

  • Unable to pass on value to report

    Hi,
    I have three pages: form, classic report and interactive report.
    I am trying to pass deptno value to deptno item created in classic report. On my form, under Actions, I am setting report's field value equal to form's field value. On clicking the Go button, the report appears but the field is blank.
    I have tried it with both classic and interactive reports, but getting the blank field.
    Can somebody suggest me the solution please?
    I am using apex.oracle.com.
    Thanks
    Zeekay

    I have the same problem!!! =) Wondering if in APEX 4.0 there is a new way of using Item_values in a report.

  • Unable to reference items in a hashtable

    HI,
    I'm having a bad PowerShell day today!
    My sample script to read in a text file and put the data into a hash table works just fine:
    $InputFile=Get-Content C:\Out\ktf06011.REQ
    $CurrentUserHashTable = @{}
    ForEach ($Line in $InputFile)
    $Data=$Line.Split("=")
    $Label=$Data[0].Trim()
    $Label=$Label.Insert(($Label.Length),"`"")
    $Label=$Label.Insert(0,"`"")
    $Value=$Data[1].Trim()
    $Value=$Value.Insert(($Value.Length),"`"")
    $Value=$Value.Insert(0,"`"")
    $CurrentUserHashTable.Add($Label,$Value)
    $CurrentUserHashTable 
    However, when I use this within a script that uses a file system watcher event to discover the presence of the text file, I cannot get anything from the hash table. I can see my variables being created, ready to pass on to the .add statement. I have found
    a workaround for now - not using a hash table - but would love to know why I see this behaviour and suggestions for getting at the data.
    Here is the code that I'm having trouble with.
    $folder = 'c:\In'
    $OutFolder = 'c:\Out'
    $filter = '*.*'
    $CurrentUserHashTable = $NULL
    $FileSystemWatcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $false;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}
    Register-ObjectEvent $FileSystemWatcher Created -SourceIdentifier FileCreated -Action {
    $name = $Event.SourceEventArgs.Name
    $InputFile=Get-Content $folder\$name
    ForEach ($Line in $InputFile)
    #Write-Host $Line
    $CurrentUserHashTable = @{}
    $Data=$Line.Split("=")
    #Write-Host "Data: " $Data
    $Label=$Data[0].Trim()
    $Label=$Label.Insert(($Label.Length),"`"")
    $Label=$Label.Insert(0,"`"")
    #Write-Host "Label: " $Label
    $Value=$Data[1].Trim()
    $Value=$Value.Insert(($Value.Length),"`"")
    $Value=$Value.Insert(0,"`"")
    #Write-Host "Value: " $Value
    $CurrentUserHashTable.Add($Label,$Value)
    $CurrentUserHashTable
    Move-Item $folder\$name $OutFolder -Force
    #Label: "ID"
    #Value: "abc00001"
    #Label: "PID"
    #Value: "00001"
    #Label: "Title"
    #Value: "Mr"
    #Label: "Initials"
    #Value: "XY"
    #Label: "Forename"
    #Value: "Mickey"
    #Label: "Surname"
    #Value: "Mouse"
    #Label: "Siteabbrev"
    #Value: "UK"
    #Label: "Status"
    #Value: "STAFF"
    #Label: "BUabbrev"
    #Value: "NOBU"
    #Label: "Department"
    #Value: "Finance"
    Note the commented bits at the bottom are the output of
    Write-Host "Value: " $Value
     and
    Write-Host "Label: " $Label
    Also, if the following are placed within the loop, I see all data items being returned, so I know that they are added to the hash table. If they are added outside the loop, I just get the final entry "Department"
    Write-Host "Keys:" $CurrentUserHashTable.Keys
    Write-Host "Values:" $CurrentUserHashTable.Values
    Many thanks,
    Jon

    Rhys,
    Thanks that was so obvious, I couldn't see it!
    I knew the answer would be simple.
    Made the amendment to my script and can now get at the data in the hashtable, via (e.g.)
    $Department=$CurrentUserHashTable.'"Department"'
    Thanks again.
    Jon

  • Personalization: can I reference an item value (like :LINE.ORDERED_QUANTITY) on a different order line?

    I am constructing a forms personalization for the "Sales Orders" form. I would like to be able to reference item values on order lines other than the current line.  Is this possible?
    Thanks, Bill

    Hi,
    (1) From where you have defined the maximum quantity ?
    (2) can you provide the personalization rules & functions you have set ?
    Morever, regd. DFF, you review the following links.
    http://docs.oracle.com/cd/A60725_05/html/comnls/us/fnd/ogenff04.htm
    http://www.erpschools.com/articles/descriptive-flexfields
    http://www.oracleerpappsguide.com/2011/02/descriptive-flex-field.html

  • Dynamic action in a report region in a master detail form

    hi
    I have created a master detail form , in which many validation etc is done ,the MASTER is a FORM  and DETAIL is a REPORT
    Now I am stuck up with the detail region .i.e report
    I have Line Detail where there are ITEMS such as SL NO: ,ITEM_ID , UOM ( Unit of measuremnt ) etc
    Now here is where I need help .
    Using POP UP LOV i have managed to fetch in LOV for the item "ITEM_ID",--- i can select an item name using the pop up LOV ,
    Now all that I want is when I select an item name from the pop up lov , an Item Id is displayed or fetched in that particular place , now i want the corresponding UOM to be diaplayed  ( i.e the UOM for that particular Item Id which has been selected by me from the pop up lov ).
    In order to resolve this I created a Dynamic action where in I get the UOM . Bt the problem is that the ITEMS displayed for selecting in the WHEN section (
    DYNAMIC action
    -IDENTIFICATION section
    -WHEN section----- items (  here i am not listed with ITEMS of the REPORT region instead ITEMS of the MASTER is available )
    -TRUE ACTION section etc is only the
    ITEMS of the MASTER region ..
    Please help me sort this out

    Mod: moved from Japanese Apex

  • Select list in report region.Everything is not in order...

    I want to have a select item in a report region. The selected item in de select list is the "master" for the records in the region. It was working fine but after dropping another region on the same page the select list is now shown beneath the report instead of on top of the report. I can't find a way to get it back on top.
    As a matter of fact I can't find any attribute that determines what comes first in this situation. Is it bad practise to use a item in a report region?

    Thanks, that's it.
    Because I wanted this region to be above two other regions I moved it to page template 2. I did not notice the "items below/items above region content". I guess I need to create a page template region 2 items above content.

  • How to reference the value of items in a generic report

    Hello
    I have created a generic report. The source is a PL/SQL-Function returning a query stored in a package of the parsing schema, using the apex_item package. I set the p_item_id values depending on p_idx and rownum. In the browser I can see the unique (id="...") of the items. The report works well.
    One column is an analytical funtion and shows for every row the same value. The column is hidden. Depending on that value I want to show or hide buttons.
    How can I get the value of this column. Apex_application.g_fxx don't work. Apex_application.g_fxx.COUNT =0 for all possible columns.
    So how can I reference the value in the report.
    Any suggestions?
    Thanks

    Hallo varad
    Should I do really?
    The SQL is a function in a package returning a sql-string. It's a join over five tables (one outer join) refrences some other package variables. For testing purposes I put in into the region, but nothing changed. SQL is ok.
    So here is the region source:
    declare
    v_mdt_id pkg_typ_lagerplatzbelegungen.mdt_id_coltype;
    v_laplstat_frei pkg_typ_lagerplatzbelegungen.laplstat_id_coltype;
    v_laplstat_leermeldung pkg_typ_lagerplatzbelegungen.laplstat_id_coltype:=1;
    v_sql VARCHAR2(10000);
    BEGIN
    v_mdt_id :=:g_mdt_id;
    v_laplstat_frei:=pkg_konst_lagerplatzstati.fkt_laplstat_frei;
    v_sql:= ' WITH lapl_lagepos
    AS
    (SELECT (rownum ) zeile
    ,laplbe1.mdt_id
    ,laplbe1.lapl_koor1
    ,laplbe1.lapl_koor2
    ,laplbe1.lapl_koor3
    ,laplbe1.lapl_koor4
    ,laplbe1.lapl_koor5
    ,lagepos.lage_id
    ,lagepos.lagepos_id
    ,pkg_sel_lagerplaetze.fkt_get_lapl_kurzbez_display( laplbe1.lapl_koor1
    ,laplbe1.lapl_koor2
    ,laplbe1.lapl_koor3
    ,laplbe1.lapl_koor4
    ,laplbe1.lapl_koor5
    , laplbe1.mdt_id) lapl_kurzbez
    ,laplbe1.lavo_id
    ,mat.mat_id
    ,mat.mat_id mat_id_neu
    ,mat.matart_id
    ,mat.matart_id matart_id_neu
    ,mat.mdt_id_mat
    ,mat.mdt_id_mat mdt_id_mat_neu
    ,mat.mat_name1
    ,mat.mat_name2
    ,lagepos.lagepos_menge
    ,lagepos.meschl_id
    ,NULL zumenge
    ,NVL(SUM(lagepos.lagepos_menge) OVER (PARTITION BY lagepos.lage_id),0)
    ,CASE
    WHEN NVL(SUM(lagepos.lagepos_menge) OVER (PARTITION BY lagepos.lage_id),0) = 0
    AND (laplbe1.laplstat_id < '||v_laplstat_frei||' OR NVL(laplbe1.lage_id,0) > 0) THEN 0
    ELSE
    NVL(SUM(lagepos.lagepos_menge) OVER (PARTITION BY lagepos.lage_id),0)+1
    END leerkennung
    FROM (SELECT laplbe.mdt_id
    ,laplbe.lapl_koor1
    ,laplbe.lapl_koor2
    ,laplbe.lapl_koor3
    ,laplbe.lapl_koor4
    ,laplbe.lapl_koor5
    ,laplbe.lage_id
    ,laplbe.laplstat_id
    ,lapl.lapl_kurzbez
    ,lapl.lavo_id
    FROM lagerplaetze lapl
    ,lagerplatzbelegungen laplbe
    WHERE lapl.lapl_kurzbez ='||'''77B04B1'''||'
    AND lapl.mdt_id ='||v_mdt_id||'
    AND laplbe.mdt_id ='||v_mdt_id||'
    AND laplbe.lapl_koor1 = lapl.lapl_koor1
    AND laplbe.lapl_koor2 = lapl.lapl_koor2
    AND laplbe.lapl_koor3 = lapl.lapl_koor3
    AND laplbe.lapl_koor4 = lapl.lapl_koor4
    AND laplbe.lapl_koor5 = lapl.lapl_koor5
    AND laplbe.mdt_id = lapl.mdt_id) laplbe1
    , (SELECT lage_id
    ,lagepos_id
    ,mdt_id
    ,mat_id
    ,matart_id
    ,mdt_id_mat
    ,meschl_id
    ,lagepos_mengeneinheit
    ,lagepos_menge
    FROM lagergebindepositionen
    WHERE NVL(lagepos_archiviert,0) =0
    AND mdt_id = '||v_mdt_id||') lagepos
    ,(SELECT mat_id
    ,matart_id
    ,mdt_id_mat
    ,mat_name1
    ,mat_name2
    FROM materialien
    WHERE mat_archiviert= 0
    AND NVL(mdt_id_mat,'||v_mdt_id||')='||v_mdt_id||') mat
    WHERE laplbe1.lage_id = lagepos.lage_id(+)
    AND lagepos.mat_id =mat.mat_id(+)
    AND lagepos.matart_id = mat.matart_id(+)
    AND lagepos.mdt_id_mat=mat.mdt_id_mat(+))
    SELECT APEX_ITEM.hidden (31, zeile,'''',''P95801_f31_''||zeile ) zeile
    ,APEX_ITEM.text (32, leerkennung,10,10,''P95801_f32_''||zeile ) "Leerkennung "
    ,APEX_ITEM.hidden (33,mdt_id ,'''' ,''P95801_f33_''||zeile ) mdt_id
    ,APEX_ITEM.hidden (34,lapl_koor1 ,'''' ,''P95801_f34_''||zeile) lapl_koor1
    ,APEX_ITEM.hidden (35,lapl_koor2 ,'''' ,''P95801_f35_''||zeile ) lapl_koor2
    ,APEX_ITEM.hidden (36,lapl_koor3 ,'''' ,''P95801_f36_''||zeile) lapl_koor3
    ,APEX_ITEM.hidden (37,lapl_koor4 ,'''' ,''P95801_f37_''||zeile) lapl_koor4
    ,APEX_ITEM.hidden (38,lapl_koor5 ,'''' ,''P95801_f38_''||zeile ) lapl_koor5
    ,APEX_ITEM.hidden (39,lage_id ,'''',''P95801_f39_''||zeile ) lage_id
    ,APEX_ITEM.hidden (40,lagepos_id ,'''' ,''P95801_f40_''||zeile) lagepos_id
    ,APEX_ITEM.display_and_save(41,lapl_kurzbez,''P95801_f41_''||zeile) "Lagerplatz"
    ,APEX_ITEM.display_and_save(42,lavo_id ,''P95801_f42_''||zeile) "Fachtyp"
    ,DECODE(mat_id ,NULL, APEX_ITEM.popup_from_lov (43,'''',''MATLAVO'','''','''',0,'''',''''
    ,''onFocus="fkt_set_bordercolor(this)" onBlur="fkt_reset_bordercolor(this)" onkeydown="fkt_submit_tab(event,this)" ''
    ,''YES'',''P95801_f43_''||zeile)
    ,APEX_ITEM.display_and_save(43,mat_id,''P95801_f43_''||zeile)) "Material-Id"
    ,DECODE(matart_id,NULL, APEX_ITEM.hidden(44,matart_id ,'''' ,''P95801_f44_''||zeile)
    , APEX_ITEM.hidden(44,matart_id ,'''' ,''P95801_f44_''||zeile)) matart_id
    ,DECODE( mdt_id_mat,NULL, APEX_ITEM.hidden (45,mdt_id_mat ,'''' ,''P95801_f45_''||zeile )
    ,APEX_ITEM.hidden (45,mdt_id_mat ,'''' ,''P95801_f45_''||zeile )) mdt_id_mat
    ,APEX_ITEM.display_and_save(46,mat_name1 ,''P95801_f46_''||zeile) "Materialname"
    ,APEX_ITEM.display_and_save(47,mat_name2 ,''P95801_f47_''||zeile) "Materialbezeichnung"
    ,APEX_ITEM.display_and_save(48,lagepos_menge ,''P95801_f48_''||zeile) "Lagernde Menge"
    ,APEX_ITEM.display_and_save(49,meschl_id ,''P95801_f49_''||zeile) "Mengenschlüssel"
    ,APEX_ITEM.text(50,zumenge,10,10,'' style="width:120px" onFocus="fkt_set_bordercolor(this)" onBlur="fkt_reset_bordercolor(this)" onkeydown="fkt_submit_tab(event,this)" '',''P95801_f50_''||zeile ) "Einzulagernde Menge"
    FROM lapl_lagepos';
    RETURN v_sql;
    end;
    Thank you for help

Maybe you are looking for

  • Regular expression question about punctuation

    hello there i'm trying to check a line in the command line to find the mac address so i need a little help in the pattern to complie here is what i've tried Pattern p4=Pattern.compile("\\d|\\w{0,}\\p{Punct}\\d|\\w{0,}\\p{Punct}\\d|\\w{0,}\\p{Punct}\\

  • Stabilizing

    I am still try to finish post production in Premiere Elements 10 (an endless prcoess for me)  and I wanted to get this board's opinion on stabilization.  I purchased a great software program called Mercalli Easy Video Stabilizer 2.0 and I feel it doe

  • Multiple session are open thought Users log out.

    Hello Gurus, I do see at CMC that many sessions are being open for many days even though users are logged out. We are using SAP 4.0 (14.0.4)  SP4. It's causing license issues and users are not able to log in. We have restarted our VM's and clear the

  • Can't start Encore CS6

    Hello, at some days i cant' start encore cs6. "PSD-Unterstützung wird initialisiert" "Adobe Encore funktioniert nicht mehr" I installed Windows 7 Prof and Adobe Production Premium CS6 new Who can help me? Greetings, Christian

  • Unable to make a transparent connection from non root user

    Hi I am trying to make a transparent connection from a non-root user and I am having permission denied when trying to generate ssh keys, as per below: $ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/g