Post insert error
hi all
i have a form for sale entry. i want to insert into an another table
when i save its contents.
i used a post insert trigger for this.
but the form has a detail block. and so this insert as many records as this block has.
the form has the following blocks.
sal_master(master block)
sal_id
sal_date
cust_id
sal_detail(detail block)
sal_id
qty
price
post insert trigger
declare
a number; -- ledger no
b number; -- customer id
c date; -- entry date
d number; -- credit
begin
-- insert into customer ledger
select nvl(max(l_id)+1,1)
into a
from cust_led;
b:= :sal_master.cust_id;
c:= :sal_master.sal_date;
d:= :ser_detail.total;
insert into cust_led (l_id, cust_id, e_date, credit)
values ( a, b, c, d);
exception
when no_data_found then
raise FORM_TRIGGER_FAILURE;
END;
on block level and form level the result is same.
i want to insert only one entry in the table for multiple records
in this form.
MUhammad Nadeem
marda (pakistan)
[email protected]
move this trigger to your sal_master(master block level) . this will only insert 1 record.
Similar Messages
-
Errors with post-insert trigger
I had a POST-INSERT TRIGGER here.but i encountered some problems.can someone help me with the errors?
begin
insert into user_acct
userid_n, user_m, coy_c, contact_n, emp_n,
work_loc_c, curr_passwd_t, prt_f, indv_pc_f, pc_deploy_c,
ext_email_addr_t, other_na_sys_t, status_c, status_rmk_t, upd_d)
values
(:user_acct.userid_n, :user_acct.user_m, :user_acct.coy_c, :user_acct.contact_n, :user_acct.emp_n,
:user_acct.work_loc_c, :user_acct.curr_passwd_t, :user_acct.prt_f, :user_acct.indv_pc_f, :user_acct.pc_deploy_c,
:user_acct.ext_email_addr_t, :user_acct.other_na_sys_t, :user_acct.status_c, :user_acct.status_rmk_t,
:user_acct.upd_d);
exception
when others then
clear_message;
Message('Insertion of Applicant Particulars failed');
SYNCHRONIZE;
RAISE Form_Trigger_failure;
end;
begin
insert into user_acct_na_detl
na_sys_c)
values
(:na_sys_cd.na_sys_c);
exception
when others then
clear_message;
Message('Insertion of Non-Application failed');
SYNCHRONIZE;
RAISE Form_Trigger_failure;
end;
when others then
null;
end;
the error:
Error 103 at line 31, column 3
Encountered the symbol 'WHEN' when expecting one if the following:
begin declare end exception exit for goto if loop mod null
pragma raise return select update while <an identifier>
<a double-quoted delimited-identifier><a bind variable><<
close current delete fetch lock insert open rollback
savepoint set sql commit<a single-quoted SQL string>
The symbol "exception"was substituted for "WHEN" to continue
Error 103 at line 2, column 1
Encountered the symbol "END"i delete the "END" already but when i compile again, i encountered some error again.
Error 370 at line 27, column
OTHERS handler must be last among the exception handlers of a block
Error 0 at line 1, column 1
Statement ignored -
Execution of ddl statement in post-insert trigger
hi,
I'm working on headstart 6.5. I wants to execute a DDL statement in post-insert-trigger.The problem is this trigger is executed in between pre-commit and post-forms-commit.In pre-commit the transaction is opened with a insert statement that is inserting "open" in field status which is having a deffered check constraint QMS_NEED_TO_CLOSE_TRANSACTION.In post-forms-commit it will check whether the transaction is open if yes will check the business rule will delete the data that was inserted into qms_transaction in pre-commit trigger and will close the transaction .
In between if i execute a DDl statement a commit will be performed on the insert statement written in pre-commit trigger.This will violate the check-constraint and we will get the error qms_need_to_close_transaction violated.
My business logic wants this statement to be executed at the post-insert trigger on the block.Is this possible??
Does anyone have face the same problem?Whts the workaround for the same?Hello,
You could use the execute_query after the commit_form called, by exeample in a KEY-COMMIT trigger.
KEY-COMMIT trigger
Commit_Form ;
Go_block( 'master_block' ) ;
Execute_Query ;Francois -
Dear All,
can anybody explain the difference b/w pre-insert and post-insert trigger ?
i need such example which process something that becomes possible in one trigger and no possible in other ?
Regards
Kashif ButtHere is an example. Please remove any syntax errors before running :-)
create sequence my_seq;
create table table_a
(id number(20) constraint pk_table_a primary key,
text varchar2(100)
create table table_b
(id number(20) constraint pk_table_b primary key,
a_id number(20) constraint fk1_table_b foreign key references table_a(id),
text varchar2(100)
Create a form with a block based on table_a with items "id" and "text"
"id" is on null canvas (not visible), put "text" on a canvas.
pre-insert:
select my_seq.nextval into :table_a.id;
This can't be done in post-insert. Then the insert will fail because it's the primary key and must be "not null"
post-insert:
insert into table_b(id, a_id, text)
values(my_seq.nextval, :table_a.id, 'Inserted automatically by post-insert');
This can't be done in the pre-insert trigger, because the foreign key constraint will require the record in table_a
to be inserted first. -
XML Publisher post-processing error 'java.io.FileNotFoundException'
Hi,
We are getting following XML Publisher post-processing error while running XML Publisher report.
It was working earlier but suddenly its erroring out.
[9/07/10 9:00:17 PM] [OPPServiceThread1] Post-processing request 559655.
[9/07/10 9:00:18 PM] [39177:RT559655] Executing post-processing actions for request 559655.
[9/07/10 9:00:18 PM] [39177:RT559655] Starting XML Publisher post-processing action.
[9/07/10 9:00:18 PM] [39177:RT559655]
Template code: XXHPOXPRRFLR
Template app: XXH
Language: en
Territory: 00
Output type: PDF
[9/07/10 9:00:18 PM] [UNEXPECTED] [39177:RT559655] java.io.FileNotFoundException: /apps/oracle/DEV/inst/apps/DEV_hlt439erplap001/logs/appl/conc/out/o559655.out (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:274)
at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:173)
[9/07/10 9:00:18 PM] [39177:RT559655] Completed post-processing actions for request 559655.
Please help me out to resolve this issue.
Thanks & Regards,
SagarikaHi,
java.io.FileNotFoundException: /apps/oracle/DEV/inst/apps/DEV_hlt439erplap001/logs/appl/conc/out/o559655.out (No such file or directory)Most probably this file is not created (since no changes have been done recently, so definitely it is not a permission issue), and if there are any log files generate at the client side it should help in investigating the issue.
Thanks,
Hussein -
Insert error message into session
hi all,
I need to Insert error message into the log of SM35 session.
1. I have created a BDC that creates a session in SM35.
2. The session is scheduled daily and gets executed automatically.
3. there is a scenario where the session should be stopped manually with a error message.
the system doesnt generate any error automatically for that scenario
can any one pls tell me whether its possible to put a manual error into SM35 session log ?
Thanks in Advance,
SanthosiniHi,
There's a few ways you could do this;
Construct your message first (i.e. combine the message text and variables into one string, then move this into the table)
or
Don't store the text, instead store the message ID, number and variable parts of the message. This has the advantage if you're running a multi-language system the log can be used by users of different languages.
Regards,
Nick -
SQL Insert Error Error in allocating a connection. Cause: No PasswordCreden
Friends,
While testing my connection in the Sun java Application Server , I get the following error .
"SQL Insert Error Error in allocating a connection. Cause: No PasswordCredential found "
Can somebody please guide ?
regards
DhirajIf you are using Netbeans, then this link might help:
http://forum.java.sun.com/thread.jspa?forumID=136&threadID=598423
Otherwise, have you try this ?
Verify your sun-ejb-jar.xml does not use default-resource-princinpal element:
<res-ref-name>jdbc/pdisasdb</res-ref-name>
<jndi-name>jdbc/pdisasdb</jndi-name>
<default-resource-principal>
<name>myname</name>
<password>geheim</password>
</default-resource-principal>
</resource-ref> -
I am getting ORA-20001: Seed insert error while seed translatable text step
Hi,
I am getting this error while English to Arabic translation in the Seed translatable text step
ORA-20001: Seed insert error: WWV_FLOW_ICON_BAR.ICON_IMAGE_ALT ORA-00001: unique constraint (APEX_030200.WWV_FLOW_TRANSLATABLE_TEXT_PK) violated
Can i get any suggetion from your side.
Thanks,
narDid you ever figure this out. Because I also have this error.
-
POSTING PERIOD ERROR WHILE DOING GR
Dear All,
I am facing error in posting period while doing GR -
1) Posting period 007 2010 is not open - For current date GR
2) Posting only lies in periods 2010/07 and 2010/06 in Company Code - For future date in 2010-08
3) Posting period 006 2010 is not open - For back date GR in 2010-06
Checked T Code MMRV - Ticked - Allow posting in previous per. (Still facing the same error)
Also as per MMRV -
Current period 07 2010
Previous period 06 2010
Last period in prev. year 12 2009
Please guide
VikasHi,
Check on it:-
COGI Posting period error
Re: Error in Opening the Posting Period.
http://www.sap-img.com/sap-sd/movement-type-posting-error-in-delivery.htm
pherasath -
Insert error in master-detail form
Probably a stupid question. When I populate the master block of
a master detail form from an LOV, I am asked to save the form.
Since the information is loaded from the LOV, there are no
changes to save. If I answer yes, it gives an Insert error due
to the primary key violation in the master block table. If I
answer no, it opens the detail block and gives the correct
information. The problem is that when I enter information into
the detail block and try to save it, I get the same error
message regarding the primary key violation in the master block.
The form works fine if I do not populate the master block from
the LOV (or from select statements in triggers). Any suggestions
will be appreciated.
LSHi,
Check for the form or block status.Looks like the status has
changed.Thats why u r getting the message.If any of the base
table item has changed then u will get such a message.Try
working on this an check it out.
Thanks
Vinod -
IDOC is posting with Errors in File to IDOC scenario
Hi,
I did the File to IDOC scenario for CREMAS . IDOC is posting with Errors .. i.e. in the status record it was showing 56- EDI: Partner profile inbound not available ..
If I manually process that IDOC in WE19 , then it was processing successfully.. and in the we19 it was showing Inbound Processing : Port Not Maintained but even though manually it was posting fine...
any ideas regarding this will be appriciated.....
Regards
BabuPlease check whether you had done the following assuming your doing File to Idoc
Settings in your Business service for the receiving system
Please specify the RFC detination, SAP System and Client of the Receiving System in the adapter specific detials.
Settings in R/3
WE20 - Add the partner profile for the particular message type cremas and process code.
Your statement
" and that same logical system name had given as Message Specific Attributes in the Sender Business Sevice parameters in I.D "
Please do mention R/3 Details in the receiver business service or system.
Thnz -
While excise posting, an error is coming "Balance in Transaction Currency"
Dear all
While capital excise posting, an error is coming "Balance in Transaction Currency" for the capital goods posting.
During the excise duty posting J1IEX our clint done some manuvall entry for excise duties so
at the time its 0.01 diffrence is coming in balance thats why we are not able to post the document.
so please can any one give the solution for this
regards
pramodhi
Check Excsie duties in "Excise Duty" Tab at Item Details level.
Kindly note that all the duties (BED, ECS and SECess) in case of RG23C Part II posting must be in EVEN numbers.
For e.g. Check whether SECess is 10.63 (ODD No) then make it either 11.00 or 10.64 or 10.62 i.e. EVEN No otherwise during Part II posting it will always show balance of 0.01
Check how much piase is the difference. Then you can decide how many values to be rounded off.
To avoid this type of problem better to ensure all amounts ( BED, Ecess and Hr Ecess) are in Even figures.
hope it clears
regards
kunal -
750GB Seagate External Drive - Disk Insertion error
I have two 750 GB Seagate External hard drives, which are daisy chained to my PowerMac G5. I was transfering files between external hard drives, when all of a sudden the computer crashed. Once I restarted, the computer gave a disk insertion error:
Disk Insertion
The disk you inserted was not readable by this computer.
The options are: "Initialize..." "Ignore" and "Eject"
One of the external hard drives is fine, the one which was directly hooked up to the computer. However, the drive that was daisy chained still gives this error. I have tried connecting the drive to another mac, but it still gave this error. I also tried connecting it to a PC, and it was detected, but it did not show up under "My Computer."
Is there a way that I could save or re-format the hard drive WITHOUT loosing the data?
Please let me know. This is very urgent. I have a lot of important data on the hard drive. Any help/ideas/suggestions are greatly appreciated. Thank you very much.Hello! Sometimes a large file transfer will lock or crash a computer. With a crash or hard restart the disk's directory is damaged and if disk utility can't repair it then DISKWARRIOR is about the only utility that can fix the problem. The data usually isn't gone. The disk's directory (road map) of where every piece of info is located on the drive has become corrupt hence there's nothing for it to find. Diskwarrior is the best utility for repairing the directory. Regular use of DW will prevent "most" disk problems as it's the directory that gets messed up rather than a physical problem with the disk in most cases. In cases where DW can't fix the problem DataRescue II can sometimes recover valuable data. Tom
-
LSMW IDoc error : APPLICATION DOCUMENT NOT POSTED with error 51
During LSMW matmas04 uploading i m getting error :APPLICATION DOCUMENT NOT POSTED with error 51
Can some one tell why ots coming so.to check errors check We05 or we02 they are same
in general i think that most of problem is relate to Dates if that your case check that you converted dates to internal format using conversion step i advice use like this function
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = ZHEADER-BEDAT
IMPORTING
DATE_INTERNAL = MBEPOH-BEDAT.
<Removed by Moderator>
Message was edited by: Marcelo Ramos -
Post-Install Error on EBS 12 - Login Page Error RW-50016 on Linux
Hi All,
Post-Install Error on EBS 12 - Login Page Error RW-50016 on Linux
Thanks in advance.set hostnme correctly
Maybe you are looking for
-
There isn't Org. Search in free search of PERNR on PNP Screen with report
Hi experts, I create a standard PNP screen with HR report, but i find there isn't org. structure search in free search for PERNR . Should I do configure anywhere to use the org. struture search of PERNR ? Thanks a lots. Yoga.
-
Cannot enable keyboard & character viewer
After a fresh install of 10.7.5, I cannot enable the keyboard & character viewer. Neither the checkbox will stay checked, nor does the option appear in the input sources menu... Any ideas? Thanks, Klaus
-
Configuration "Internet Sales" 1.5
Hi, I install the producto "Internet Sales" 1.5 (BP_ERP5SAL) in the stack Java CRM system. whe logon user with role Internet Sales show messages error: Portal runtime error. An exception occurred while processing your request. Send the exception ID t
-
Hello SAP Guru's, We are getting a Pricing Error in the Overall Proccessing status in the Document Flow against our Invoice. This error shown below is something we have never seen before ,I could see that the Previous Sales order which was created on
-
Transport not implemented - error in transport
Hi experts, I'm facing a problem with the transport of a workflow : it 's creating following error : Object R3TRPDWS20000075 is in repair status. Therefore, it cannot be imported. System response The object is not imported. Procedure If you still wan