Batch query !

hi all
I have a problem with batch determination.
When I process my out bound delivery delievery document (VL01n) the batch number for the shipment is not getting determined. When I press F4 for the possible values it says, "invalid batch determined" but allowing me to process the delivery and PGI.
Why so? Can any one clarify please.....
In the meantime, if any of you have a complete document (with screen shots, if possible) on batch determination procedure please send it to me at [email protected]
Thanks in advance !

dear SDGUY
please gothough this
Please find the Notes on Batch Management Below:
SAP allows a configuration setting for 3 different batch levels. This wills effective your possibilities. Option Number 2 is the default configuration for SAP out of the box:
1.) Plant - can allow for the Batch Management Flag on a material sold out of 2 different plants to be set independently. Batch numbers can be used for multiple materials, and batch specifications and analytical results can be different for each batch (multiple batch Master records).
2.) Material - Batch Management flag is set the same for the material across all plants that use it. Batch numbers can be used for multiple materials, however, batch specification and analytical results are the same for the batch (one Batch Master Record).
3.) Client - Batch Management flag is set the same for material across all plants that use it. Batch number can only be used for one material across the client. (One Batch Master Record).
If the Batch level flag is set at the Client level, it allows for a batch number to be used with only one material throughout the entire SAP client. This is troublesome with products which are produced in bulk and then packaged into smaller size containers for sale. Due to the limitation of having only one batch number per material, when the product is packaged, new batch numbers have to be assigned to the finished packages, even though the same bulk material is being used inside the package. Because of this work-a rounds have been created and business processes adjusted to accommodate this restriction.
There is a process in SAP that will allow for the conversion of the Batch Level in SAP from Client level to Material level. Please investigate SAP notes 41715, 891902, 893053, 900359 among others, and it appears that there is a conversion program in SAP that will do this in configuration.
In addition to above Please find some more stuff,
A batch in the Materials Management system is defined as a subset or partial quantity of a material that is managed separately from other subsets of the same material. Each batch is identified not only by its material identification but also by a separate batch number. Typical examples of batches include different production lots (such as paints, dyes, wallpapers, and pharmaceutical products), delivery lots, or quality grades of a material.
In Sales and Distribution (SD), it is possible to determine batches that match customer specifications. Batch determination can be triggered at two points in the process, either when the sales order is entered, or when the delivery is created.
If you enter a batch number directly into the sales document, the system checks whether its availability and expiration dates are valid. When you copy a pre-sales document to a sales order, any existing batch numbers are also automatically copied but cannot be changed in the sales order. If you create a sales order with materials to be managed in batches that does not have a preceding document, you can change the batch numbers until subsequent documents, such as the delivery, have also been created. If, when creating a delivery, the system discovers that the copied batch is not valid, a warning is issued by the system. In this case, the batch specification must be changed in the sales document source.
Maintaining Master Data for Batches
If a material is managed in batches, you indicate this fact in the material master record in either the Purchasing or Plant data/storage 1 views. You can also create and maintain master data for individual batches, specifying such information as the expiration date, valuation type, and the country of origin. If you are planning to use batch split at delivery time, you must also maintain the relevant customer master records for those customers who permit batches to be split.
Entering Batch Number in Sales Document
Before you can enter a batch number in a sales document, a delivering plant must be entered for the item. If no delivering plant is entered, the Batch field remains inactive.
You can find the Batch field on the Item overview tab page in the table with the items.
If you do not know the batch number, you can display all the available batches in the delivering plant for your material, by using the input help.
An availability check is carried out for the batch, which you have entered, and the quantity available is confirmed.
If no batch number is proposed in the sales order for an item with material to be handled in batches, automatic batch determination can be carried out in the delivery.
There are four points at which you should use batch determination in Sales & Distribution. These are:
Quotations
Quantity contracts
Sales orders (or scheduling agreement)
Delivery
We use batches in SD where the materials are produced under one batch and they are given the shell life expiry date for each batch,
A1) Normally we use batch determination at delivery level, because at the time of order material may or may not be created. For this material should be configured with batch and batch determination should be checked in sales views of material.
A2) Batch Determination during order Creation.
For this you need to maintain Classes d for you Material. Depending on the Manufacturing process you can define the characteristics for your material.
Ex: Purity for Medicines, Resistance for Electric Items.
You need to create a class (You might have to create a new class type) which incorporates the characteristic.
First Create the Characteristic Using CT04 and then using CL02 create the Class including this characteristic.
Then in your material master Classification View Enter this class.
Then Create a Batch for the particular plant and Storage Location using MSC1N.Give the value of the characteristics in this batch.
Then go to SPRO ->Logistics General ->Batch Management and maintain the Condition Technique (Procedure, Strategy Types and assignment to sales docs etc).
Then Create the Batch Determination Record using VCH1.
Config Setting In Batch Management
Logistics general - Batch Management
1.1. Specify Batch Level
Menu Path Enterprise Structure> Logistics General> Batch Management --> Specify batch level and activate batch status management Transaction OMCT
1.2. Batch Number - Activate Internal Number Assignment
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Number Assignment --> Activate internal batch number assignment Transaction OMCZ
1.3. Batch Creation - for Goods Movements
Menu Path Enterprise Structure> Logistics General> Batch Management --> Creation of new batches --> Define batch creation for goods movements Transaction
1.4. Characteristic Value Assignment -- Update Standard Characteristics
Menu Path Enterprise Structure> Logistics General> Batch Management --> Characteristic Value Assignment --> Update Standard Characteristics Transaction
1.5. Activate Batch Classification for Goods Movements in Inventory Management
Menu Path Enterprise Structure> Logistics General> Batch Management --> Characteristic Value Assignment --> Valuation for goods movements --> Activate Batch Classification for goods movements in Inventory Management Transaction OMCV
1.6. Batch Determination – Condition Table (Cross Client)
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Condition Tables --> Define production order condition tables Transaction OPLB
1.7. Batch Determination – Condition Table (Cross Client)
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Condition Tables --> Define SD condition Tables Transaction V/C7
1.8. Batch Determination – Access Sequence (Cross Client)
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Access Sequences --> Define Production Order Access Sequences Transaction OPLF
1.9. Batch Determination – Access Sequence (Cross Client)
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Access Sequences --> Define SD Access Sequences Transaction V/C2
1.10. Batch Determination – Strategy Types
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Production Order Strategy Types Transaction OPLE
1.11. Batch Determination – Strategy Types
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define SD Strategy Types Transaction V/C1
1.12. Batch Determination – Batch Search Procedure
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define IM Search Procedure Transaction OMCY
1.13. Batch Determination – Batch Search Procedure
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Production order Search Procedure Transaction OPLG
1.14. Batch Determination – Batch Search Procedure
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define SD Search Procedure Transaction V/C3
1.15. Batch Determination – Batch Search Procedure Allocation
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Allocate IM search procedure/activate check Transaction OMCG
1.16. Batch Determination – Batch Search Procedure Allocation
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Assign Search procedure to production order Transaction OPL8
1.17. Batch Determination – Batch Search Procedure Allocation (SD)
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Allocate SD Search procedure Transaction V/C5
1.18. Batch Determination – Activate Automatic Batch Determination (SD)
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Activate Automatic Batch Determination in SD -->For delivery item categories Transaction V/CL
1.19. Batch Determination – Batch Selection Class
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Selection Classes Transaction CL01
1.20. Batch Determination – Sort Rule
Menu Path Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Sort Rules Transaction CU70
1.21. Batch Determination – Make Settings for Batch Where-used list
Menu Path Enterprise Structure> Logistics General> Batch Management --> Make Settings for Batch Where-used list Transaction OMBB
Hope this helps you.
General Setting:
1. Define Batch Level
Use
This transaction enables you to set the batch level for batch management. Three unique options for a material are available:
At plant level•
At material level•
At client level•
Prerequisites
If the material or client level for a material is chosen, check that no materials exist in stock. If a material exists in stock, the level may not be changeable.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code OMCE
IMG Menu Logistics Batch Management Specify Batch Level and Activate Status Management - General
2. Choose Batch Level
3. In the Define Batch Level screen, select Batch unique at material level and choose save.
4. If the system displays any warning messages, continue through them by choosing Enter.
Result
The batch level has been set to the material level.
2. Activate Status Management
Use
This activity sets the batch management to active status in the client.
Prerequisites
The batch level should be set before the batch management is set to active.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code OMCS
IMG Menu Specify Batch Level and Logistics - General Batch Management Activate Status Management
2. Choose Batch status management active.
3. Choose Save.
Result
The batch level status has been activated.
3. Update LOBM Standard Characteristics
Use
This activity copies LOBM standard characteristics from client 000 to the development client.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code BMSM
Batch Batch Valuation IMG Menu Update Standard Characteristics Logistics - GeneralManagement 
2. On the Update the Standard Features dialog box, choose Yes.
3. On the Maintain Standard Features LOBM screen, choose Back.
4. On the Copy Object Lists between clients screen, choose Back.
5. On the Maintaining Standard Characteristics with Object Dependencies screen, choose Back.
Result
You have copied the LOBM standard characteristics from client 000 into your development client.
IMG Settings for Scenario-1 (Batch Classification)
1. Create Class for Batch Management
Use
In this step, you define classes for use with batches.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code CL02
SAP R/3 Role Menu Installation ® Create Class for Batch Management
2. Choose Create and maintain the necessary master data manually. The relevant data can be found in the file:
Result
The materials are later assigned to class in the material masters is used in the batch determination search strategies.
2. Activate Batch Classification for Goods Movements
Use
This step activates batch classification for goods movements in IM.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code OMCV
Batch Management Batch Valuation IMG  Valuation for Goods Movement inMenu Logistics - Genera Activate Batch Inventory Management Classification for Goods Movements in IM
2. On the Classify Batches Within Goods Movement Screen, make the following entries:
Result
You have activated batch classification for goods movements in IM.
3. Order type Dependent Parameters
Process order control parameters are defined for each order type. The following screen shows the defined order type dependent parameters
Conclusion
In this document, necessary settings for Batch Management are documented. For module specific settings, please find the respective building blocks.
IMG Settings for Scenario-2 (Batch Split Valuation based on Source)
1. Activate Split Valuation
Use
This step activates split valuation in batch classification.
Procedure
3. Access the activity using one of the following navigation options:
Transaction Code OMW0
IMG Menu Activate  Material Valuation and Account category  Split Valuation Split Valuation LogisticsManagement 
1. Activate Split Valuation
Use
This step activates split valuation in batch classification.
Procedure
Access the activity using one of the following navigation options:
Transaction Code OMW0
Valuation and Split Valuation IMG Menu Activate Split Valuation Logistics Material Management Account category 
2. Configure Split Valuation
Use
This step activates split valuation in batch classification.
Procedure
Access the activity using one of the following navigation options:
Transaction Code OMWC
IMG Menu configure Split  Material Valuation and Account category  Split Valuation Valuation LogisticsManagement 
Two new entries ZIN and ZEX are created as valuation type.
New Valuation Category Z is Created with following setting.
For Valuation Category Z valuation types ZINT and ZEX are activated for the Plant ZB01.
For the Plant ZB01 the following Valuation Categories are activated.
IMG Settings for Scenario-3 (Active ingredient Valuation)
1. Create Unit of Measure
Use
The purpose of this activity is to create unit of measure.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code CUNI
IMG Menu Check General settingsunits of measurement
2. On the Unit of measure Initial screen choose No dimensions and click Unit of Measure.
3. Click Create and make the following entries.
Key field Entry
Int. meas. unit YGW YWK
Commercial YAI YIK
Technical Ylbai Yai/lb
Measurement unit text Pound act. ingrd. lb act.ingrd. / lb
lb ac.ing. yai/lb
Commercial meas. unit X
Result
A unit of measure is created.
2. Edit Batch-Specific Material Unit of Measure
Use
The purpose of this activity is to edit batch-specific material unit of measure.
Procedure
1. Access the activity using the following navigation options:
Transaction Code BMA1
IMG Menu Logistics - General Edit Batch Management Batch-Specific Material Units of MeasureBatch-Specific Material Unit of Measure
2. On the Change View “Batch specificUnits of Measures” screen, choose New Entries and make the following entries.
Key field Entry
Batch Uom YAI
Ref. Uom LB
Result
Batch specific unit of measure for the active ingredient edited.
3. Define Calculation of Proportion Quantity from Base Quantity
Use
The purpose of this activity is to define calculation of proportion quantity from the base quantity.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code BMA3
Menu Logistics – General Batch Management IMG Batch-Specific Material Units of Measure ofCalculate Proportional Factors Define Calculation Proportion Quantity from Base Quantity
2. On the Change View “Calculation of proportion/product quant. from base quant” screen, make the following entries:
Units of Measure Technical Measurement Unit. Text
YIK Yai/lb lb act.ingrd. / lb
3. Choose the Details button.
4. Make the following entries:
Field Entry
Batch-specific UoM YAI
Base Unit of Measure LB
5. Save the entries.
Result
Calculation of proportion quantity is defined.
4. Define Strategy Types to Determine Receiving Batches
Use
The purpose of this activity is to define strategy types to determine receiving batches.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code DRC6
Derivation ofIMG  Menu Logistics - General Derivation of Batch Batch Management Batch Data  Set UpSet Up Condition Technique for Derivation Define Strategy Types toData  Determine Receiving BatchesCondition Technique for Derivation
2. On the Change View “Conditions: Types”: Overview screen, make the following entry:
CTyp AcSq. ValTo From LA Name
ZDR1 BDR1 EN MatNumber/MatType
3. Save the entry.
Result
The strategy types to determine receiving batches is defined.
5. Define Search Procedures to Determine Receiving Batches
Use
The purpose of this activity is to define search procedures to determine receiving batches.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code DRC7
Derivation ofIMG  Menu Logistics - General Derivation of Batch Batch Management Batch Data  Set UpSet Up Condition Technique for Derivation Define Search ProceduresData  to Determine Receiving BatchesCondition Technique for Derivation
2. On the Change View “Conditions: Types”: Overview screen, choose New Entries button, and make the following entries:
Proc. LA Description
ZDR001 EN MatNumber/MatType
3. Press Enter and select Control folder on the left pane and make the following entries:
Step Cntr Ctyp From To Reqt AltCty AltCBV
001 01 ZDR1 000 001 000 000 000
4. Save the entries.
Result
Search procedures to determine receiving batches is defined.
6. Define Derivation Events
Use
The purpose of this activity is to define the derivation event.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code
IMG Menu Define Logistics - General Batch ManagementDerivation of Batch Data Derivation Events
2. On the Change View “Assignment of Search Procedures to Derivation Events”: Overview screen, make the following entry:
DE RecProc. SndrSch. Typ Window Control
200 ZDR001 BDS001 S
3. Save the entry.
Result
The derivation event is defined.
7. Activate Split Valuation
Use
The purpose of this activity is to activate split valuation.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code OMW0
SplitIMG Menu Activate Split Valuation Material Management Valuation and Account Assignment Valuation 
2. On the Activate Valuation screen, choose Split material valuation active.
3. Save your entry.
Entries made in this transaction will be not transported automatically.
Result
Split valuation was activated.
8. Configure Split Valuation
Use
The purpose of this activity is to configure split valuation.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code OMWC
IMG Menu Configure Split Material Valuation and Account Assignment  Split Valuation Valuation Management
2. On the Split Valuation of Materials screen, choose Global categories.
3. On the Global Valuation Categories screen, select Valuation From the menu bar, choose Goto Global categories  Assignments Cat. X. Cat. OUs.
4. On the Valuation Category X: Allocate to Plants screen, select the required plants and choose Activate.
5. Save your changes.
Result
Split valuation was configured.
9. Configure Pricing Procedure for Sales Order
Use
The purpose of this activity is to configure Pricing Procedure for sales order.
Procedure
2. Access the activity using one of the following navigation options:
Transaction Code V/08
IMG Menu Sales and Distribution
Result
Pricing Procedure was configured.
1. IMG Settings for Scenario-2 (Batch Split Valuation based on Source)
Update LOBM Standard Characteristics
Use
This activity copies LOBM standard characteristics from client 000 to the development client.
Procedure
6. Access the activity using one of the following navigation options:
Transaction Code BMSM
IMG Menu Update Standard Characteristics Logistics - General Batch Management Batch Valuation 
7. On the Update the Standard Features dialog box, choose Yes.
8. On the Maintain Standard Features LOBM screen, choose Back.
9. On the Copy Object Lists between clients screen, choose Back.
10. On the Maintaining Standard Characteristics with Object Dependencies screen, choose Back.
Result
You have copied the LOBM standard characteristics from client 000 into your development client.
2. Create Class for Batch Management
Use
In this step, you define classes for use with batches.
Procedure
2. Access the activity using one of the following navigation options:
Transaction Code CL02
SAP R/3 Role Menu Installation ® Create Class for Batch Management
3. Choose Create and maintain the necessary master data manually. The relevant data can be found in the file:
Result
The materials are later assigned to class in the material masters is used in the batch determination search strategies.
3. Create Sort Sequence
Use
This activity creates the sort sequence used to sort batches during batch determination.
Prerequisites
As a rule, all characteristics (this applies to standard characteristics as well as to user-defined characteristics) used in the sort sequence must also be contained in the batch class.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code CU70
SAP R/3 Role Menu Installation ®Create Sort Sequence
2. To maintain the necessary master data manually, make the following entries:
11. Save your entry.
Result
The sort sequence is created with characteristic
4. Create Sort Sequence
Use
This activity creates the sort sequence used to sort batches during batch determination.
Prerequisites
As a rule, all characteristics (this applies to standard characteristics as well as to user-defined characteristics) used in the sort sequence must also be contained in the batch class.
Procedure
1. Access the activity using one of the following navigation options:
Transaction Code CU70
SAP R/3 Role Menu Installation ®Create Sort Sequence
3. To maintain the necessary master data manually, make the following entries:
12. Save your entry.
Result
The sort sequence is created with characteristic
And Priicng prospective
please take following senarios
one is discount based on the expiry date
rewards if it helps
siva

