RollBack Transaction using UDO
Hi
I want to perform some validation on MY UDO form. But problem is if i entered some wrong value into our form then what happen, it shows the alert and saved data also. <b>Is it possible to stop this transaction</b> , if yes how???. Plz suggest
Hi Pankaj,
Not sure what you mean exactly. If you say it shows the alert, do you have a message that shows when you click the add/update button. If so, you can simply avoid SBO from processing the transaction by setting the BubbleEvent variable to false. This variable is passed in with your item event.
Hope it helps,
Adele
Similar Messages
-
Is "SET TRANSACTION USE ROLLBACK SEGMENT" only a hint
I have two users, one makes some inserts in a table.
The other makes a select which visits many rows.
I have a big rollback-segment.
To ensure, both users use this rollback-segment I created a logon-trigger:
CREATE OR REPLACE TRIGGER a_logon AFTER LOGON
ON DATABASE
WHEN ( USER IN ( 'SCOTT', 'BOB' ) )
BEGIN
SET TRANSACTION USE ROLLBACK SEGMENT rbs_big;
END;
But I still get "snapshot to old" messages from the select, which contains the name off an other rollback-segment in the message.
The trigger really fires, i tested it by adding an insert-statement to a log-table.
What`s wrong ?The set transaction use rollback segment lasts only until you commit or rollback first time and all other transactions in that session will not be forced to that rbs anymore. Other possible solution could be that other users are accessing same tables / updating them so those sessions can't keep the read consistent image available anymore for your sessions.
-
Set Transaction Use Rollback segment
Hi everybody. Does It make sense issue a "set transaction use rollback" for a single query that do not update, insert or delete. The trouble is that I get e "SnapShot too Old" for a query that just do a query.
Thanks!No, If you are not making any modifications then you do not generate rollback (or even a transaction to my knowledge). The SNAPSHOT TOO OLD is because a different session has run through the rollback for the read consistent view you need (either because someone made changes to a table you are reading or from delayed block cleanout). Delayed block cleanout is a pretty complicated scenario so I'll leave it to the Oracle documentation to explain that. Just be aware that even if nobody has made changes to the table since you started your query you can still get SNAPSHOT TOO OLD. Thankfully, 9i helps elleviate this somewhat with the introduction of UNDO TABLESPACES.
Richard -
TRANSACTION을 ROLLBACK SEGMENT에 할당하는 방법(SET TRANSACTION USE)
제품 : ORACLE SERVER
작성날짜 : 2003-04-04
TRANSACTION을 ROLLBACK SEGMENT에 할당하는 방법
==============================================
(SET TRANSACTION USE ROLLBACK SEGMENT)
Purpose
Batch job 등을 사용할 때 특별히 크게 만든 rollback segment를 사용하도록
할 수가 있다. transaction에 특정한 rbs를 지정하는 방법을 알아보자.
Explanation
Oracle은 다음과 같은 규칙에 의해 각 Transaction이 사용하는 Rollback
segment를 결정한다.
1. Active Transaction의 수가 가장 작은 Rollback Segment에 할당한다.
2. 만약 1의 조건에 만족하는 Rollback segment가 하나 이상이면, 가장
마지막에 할당된 rbs 다음의 rbs를 할당한다. 이것은 undo 기능을 더
오래 지속시키도록 해 준다.
그러나, Application이 큰 rollback segment가 필요하다면 위와 같이
자동적인 rollback segment의 할당이 아닌 Manual하게 특정 rollback
segment를 할당 가능하다.
다음의 방법을 사용한다.
1) 큰 rollback segment를 만든다. 큰 rollback segment 를 만들기
위해서는 rbs tablespace에 영역이 충분히 커야 하므로 필요할 경우
tablespace를 확장하는 작업을 한다.
<tablespace 확장>
$ sqlplus system/manager
sql> alter tablespace rbs add datafile '?/rbs1SID.dbf' size 100m;
<rollback segment 생성>
sql> create rollback segment big_rbs storage(initial 10m next 10m)
tablespace rbs;
sql> alter rollback segment big_rbs online;
2) Transaction 를 assign 한다.
<sqlplus>
SQL> set transaction use rollback segment big_rbs;
<pro*c>
exec sql commit work;
exec sql set transaction use rollback segment big_rbs;
<forms>
dbms_transaction.use_rollback_segment('big_rbs');
이와 같이 지정하면 이후에 commit 또는 rollback이 일어날 때까지
한 transaction에만 해당된다. -
Java.sql.SQLException: Cannot call rollback when using distributed transac
Hi all,
I am getting the below exception trace when I tried to rollback the data in WLI.I am getting the db connection Object from DBControl.
java.sql.SQLException: Cannot call rollback when using distributed transactions
at weblogic.jdbc.wrapper.JTAConnection.rollback(JTAConnection.java:313)
at controls.DailyFeedFileJavaImpl.excuteBatch(DailyFeedFileJavaImpl.jcs:
904)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
:371)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
3)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
6)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:381)
at $Proxy59.excuteBatch(Unknown Source)
at QnbDailyFeedProcess.feedFileJavaObjExcuteBatch(QnbDailyFeedProcess.jp
d:274)
at QnbDailyFeedProcess_wf$ImplControlSend15.invoke(QnbDailyFeedProcess_w
f.java:146)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.java:32)
at com.bea.wli.bpm.runtime.ProcessState.executeInternalCallback(ProcessS
tate.java:726)
at QnbDailyFeedProcess_wf$_ProcessState.executeInternalCallback(QnbDaily
FeedProcess_wf.java:311)
at com.bea.wli.bpm.runtime.ProcessState.executeInternalCallback(ProcessS
tate.java:685)
at com.bea.wli.bpm.runtime.ProcessState.processNodeOrchestration(Process
State.java:681)
at sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
:371)
at com.bea.wli.bpm.runtime.JpdInternalDispMethod.invoke(JpdInternalDispM
ethod.java:87)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
3)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
6)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:24shanmuga gomathi nayagam wrote:
Hi all,
I am getting the below exception trace when I tried to rollback the data in WLI.I am getting the db connection Object from DBControl.
java.sql.SQLException: Cannot call rollback when using distributed transactions
at weblogic.jdbc.wrapper.JTAConnection.rollback(JTAConnection.java:313)Hi, Ideally, you should obtain the Transaction object and roll it back/ set it
to rollback only.
Joe
at controls.DailyFeedFileJavaImpl.excuteBatch(DailyFeedFileJavaImpl.jcs:
904)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
:371)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
3)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
6)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:381)
at $Proxy59.excuteBatch(Unknown Source)
at QnbDailyFeedProcess.feedFileJavaObjExcuteBatch(QnbDailyFeedProcess.jp
d:274)
at QnbDailyFeedProcess_wf$ImplControlSend15.invoke(QnbDailyFeedProcess_w
f.java:146)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.java:32)
at com.bea.wli.bpm.runtime.ProcessState.executeInternalCallback(ProcessS
tate.java:726)
at QnbDailyFeedProcess_wf$_ProcessState.executeInternalCallback(QnbDaily
FeedProcess_wf.java:311)
at com.bea.wli.bpm.runtime.ProcessState.executeInternalCallback(ProcessS
tate.java:685)
at com.bea.wli.bpm.runtime.ProcessState.processNodeOrchestration(Process
State.java:681)
at sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
:371)
at com.bea.wli.bpm.runtime.JpdInternalDispMethod.invoke(JpdInternalDispM
ethod.java:87)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
3)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
6)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:24 -
BINDING.JCA-12510 JCA Resource Adapter - Cannot call rollback when using di
Hi,
i'm facing a simillar issue with dbadapter while trying to insert a record.
The issue that I'm facing is: (BINDING.JCA-12563)
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: http://InsertEmployee.TestEmp. Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
I faced the same issues that have been posted in this thread before but this is a new one I'm seeing.
Following are the configurations that I'm using.
WEBLOGIC ADMIN CONSOLE
JDBC datasources
General tab:
JNDI Name: jdbc/SOADataSource
Connection Pool tab:
URL - jdbc:oracle:thin:@localhost:1522/XE
Driver Class Name - oracle.jdbc.xa.client.OracleXADataSource
Properties - user=SATRA_SOAINFRA
oracle.net.CONNECT_TIMEOUT=10000
Deployments
Inside DbAdapter - Configuration
The general tab shows blank values for 'Native lib dir' and 'JNDI name' fields. Is this normal or I need to populate values into these.
Inside Outbound Connection Pools the javax.resource.cci.ConnectionFactory created an entry 'eis/DB/10gXE_DBCon'
following is the settings for dataSourceName property
dataSourceName java.lang.String jdbc/SOADataSource
I have kept the value for xADataSourceName as blank as giving the same value of 'jdbc/SOADataSource' throws error.
The JNDI value that I'm using while creating the database adapter from Jdev is eis/DB/10gXE_DBCon where 10gXE_DBCon is the database connection name.
Can you please tell me what is the issue and where I'm going wrong.
Thanks in advance,
SatrajitHi Sunil,
I followed your advice and did the changes, that error has gone but a new error is popping up.
BINDING.JCA-12563 Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertEmployee.TestEmp]. Caused by java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist . ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
The name of the table i'm inserting to is test_emp and it exists in the database.
the .jca file for dbadsapter is like
<adapter-config name="FileToDB_DBAdp" adapter="Database Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
<connection-factory location="eis/DB/10gXE_DBCon" UIConnectionName="10gXE_DBCon" adapterRef=""/>
<endpoint-interaction portType="FileToDB_DBAdp_ptt" operation="insert">
<interaction-spec className="oracle.tip.adapter.db.DBWriteInteractionSpec">
<property name="DescriptorName" value="FileToDB_DBAdp.TestEmp"/>
<property name="DmlType" value="insert"/>
<property name="MappingsMetaDataURL" value="FileToDB_DBAdp-or-mappings.xml"/>
<property name="DetectOmissions" value="true"/>
<property name="GetActiveUnitOfWork" value="false"/>
</interaction-spec>
</endpoint-interaction>
</adapter-config>
and the .xsd file for dbadapter is
<?xml version = '1.0' encoding = 'UTF-8'?>
<xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/FileToDB_DBAdp" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/FileToDB_DBAdp" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="TestEmpCollection" type="TestEmpCollection"/>
<xs:complexType name="TestEmpCollection">
<xs:sequence>
<xs:element name="TestEmp" type="TestEmp" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TestEmp">
<xs:sequence>
<xs:element name="empid" type="xs:decimal" nillable="true"/>
<xs:element name="name" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="designation" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="salary" type="xs:decimal" minOccurs="0" nillable="true"/>
<xs:element name="deptno" type="xs:decimal" minOccurs="0" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
If I change element name from 'TestEmp' to 'Test_Emp' in the .xsd file,
I'm getting the following issue ...
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: Could not create/access the TopLink Session. This session is used to connect to the datastore. Caused by java.lang.NullPointerException. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
I'm confused why does it take the table name as TestEmp and not as Test_Emp.
Regards,
Satrajit -
Different rollback segment used. why?
Hi. I am trying to use rollback segment RB6 in a delete process in a stored procedure using SET TRANSACTION USE ROLLBACK SEGMENT RB6;
However, when the procedure is called and performed, an error is thrown:
ORA-01562: failed to extend rollback segment number 2
ORA-01650: unable to extend rollback segment RB2 by 128 in tablespace my_table_space
If you notice, the error refers to segment RB2. I have not set RB2 as a rollback segment in this procedure. How is it possible? I am using RB6 and now it's throwing an error regarding RB2? Please help. Thanks.It depends on where in the code you SET TRANSACTION, when you call the procedure, where delete transaction starts and where it ends. i.e does the delete part of the code run within that same windows?
The database can decide which rollback segment to use for different transactions.
BTW - What is your oracle release? -
Set transaction use roll back segmet
Hi all:
I have lot of packages with the statement set transaction use roll back segment RBS_BIG.I am working on upgrade project and using undo tablespaces.
Is there a quick way to grep the this statement from all the packages and remove off.Does the presence of this statement in packages of new database cause compilation errors ?
Thanks,
GaneshHi,
Set init.ora parameter as follows and restart database. All SET TRANSACTION USE ROLLBACK SEGMENT statements will have no effect and ignored.
UNDO_SUPPRESS_ERRORS=TRUE
You may use ALTER SYSTEM rather than restart db. If your database use spfile.ora, you have to execute:
ALTER SYSTEM SET UNDO_SUPPRESS_ERRORS=TRUE SCOPE=BOTH;
Best regards,
Dima -
Hi all:
I have lot of packages with the statement set transaction use roll back segment RBS_BIG.I am working on upgrade project and using undo tablespaces.
Is there a quick way to grep the this statement from all the packages and remove off.Does the presence of this statement in packages of new database cause compilation errors ?
Thanks,
GaneshThe set transaction use rollback segment <rbsegment> is ignored in 10g. In 9i databases this could cause errors when using automatic undo management. For your 9i databases you can suppress the errors by setting UNDO_SUPPRESS_ERRORS=true.
-
Sql to find check Percent of Rollback Segment Used?
I have the following queries to find information about rollback segments.
I want the sql to find % of rollback segment used.
--rollsegs.sql
select SEGMENT_NAME, OWNER, TABLESPACE_NAME, SEGMENT_ID, status
from dba_rollback_segs order by segment_name;
select name, extents, writes, xacts, gets,waits, shrinks, aveactive, status
from v$rollname n, v$rollstat s
where n.usn = s.usn
order by name;
--rolbstat.sql
select name, rssize, hwmsize "High", optsize "Opt", wraps, extends, shrinks,
aveshrink "Aveshr", aveactive "Aveact"
from v$rollname n, v$rollstat s
where n.usn = s.usn
order by name;
set numformat 999999990;DrBurgs, there was a time when your session was assigned a rollback segment that rollback segment held all the updates performed by your session but by Oracle version 8.1 every transaction executed by your session could be assigned to a different rollback segment.
So every 100,000 or whatever value of N use choose as your commit point could result in a different rollback segment being used. You can use v$rollstat and v$transaction to monitor rollback segment usage while the job is running.
You stated that you had one rollback segment for every tablespace. There is no relation in Oracle between the number of tablespace and the number of rollback segments you should have.
You should choose the number of rollback segments to create based on the expected user load and how large a transaction you need to be able to support. For manually defined rollback segments set the initial extent size and the next extent size equal with pctincrease = 0. Then set optimal to the size you would like each rollback segment to be. This size should be large enough that shrinks do not happen often but small enough that one segment that expands will not result in other rollback segments being able to extend. By using uniform extent size you guarentee that every free extent is usable by any other rollback segment that needs to extend.
With a true warehouse you probably have very little update compared to your select load and the updates are probably load jobs. In this case you may need very few, very large rollback segments to handle the load.
HTH -- Mark D Powell -- -
Rollback segments using UNDO Tablespace?
First, I created a database for a vendor with an Undo Tablespace UNDOTBS. Then the vendor requested me to create rollback segments instead. So I created a new tablespace RBSTBS just to hold these segments. When I tried to create the rollback segment using the newly created tablespace RBSTBS, it complained that I am not allowed to use non-system tablespaces.
So instead, I used the Undo tablespace UNDOTBS to hold the rollback segment. It worked.
Am I really allowed to use the UNDO tablespace to hold rollback segments? Can't I use normal tablespaces for rollback segments?
Another thing, the vendor wanted me to create rollback segments of 200MB each. Where do I set this while creating the rollback segment? Is this the INITIAL, NEXT, or OPTIMAL size?
I know that Oracle recommends using UNDO rather than rollback segments. Is there any advantage in using traditional rollback segments?
Thanks for any help!Advantage with rollback segment is you can force your transaction to use any specific rollback segment, where as with undo you don't have any control. Oracle does it for us.
Thanks and Regards,
Satheesh Babu.S
Bangalore. -
How to find out the Transactions used per month & the USER who used that
Hi,
1)How to find out the Transactions used per month & the USER who used that?
2)and can i get the above same for minimum 20 month?
System : SAP- Enterprise Core Component.You can use my program...
*& Report Z_ABAP_TCODE_MONITOR
*****& Program Type : Report *
*****& Title : Z_ABAP_TCODE_MONITOR *
*****& Transaction code : ZTCODE_USAGE *
*****& Developer name : Shailendra Kolakaluri *
*****& Deveopment start date : 26 th Dec 2011 *
*****& Development Package : ZDEV *
*****& Transport No : DEVK906086 *
*****& Program Description : This program is to display
*List all tcodes executed during previous day.
*& Show the number of users executing tcodes
*& Modification history
REPORT Z_ABAP_TCODE_MONITOR.
*& List all tcodes executed during previous day.
*& Show the number of users executing tcodes
TYPE-POOLS : slis.
DATA: ind TYPE i,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
layout TYPE slis_layout_alv,
variant TYPE disvariant,
events TYPE slis_t_event WITH HEADER LINE,
heading TYPE slis_t_listheader WITH HEADER LINE.
*REPORT z_report_usage.
TYPES: BEGIN OF zusertcode,
date TYPE swncdatum,
user TYPE swncuname,
mandt TYPE swncmandt,
tcode TYPE swnctcode,
report TYPE swncreportname,
count TYPE swncshcnt,
END OF zusertcode.
*data : date type n.
DATA: t_usertcode TYPE swnc_t_aggusertcode,
wa_usertcode TYPE swncaggusertcode,
wa TYPE zusertcode,
t_ut TYPE STANDARD TABLE OF zusertcode,
wa_result TYPE zusertcode,
t_result TYPE STANDARD TABLE OF zusertcode.
PARAMETER: month TYPE dats DEFAULT sy-datum.
*PARAMETER: date TYPE dats.
*select-options : username for wa_usertcode-account.
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_fieldcatalog.
PERFORM set_layout.
PERFORM get_event.
PERFORM get_comment.
PERFORM display_data.
FORM get_data .
*date = sy-datum - 2 .
After start-of-selection add this line (parameter Month required 01 as day).
concatenate month+0(6) '01' into month.
CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
EXPORTING
component = 'TOTAL'
ASSIGNDSYS = 'DEV'
periodtype = 'M'
periodstrt = month
TABLES
usertcode = t_usertcode
EXCEPTIONS
no_data_found = 1
OTHERS = 2.
wa-date = month.
*wa-date = date.
wa-mandt = sy-mandt.
wa_usertcode-account = username.
LOOP AT t_usertcode INTO wa_usertcode.
wa-user = wa_usertcode-account.
IF wa_usertcode-entry_id+72 = 'T'.
wa-tcode = wa_usertcode-entry_id.
wa-report = space.
ELSE.
wa-tcode = space.
wa-report = wa_usertcode-entry_id.
ENDIF.
COLLECT wa INTO t_ut.
ENDLOOP.
SORT t_ut BY report ASCENDING.
CLEAR: wa, wa_result.
endform.
FORM get_fieldcatalog .
fcat-tabname = 't_ut'.
fcat-fieldname = 'DATE'.
fcat-seltext_l = 'Date'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'MANDT'.
fcat-seltext_l = 'Client'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'USER'.
fcat-seltext_l = 'User Name'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'TCODE'.
fcat-seltext_l = 'Transaction Code'.
fcat-key = 'X'.
APPEND fcat.
ENDFORM.
*& Form SET_LAYOUT
text
--> p1 text
<-- p2 text
FORM set_layout .
layout-colwidth_optimize = 'X'.
ENDFORM. " SET_LAYOUT
*& Form GET_EVENT
text
--> p1 text
<-- p2 text
*FORM get_event .
events-name = slis_ev_top_of_page.
events-form = 'TOP_OF_PAGE'.
APPEND events.
*ENDFORM. " GET_EVENT
**& Form GET_COMMENT
text
--> p1 text
<-- p2 text
*FORM get_comment .
DATA: text(30).
text = 'Billing Report'.
heading-typ = 'H'.
heading-info = text.
APPEND heading.
*ENDFORM. " GET_COMMENT
**& Form top_of_page
text
--> p1 text
<-- p2 text
*FORM top_of_page .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading[]
I_LOGO =
I_END_OF_LIST_GRID =
*ENDFORM. " top_of_page
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
sort t_ut[].
DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
is_layout = layout
it_fieldcat = fcat[]
i_save = 'A'
is_variant = variant
it_events = events[]
TABLES
t_outtab = t_ut
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " DISPLAY_DATA -
How To Perform Lot Split Transactions Using Transaction Open Interface (MTI)
Can anyone give me some guidance on how to perform lot split transaction using MTI?
I am using the following code:
DECLARE
l_transaction_type_id NUMBER := 83;
l_transaction_action_id NUMBER := 41;
l_transaction_source_type_id NUMBER := 13;
l_org_id NUMBER := 1884;
l_txn_header_id NUMBER;
l_txn_if_id1 NUMBER;
l_txn_if_id2 NUMBER;
l_txn_if_id3 NUMBER;
l_parent_id NUMBER;
l_sysdate DATE;
l_item_id NUMBER :=287996;
l_user_id NUMBER;
l_distribution_account_id NUMBER;
l_exp_date DATE;
BEGIN
--For Lot Merge, there should be only one resultant lot.
--The transaction_quantity populated in MTI/MTLI should be the entire
--quantity that is available to transact for the org/sub/item/locator/LPN in
--that particular lot number.
--Get transaction_header_id for all the MTIs
SELECT APPS.mtl_material_transactions_s.NEXTVAL
INTO l_txn_header_id
FROM sys.dual;
--Get transaction_interface_id of resultant record
SELECT APPS.mtl_material_transactions_s.NEXTVAL
INTO l_txn_if_id1
FROM sys.dual;
l_parent_id := l_txn_if_id1;
l_sysdate := SYSDATE;
l_user_id := -1; --substitute with a valid user_id
l_distribution_account_id := NULL; --needed for lot translate
l_exp_date := NULL; --set if required
--Populate the MTI record for resultant record
INSERT INTO MTL_TRANSACTIONS_INTERFACE
transaction_interface_id,
transaction_header_id,
Source_Code,
Source_Line_Id,
Source_Header_Id,
Process_flag,
Transaction_Mode,
Lock_Flag,
Inventory_Item_Id,
revision,
Organization_id,
Subinventory_Code,
Locator_Id,
Transaction_Type_Id,
Transaction_Source_Type_Id,
Transaction_Action_Id,
Transaction_Quantity,
Transaction_UOM,
Primary_Quantity,
Transaction_Date,
Last_Update_Date,
Last_Updated_By,
Creation_Date,
Created_By,
distribution_account_id,
parent_id,
transaction_batch_id,
transaction_batch_seq,
lpn_id,
transfer_lpn_id
VALUES
l_txn_if_id1, --transaction_header_id
l_txn_header_id, --transaction_interface_id
'INV', --source_code
-1, --source_header_id
-1, --source_line_id
1, --process_flag
3, --transaction_mode
2, --lock_flag
l_item_id, --inventory_item_id
null, --revision
l_org_id, --organization_id
'EACH', --subinventory_code
1198, --locator_id
l_transaction_type_id, --transaction_type_id
l_transaction_source_type_id, --transaction_source_type_id
l_transaction_action_Id, --l_transaction_action_id
100000, --transaction_quantity
'EA', --transaction_uom
100000, --primary_quantity
l_sysdate, --Transaction_Date
l_sysdate, --Last_Update_Date
l_user_id, --Last_Updated_by
l_sysdate, --Creation_Date
l_user_id, --Created_by
l_distribution_account_id, --distribution_account_id
l_parent_id, --parent_id
l_txn_header_id, --transaction_batch_id
2, --transaction_batch_seq
NULL, --lpn_id (for source MTI)
NULL --transfer_lpn_id (for resultant MTIs)
--Insert MTLI corresponding to the resultant MTI record
INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
transaction_interface_id
, Source_Code
, Source_Line_Id
, Process_Flag
, Last_Update_Date
, Last_Updated_By
, Creation_Date
, Created_By
, Lot_Number
, lot_expiration_date
, Transaction_Quantity
, Primary_Quantity
VALUES (
l_txn_if_id1 --transaction_interface_id
, 'INV' --Source_Code
, -1 --Source_Line_Id
, 'Y' --Process_Flag
, l_sysdate --Last_Update_Date
, l_user_id --Last_Updated_by
, l_sysdate --Creation_date
, l_user_id --Created_By
, 'Q0000.1' --Lot_Number
, l_exp_date --Lot_Expiration_Date
, 100000 --transaction_quantity
, 100000 --primary_quantity
INSERT INTO MTL_TRANSACTIONS_INTERFACE
transaction_interface_id,
transaction_header_id,
Source_Code,
Source_Line_Id,
Source_Header_Id,
Process_flag,
Transaction_Mode,
Lock_Flag,
Inventory_Item_Id,
revision,
Organization_id,
Subinventory_Code,
Locator_Id,
Transaction_Type_Id,
Transaction_Source_Type_Id,
Transaction_Action_Id,
Transaction_Quantity,
Transaction_UOM,
Primary_Quantity,
Transaction_Date,
Last_Update_Date,
Last_Updated_By,
Creation_Date,
Created_By,
distribution_account_id,
parent_id,
transaction_batch_id,
transaction_batch_seq,
lpn_id,
transfer_lpn_id
VALUES
l_txn_if_id1, --transaction_header_id
l_txn_header_id, --transaction_interface_id
'INV', --source_code
-1, --source_header_id
-1, --source_line_id
1, --process_flag
3, --transaction_mode
2, --lock_flag
l_item_id, --inventory_item_id
null, --revision
l_org_id, --organization_id
'EACH', --subinventory_code
1198, --locator_id
l_transaction_type_id, --transaction_type_id
l_transaction_source_type_id, --transaction_source_type_id
l_transaction_action_Id, --l_transaction_action_id
100000, --transaction_quantity
'EA', --transaction_uom
100000, --primary_quantity
l_sysdate, --Transaction_Date
l_sysdate, --Last_Update_Date
l_user_id, --Last_Updated_by
l_sysdate, --Creation_Date
l_user_id, --Created_by
l_distribution_account_id, --distribution_account_id
l_parent_id, --parent_id
l_txn_header_id, --transaction_batch_id
3, --transaction_batch_seq
NULL, --lpn_id (for source MTI)
NULL --transfer_lpn_id (for resultant MTIs)
--Insert MTLI corresponding to the resultant MTI record
INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
transaction_interface_id
, Source_Code
, Source_Line_Id
, Process_Flag
, Last_Update_Date
, Last_Updated_By
, Creation_Date
, Created_By
, Lot_Number
, lot_expiration_date
, Transaction_Quantity
, Primary_Quantity
VALUES (
l_txn_if_id1 --transaction_interface_id
, 'INV' --Source_Code
, -1 --Source_Line_Id
, 'Y' --Process_Flag
, l_sysdate --Last_Update_Date
, l_user_id --Last_Updated_by
, l_sysdate --Creation_date
, l_user_id --Created_By
, 'Q0000.1' --Lot_Number
, l_exp_date --Lot_Expiration_Date
, 100000 --transaction_quantity
, 100000 --primary_quantity
--Get transaction_interface_id of Source record-1
SELECT APPS.mtl_material_transactions_s.NEXTVAL
INTO l_txn_if_id2
FROM sys.dual;
--Populate the MTI record for Source record-1
INSERT INTO MTL_TRANSACTIONS_INTERFACE
transaction_interface_id,
transaction_header_id,
Source_Code,
Source_Line_Id,
Source_Header_Id,
Process_flag,
Transaction_Mode,
Lock_Flag,
Inventory_Item_Id,
revision,
Organization_id,
Subinventory_Code,
Locator_Id,
Transaction_Type_Id,
Transaction_Source_Type_Id,
Transaction_Action_Id,
Transaction_Quantity,
Transaction_UOM,
Primary_Quantity,
Transaction_Date,
Last_Update_Date,
Last_Updated_By,
Creation_Date,
Created_By,
distribution_account_id,
parent_id,
transaction_batch_id,
transaction_batch_seq,
lpn_id,
transfer_lpn_id
VALUES
l_txn_if_id2, --transaction_header_id
l_txn_header_id, --transaction_interface_id
'INV', --source_code
-1, --source_header_id
-1, --source_line_id
1, --process_flag
3, --transaction_mode
2, --lock_flag
l_item_id, --inventory_item_id
null, --revision
l_org_id, --organization_id
'EACH', --subinventory_code
1198, --locator_id
l_transaction_type_id, --transaction_type_id
l_transaction_source_type_id, --transaction_source_type_id
l_transaction_action_Id, --transaction_action_id
-200000, --transaction_quantity
'EA', --transaction_uom
-200000, --primary_quantity
l_sysdate, --Transaction_Date
l_sysdate, --Last_Update_Date
l_user_id, --Last_Updated_by
l_sysdate, --Creation_Date
l_user_id, --Created_by
l_distribution_account_id, --distribution_account_id
l_parent_id, --parent_id
l_txn_header_id, --transaction_batch_id
1, --transaction_batch_seq
NULL, --lpn_id (for source MTI)
NULL --transfer_lpn_id (for resultant MTIs)
--Insert MTLI corresponding to the Source record-1
INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
transaction_interface_id
, Source_Code
, Source_Line_Id
, Process_Flag
, Last_Update_Date
, Last_Updated_By
, Creation_Date
, Created_By
, Lot_Number
, lot_expiration_date
, Transaction_Quantity
, Primary_Quantity
VALUES (
l_txn_if_id2 --transaction_interface_id
, 'INV' --Source_Code
, -1 --Source_Line_Id
, 'Y' --Process_Flag
, l_sysdate --Last_Update_Date
, l_user_id --Last_Updated_by
, l_sysdate --Creation_date
, l_user_id --Created_By
, 'Q0000' --Lot_Number
, l_exp_date --Lot_Expiration_Date
, -200000 --transaction_quantity
, -200000 --primary_quantity
END;the first MTI record should be the source record ...ie. it should have transaction quantity as negative.
new set of MTI records should have positive transaction quantities.
Also ensure that sum of transaction quantities for the set should be 0...
What is the error that you are getting?
Thanks,
Hrishi. -
How to start and finish a transaction using EJB 3.0 in JDeveloper
Hello everybody!
Does anybody can explain how to start and finish a transaction using EJB 3.0. I need to start a transaction insert some information in some tables and if everything was fine commit the information.
I put the annotation @TransactionManagement(TransactionManagementType.BEAN) in my session bean and @Resource SessionContext ejbContext; but I don't what anything else I have to do.
Any help will be appreciate.I tryied to use in the client the statement EntityTransaction transaction = myBean.getTransact(); but I receive the EJBException: Cannot use resource level transactions with a container managed EntityManager
I just need to start a transaction something like this: transaction.begin(); and finish the transaction, something like this: transaction.commit();
Does anybody can help? -
Transactions used in simple file-idoc scenario
hi all,
what are the transactions used in idoc scenario...(Ex: idx1 for creating new idco)
let me know what is the transaction code to find the clients available...
Is it 'SCC4'
Please provide me required info
Thanks
Narasimha
Edited by: Narasimha bommela on Jan 23, 2008 9:17 PMTry this guide:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cdded790-0201-0010-6db8-beb9bb2b2660
Covers everything from setting partner profiles to monitoring Idocs
I can also recommend this book: http://www.sap-press.com/product.cfm?account=&product=H1935
Maybe you are looking for
-
I recently bought two iMac quad core i5 processor speed 2.5 Ghz. Every time I use Air Drop and I send a file from one iMac to the other, a black curtain drops and I am asked to restart the computer!!! What can I do?
-
IPod Nano 5g, the video camera doesn't work.
Everytime i click on the camera the screen goes black and the ipod freezes. What can i do to fix this problem???
-
How to use pl/sql code as ODI user defined function
Hi All, i have a pl/sql code and i want to create ODI user defined function using this code . please find the pl/sql code below: ============================ declare v_no_of_duplicate_rec number := 0; begin select count(*) into v_no_of_duplicate_rec
-
File transfer speed in 10.5.2
Since installing 10.5.2 the transfer speed between two Macs sharing a wireless access point is abysmal. 1GB now takes 8 hours to transfer if copied through the Finder. It used to take about half an hour. Using rsync from the command line the same tra
-
I have an IPAD 2 and need a flash player equivalent/3rd party app to install on my IPAD?