FOR I IN 1..HTMLDB_APPLICATION.G_F01.COUNT
I cannot seem to get row processing (using G_Fxx.count) to work property.
I have followed the HOWTO section to create an updateable report with a Checkbox. On Load, all checkboxes are set to UNCHECKED:
SELECT X.OFFICER_ID
, X.OFFICER_NAME_TX
, X.OFFICER_TITLE_TX
FROM (
SELECT HTMLDB_ITEM.CHECKBOX(1,'N',NULL,'Y')
|| HTMLDB_ITEM.HIDDEN(2,OFFICER_ID) OFFICER_ID
, HTMLDB_ITEM.TEXT(3,OFFICER_NAME_TX) OFFICER_NAME_TX
, HTMLDB_ITEM.TEXT(4,OFFICER_TITLE_TX) OFFICER_TITLE_TX
FROM CDIS_INV_OFFICER
WHERE CORONER_CASE_ID = :P1_CORONER_CASE_ID
UNION ALL
SELECT HTMLDB_ITEM.CHECKBOX(1,'N',NULL,'Y')
|| HTMLDB_ITEM.HIDDEN(2,NULL) OFFICER_ID
, HTMLDB_ITEM.TEXT(3,NULL) OFFICER_NAME_TX
, HTMLDB_ITEM.TEXT(4,NULL) OFFICER_TITLE_TX
FROM ALL_OBJECTS WHERE ROWNUM <= NVL(:P2_ADD_OFFICER_CNT, 0)) X
I attempt to loop through the looped rows and upate the Officer Name and Title for those rows checked.
BEGIN
-- Loop through the rows that have been checked.
FOR I IN 1..HTMLDB_APPLICATION.G_F01.COUNT
LOOP
-- Update the Officer Name and Title if checked.
CDIS$CDIS_INV_OFFICER_U.P_UPDATE_BY_OFFICER_ID
( HTMLDB_APPLICATION.G_F02(I)
, :P1_CORONER_CASE_ID
, REPLACE(HTMLDB_APPLICATION.G_F03(I),'%'||'NULL%',NULL)
, REPLACE(HTMLDB_APPLICATION.G_F04(I),'%'||'NULL%',NULL)
, :F118_STATUS_CD
, :F118_STATUS_DESC ) ;
END IF ;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
:F118_STATUS_CD := '1' ;
:F118_STATUS_DESC := SUBSTR((SQLERRM),1,2000);
END ;
If I check row 1 and 3 and hit the UPDATE button, rows 1 and 2 get updated. If I check rows 1, 3, 5, 7 and 9, then rows 1 to 5 get updated.
From what I can determine, all that FOR I IN 1..HTMLDB_APPLICATION.G_F01.COUNT holds is the count of the rows update. Then when I loop through, I update the FIRST X-many rows. So, if 5 rows are checked, the first 5 rows are updated.
What exactly am I doing wrong?
Vivek thanks for helping find the solution.
I see that there are several threads on this topic â having to do with updateable reports, checkboxes and hidden columns (most likely the Primary Key or parts of the Primary Key). Maybe I should write a HOWTO, but here first is the solution for those that are currently experiencing this problem.
First let me address the value contained within HTMLDB_APPLICATION.G_F01.COUNT:
G_F01.COUNT contains the number of rows checked. It does not identify those rows. Meaning, if you have 3 rows checked this variable will contain the number 3. If you use this variable in a LOOP Statement (i.e. "FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT") the variable "i" will start at 1 and be incremented by 1 until it gets to 3. So, the values will be 1, 2 and 3.
If you then reference HTMLDB_APPLICATION.G_F03(i), you will reference the 3rd column in the array for rows 1, 2 and 3. This is not necessarily the checked rows. Meaning if rows 1, 3 and 5 are checked and then HTMLDB_APPLICATION.G_F03(i) is referenced in the loop, the wrong rows will be referenced.
The solution is "not to reference HTMLDB_APPLICATION.G_F03(i)" but instead "to reference HTMLDB_APPLICATION.G_F03(HTMLDB_APPLICATION.G_F01(i))".
Within my Region Definition, I have:
SELECT HTMLDB_ITEM.CHECKBOX(1,ROWNUM)
_______, X.Officer_Name
_______, X.Officer_Title
FROM (
SELECT HTMLDB_ITEM.HIDDEN(2,Officer_Id)
______|| HTMLDB_ITEM.TEXT(3,Officer_Name) Officer_Name
______, HTMLDB_ITEM.TEXT(4,Officer_Title) Officer_Title
FROM CDISINV_OFFICER
WHERE Coroner_Case_Id = :P1_CORONER_CASE_ID ) X
The Checkbox is stored in F01. The Hidden Primary Key is stored in F02 (if there were multiple columns in the Primary Key, one would have multiple hidden columns and multiple associated F##s). The updateable report columns are stored in F03 and F04.
Within my "After Update" Process (On Submit â After Computations and Validations), I have:
BEGIN
FOR I IN 1..HTMLDB_APPLICATION.G_F01.COUNT
LOOP
UPDATE CDIS_INV_OFFICER
____SET Officer_Name = HTMLDB_APPLICATION.G_F03(HTMLDB_APPLICATION.G_F01(i))
_______, Officer_Title = HTMLDB_APPLICATION.G_F04(HTMLDB_APPLICATION.G_F01(i))
WHERE Coroner_Case_Id = :P1_CORONER_CASE_ID
___AND Officer_Id = HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i)) ;
END LOOP;
Notice that I am referencing F03(F01(i)) and not F03(i).
Instead of going F03(1), F03(2) then F03(3), I am actually referencing the rows associated with the checkboxes.
This is how the Checked Rows (where the CHECKBOX is set to âEnabledâ) are selected, via the ROWNUM stored within the Regional Definition.
This solution works well.
I hope you find my explanation helpful.
Similar Messages
-
FOR i IN 1..htmldb_application.g_f01.COUNT LOOP
Hello,
I have created a report query as below
SELECT
ROWNUM,
x.household_org_affil_id,
x.hoaf_effective_date,
x.hoaf_terminate_date,
x.partner_organization,
x.primary_type,
x.relationship_type ,
x.affiliated_person_id,
x.chksum,
x.del
FROM (SELECT
htmldb_item.hidden(1,household_org_affil_id) household_org_affil_id,
wwv_flow_item.date_popup(2,NULL,vbhoaf.effective_date) hoaf_effective_date,
wwv_flow_item.date_popup(3,NULL,vbhoaf.terminate_date) hoaf_terminate_date,
htmldb_item.display_and_save(4,partner_common_name) partner_organization,
htmldb_item.HIDDEN(5,affiliated_person_id) affiliated_person_id,
htmldb_item.display_and_save(6,primary_type) primary_type,
htmldb_item.display_and_save(7,relationship_type_dis) relationship_type,
htmldb_item.md5_checksum(
household_org_affil_id,
vbhoaf.effective_date,
vbhoaf.terminate_date) chksum,
htmldb_item.checkbox(50, household_org_affil_id, (case when vbhoaf.terminate_date is null then 'DISABLED' else NULL end)) del
FROM vb_household_org_affil vbhoaf
JOIN vb_household_membership vbhm
ON vbhoaf.family_household_id = vbhm.family_household_id
JOIN vb_partner_organization vbpo
ON vbpo.partner_organization_id = vbhoaf.partner_organization_id
WHERE :P1580_AFFILIATED_PERSON_ID IS NOT NULL
AND vbhm.affiliated_person_id = :P1580_AFFILIATED_PERSON_ID) x
But if I am trying to loop as below
FOR i IN 1 .. htmldb_application.g_f01.COUNT LOOP
I am getting an error 'no data found' as like the array g_f01 does not exist. But If I am refering g_f02, that is ok but that is not the one I want.
Can you anyone please help me to find what is wrong.
Thanks in advance,
NattuHello Nattu,
Although it seems that your query is working in the way you wrote it, I believe it makes more sense (at least for me) that the use of the APEX API will be within the main query and not within the sub-query.
In your case, as you created the household_org_affil_id column as hidden one, you probably don’t want to display it. Did you uncheck the “Show” attribute for this column? In this case the column don’t get to be POSTed, and the corresponding G_Fxx array will be empty.
In order to correct that, and still get a presentable report, you need to concatenate the hidden column with a column you are displaying. This way the hidden values will be populated to the corresponding G_Fxx array. You can try something like this:
SELECT ROWNUM
htmldb_item.hidden(1,household_org_affil_id) ||
wwv_flow_item.date_popup(2,NULL,vbhoaf.effective_date) hoaf_effective_date,
from (select x.hoaf_effective_date, . . .
from vb_household_org_affil vbhoaf x
where . . . )
@ ines:
There isn’t any problem to use G_F01 to accommodate a hidden column. The example in the documentation is doing just that - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/api.htm#sthref2857 .
Hope this helps,
Arie. -
I have 2 different queried regions (PL/SQL Function returning Query). I want to use one SAVE button to save all values in both regions. One is a student's SAT scores, the other is their ACT scores. They reference 2 distinct tables, sat and act.
The problem seems to be that the regions share the f01, etc. identifiers. I tried to get around this by making f01 indicate which test it is, ie. which table to update.
I'm using the "for i in 1..htmldb_application.g_f01.count loop" construct. It works fine when only 1 of the regions has records. But when they both have rows i get this error: ORA-01403: no data found... apparently not retrieving the records? Here is my process code, which is executed when the SAVE button is pressed:
-- There are 2 regions, SAT and ACT. Since they share form identifiers
-- (f02, etc.) the Test Type was needed to distinguish which table to insert
-- the values into, sat or act.
-- SAT
-- f01 = Test Type ( = SAT )
-- f02 = permnum
-- f03 = SAT admindate
-- f04 = SAT testsite
-- f05 = SAT math
-- f06 = SAT verbal
-- f07 = SAT composite
-- ACT
-- f01 = Test Type ( = ACT )
-- f02 = ACT permnum
-- f03 = ACT admindate
-- f04 = ACT testsite
-- f05 = ACT math
-- f06 = ACT english
-- f07 = ACT reading
-- f08 = ACT science
-- f09 = ACT composite
begin
for i in 1..htmldb_application.g_f01.count
loop
if htmldb_application.g_f01(i) = 'SAT' then
update sat
set testsite = htmldb_application.g_f04(i),
math = replace(htmldb_application.g_f05(i), '', NULL),
verbal = replace(htmldb_application.g_f06(i), '', NULL),
composite = replace(htmldb_application.g_f07(i), '', NULL)
where permnum = :GLOBAL_PERMNUM
and to_char(admindate, 'DD-MON-YYYY') = htmldb_application.g_f03(i);
end if;
if htmldb_application.g_f01(i) = 'ACT' then
update act
set testsite = htmldb_application.g_f04(i),
math = replace(htmldb_application.g_f05(i), '', NULL),
english = replace(htmldb_application.g_f06(i), '', NULL),
reading = replace(htmldb_application.g_f07(i), '', NULL),
science = replace(htmldb_application.g_f08(i), '', NULL),
composite = replace(htmldb_application.g_f09(i), '', NULL)
where permnum = :GLOBAL_PERMNUM
and to_char(admindate, 'DD-MON-YYYY') = htmldb_application.g_f03(i);
end if;
end loop;
end;Ok i broke them out into 2 separate processes, with a Save button in each region "SAVE_SAT" and "SAVE_ACT". Like this:
// | PROCESS: Save Changes to SATs |
-- There are 2 regions, SAT and ACT. Since they share form identifiers
-- (f02, etc.) the Test Type was needed to distinguish which table to insert
-- the values into, sat or act.
-- SAT
-- f01 = Test Type ( = SAT )
-- f02 = permnum
-- f03 = SAT admindate
-- f04 = SAT testsite
-- f05 = SAT math
-- f06 = SAT verbal
-- f07 = SAT composite
begin
for i in 1..htmldb_application.g_f01.count
loop
if htmldb_application.g_f01(i) = 'SAT' then
update sat
set testsite = htmldb_application.g_f04(i),
math = replace(htmldb_application.g_f05(i), '', NULL),
verbal = replace(htmldb_application.g_f06(i), '', NULL),
composite = replace(htmldb_application.g_f07(i), '', NULL)
where permnum = :GLOBAL_PERMNUM
and to_char(admindate, 'DD-MON-YYYY') = htmldb_application.g_f03(i);
end if;
end loop;
end;
// | PROCESS: Save Changes to ACTs |
-- ACT
-- f01 = Test Type ( = ACT )
-- f02 = ACT permnum
-- f03 = ACT admindate
-- f04 = ACT testsite
-- f05 = ACT math
-- f06 = ACT english
-- f07 = ACT reading
-- f08 = ACT science
-- f09 = ACT composite
begin
for i in 1..htmldb_application.g_f01.count
loop
if htmldb_application.g_f01(i) = 'ACT' then
update act
set testsite = htmldb_application.g_f04(i),
math = replace(htmldb_application.g_f05(i), '', NULL),
english = replace(htmldb_application.g_f06(i), '', NULL),
reading = replace(htmldb_application.g_f07(i), '', NULL),
science = replace(htmldb_application.g_f08(i), '', NULL),
composite = replace(htmldb_application.g_f09(i), '', NULL)
where permnum = :GLOBAL_PERMNUM
and to_char(admindate, 'DD-MON-YYYY') = htmldb_application.g_f03(i);
end if;
end loop;
end;
Now, i can save SAT information (for that region), but i get this error when i try to save changes to the ACT region:
ORA-01403: no data found
? -
Using HTMLDB_APPLICATION.G_F01 in a stored procedure
I have a page with pl/sql function returning sql query report. The query works fine and produces a report with check boxes. The query looks like this:
SELECT HTMLDB_ITEM.CHECKBOX(1,material_code) export,
material_code, COUNT(*)
AS letters FROM du_materials
WHERE ... long where clause.
The query produces a nice report with checkboxes.
I placed a region button on the page which redirects to this URL:
#OWNER#.du_mailmerge.write_materials?user_id=871010501&one_many=MANY
The purpose of this stored procedure is to produce a file download.
The stored procedure looks like this:
PROCEDURE write_materials(user_id IN VARCHAR2,
one_many IN VARCHAR2) IS
BEGIN
FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
IF HTMLDB_APPLICATION.G_F01(i) IS NOT NULL THEN
write_mime_header(file_name=>HTMLDB_APPLICATION.G_F01(i) || '.csv');
write_table_data(HTMLDB_APPLICATION.G_F01(i));
END IF;
END LOOP;
END write_materials;
When I run the application and click the button, I get a blank page in the browser. Before I tried this, I used simple code that did not reference HTMLDB_APPLICATION and it worked fine. I have run some debugging code in the above procedure and find that HTMLDB_APPLICATION.G_F01.COUNT appears to be null or zero. There are no errors in the apache error log.
I have tried replacing HTMLDB_APPLICATION.G_F01.COUNT with
v('G_F01.COUNT'), that does not work either.
What's wrong? Is my syntax bad? Is the array not available to a stored procedure?Thanks much for your response. I was afraid of that.
I quess I will have to go with this fallback plan:
1. put code in page process to create file use UTL_FILE.
2. Using the techniques in the How-to file export/import, import the whole file to clob, then export it.
3. delete import from table
4. return to my page.
This forum is great. Thanks to everyone who reads and responds to us newbies with HTML DB. -
Htmldb_application array count 0 when it shouldn't be
This was working until I made modifications to the application, i.e. tabs, menus and such. It uses a manually built tabular form - that part works and displays with correct values, but when I try to access the array with a loop it appears to be empty.
I also have an item P3_WHERE_CLAUSE that runs a similar loop to build a where clause for validation. I modified it to debug as shown below.
Any hints greatly appreciated - can't figure out how I broke it.
Here's the query for the tabular form:
select
htmldb_item.select_list_from_query(
1,key_id,
'select key_id, object_key from
val_object_key k,
VAL_OBJECT o
where o.object_name = :P3_OBJECT_NAME
and k.object_id = o.object_id') Key_id,
htmldb_item.select_list_from_query(2,object_key,
'select object_key, object_key from
val_object_key k,
VAL_OBJECT o
where o.object_name = :P3_OBJECT_NAME
and k.object_id = o.object_id') Key,
htmldb_item.text(3,'',50) Value
from VAL_OBJECT_KEY k,
VAL_OBJECT o
where o.object_name = :P3_OBJECT_NAME
and k.object_id = o.object_id;
Here's the code to save the page information (several items in a cascading form and then it loops to include values from the tabular form). The loop does not execute.
DECLARE P_KEY_ID NUMBER;
kvs_id NUMBER;
BEGIN
select prov_id.nextval into kvs_id from dual;
insert into key_val_set kvs_id values (kvs_id);
for i in 1..htmldb_application.g_f01.count
loop
insert into key_value (KV_ID,KEY_ID,KEY_VALUE,KVS_ID)
values
prov_id.nextval,
htmldb_application.g_f01(i),
htmldb_application.g_f03(i),
kvs_id)
end loop;
INSERT INTO PROV_INSTANCE
CLASS_ID,
SOURCE_ID,
DATE_OCCURED,
KVS_ID
VALUES
:P3_CLASS_NAME,
:P3_SRC_NAME,
:P3_DATE_OCCURED,
kvs_id
commit;
END;
Here's the test loop:
begin
:P3_WHERE_CLAUSE := 'begin test';
for i in 1..htmldb_application.g_f01.count
loop
:P3_WHERE_CLAUSE := 'where '||i;
end loop;
return :P3_WHERE_CLAUSE;
end;Never mind - it was a page flow misunderstanding.
-
Hi there,
We are trying to reference data returned by a query using an array statement such as XX := htmldb_application.g_F01.count;
The value is always zero. Are we missing something?
ThanksHi Scott,
Correct.
We have say 2 columns FUND and EXCEL_FUND. A snippet of the query would look like;
select a.segment1 fund, '="' || a.segment1 || '"' excel_fund.....
they return 01 and ="01" for example.
We conditionally display 01 on the on-screen report but we want to export ="01" to excel so the leading zeros are not stripped out.. The browser displays the report region data 01 correctly. But we cannot export ="01" as it appears that unless you display the value you cannot export it(version 3.1).
So we have our own export to excel button which works if we re-run the query. But we do not want to re-run the query, we want to re-use the "result set" of the on-line report(sorry, i am not certain what all the terms are). Everyone seems to use the htmldb_application package but we don't know if the htmldb_application.g_F01 array item is loaded up by the app or do we have to do it? We are in a bit of a fog.
Any help is appreciated.
Thanks -
HTMLDB_APPLICATION.G_F01 has wrong value!
HTMLDB_APPLICATION.G_F01 has wrong value!
Hello again,
I have a search page in my app (here the user defines the search criteria) P1.
The page branches to P130, where the result is shown. This second page contains a region of type 'SQL Query (PL/SQL Function Body Returning SQL Query)'. The code for this dynamic query is 231 lines of code, so I want to spare you scrolling through it here . What it basically does is generating SQL QRY's such as the following:
select distinct(sq.SAMPLE_ID) XXX,
'ID: '||sq.SAMPLE_ID||'
' ||'Type: '||sq.SAMPLE_TYPE||'
' ||'Collection Date: '||sq.COLLECTION_DATE SAMPLE_INFO,
'Aliquots (T/A): '||to_char(sq.ALIQUOTS_TOTAL)|| '/' ||to_char(sq.ALIQUOTS_AVAILABLE)||'
' ||'Volume (T/A): '||to_char(sq.VOLUME_TOTAL,'990D00')|| '/' ||to_char(sq.VOLUME_AVAILABLE,'990D00') AVAILABILITY,
'Age: '||sq.PATIENT_AGE||'
' ||'Gender: '||sq.PATIENT_SEX||'
' ||'Bloodtype: '||sq.BLOOD_TYPE||'
' PATIENT_INFO,
DML_SERVICE.get_Diagnoses(sq.SAMPLE_ID) DIAGNOSES,
DML_SERVICE.get_Medications(sq.SAMPLE_ID) MEDICATIONS,
DML_SERVICE.get_Interferences(sq.SAMPLE_ID) INTERFERENCES,
DML_SERVICE.get_LabData(sq.SAMPLE_ID) LABDATA,
decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.text(1, '1', 1, 2)) ORDER_QTY,
decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.checkbox(2,sq.SAMPLE_ID)) ORDER_ME
from SEARCH_V01 sq
where sq.DIAGNOSIS = 'D-Dimer'
order by 1 desc
The DML_SERVICE functions just return a string(Varchar2). At the right side of the report I have two columns, one with a textfield (ORDER_QTY, default: 1) and one with a checkbox (ORDER_ME) for each line.
For each line where the checkbox is checked, a process (On Submit - after Comp and Val) places the order for the requested quantity (this is done by inserting an Order ID into the ALIQUOTS table -> see bold update statement below).
The process follows:
declare
alq_qty number;
alq_id number;
cnt number;
begin
cnt := 0;
for i in 1..HTMLDB_APPLICATION.G_F02.count
loop
select count(*) -- set alq_qty to number of available alq's
into alq_qty
from ALIQUOTS a
where a.SAMPLE_ID = HTMLDB_APPLICATION.G_F02(i)
and a.ORDER_ID = 0;
insert into D_DEBUG (ID, DD) values (1, 'wanted: ' || HTMLDB_APPLICATION.G_F01(i) || ' available: ' || alq_qty); -- REMOVE!!!
if alq_qty > to_number(HTMLDB_APPLICATION.G_F01(i)) then -- if there are enough alq's
alq_qty := to_number(HTMLDB_APPLICATION.G_F01(i)); -- set alq_qty to number of ordered alq's
end if;
for n in 1..alq_qty
loop
select min(ID)
into alq_id
from ALIQUOTS
where sample_id = HTMLDB_APPLICATION.G_F02(i)
and order_id = 0;
insert into D_DEBUG (ID, DD) values (1, 'alq_id: '||alq_id); -- REMOVE!!!
update ALIQUOTS
set order_id = :P130_SELECT_ORDER
where id = alq_id;
cnt := cnt + 1;
end loop;
dml_service.upd_sample_record(HTMLDB_APPLICATION.G_F02(i)); -- refresh data in SAMPLE table
end loop;
:P130_MSG := 'Assigned '||cnt||' aliquots to order: '||:P130_SELECT_ORDER;
end;
Now my problem is that this process does what it should, sometimes. When I enter 6 in one row and check the checkbox and enter 4 in another row and check that checkbox and then press SUBMIT, 10 aliquots are assigned to my order.
Sometimes.... the other times the process just orders 2 aliquots, one of each line and disregards the number entered in the textfield.
Or so it may seem: I added some lines to write debug info into D_DEBUG (see above.) From those entries you can assume that the content of HTMLDB_APPLICATION.G_F01(i) is in fact '1' when the process does its work. So I think the problem lies somewhere in the creation of htmldb_item.text(), (I went through the API of that htmldb_item again and again...)
Also: I can reproduce / recreate this error. It's totally weird: for some rows it (always) works and for some it (always) doesn't !!!
So, any help, any suggestion is really appreciated (I'm currently working on bringing the crucial part of this to marvel.oracle.com)
-David-
[Edited by: sleuniss on Jul 15, 2004 12:18 PM]
Changed subject line.Now the subjectline is right, but the indentation is gone.... :-(
again the SQL query:
select distinct(sq.SAMPLE_ID) XXX,
'ID: '||sq.SAMPLE_ID||'
' ||'Type: '||sq.SAMPLE_TYPE||'
' ||'Collection Date: '||sq.COLLECTION_DATE SAMPLE_INFO,
'Aliquots (T/A): '||to_char(sq.ALIQUOTS_TOTAL)|| '/' ||to_char(sq.ALIQUOTS_AVAILABLE)||'
' ||'Volume (T/A): '||to_char(sq.VOLUME_TOTAL,'990D00')|| '/' ||to_char(sq.VOLUME_AVAILABLE,'990D00') AVAILABILITY,
'Age: '||sq.PATIENT_AGE||'
' ||'Gender: '||sq.PATIENT_SEX||'
' ||'Bloodtype: '||sq.BLOOD_TYPE||'
' PATIENT_INFO,
DML_SERVICE.get_Diagnoses(sq.SAMPLE_ID) DIAGNOSES,
DML_SERVICE.get_Medications(sq.SAMPLE_ID) MEDICATIONS,
DML_SERVICE.get_Interferences(sq.SAMPLE_ID) INTERFERENCES,
DML_SERVICE.get_LabData(sq.SAMPLE_ID) LABDATA,
decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.text(1, '1', 1, 2)) ORDER_QTY,
decode(to_char(sq.ALIQUOTS_AVAILABLE), '0', null, htmldb_item.checkbox(2,sq.SAMPLE_ID)) ORDER_ME
from SEARCH_V01 sq
where sq.DIAGNOSIS = 'D-Dimer'
order by 1 desc
and the process:
declare
alq_qty number;
alq_id number;
cnt number;
begin
cnt := 0;
for i in 1..HTMLDB_APPLICATION.G_F02.count
loop
select count(*) -- set alq_qty to number of available alq's
into alq_qty
from ALIQUOTS a
where a.SAMPLE_ID = HTMLDB_APPLICATION.G_F02(i)
and a.ORDER_ID = 0;
insert into D_DEBUG (ID, DD) values (1, 'wanted: ' || HTMLDB_APPLICATION.G_F01(i) || ' available: ' || alq_qty); -- REMOVE!!!
if alq_qty > to_number(HTMLDB_APPLICATION.G_F01(i)) then -- if there are enough alq's
alq_qty := to_number(HTMLDB_APPLICATION.G_F01(i)); -- set alq_qty to number of ordered alq's
end if;
for n in 1..alq_qty
loop
select min(ID)
into alq_id
from ALIQUOTS
where sample_id = HTMLDB_APPLICATION.G_F02(i)
and order_id = 0;
insert into D_DEBUG (ID, DD) values (1, 'alq_id: '||alq_id); -- REMOVE!!!
update ALIQUOTS
set order_id = :P130_SELECT_ORDER
where id = alq_id;
cnt := cnt + 1;
end loop;
dml_service.upd_sample_record(HTMLDB_APPLICATION.G_F02(i)); -- refresh data in SAMPLE table
end loop;
:P130_MSG := 'Assigned '||cnt||' aliquots to order: '||:P130_SELECT_ORDER;
end;
-David- -
Access htmldb_application.g_f01 from Report Query ?
I want to have a search functionality built into the report itself, so, was trying to create a sql report as:
select htmldb_item.hidden(1,null) empno,
htmldb_item.text(2,null) ename,
htmldb_item.select_list_from_query(3,null,'select distinct job, job from emp') job,
htmldb_item.popupkey_from_query(4,null,'select ename, empno from emp',10) mgr
from dual
union all
select empno, ename, job, mgr
from emp
where empno = NVL(htmldb_application.g_f01(1), empno)
and ename = NVL(htmldb_application.g_f02(1), ename)
However, this gives an error saying "ORA-06553: PLS-221: 'G_F01' is not a procedure or is undefined".
I changed the radio button to parse query at runtime only to ensure that the collection gets created first, but even then during runtime it gives the same error. I tried to create two reports (to try conditional display) the first report contain the union clause, and the second report just containing select * from emp where empno = htmldb_appl....
even this is giving error.
Is there anyway to achieve this functionality ?Ok, I created hidden columns for :p1_empno, p1:ename, p1:job etc and in a submit process assigned them to the htmldb_application.g_f01, ...etc, and changed the query to
from emp where empno = nvl(:p1_empno, empno) and ....
this is working,
(a)Is there any better way to do it instead of creating these hidden columns.
(b)how can we toggle this htmldb_item.hidden, ..., row (search row) display ? clicking on an icon in the column header should either display this row and clicking it again should hide this row. -
How would I create a Summary Chart for the Current Year Using a Count by Month?
Post Author: MarkS
CA Forum: Charts and Graphs
I have a data set of 3 date fields. I would like to create a summary counting all of the occurrances of each of these dates per month, similar to using a SumProduct() command in excel.
For example, my data is as follows:
Registered Date | Application Date | Sale Date
1/1/2007 | 2/1/2007 | 2/20/2007
1/10/2007 | 2/1/2007 | 3/20/2007
2/20/2007 | 3/10/2007 | 3/20/2007
I would like to summarize this information by month as follows:
| Jan '07 | Feb '07 | Mar '07 | TOTAL
Registered | 2 | 1 | 0 | 3
Applications | 0 | 2 | 1 | 3
Sales | 0 | 1 | 2 | 3
TOTAL | 2 | 4 | 3 | 9
Is there any way to do this?Post Author: V361
CA Forum: Charts and Graphs
Yes, but it will require some effort. Group on "Sale Date" Change the group to group by month. You can then create a running total for "Registered Date","Application Date"," Sale Date" For Registered date, I used Field to summarize Registered Date, Type of summary was count, Evaluate use a formula, reset on change of group 1 (I only have one group, "Sale Date") The formula will look like this.
month ({Registered Date }) in [1,2,3,4,5,6,7,8,9,10,11,12]
You would build your other running totals (Counts) using the same methods,
Once you have these, you should be able to create your chart. -
MI02 : new items for a document with item already counted
Dear.
I try to insert new items for an inventory document.
This document have items already counted.
The system send this error message M7706 : Items already counted (no new items possible).
Do you know a solution to avoid this error message ?
Thanks.M7706 is a hard coded error message, you cannot control it via message attributes.
What you can do is to do a re-count via transaction MI11 with reference to this inventory document. In this case you will be able to add new items, however, you have to enter the counted amounts for the existing items again.
But in my opoinion it's easier to create a new PID as suggested by Jurgen. -
Consignment vs owned inventory for the same material/inventory (cycle count)
Hi All,
I am looking at ways within SAP that I could differentiate materials/inventory that are consignment and owned inventory...
We have a department that are experiencing difficulties performing cylce counts as they both owned and consignments parts and materials and it is currently done manually.
Is there a way for us to generate a single inventory that includes both owned and consignment in the same report?
Any help would be great!
Cheers!
WendellHi Wendell,
If you have batch management and WM, this should not be a problem.. In this case, you should be able to identify where each batch is located and if the batch is consignment or own.
If not, then execpt you separate the inventory in different storage locations, the inventory could be mixed.
Anyway, I recommend you to move this thread to SAP MM:
SAP ERP - Logistics Materials Management (SAP MM)
Kind Regards,
Mariano -
LX26, Quant for storage bin can not be counted
T code LX26 , executed for a WH/storage Type .The report displays some bins as Ready/Blocked or Overdue /Blocked and when trying to activate those for counting the error message flashes -
Quant for storage Types XXX can not be counted .
How can I unblock these bins and activate for cycle counting.Please helpyou must not have any open TO for this quant
the quant must have a positive quantity, negative quants cannot be counted
make sure that this quant is not included in any other still open count -
I'm running a dual boot environment with OSX and Win 7. Before upgrading to OS Lion I had three partitions setup, one for OS SL, WIn7 and a shared ExFAT volume for multual file sharing between the OSs(Worked great!). After upgrading to OS Lion my shared volume was blocked out from Windows but remained visible to Lion. The Partition boundaries appear to be currupted by the newly added "Recovery HD" Partition that comes along with the Lion installation. This inserted volume has also started a chain of error in Disk Untility indicating "Invalid Volume File Counts". This can be cleaned up by Disk Utility using the installation CD or ironically the Recovery HD partition. The repair is only good for one reboot than the invalid Volume error returns. Windows seems fine outside of the lost shared volume but if you try to format the free space left behind by the partition issue major issues happen. Formatted actually creats a Dynamic disk switch and toasts all three volumes. OS Lion seems to be a wounded animal as I now have to reboot twice to get Lion to load up after setting up bootcamp. The problem is the partitions and OS Lion new Recovery HD. What I need is a fix to stabilize the OS Lion partition and restore the shared volume.
PeteThere are hundreds of postings describing your error and how to resolve it so I won't rehash those here. Use the search at the top right of this page to search for your error.
But I will advise you that Windows 7 32bit will not work satisfactorily for you. You said you have 8GB ram. 32 bit Windows will not address more than about 2.5GB to 3GB of your ram. You need to install the 64 bit Windows 7 in order for Windows to use all your ram.
When you bought the retail Windows 7 operating system it should have had two disks in the package, one being 32 bit and the other being the 64 bit version of Windows 7. -
Unsolved STB billing for over a year now and counting
http://forums.verizon.com/t5/My-Verizon-Account-Residential/Being-charged-for-3-hd-boxes-instead-of-...
Please view post above made by me with a different handle back a few months ago. Of course, these verizon sites being consistently broken, I wasn't able to log in with my original forum handle no matter what I tried so I had to resort to make a new one.
I was assigned a VZ agent that tried to help me and kept on adjusting the bill monthly but never solved the root of the problem. I can't recall for sure but her name may have been Jessica and she may be on this forum.
This month again, the bill needs to be a adjusted due to the constant overcharge for a 3rd non-existent receiver.Put on a video or movie (which keeps the backlight on), and just set it on the desk and leave it playing until it goes off. Shouldn't take much more than a few hours.
-
How to apply condition for 3 countries out of 6 counties (in smartforms)
Moved to correct forum
hi friends,
i have a requirement in SMARTFORMS...
my requirement: i need to implement some logic which should effect only 3 countries out of 6 countries.
now i implemented my logic but the thing is how to restric only for 3 countries?
do i need to write the condition in program line like:
IS_BIL_INVOICE-HD_ORG-SALESORG = 'O110'
IS_BIL_INVOICE-HD_ORG-SALESORG = 'Y110'
IS_BIL_INVOICE-HD_ORG-SALESORG = 'W110'
or
do i need to write condition like:
IS_BIL_INVOICE-HD_ORG-SALESORG = 'O110'
OR
IS_BIL_INVOICE-HD_ORG-SALESORG = 'Y110'
OR
IS_BIL_INVOICE-HD_ORG-SALESORG = 'W110'
please guide me...
thanks in advance,
Edited by: Matt on Mar 23, 2009 10:09 AMHi,
your 2 (second) option (with the OR) is the right one.
Gr., Frank
added the SAP help for the operands to inform GURU RAM.
SAP Smart Forms: operand
Specification of a field name or operand
Use
Within a Smart Form a node and all inferior nodes are processed only if
the respective output condition is true. A condition can either be a
logical expression on field values or consist of events or position
queries in the form processing.
You can determine a condition as logical expression using a table
control. Each line of the table control consists of a field name, a
comparison operator, and a comparison value. The comparison value can
itself be a field name. As compariosn operators, the ABAP operators =,
<>, <, >, <=, >=, CP (contains pattern) and NP (not contains pattern)
are allowed.
All lines of the table control are linked with the logical AND. In
addition, you can use a pushbutton of the table control to insert an OR
link for comparisons. In the table control, it is displayed as line with
gray background. The Check function checks whether all field names that
appear in the comparisons are declared in the form interface or in the
global data of the form.
See also: Determining OutputConditions
Maybe you are looking for
-
OK, as always I waited before downloading a new OS and I'm sure glad I did. On the APP store I sorted comments by most critical...and WHOA...what is Apple doing? No support for Logic 9, MS Office? Is Apple only trying to reach the iphone/iTouch crowd
-
HT204053 upload photo from pc to iphone
upload photo from pc to iphone
-
Document Journal s_alr_87012287 - System date
Hi, A company was late to deliver the Document Journal. Is it possible to leave out the system date on the Document Journal? Thank you for your feedback. Kind regards, Linda
-
SP01: 300 downloads of SP01 PL03! Give feedback here - or open a new topic
Hello, 2005A SP01 PL03 has been downloaded by more than 300 times. Feedback about issues is rare. Usually this means that no major issues occured and that the information given (e.g. in the documentation of DB and UI changes + potential compatibility
-
SAP note 105621 -- Hiding Cost Conditions in Sales Document
dear experts: i am facing a issue regarding SAP Note 105621. in this note it says we need to implement user exit USEREXIT_FIELD_MODIFICATION USEREXIT_FIELD_MODIFIC_LEER USEREXIT_FIELD_MODIFIC_KZWI USEREXIT_FIELD_MODIFIC_KOP