Updating Database table through Format Trigger in 10g Reports
Dear Users
I'm using 10g Reports Rel.2. I'm using a report column as a hyperlink using SRW.Set_Hyperlink. I've taken 2 actions through this hyperlink. 1stly I'm callin a report from this link n 2ndly I'm running an update statement after the hyperlink statement like below:
SRW.Set_Hyperlink('....');
Begin
Update table_name Set
column_name=value;
End;
So the 1st statement is running well i.e report is being called but update statement is not executing. I've tried this both in HTMLCSS and PDF formats but Update statement is not executing. I was doing the same job successfully in 6i reports behind a button (except that report was being called using Srw.Run_Report). Is there any thing different in 10g reports for this job ???
I'm using 'Update statement' behind the hyperlink in different situations for example I wish that a report should print only through a button or a hyperlink and its destination should be a printer. 2ndly I want to keep record of printed reports through updating a field against printed records in a table so that user should not be able to print a data again and again. I was doing this successfully in 6i behind a button but in 10g, report is being called through hyperlink but update statement below the report calling code does not execute.
Have u understood the situation
Similar Messages
-
Update database table through table control
Dear friends
i have to update entered data in table control to data base table please suggest some modification in my coding for the same
following is my coding
report zrb_ins_data.
data wa_tmp_rebset type zrb_hed.
data wa_tmp_rebset1 type zrebate_items.
types:begin of st_hdr,
bukrs type zrb_hed-bukrs,
sch_typ type zrb_hed-sch_typ,
sch_desc type zrb_hed-sch_desc,
sch_no type zrb_hed-sch_no,
vtweg type zrb_hed-vtweg,
vkorg type zrb_hed-vkorg,
vkbur type zrb_hed-vkbur,
vkgrp type zrb_hed-vkgrp,
spart type zrb_hed-spart,
regio type zrb_hed-regio,
ort02 type zrb_hed-ort02,
ort01 type zrb_hed-ort01,
kunnr type zrb_hed-kunnr,
konzs type zrb_hed-konzs,
matkl type zrb_hed-matkl,
matnr type zrb_hed-matnr,
lifsk type zrb_hed-lifsk,
shtyp type zrb_hed-shtyp,
from_date type zrb_hed-from_date,
to_date type zrb_hed-to_date,
hkont type zrb_hed-hkont,
aufnr type zrb_hed-aufnr,
end of st_hdr.
types : begin of st_itm,
item_id type zrebate_items-sch_no,
sch_no type zrebate_items-sch_no,
from_dat type zrebate_items-from_dat,
to_dat type zrebate_items-to_dat,
type type zrebate_items-type,
qty_per_rate type zrebate_items-qty_per_rate,
key1 type zrebate_items-key1,
curr_com type zrebate_items-curr_com,
key2 type zrebate_items-key2,
qty_per_rate1 type zrebate_items-qty_per_rate1,
curr_com1 type zrebate_items-curr_com1,
end of st_itm.
data:it_hdr type table of st_hdr with header line,
wa_hdr type st_hdr,
it_itm type table of st_itm with header line,
wa_itm type st_itm.
controls ztbl type tableview using screen 1000.
*CALL SCREEN 1000.
*& Module STATUS_1000 OUTPUT
text
module status_1000 output.
set pf-status 'SYMBOL'.
set titlebar 'xxx'.
endmodule. " STATUS_1000 OUTPUT
*& Module USER_COMMAND_1000 INPUT
text
*module USER_COMMAND_1000 input.
*& Module get_data OUTPUT
text
*& Module user_command_1000 INPUT
text
module user_command_1000 input.
case sy-ucomm.
when 'EXEC'.
perform get_data.
endcase.
endmodule
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form get_data .
move-corresponding wa_hdr to wa_tmp_rebset.
modify zrb_hed from wa_tmp_rebset.
move-corresponding wa_itm to wa_tmp_rebset1.
wa_tmp_rebset1-item_id = 'TS1234'.
wa_tmp_rebset1-sch_no = wa_hdr-sch_no.
wa_tmp_rebset1-from_dat = wa_itm-from_dat.
wa_tmp_rebset1-to_dat = wa_itm-to_dat.
append wa_itm to it_itm.
modify zrebate_items from wa_tmp_rebset1.
endform.hi,
Refer to this link...you'll get the idea..
how to update dbtab from table control?
Re: How to update a DB from a table control.
Edited by: avinash kodarapu on Dec 27, 2008 12:36 PM -
I have 1 million records in application server and I want to update database table from that.
Is UPDATE statement the best technique to do it.
Just wanted to know if there is any other better tehcniques.
Also i want to write the errors to job log. How can we do that?
Regards,
DNPIf they are all new records or all changes, it would be best to use INSERT or UPDATE. You will also want to do mass inserts/changes using an internal table. Since you have so many records, you will probably have to do this in chunks in order to avoid dumping on the rollback area.
Rob -
Updating HRP table through abap codes - is it correct
Hi all,
In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
REPORT ZHRPAR0005 .
TABLES: HRP1000, HRP1001.
DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
IT_1001-OTYPE = 'S'.
APPEND IT_1001.
INSERT INTO HRP1001 VALUES IT_1001.
Thanks
RibhuHi Ribhu..
there are various FMs available for this purpose..
use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
then some related table might not be updated..
So use FMs..
RH_COPY_INFTY
RH_CUT_INFTY
RH_DELETE_INFTY
RH_INSERT_INFTY
RH_INVERT_RELA_INFTY
RH_UPDATE_INFTY
<b>For IT 1001 </b>
RH_CUT_INFTY_1001_EXT
RH_CUT_INFTY_1001_EXT_GENERIC
RH_DELETE_INFTY_1001_EXT
RH_DEL_INFTY_1001_EXT_GENERIC
RH_INSERT_INFTY_1001_EXT
RH_UPDATE_INFTY_1001_EXT
RH_BASE_READ_INFTY_1001
RH_READ_INFTY_1001
RH_READ_INFTY_1001_EXT
RH_READ_INFTY_1001_EXT_ONLY
Reward if useful
Regards
Prax -
Updating HRP tables through abap code- is it correct?
Hi all,
In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
REPORT ZHRPAR0005 .
TABLES: HRP1000, HRP1001.
DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
IT_1001-OTYPE = 'S'.
APPEND IT_1001.
INSERT INTO HRP1001 VALUES IT_1001.
Thanks
RibhuHi Ribhu..
there are various FMs available for this purpose..
use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
then some related table might not be updated..
So use FMs..
RH_COPY_INFTY
RH_CUT_INFTY
RH_DELETE_INFTY
RH_INSERT_INFTY
RH_INVERT_RELA_INFTY
RH_UPDATE_INFTY
For IT 1001
RH_CUT_INFTY_1001_EXT
RH_CUT_INFTY_1001_EXT_GENERIC
RH_DELETE_INFTY_1001_EXT
RH_DEL_INFTY_1001_EXT_GENERIC
RH_INSERT_INFTY_1001_EXT
RH_UPDATE_INFTY_1001_EXT
RH_BASE_READ_INFTY_1001
RH_READ_INFTY_1001
RH_READ_INFTY_1001_EXT
RH_READ_INFTY_1001_EXT_ONLY
Reward if useful
Regards
Prax -
How to update database table !!!
hi all,
Please advice how to update database table with certain cndition needs to be checked.
Please consider below scenario.
have used enqueu and dequeue function to lock entries and also i have used BAPI so considering that return parameter . i want to update table
/tdk/st0027.
1. I want to update database table
2. there are certain condition needs to be checked like ,
loop at it_final into wa_final.
th_return-type = 'S'.
if th_final-vbeln = /tdk/st0027-vbeln and
th_final-posnr = /tdk/st0027-posnr and
th_final-etenr = /tdk/st0027-sdslno.
above condition which i need to check .and need to append below system fields need to be appended in table.
th_final-prstsind = '20'.
th_final-chgdate = g_date.
th_final-chgtime = g_uzeit.
th_final-chgprog = g_cprog.
th_final-chguser = g_uname.
append th_final to td_final.
update /tdk/st0027 FROM th_final.
endif.
endloop.
but i am getting error saying that "The type od database table and work area (TH_FINAL) are not unicode convertible"?
I am not able to understandwhat would be the solution for this ?
Thanks and regards,
Prasad K. NAralkarThe error occurs in the UPDATE statement included in the code. In this statement it is seen that there is a mismatch of structure defined for the DDIC table /tdk/st0027 and that of your work area th_final.
try to create a structure w.r.t the DDIC table.
Eg: DATA: wa_temp TYPE /tdk/st0027.
MOVE-CORRESPONDING th_final TO wa_temp.
Then try to UPDATE using the temporary work area i.e wa_temp which has structure similar to that of the database table. -
Enqueue and Dequeue before updating Database table
Hi all,
We are updating database tables using INSERT, MODIFY and UPDATE statements. Since many people will be running the application at the same time we need to lock the table before updating database table. So we need to use ENQUEUE and DEQUEUE functionality for this purpose.
Can any plz explain what are the steps we should follow now?
Thanks in advance.Hi,
Any Database access should carefully handled as multiple applications may be accessing the database at the same time. To read a record from the database you don't need to implement a lock, but to write you need not only locks but also ideally should use the Update Function Modules to comply SAP "All or Nothing" Principle. This will prevent data inconsistency of the database and the data will be proper state. You need to use the COMMIT WORK and ROLLBACK WORK in you code to handle the consistency part of the database.
The best design approach would be seperate the Database Layer completely from the business layers. This will make your code robust and easy to maintain.
As, for the Locking Concepts, you will get multiple resources from SDN as how to create Locks and implement the Locking modules in your code. But more than that what matters is why and how to implement the SAP Locking concepts to make your application run better.
Have a look at the following link
http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
Hope this helps.
Thanks,
Samantak. -
Doubt in updating database table
hi all
i want to modify values ztable from a internal table ....
for eg : the ztable contains matnr and accept_qty
matnr qty
mat01
mat02
i need to modify qty of the table .. i am using where condition (ie modify where matnr = ) but where condition is not working for database tables .... how to proceed with this ..
thanks
lokeshhi,
before that :- modify statemnt will modify a record if there is record having the same key like that of record in work area.
if there is no record in itab with key of work area record, it will insert a new record in itab.
look this sample code.
*modify internal table
loop at itab into wa.
wa-field1 = data1.
wa-field2 = data2.
wa-field 3= data3.
modify itab from wa transporting field1 field2 field3 where key_field = wa-keyfield. "there shuld not be any chang in key field.
endloop.
*now update database table
*work area and data base structure shuld be same type
if itab[] is not initial.
modify ztable from table itab.
endif.
rgds
anver
if hlped pls mark points -
How does SAP updates MKPF Table Through TCODE MB0A
Hello There,
how does SAP updates MKPF Table Through TCODE MB0A ( POST GOODS RECEIPT )? I tried to debug the same by posting GR, but could not figure out.
Awaiting Reply
SantoshHi ,
These are the table that are updated through the MB0A ,,
DGESV DMAEX DMAKT DMAPE
DMARM DMEAN DMKAL DMLAN
DPROW DQMAT DUNGV MARA
MARC MARD MBEW MFHM
MLGN MLGT MPGD MPOP MVKE,
MCHA, MCHB, MCHD.
Regards,
Bharani -
PL/SQL Trying to update a table through trigger on the same table
Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
Message was edited by:
user625855CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
DECLARE
current_transport_id NUMBER;
check_value NUMBER;
check_block_id NUMBER;
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
current_transport_id := get_curent_trans_id; --function that gets the current transport_id
check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
IF check_value = 1 AND check_block_id = 0 THEN
create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
ELSE
null;
END IF;
END block_id_trigger;
Ok, I cleaned the code somewhat.
user625855 -
Updating values in database table through Transaction
Hi,
Actually We have one transaction named EWAWA01. In that when we display the values from the transaction, there is a netweight field. The transaction displaying netweight values, but that value is not updated in the database table named EWA_WA_WEIGHPROC. How can i update that netweight value in the table.data:v_v_EWA_WA_WEIGHPROC type (v_EWA_WA_WEIGHPROC lenth) c.
decleare the data in charter type.
after pass the data charter type.
v_EWA_WA_WEIGHPROC = EWA_WA_WEIGHPROC
update db. -
How to find out who updated database tables
Hi
We are using Oracle Database 10g Release 10.2.0.4.0.
A user, via pl/sql developer, has been updating data on our database. This resulted in certain reports not balancing. At that time, we did not have database triggers on the tables concerned. We now need to go back at least a month or more to see who had updated these tables. We have a username, is there any script that we can use? How accurate is v$active_session_history? Would it give us all the info we need?781424 wrote:
Hi
We are using Oracle Database 10g Release 10.2.0.4.0.
A user, via pl/sql developer, has been updating data on our database. This resulted in certain reports not balancing. At that time, we did not have database triggers on the tables concerned. We now need to go back at least a month or more to see who had updated these tables. We have a username, is there any script that we can use? How accurate is v$active_session_history? Would it give us all the info we need?It is little easy to know with AUDITING, or use Log miner to analyze log files. -
Backing Up Database Table and Records in Oracle 10g
Hi All,
I created database for my company with Oracle 10g Database Server and want to backup all my database tables and records within (i.e creating another username inside the data and transfer them) and outside (i.e transfering them in another destination outside the database server) the database. Could you please instruct me on how to achieve?
I look forward to hearing from you all.
Thank you.
JcHi, use RMAN utility
do this
rman target sys/*** nocatalog
run {
allocate channel t type disk;
backup
format '/app/oracle/backup/%d_t%t_s%s_p%p'
(database);
release channel t;
{code
Also read backup and recovery guide at http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/toc.htm
regards -
Updating a table through a manually created tabular form does not work.
Hi Friends,
I don't know why the "On submit - After computations and validations" process does not update the referenced table. May I miss something. Here is my source :
select
apex_item.hidden(1,eqp_id) id,
apex_item.hidden(2,tcs_tcs_id) tcs,
apex_item.text(3,eqp_equip_name,50) name,
apex_item.text(4,eqp_equip_ident,50) ident,
apex_item.text(5,eqp_equip_type,15) type
from equip_physical
where tcs_tcs_id = :P1_TCS_ID
and here is the process source
FORALL i IN 1..apex_application.g_f01.count
UPDATE equip_physical
SET eqp_equip_name=apex_application.g_f03(i),
eqp_equip_ident=apex_application.g_f04(i),
eqp_equip_type=apex_application.g_f05(i)
WHERE eqp_id=apex_application.g_f01(i);
No error message is displayed and my success message associated to the process is displayed. But the modified text field value is erased and the database table is not updated.I'd call it a bug/missing feature.
It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
I'd file this with Oracle Support and see what they say.
Include a link to this thread and your workspace login information.
I got something to work by: (probably not what you want.)
using the C004 column directly. (I just added it to the SQL code)
setting the column's attribute "Display As" to "Date Picker"
setting the column's attribute "Number /Date Format" to DD-MM-YYYY
I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
MK -
CRUD using ADF fails to update database table
Hi All,
I am very new to ADF and JDev. I am using JDev 11.1.1.2.0 and oracle 10g DB.
I have created the required
1. model, view control, Data control files using JDev for a DB table.
2. .jspx file that has a 'panel accordin' and a 'panel formLayout' layouts to display the required table fields on the page.
I am using Panel accordin layout to display the data with navigators buttons and works fine.
In Panel Form layout, after displaying the fields I have added "Submit" button. I have bound this button with "Commit" operation by simple drag and drop.
PS: I have added the fields by simple drag drop of the data control file mapped to the table in question.
On running the page I find things work fine till I want to use the submit button. It just updates the UI front but when I verify in my database table I find that it has not been updated.
I am clueless. Pls guide.
A site with step - by - step end to end development will be very great.
Waiting desparately to get this solved.
Thanks all
Edited by: user8925296 on Jan 16, 2010 2:13 AMYou need to be careful. Submit and committing to the database are two different things.
Submit on a page (and autoSubmit the property) are only posting the changes you typed into the field, back down to the application server. NOTHING is happening with the database at this point. So the applications's internal "cache" of records (using something like ADF BC) is holding the changes but the database doesn't know anything. So if you quit now, no changes will go to the database.
These changes onlyget submitted down to the app server when you do some sort of action like press a button. Simply navigating fields will be doing nothing back to the app server. If you add autoSubmit then you will automatically submit the changes on that field down to the app server when you leave the field (but again, this is not touching the database)
You have to explicitly add a COMMIT operation to save those changes to the database.
Maybe if you try in a simple EMP example and send us your findings we can help direct you further.
Regards
Grant
Maybe you are looking for
-
Multiple Apple Tv's One Mac.
If I have three Apple tv's will I be able to sync from one mac? With the new movie rental format if we rent a movie on one apple tv will we be able to see it on the other two in other rooms?
-
IPhone 5 calendar not syncing with iCloud
When I look for Settings>Mail,Contacts,Calendars>Default Calendar I do not have a "Default Calendar" option. I have also noticed the iPhone calendar only has one of my four calendars on my iCloud account and will not let me add the others. It is not
-
Is it possible to replace a 17" screen i know the 17' is now deplete
Hi The coating has started to come off my screen so need it replacing. I have the 17" macbook pro retina screen, i know they don't do the 17" mac anymore but wondered if there is any stock that is kept for such replacements. Many thanks Tracey x
-
Inventory Management (0IC_C03) cube
When I carry out delta loads to the Inventory Management (0IC_C03) InfoCube do I need to compress these delta loads with No Marker Update? Thanks
-
Accessing Java Classes from Webservice Stubs
So far I have been able to call a web service and copy the appropriate directories and files to the designated class path. I can also successfully access a class file like this: MyObject = CreateObject("java", "ca.x.y.z.TestCollection.TestItem"); Ho