Similar Messages

  • Warranty lookup batch query doesn't work

    Hi
    I encounter a problem with warranty lookup batch query here :
    http://csp.lenovo.com/ibapp/il/WarrantyLookupBatch.jsp
    Every time i try to access this tool i get this error :
    An error occurred while processing your request.
    Reference #97.b1ef54b8.1422368820.2637a55b
    best regard

    hi
    Am i the only one who have this problem ?
    from this page :
    http://support.lenovo.com/fr/fr/warrantylookup
    I fellow the link : "Executer la requête par lots"
    Then I reach this page : http://csp.lenovo.com/ibapp/il/WarrantyLookupBatch.jsp
    with this error message :
    An error occurred while processing your request.
    Reference #97.95fa56b8.1422434472.25843ff  (Edit : => it seem that this value change)
    Can someone try this to confirm the problem from LENOVO or from me?
    best regard

  • Batch Query with Batch but need address lines split by column

    Hi folks,
    I have the following query I created with the batch number of the sales order:
    SELECT T0.[DocDate] as "Date", T1.[DocNum] as "Sales Order Number",  T0.[CardCode] as "Customer Code", T0.[CardName] as "Customer Name",T1.[Address2], T0.[ItemCode],  T0.[ItemName], T0.[BatchNum], T0.[Quantity], T1.pickrmrk FROM IBT1 T0, ORDR T1 WHERE T0.[BaseNum] = T1.[DocNum] and T1.docstatus = 'O' and T0.WHSCODE = '01' order by T0.BaseNum
    Now I need to split the address by column so need street, block, city, county, country and zipcode fields from CRD1, but would either need the ship to address of the sales order it is selected or even just the default ship to address of the sales order.  In above query T1.[Adress2] is not quite right for our needs, as this file will have to be exported to 3rd party.  So I have gotten this far:
    SELECT T0.[DocDate] as "Date", T1.[DocNum] as "Sales Order Number",  T0.[CardCode] as "Customer Code", T0.[CardName] as "Customer Name",T1.[Address2], T2.[Street], T2.[Street], T2.[Block], T2.[City], T2.[County], T2.[Country], T2.[Zipcode], T0.[ItemCode],  T0.[ItemName], T0.[BatchNum], T0.[Quantity], T1.pickrmrk FROM IBT1 T0, ORDR T1, CRD1 T2 WHERE T0.[BaseNum] = T1.[DocNum] and T1.docstatus = 'O' and T0.WHSCODE = '01' and T0.[CardCode] = T2.[CardCode] and T2.[AdresType] = 'S' order by T0.BaseNum
    but will split into multiples if a business partner have more than one shipping address.
    Can someone please advise on this one?
    Many thanks in advance,

    Thanks Agustin, tried it with RDR12 as the following query:
    SELECT T0.[DocDate] as "Date", T1.[DocNum] as "Sales Order Number",  T0.[CardCode] as "Customer Code", T0.[CardName] as "Customer Name",T1.[Address2], T2.[StreetS], T2.[BlockS], T2.[CityS], T2.[ZipCodeS], T2.[CountyS], T2.[CountryS], T2.[ZipCodeS], T0.[ItemCode],  T0.[ItemName], T0.[BatchNum], T0.[Quantity], T1.pickrmrk FROM IBT1 T0, ORDR T1, RDR12 T2 WHERE T0.[BaseNum] = T1.[DocNum] and T1.docstatus = 'O' and T0.WHSCODE = '01' order by T0.BaseNum
    but has multiple lines for different addresses (and not just shipping addresses of that businss partner sales order).
    Anymore ideas or can you spot error in the query?
    Thanks again,

  • JDBC batch query with insert sometimes hangs on executeBatch

    We have the following problem:
    Java client sends through JDBC INSERT query using batch,
    and sometimes this query hangs.
    In V$SESSION ACTIVE session appears, which remains ACTIVE forever.
    Also locked object appears in V$LOCKED_OBJECT and open coursor appears.
    How to know what happens inside the query? Why it hangs?
    This is a thread dump for jdbc thread:
    The thread dump is listed below:
    "SdrWriterThread-1" prio=5 tid=0x184264c8 nid=0x214 runnable [18f1f000..18f1fd94]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at oracle.net.ns.Packet.receive(Unknown Source)
    at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:718)
    at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:690)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:373)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
    - locked <0x10641b80> (a oracle.jdbc.ttc7.TTC7Protocol)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:2883)
    - locked <0x100900d0> (a oracle.jdbc.driver.OraclePreparedStatement)
    at com.jnetx.xr.persistence.DAO.executeBatch(DAO.java:66)

    Anton,
    Why it hangs?It's waiting for a lock to be released. The default behaviour of Oracle is to wait indefinitely for a lock to be released.
    You can see this behaviour if you try to update the same row from tw different "SQL*Plus" sessions, for example (since the default behaviour of "SQL*Plus" is not to automatically commit changes).
    In one "SQL*Plus" session, update a row -- but do not commit. In the second session, try to update the same row -- it "hangs". It will remain like this until the first session releases the lock. The simplest way to release the lock is for the first session to execute either a "commit" or "rollback". As soon as you do that, you will see the first session become unstuck.
    Of-course, from the [lack of] information you have posted, I cannot tell you what is holding the lock, or why.
    Good Luck,
    Avi.

  • Rewrite draft document batch query for live document

    Hello Experts,
    I have written a query that returns data from DRAFT A/P Credit Memos.  It returns all line items and includes all linked batch numbers if any.
    I want to run the same query against A/P Credit memos once the document is 'added'.  Here's the current query...
    select odrf.docentry, DRF1.itemcode, DRF1.dscription, odrf.cardcode, obtn.distnumber, odrf.Docdate as 'Date Opened'
    from odrf
    join DRF1 on odrf.docentry = DRF1.docentry
    left join DRF16 on DRF1.docentry = DRF16.absentry AND DRF1.linenum = drf16.linenum
    left join obtn on DRF16.objabs = obtn.absentry
    where DRF1.dscription IS NOT NULL
    AND odrf.objtype = 19
    I'm having a difficult time translating this logic over to live documents.  It seems there is no equivalent table to DRF16 on live documents? 

    Yes I tried that.  However my RPC16 table is empty.  Which is odd because you would think after adding a draft document into a live document the data from DRF16 would show up in RPC16.  This appears to be the case for DRF1 to RPC1 tables at least...

  • Batches Query

    Hello All,
                 Is there a query whcih will change item to :
                 Manage Item by : Batches
                 Management Method: On Every Transaction
    Thanks
    Max

    Hi Max,
    Query is only allowed to use as read only tool. You can not run query to change anything. You may lose SAP support by doing so.
    Thanks,
    Gordon

  • Batch Query takes too much time

    Hi All,
    A query as simple as
    select * from ibt1 where batchnum = 'AAA'
    takes around 180 seconds to give results. if I replace batchnum condition with itemcode or anything other than batchnum, the same query returns results in some 5 seconds. the IBT1 table has nearly 3 lac rows. Consequently, a little complex query involving batchnm conditions gives 'query execution time out' error.
    what could be the reason? any resolution?
    Thanks,
    Binita

    Hello Binita,
    You need some database tunning....
    The IBT1 table has complex index on ItemCode, BatchNum, LineNum, WhsCode, and has no index on bacthnumber. But it has statistics, and statistics are useful for running queries ( see [ms technet here|http://technet.microsoft.com/hu-hu/library/cc966419(en-us).aspx]). Also there is a note about performance tunning databases 783183 .
    There is 2 ways to "speed up" your query: indexes and statistics
    Statistics
    See the statistics of IBT1 table:
    exec SP_HELPSTATS 'IBT1','ALL'
    the result set you see : the statistics name ([IBT1_PRIMARY]  and some statistics created by the system name likes WASys_XXXX. For Batchnum, you can execute the following statement:
    DBCC SHOW_STATISTICS ('IBT1',_WA_Sys_00000002_4EE969DE)
    --where _WA_Sys_00000002_4EE969DE is the name of the statistics of batchnum
    Check the resultset. If the "updated", "rows","row sampled" columns. If necessary, you can update the statistics by:
    -- update statistics on whole database
    EXEC SP_UPDATESTATS
    -- update all statistics of IBT1 table
    UPDATE STATISTICS IBT1 WITH FULLSCAN
    -- update a specific statistics of IBT1 table
    UPDATE STATISTICS IBT1(_WA_Sys_00000002_4EE969DE) WITH FULLSCAN
    Index defragmentation/reindex
    If the index not contiguous, the seeking inside several fragmented files takes more time.
    Execute your query in Management Studio Query analizer, and trun on Excution plans (CTRLL or CTRLM). This shows the compute cost of the query.
    select * from ibt1 where batchnum = 'AAA'
    result will be [IBT1_PRIMARY]  index scan.  You can check the fragmentation of the primary index of IBT1 table:
    DBCC SHOWCONTIG ('IBT1') WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS
    In the resultset the column ScanDensity shows the fragmentation percent, This value is 100 if everything is contiguous; if this value is less than 100, some fragmentation exists.
    Reindex can be done by the following statement:
    DBCC DBREINDEX ('IBT1','IBT1_PRIMARY',100) WITH NO_INFOMSGS
    Take care: all statements should NOT be execute during business hours.
    This may helps you.
    Regards,
    J.

  • Batch query execution failure

    Hi folks,
    We are currently implementing a module that requires us to batch around 9000!
    prepared insert statements in a single transaction. I tried to use the SqlPreparedStatement.executebatch()using
    the JDriver (for MS sql server 7.0) that ships with Weblogic but I am getting
    an exception: (java.sql.SQLException: This JDBC 2.0 method is not implemented).
    I would appreciate it if you could provide me some information regarding a fast
    JDBC driver that we can use that supports the aforementioned functionality. The
    driver will be used on BEA 6.0 sp1 and MS SQL Server 7.0.
    Cheers,
    Tony

    Antony Kakoudakis wrote:
    >
    Hi folks,
    We are currently implementing a module that requires us to batch around 9000!
    prepared insert statements in a single transaction. I tried to use the SqlPreparedStatement.executebatch()using
    the JDriver (for MS sql server 7.0) that ships with Weblogic but I am getting
    an exception: (java.sql.SQLException: This JDBC 2.0 method is not implemented).
    I would appreciate it if you could provide me some information regarding a fast
    JDBC driver that we can use that supports the aforementioned functionality. The
    driver will be used on BEA 6.0 sp1 and MS SQL Server 7.0.
    Cheers,
    TonyHi. Any JDBC driver worthy of the name will work with weblogic. I recommend the inet driver
    from www.inetsoftware.de, or you can get a copy of the beta release of the driver
    MS is giving away now from their site. It (and the coming GA) is based on the Merant/DataDirect
    commercial driver, which is sold for use on SQL7. I know the beta one works with SQL7. I have
    been told that for marketing reasons there will be some code put in the GA driver to make it not
    work with anything older than SQL2k. That may or may not come to be true, but I'd get the beta now.
    Joe

  • Advise on sql query for batch job

    Hi all,
    I'm planning to perform a batch query for 4000 records.
    The query is as follows and we will loop it for 4000 times.
    select w.idno, w.place, e.user_arrival_dt from main.tbl_user w, main.tbl_job e
    where w.idno = e.idno and w.idno = <idno>
    I find that rather inefficient in term of performance.
    I can use the below too but the the in clause has a limit.
    select w.idno, w.place, e.user_arrival_dt from main.tbl_user w, main.tbl_job e
    where w.idno = e.idno and w.idno in <idno1, idno2, idno3, idno4, etc>
    Another way that I can think of is to loop for 10 times and use this query
    select w.idno, w.place, e.user_arrival_dt from main.tbl_user w, main.tbl_job e
    where w.idno = e.idno and w.idno in <idno1, idno2, idno3, idno4, until idno400>
    is there any other more efficient way of coding to achive the above?
    kindly advise.
    thanks!

    Hi,
    Qwerty and Surachart are right; the best way is to put the 4000 values into 4000 rows of a table (perhaps a Global Temporary Table) and use a sub-query.
    If you really must have 4000 literals, then you can have 4000 items in a list like this:
    where      w.idno      = e.idno
    and      (w.idno, 0) IN     ( (idno1,    0)
                   , (idno2,    0)
                   , (idno3,    0)
                   , (idno4000, 0)     
                   )See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3508573&#3508573] for discussion.

  • Batch hint in toplink jpa

    hi all.
    Is there any mechanism in TopLink Essentials to make query with batch query hints like in EclipseLink?
    Thanks in advance.

    No, this functionality is only offered in EclipseLink. You can upgrade to EclipseLink for this.
    James : http://www.eclipselink.org

  • ADF default query functionality.

    I have an application module that is a master-detail-detail relationship. In my JSP page, I drill down to the detail records from the master records page, which has a range size of 12. It appears that a query is executed, by default, for all the view objects for every record in the range size. In my case, this is very inefficient. Is there a way to bypass this functionality?

    Brett,
    By default you'll be running in Batch mode.
    You can try running in immediate mode to see whether this eliminates the batch-querying of your masters.
    See this link in the ADF Toy Store demo whitepaper about batch mode:
    http://www.oracle.com/technology/products/jdev/collateral/papers/10g/adftoystore/readme.html#batchmode

  • Make partition on batch repository

    Dear all,
    If I make partition on batch repository tablespace, how can I drive the batch query results to filled in the specific partition ????
    Please, urgently required solution.
    Thanks & Regards,
    Sondhari

    Hi Sondhari
    No I think you must have misunderstood Rod's suggestion.
    What you have described is Discoverer's normal method of scheduling, without a batch repository user. In this method each user will automatically have any scheduled workbooks and results stored in their own schema. If all of the user schemas are in the same tablespace then this is exactly what you described and is exactly the way Oracle designed it to work.
    If you want to follow Rod's advice, you would create multiple batch repository schemas all of which were using the same tablespace. These accounts would be in addition to the user's own schema so basically you would have two accounts per user. If you want to go the whole partitioned approach then create one tablespace per user schema. Now everything will be as separate as possible. Mind you this would be complete overkill.
    Perhaps you would share with us again just why you want to keep these results separate? Because they are owned by different users they would be separate from each other even in the same tablespace.
    Best wishes
    Michael

  • SPWeb.ProcessBatchData - why no support for query-based updating?

    I'm aware how to use SPWeb.ProcessBatchData, but for very large lists (10000+ items) it's still very slow if all you want to do is update every single item to have a particular value in one column, as you still have to walk the whole list to build
    a massive batch query that you then pass to ProcessBatchData, and the updates issued to SQL server are still much more expensive than needed.
    My question is why doesn't ProcessBatchData support query-based updating, where you include a <Where> clause as part of the batch query to indicate which items you want to update?

    Only SharePoint team can answer your question I think, but yes it would be better to have the query option, maybe. However, you can still do what you want but doing a little extra work - get all items IDs using the first SPQuery call (passing ViewFields
    with minimum fields, you many not need all fields, maybe title and ID) then prepare your xml for process batch.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Abnoraml termination of query

    Hi,
    I executed a batch query. During the execution the database abnormally
    down. I checked in alert log file and trace file. But I am not able to see any errors.
    What will be the possible reasons?
    Regards,
    Mat.

    t is not saying anything about abnormal shutdown. But
    I can see a message related to crash recovery, the
    next time database opened.
    Regards,
    Mat.So looks like it was down aborted. Is there anything in event viewer?
    btw, better patch your DB to few level to 9.2.0.8 for example. the maiden version of major release tend to buggy.

  • Function calling the java code

    I have a java code that returns the size of the file name. I have created a pl/sql function that calls the method in the java class.
    The problem I face is , when I try to call the function using the command "CALL f_size('C:\Batch\Query.sql')into :leng " , the error comes reporting that
    "No method func in class fSize ".
    I have given both the java& pl/sql code. Can anyone help me out?
    import java.io.*;
    public class fSize {
    public static long func(String s)
    File file = new File(s);
    long length = file.length();
    return length;
    create or replace function f_size(path varchar2) return number
    as language java
    name 'fSize.func(String) return java.lang.Long';

    What version of the database are you runnning?
    If Oracle 9.2 or later, no need for java code. Use UTL_FILE.FGETATTR procedure.
    FGETATTR Procedure
    This procedure reads and returns the attributes of a disk file.
    Syntax
    UTL_FILE.FGETATTR(
       location    IN VARCHAR2,
       filename    IN VARCHAR2,
       exists      OUT BOOLEAN,
       file_length OUT NUMBER,
       blocksize   OUT NUMBER);
    Parameters
    Table 95-24 FGETATTR Procedure Parameters
    Parameters Description
    location
    Directory location of the source file, a DIRECTORY_NAME from the ALL_DIRECTORIES view (case sensitive)
    filename
    The name of the source file to be copied
    exists
    A BOOLEAN for whether or not the file exists
    file_length
    The length of the file in bytes. NULL if file does not exist.
    blocksize
    The file system block size in bytes. NULL if the file does not exist.
    SQL> create or replace and compile java source named "fSize" as
      2  import java.io.*;
      3  public class fSize {
      4      public static long func(java.lang.String s)
      5      {
      6          File file = new File(s);
      7          long length = file.length();
      8          return length;
      9      }
    10  };
    11  /
    Java created.
    SQL> show errors
    No errors.
    SQL> create or replace function f_size(path varchar2) return number
      2  as language java
      3  name 'fSize.func(java.lang.String) return java.lang.Long';
      4  /
    Function created.
    SQL>
    SQL> select f_size('C:\sqlnet.log') from dual ;
    F_SIZE('C:\SQLNET.LOG')
                        762
    1 row selected.
    SQL>
    SQL>
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL>

Maybe you are looking for

  • How to enable Pinch Open/Close or Double Tap

    Hi All, First of all congratulations for Packager for iPhone project and for Adobe Labs team's dedication. I have successfully converted a flash application to iPhone and without re-write any AS code. How can I use standard gesture uses supported by

  • Scroll bar does not appear in some PDF files. How can I enable it?

    Scroll bar does not appear in some PDF files. How can I enable it?

  • Take long time for search a signal

    when there is no service in the iphone they take long to make searching for a signal

  • Default "OPEN" folder

    Lately, Photoshop CC always opens a default folder-which is several clicks away from the folder I am using. How do I set it to default to the most recent open folder when I click "OPEN" ?

  • Reports & Sub-Report

    I am new to oracle reports and would like to know how to design sub-reports. I have a main query that I need to run. For each record in that main query, I would like to run 2 others queries where the key is equal to the key in the main query. Is this