Right syntax to find all records of a class
I want to find all records of a particular entity class available in DB. I find that the following query works fine when using Hibernate as JPA provider, but fails when using Glassfish's default (Toplink).
SELECT p FROM com.mycompany.Person pAs per JPA spec, which is the correct form to refer to an entity class in queries? Is it the fully qualified name or only the simple name? If it is only the simple name, how do I manage rare cases where two different packages have classes with same name?
Sorry for wasting users' time. A second look into the JPA spec answered it.
For those coming across this problem, entity name of a class defaults to its unqualified class name. :)
Similar Messages
-
Finding all records created today after 5 pm
To fetch all records created after 5pm today, i use
SELECT * fROM purchase_orders
where created_on_dt > to_Date ('26/07/2010 17:00:00','dd/mm/yyyy hh24:mi:ss')Is there a simpler way to fetch this?Are you sure:
1 with t as (select trunc(sysdate)+8/24 created_on_dt from dual)
2 select * from t
3* where to_char(created_on_dt,'HH') > '05'
SQL>/
CREATED_ON_DT
26/07/2010 08:00:00It is always better to compare dates to dates if you want the correct results. -
Find all records that have character alone in a string
Oracle 10g Enterprise Edition
Hi all,
I must select from a varchar2 field, all the records that have a character (number or char) alone in the string.
For example.
ASDF BHGR H RR (yes, cause "H")
ASDF BHGR H4 R (yes, cause "R")
ASDF B H4 DDR (yes, cause "B")
ASDF B H4 DDR (yes, cause "B")
ASDF BC 1 DDR (yes, cause "1")
ASDF BC / DDR (yes, cause "/")
ASDF BHGR H4 RR (no)
ASDF (no)
I'm trying by SubStr, but I cannot generally solutions.
Thank's for any suggestion.
CiaoOk, just a try :
SQL> with tbl as
2 (select 'ASDF BHGR H RR' str from dual union all
3 select 'ASDF BHGR H4 R' str from dual union all
4 select 'ASDF B H4 DDR' str from dual union all
5 select 'ASDF BHGR H4 R1' str from dual union all
6 select 'ASDF BHGR H4' str from dual union all
7 select 'ASDF - H4' str from dual union all
8 select 'a1 ASDF BHGR H4' str from dual union all
9 select 'ASDF B H4 DDR' str from dual union all
10 select 'ASDF BC 1 DDR' str from dual union all
11 select 'ASDF BC / DDR' str from dual)
12 select str,
13 decode(regexp_instr(str,'^. | . | .$'),0,'no',decode(regexp_instr(str,'^- | - | -$'),0,'yes','no')) res
14 from tbl;
STR RES
ASDF BHGR H RR yes
ASDF BHGR H4 R yes
ASDF B H4 DDR yes
ASDF BHGR H4 R1 no
ASDF BHGR H4 no
ASDF - H4 no
a1 ASDF BHGR H4 no
ASDF B H4 DDR yes
ASDF BC 1 DDR yes
ASDF BC / DDR yes
10 rows selected.May is there is a simpler way.
Nicolas. -
Is it possible to find all subclasses or implementing classes?
Hi, I want to provide a GUI which displays all classes which are subclasses of a class or are implementing a special interface. To avoid maintaining these lists by hand, I'm searching for a way to find out with a piece of code. So my first taught was to use the reflection API (java.lang.Class) but there is no such method available.
In most cases these classes are in the same package, so it would be enough to get all casses of a pacckage and to test them with instanceof.
Is there any way to do so?
Thanks a lot in advance.
Greetings MichaelHi Pete,
Thanks for the reply. That's exactly what I've been looking for.
I hope Sun will add something like this to the normal j2se-.API.
Greetings Michael -
How to find all condition records
HI,
How can I find all the condition records for a combination of sales organization, distribution channel and matnr.
In a condition table we can find only current valid condition record. I want to display all the valid condition records for this combination. I find one field in KONH table with VAKEY where we can give these values. Is it correct process?
What is difference between condition header and item levels? ie. whether one condition number can have different materials prices as items? if so the above logic wont work. So can you please clarify.
Thanks in advance.
with many regards,
VamsiYa now I have understood what you are talking about.
The fields in the header level and first field in the item level usually is formed based on the access sequence you select. Eg) If you choose PR00 with access sequence Sales Org / Dist Chnl / Material you would find the Sales Org and Dist Chnl as part of the header level and the material at the item level.
The significance of the item level is that you can maintain different records for the header level data entered, however the item level field has to change. In our example if you need to maintain the price of 10 products for the same Sales Org and Dist Chnl you can do so by entering one after the other.So your header level would contain the Sales Orgn say 0001, Dist Chnl 01 while you can maintain the value for M1, M2....M10 in the same screen.
If you enter a record where the combination of the header field and first field in the item level already exist in the same screen the system would then give you an error message "The condition is being processed in the current session" and would remove the second record. You can try this out my entering the material M1 twice in the same screen of VK11.
Hope it helped you. Do let me know if you have any doubt.
Regards
NP -
Data loads is not picking up all records
Hello, wonder if anyone ever encountered the following problem. I've been trying to load a flat file to BPC and for a year now, we've had no issues. This time however, it seems that not all records were loaded, eventhough the status indicated the correct number of rows were successfully loaded. Any ideas what may be causing this? I've checked the conversion files, account dimension and nothing has changed. Any help with this is greatly appreciated. Ideas on how / where to check for potential trouble spots are all welcome.
Thanks in advance.
DavidHello,
If you are using the standard SSIS package import, the rejected record should be reported into the log file at the end. However, in order to see if there are rejected records or not, you can try to validate your transformation file using the same import file.
You can also verify also the temporary files generated into D:\BPC\Data\Webfolders\APSHELL_Sorin\Finance\PrivatePublications. In this way you can find the right calues imported into the cube.
How you check if data is loaded or not?
Best regards,
Mihaela -
How to find a record then edit using sql server management studio
Hello,
A very basic question:
I want to find a record stored in MS SQL Server 2008 express database table then edit the record.
I tried to do it using SQL Server 2008 management studio express because I have been using MS Access database all the time. I have right clicked the table in management studio, clicked the "Edit top 200 records" menu item then when records were
displayed on the result pane, I pressed Ctrl + F key to find a student named Simon for example. Well, nothing happened. I couldn't see any dialog boxes for putting in the search criteria.
I guess I cannot simply use Ctrl+F in SQL Server management studio to find / edit a record.
Can someone please teach me how to find a record specifying a search criteria then edit the record in SQL server management studio?Hi ZKM128,
I have not seen Ctrl+F to be used to look for desired rows in Sql server.
On the result pane after you selected "Edit top 200 records", just right click , select
PANE, SQL, you will get the T-Sql query t,here you need to mention the exact criteria which you are looking for, and then you will get the desired rows and then you can edit.
Thanks
Manish
Please use Marked as Answer if my post solved your problem and use
Vote As Helpful if a post was useful. -
SQL syntax error when creating record insertion form
Good day,
I was hoping someone could help me. I am trying to create a record insertion form on a website to insert data into a database table. When attempting to create the form, I am getting the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMaili' at line 1
Not sure what is going on. I am running windows 8 and DW cs5 w/ MYSQL. I am testing on a local server prior to pushing to the remote server.
Thank you for your assistance and please advise any code you would like me to send.Here is all the code from this particular webpage. I apologize, I am too stupid to realize which parts are SQL vice PHP vice HTML:
<?php require_once('Connections/group4.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO individual (Grade, LastName, FirstName, M.I., Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMailing Address`, Citizenship, Designation, IATrainingComplete, IADate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Grade'], "text"),
GetSQLValueString($_POST['LastName'], "text"),
GetSQLValueString($_POST['FirstName'], "text"),
GetSQLValueString($_POST['MI'], "text"),
GetSQLValueString($_POST['Organization'], "text"),
GetSQLValueString($_POST['Office'], "text"),
GetSQLValueString($_POST['Department'], "text"),
GetSQLValueString($_POST['Phone'], "double"),
GetSQLValueString($_POST['EmailAddress'], "text"),
GetSQLValueString($_POST['JobTitle'], "text"),
GetSQLValueString($_POST['OfficialMailing_Address'], "text"),
GetSQLValueString($_POST['Citizenship'], "text"),
GetSQLValueString($_POST['Designation'], "text"),
GetSQLValueString($_POST['IATrainingComplete'], "text"),
GetSQLValueString($_POST['IADate'], "text"));
mysql_select_db($database_group4, $group4);
$Result1 = mysql_query($insertSQL, $group4) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
mysql_select_db($database_group4, $group4);
$query_rsIndividual = "SELECT * FROM individual ORDER BY IndividualNumber ASC";
$rsIndividual = mysql_query($query_rsIndividual, $group4) or die(mysql_error());
$row_rsIndividual = mysql_fetch_assoc($rsIndividual);
$totalRows_rsIndividual = mysql_num_rows($rsIndividual);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Us</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.header {
font-size: 36px;
text-decoration: underline;
.quote {
font-size: 18px;
font-style: italic;
.tablethisone {
margin: 5px;
padding: 25px;
border: medium none #000;
text-align: center;
</style>
</head>
<body>
<p><img src="Images/EGA.png" width="227" height="222" alt="EGA" /><span class="header">SAAR Tracking System
</span></p>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.php">Home</a> </li>
<li><a href="search.php">Search</a></li>
<li><a href="contact.php">Contact Us</a> </li>
</ul>
<p> </p>
<p>PRIVACY ACT STATEMENT</p>
<p>Executive Order 10450, 9397; and Public Law 99-474, the Computer Fraud and Abuse Act.
To record names, signatures, and other identifiers for the purpose of validating the trustworthiness of individuals requesting
access to Department of Defense (DoD) systems and information. NOTE: Records may be maintained in both electronic
and/or paper form.</p>
<p> </p>
<p> </p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Grade:</td>
<td><input type="text" name="Grade" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">LastName:</td>
<td><input type="text" name="LastName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">FirstName:</td>
<td><input type="text" name="FirstName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">M.I.:</td>
<td><input type="text" name="MI" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Organization:</td>
<td><input type="text" name="Organization" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Office:</td>
<td><input type="text" name="Office" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Department:</td>
<td><input type="text" name="Department" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Phone:</td>
<td><input type="text" name="Phone" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">EmailAddress:</td>
<td><input type="text" name="EmailAddress" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">JobTitle:</td>
<td><input type="text" name="JobTitle" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">OfficialMailing Address:</td>
<td><input type="text" name="OfficialMailing_Address" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Citizenship:</td>
<td><input type="text" name="Citizenship" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Designation:</td>
<td><input type="text" name="Designation" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">IATrainingComplete:</td>
<td><input type="text" name="IATrainingComplete" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">IADate:</td>
<td><input type="text" name="IADate" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Insert record" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Disclosure of this information is voluntary; however, failure to provide the requested information may impede, delay or
prevent further processing of this request.</p>
<p class="quote">"Be polite, be professional, but have a plan to kill everybody you meet" General James Mattis</p>
<p> </p>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($rsIndividual);
?> -
Help with Finding Duplicate records Query
HI,
I am trying to write a query that will find duplicate records/cases.
This query will be used in a report.
So, here are the requirements:
I need to find duplicate cases/records based on the following fields:
DOB, DOCKET, SENT_DATEI was able to do that with the following query. The query below is able to give me all duplicate records based on the Criteria above
SELECT DEF.BIRTH_DATE DOB,
S.DOCKET DOCKET,
S.SENT_VIO_DATE SENT_DATE, COUNT(*)
FROM SENTENCES S,
DEFENDANTS DEF
WHERE S.DEF_ID = DEF.DEF_ID
AND S.CASE_TYPE_CODE = 10
GROUP BY DEF.BIRTH_DATE, S.DOCKET, S.SENT_VIO_DATE
HAVING COUNT(*) > 1;
//I AM GOING TO CALL THIS QUERY 'X'Now, the information to be displayed on the report: defendants Name, DOB, District, Docket, Def Num, Sent Date, and PACTS Num if possible.
The problem that I need help on is how to combine those queries together (what I mean is a sub query). the 'X' query returns multiple values. please have a look at the comments on the query below to see what I'm trying to achieve.
here is the main query:
SELECT INITCAP(DEF.LAST_NAME) || ' ' || INITCAP(DEF.FIRST_NAME) || ' ' || INITCAP(DEF.MIDDLE_NAME) DEFENDANT_NAME,
DEF.BIRTH_DATE DOB,
TRIM(DIST.DISTRICT_NAME) DISTRICT_NAME,
S.DOCKET DOCKET,
S.DEF_NUM DEF_NUM,
S.SENT_VIO_DATE SENT_DATE,
DEF.PACTS_ID PACTS_NUM
FROM USSC_CASES.DEFENDANTS DEF,
USSC_CASES.SENTENCES S,
LOOKUP.DISTRICTS DIST
WHERE DEF.DEF_ID = S.DEF_ID
AND S.DIST_ID = DIST.USSC_DISTRICT_ID
AND S.CASE_TYPE_CODE = 10
AND S.USSC_ID IS NOT NULL
AND // what i'm trying to do is: DOB, DOCKET, SENT_DATE IN ('X' QUERY), is this possible ??
ORDER BY DEFENDANT_NAME; thanks in advance.
I am using Oracle 11g, and sql developer.
if my approach doesn't work, is there a better approach ?
Edited by: Rooney on Jul 11, 2012 3:50 PMIf I got it right, you want to join table USSC_CASES.DEFENDANTS to duplicate rows in USSC_CASES. If so:
SELECT INITCAP(DEF.LAST_NAME) || ' ' || INITCAP(DEF.FIRST_NAME) || ' ' || INITCAP(DEF.MIDDLE_NAME) DEFENDANT_NAME,
DEF.BIRTH_DATE DOB,
TRIM(DIST.DISTRICT_NAME) DISTRICT_NAME,
S.DOCKET DOCKET,
S.DEF_NUM DEF_NUM,
S.SENT_VIO_DATE SENT_DATE,
DEF.PACTS_ID PACTS_NUM
FROM USSC_CASES.DEFENDANTS DEF,
SELECT *
FROM (
SELECT S.*,
COUNT(*) OVER(PARTITION BY DEF.BIRTH_DATE, S.DOCKET, S.SENT_VIO_DATE) CNT
FROM USSC_CASES.SENTENCES S
WHERE CNT > 1
) S,
LOOKUP.DISTRICTS DIST
WHERE DEF.DEF_ID = S.DEF_ID
AND S.DIST_ID = DIST.USSC_DISTRICT_ID
AND S.CASE_TYPE_CODE = 10
AND S.USSC_ID IS NOT NULL
ORDER BY DEFENDANT_NAME;If you want to exclude duplicates from the query and do not care which row out of duplicate rows to choose:
SELECT INITCAP(DEF.LAST_NAME) || ' ' || INITCAP(DEF.FIRST_NAME) || ' ' || INITCAP(DEF.MIDDLE_NAME) DEFENDANT_NAME,
DEF.BIRTH_DATE DOB,
TRIM(DIST.DISTRICT_NAME) DISTRICT_NAME,
S.DOCKET DOCKET,
S.DEF_NUM DEF_NUM,
S.SENT_VIO_DATE SENT_DATE,
DEF.PACTS_ID PACTS_NUM
FROM USSC_CASES.DEFENDANTS DEF,
SELECT *
FROM (
SELECT S.*,
ROW_NUMBER() OVER(PARTITION BY DEF.BIRTH_DATE, S.DOCKET, S.SENT_VIO_DATE ORDER BY 1) RN
FROM USSC_CASES.SENTENCES S
WHERE RN = 1
) S,
LOOKUP.DISTRICTS DIST
WHERE DEF.DEF_ID = S.DEF_ID
AND S.DIST_ID = DIST.USSC_DISTRICT_ID
AND S.CASE_TYPE_CODE = 10
AND S.USSC_ID IS NOT NULL
ORDER BY DEFENDANT_NAME;SY. -
Not getting all records in pagination
I am also have a problem getting all records in the report as the post on Apr. 21,2004. My reports pagination stops at 500. When I set the 'max row count' to 100000. The pagination at the bottom of my page disapears. When I leave 'max row count' empty, it only goes from 1-500. No way to view records past the 500th record.
I see there was a post on Apr. 21, 2004 about the same thing but it did not specify a fix or work around or if I'm missing a setting. (also tried the log off/on but did not help).
*My pagination Scheme is 'Row Ranges 1-15 16-30 in select list(wiht pagination)'
*My report has 1000+ records.
Thanks, PaulaThe actual number of rows supported by the select list depends on how many rows you show on each page. If you go with the default of 15 rows, you would be able to use the select list with close to 5000 rows. If you increase the number of rows per page, the select list will work with even more rows.
If the select list can't be used, it may make sense to consider using the "row ranges with set pagination" style. Set pagination lets you navigate from one set to the next instead of one page to the next, so you can navigate through your result set a lot quicker.
However the best option for reports with that many rows would be "row ranges x-y", without showing the total number of rows. The reason is that the report renders a lot faster if you don't have the total number of rows calculated. In order to better be able to find certain records, I would recommend a search field on your report page that lets you filter the result set.
Hope this helps,
Marc -
All Records not showing in Report
Hi All,
U just solved my amount problem....
But now i gives my earlier problem again, means displaying only 1 rows, when i executing for 1 month in selection criteria...and amount showing right total of all records...
example---
Document No......Doc. date.......P.date........Vendor..........Name.........Tax Code.........Base Amt....... Tax Amt........Ven. Ref.........P. Doc...
5500000022 .......22.04.2008 ...28.04.2008....1011............XXXXXXX........NB..................500,000............25,000.............A-102.......4500034463
This Document No. is my 1st Document no. (5500000022)..
Here Base Amount (500,000) & Tax Amount (25,000) is the total of more than 100 records total but showing in Single Row...(This rows showing the only 1st record)...
Here what is the problem in my program...where i m wrong in clearing the itab or itab2...
please let me know...
I m again sending my corrected Program...
Code-----
REPORT zak_form_c4 NO STANDARD PAGE HEADING LINE-SIZE 125 .
TABLES : bsik,bkpf,bseg,j_1imovend,lfa1,t001,t005u,bsak,ekko,bsis, ekkn, anla, anlc.
TYPE-POOLS : slis.
DATA : BEGIN OF itab OCCURS 0,
hkont LIKE bseg-hkont, "Gl account
mwskz LIKE bseg-mwskz, "Tax Code
dmbtr LIKE bseg-dmbtr, "Amount
buzei LIKE bseg-buzei, "line item
ebeln LIKE bseg-ebeln, "Purchasing Document
ebelp LIKE bseg-ebelp, "line item nbr
hwbas LIKE bseg-hwbas, "Base amount
shkzg LIKE bseg-shkzg, "Debit/Credit code
belnr LIKE bsik-belnr, "Document number
gjahr LIKE bsik-gjahr, "Fiscal Year
bldat LIKE bsik-bldat, "Document Date
budat LIKE bsik-budat, "Posting Date
lifnr LIKE bsik-lifnr, "Vendor number
xblnr LIKE mkpf-xblnr, "Ven invoice nbr
name1(25), "name1
ort01 LIKE lfa1-ort01, "City
j_1ilstno LIKE j_1imovend-j_1ilstno, " Vendor tin nbr
regio LIKE lfa1-regio, "Region Code
bezei LIKE t005u-bezei, "Region desc
dmbtr1 LIKE bseg-dmbtr, "Amount
hwbas1 LIKE bseg-hwbas, "Base amount
END OF itab.
DATA : BEGIN OF itab3 OCCURS 0.
INCLUDE STRUCTURE itab.
DATA:END OF itab3.
DATA : wa LIKE LINE OF itab.
DATA : BEGIN OF itab1 OCCURS 0.
INCLUDE STRUCTURE itab.
DATA:END OF itab1.
DATA : BEGIN OF itab2 OCCURS 0.
INCLUDE STRUCTURE itab.
DATA:END OF itab2.
***********************************Purchase order history
DATA: BEGIN OF bet OCCURS 50.
INCLUDE STRUCTURE ekbe.
DATA: END OF bet.
DATA: BEGIN OF bzt OCCURS 50.
INCLUDE STRUCTURE ekbz.
DATA: END OF bzt.
DATA: BEGIN OF betz OCCURS 50.
INCLUDE STRUCTURE ekbez.
DATA: END OF betz.
DATA: BEGIN OF bets OCCURS 50.
INCLUDE STRUCTURE ekbes.
DATA: END OF bets.
DATA: BEGIN OF xekbnk OCCURS 10.
INCLUDE STRUCTURE ekbnk.
DATA: END OF xekbnk.
DATA : w_container TYPE scrfname VALUE 'CL_GRID',
w_cprog TYPE lvc_s_layo,
g_repid LIKE sy-repid,
w_save TYPE c,
w_exit TYPE c,
cl_grid TYPE REF TO cl_gui_alv_grid,
cl_custom_container TYPE REF TO cl_gui_custom_container,
it_fld_catalog TYPE slis_t_fieldcat_alv,
wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
layout TYPE slis_layout_alv,
col_pos LIKE sy-cucol ,
alvfc TYPE slis_t_fieldcat_alv.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : hkont LIKE bseg-hkont OBLIGATORY. "GL Code
*SELECT-OPTIONS : hkont FOR bseg-hkont .
SELECT-OPTIONS : belnr FOR bsik-belnr .
SELECT-OPTIONS : gjahr FOR bsik-gjahr .
SELECT-OPTIONS : bldat FOR bsik-bldat.
SELECT-OPTIONS : budat FOR bsik-budat.
SELECTION-SCREEN : END OF BLOCK b1.
PERFORM fill_catalog1 USING:
'HKONT' 'ITAB2' 'G/L Code' ,
'BELNR' 'ITAB2' 'Document Number',
'GJAHR' 'ITAB2' 'Year',
'BLDAT' 'ITAB2' 'Doc. date' ,
'BUDAT' 'ITAB2' 'Posting Date',
'LIFNR' 'ITAB2' 'Vendor',
'NAME1' 'ITAB2' 'Name',
'EBELN' 'ITAB2' 'Purchasing Document',
'MWSKZ' 'ITAB2' 'Tax Code',
'HWBAS' 'ITAB2' 'Base Amount',
'DMBTR' 'ITAB2' 'Tax Amount',
'XBLNR' 'ITAB2' 'Vendor Inv. No.'.
SELECT DISTINCT hkont belnr gjahr bldat budat INTO CORRESPONDING FIELDS OF TABLE itab
FROM bsis
WHERE bukrs = '1000'
AND hkont = hkont
AND belnr IN belnr
AND gjahr IN gjahr
AND bldat IN bldat
AND budat IN budat.
SORT itab BY belnr.
LOOP AT itab.
SELECT * FROM bseg WHERE belnr = itab-belnr AND gjahr = itab-gjahr
AND bukrs = '1000'
AND ( ebeln <> ' ' OR hkont = hkont ).
IF sy-subrc = 0.
itab-buzei = bseg-buzei.
itab-mwskz = bseg-mwskz.
IF bseg-ebeln <> ' '.
itab-ebeln = bseg-ebeln.
itab-ebelp = bseg-ebelp.
MODIFY itab.
ENDIF.
IF bseg-hkont = hkont.
itab-shkzg = bseg-shkzg.
itab-hwbas = bseg-hwbas.
itab-dmbtr = bseg-dmbtr.
IF itab-shkzg = 'H'.
itab-dmbtr = itab-dmbtr * ( -1 ).
ENDIF.
MOVE-CORRESPONDING itab TO itab2.
APPEND itab2.
ENDIF.
ENDIF.
ENDSELECT.
ENDLOOP.
LOOP AT itab2.
SELECT SINGLE * FROM ekko WHERE ebeln = itab2-ebeln.
IF sy-subrc = 0.
itab2-lifnr = ekko-lifnr.
ENDIF.
CALL FUNCTION 'ME_READ_HISTORY'
EXPORTING
ebeln = itab2-ebeln
ebelp = itab2-ebelp
webre = 'X'
TABLES
xekbe = bet
xekbz = bzt
xekbes = bets
xekbez = betz
xekbnk = xekbnk.
itab2-xblnr = bet-xblnr.
SELECT SINGLE * FROM lfa1 WHERE lifnr = itab2-lifnr.
itab2-name1 = lfa1-name1.
itab2-ort01 = lfa1-ort01.
itab2-regio = lfa1-regio.
SELECT SINGLE * FROM t005u WHERE bland = itab2-regio
AND spras = 'EN'
AND land1 = 'IN'.
itab2-bezei = t005u-bezei.
SELECT SINGLE * FROM j_1imovend WHERE lifnr = itab2-lifnr.
IF sy-subrc = 0 .
itab2-j_1ilstno = j_1imovend-j_1ilstno. " Vendor tin nbr
ENDIF.
MODIFY itab2.
ENDLOOP.
SORT itab2 BY belnr.
LOOP AT itab2.
DATA : cnt TYPE i,
cnt1 TYPE i.
itab1-dmbtr1 = itab1-dmbtr1 + itab2-dmbtr.
itab1-hwbas1 = itab1-hwbas1 + itab2-hwbas.
AT END OF belnr.
cnt = sy-tabix.
cnt1 = cnt - 1.
DO cnt1 TIMES.
DELETE itab2.
ENDDO.
CLEAR itab2.
itab2-dmbtr = itab1-dmbtr1.
itab2-hwbas = itab1-hwbas1.
MODIFY itab2 TRANSPORTING dmbtr hwbas .
ENDAT.
ENDLOOP.
layout-zebra = 'X' .
layout-colwidth_optimize(1) = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZAK_FORM_C4'
is_layout = layout
it_fieldcat = it_fld_catalog
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab2
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.
*& Form FILL_CATALOG1
text
-->P_FIELDNAME text
-->P_REF_TABLE text
-->P_SCRTEXT text
FORM fill_catalog1 USING p_fieldname TYPE any
p_ref_table TYPE any
p_scrtext TYPE any.
CLEAR : wa_fld_catalog.
wa_fld_catalog-fieldname = p_fieldname.
wa_fld_catalog-tabname = p_ref_table.
wa_fld_catalog-seltext_s = p_scrtext.
wa_fld_catalog-seltext_m = p_scrtext.
wa_fld_catalog-seltext_l = p_scrtext.
wa_fld_catalog-datatype = 'CURR'.
wa_fld_catalog-outputlen = 20.
APPEND wa_fld_catalog TO it_fld_catalog.
ENDFORM. " fill_catalog1.
Plz let me know...
ThanksHello Prince,
I just want that my code will show single time records..and Sum of base Value and Tax amount...
You want to summarise Base Value and Tax amount per document, right
I am making a very very small modification to the declaration of ITAB:
DATA :
BEGIN OF itab OCCURS 0,
belnr LIKE bsik-belnr, "Document number "--> Add here
buzei LIKE bseg-buzei, "line item "--> Add here
hkont LIKE bseg-hkont, "Gl account
mwskz LIKE bseg-mwskz, "Tax Code
dmbtr LIKE bseg-dmbtr, "Amount
" buzei LIKE bseg-buzei, "line item "--> Delete Here
ebeln LIKE bseg-ebeln, "Purchasing Document
ebelp LIKE bseg-ebelp, "line item nbr
hwbas LIKE bseg-hwbas, "Base amount
shkzg LIKE bseg-shkzg, "Debit/Credit code
" belnr LIKE bsik-belnr, "Document number "--> Delete here
gjahr LIKE bsik-gjahr, "Fiscal Year
bldat LIKE bsik-bldat, "Document Date
budat LIKE bsik-budat, "Posting Date
lifnr LIKE bsik-lifnr, "Vendor number
xblnr LIKE mkpf-xblnr, "Ven invoice nbr
name1(25), "name1
ort01 LIKE lfa1-ort01, "City
j_1ilstno LIKE j_1imovend-j_1ilstno, " Vendor tin nbr
regio LIKE lfa1-regio, "Region Code
bezei LIKE t005u-bezei, "Region desc
dmbtr1 LIKE bseg-dmbtr, "Amount
hwbas1 LIKE bseg-hwbas, "Base amount
END OF itab.
And modified the code as below:
DATA:
V_DMBTR TYPE DMBTR,
V_HWBAS TYPE HWBAS.
LOOP AT ITAB2.
V_DMBTR = V_DMBTR + ITAB2-DMBTR.
V_HWBAS = V_HWBAS + ITAB2-HWBAS.
AT END OF BELNR.
ITAB2-DMBTR = V_DMBTR.
ITAB2-HWBAS = V_HWBAS.
APPEND ITAB2 TO ITAB3.
CLEAR: ITAB2, V_DMBTR, V_HWBAS.
ENDAT.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZAK_FORM_C4'
is_layout = layout
it_fieldcat = it_fld_catalog
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab3 "itab2 --> Use ITAB3 instead of ITAB2
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.
BR,
Suhas
Edited by: Suhas Saha on Jan 13, 2009 3:23 PM -
How can I make a report of all records with the date in the last two weeks?
Hi!
I have records with a date field, I want to create a report that only includes records with a date which is within the last two weeks of the system date, is this possible? Surely this is a basic database function, I would have thought, but I can find no help about it and there's very little in Mac Help about doing anything other than simple stuff with reports.
I'm not a genius with databases, so help with any required formula or what have you would be great!Hi Jonathan,
Here's a formula you can use with the Match function. 'Date' is the name of the date field, which must be a "Date" type field.
'Date'>NOW()-14
Match will select (highlight) all records matching the query. You'll then need to use Organize > Hide Unselected to show only the matches.
Unfortunately, I haven't found a way to make the NOW() function work in a Find request, and neither Match requests nor Hide Unselected can be included in a recorded search, either of which would reduce repeating the report to a one-button operation.
Regards,
Barry -
hi all,
tell me the steps how to find a record in PSA.suppose there are >20 data packages..how can i find out that specific record from those datapackages with out knowing datapackage..
thanks,
jackHi Jack,
It so happens that when data is pulled into the PSA there will be no specific order. Hence it is impossible to know which record is present in which data package.
But if you want to know how many error records are there and what are those there are always options of selecting all the packets and display only erraneous records.
Regards,
Pramod -
When pulling music from a harddrive and it say music can not be found, is there a way to stop this from happening every time I play music on my computer? It used to find all music when serching for song but now it only finds 1 at a time. I have over 2000 songs so I can't go through this every time.
1) However I do not want to move my itunes Music onto the flash drive, only my Movies, and want to keep my music on my hard drive.
Is this possible?
Yes
2) Do the MacBook Air's not have a separate program other than itunes that can play movies? If so, is there a program I can get to solve this problem? I went onto the App Store to see if there was something I could download, but all the apps were for creating DVD's, not simply playing them.
If you can play the movies in iTunes, you should be able to open the movie files using Quicktime, which should already be on your system. If you have already transferred the files to your flash drive, open the flash drive in Finder, and hold control when you click on the movie file (or right click if you have the enabled) and select Open With Quicktime Player. This should play the movie directly from the flash drive.
If you want to set all .m4v files to open with Quicktime by just double clicking on the file, you can follow the steps here: http://www.tech-recipes.com/rx/2573/os_x_how_to_change_default_application_to_op en_file_type/
3) If 1. & 2. questions are solvable, will it then be safe to delete the movies from my itunes?
You can move the TV shows to your flash drive by dragging them from the iTunes window to your flash drive in Finder or the flash drive icon on the desktop. When you are sure everything is transferred over to your external device, you can delete the movie from iTunes. I recommend playing the videos from the flash drive first before deleting them in iTunes.
To delete the videos from iTunes, you can highlight them and press the delete key on your keyboard. In the next prompt, you would want to move it to the trash so that it is deleted from your internal hard drive.
I hope that helps! -
I am getting the following error while running JSP. Can anyone guide me.
Caught "com.evermind.server.rmi.OrionRemoteException" while attempting to find all DepartmentBean entries.
com.evermind.server.rmi.OrionRemoteException: Database error: Io exception: The Network Adapter could not establish the connection; nested exception is: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Add entry
I have doubt in
My rmi.xml file
<?xml version="1.0" standalone='yes'?>
<!DOCTYPE rmi-server PUBLIC "Orion RMI-server" "http://xmlns.oracle.com/ias/dtds/rmi-server.dtd">
<rmi-server port="23791" >
<!-- A remote server connection example -->
<!-- <server host="the.remote.server.com" username="adminUser" password="123abc" /> -->
<!-- <server host="169.254.162.207" username="admin" password="welcome" /> -->
<!-- <server host="prg-fg9s9g12dnz" username="admin" password="welcome" /> -->
<!-- path to the log-file where RMI-events/errors are stored -->
<log>
<file path="../log/rmi.log" />
</log>
</rmi-server>
If I give server host line My oc4j server is NOT initialized.
In My Data Sources file :
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="jdbc/DBConnection"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/DBConnection"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="RajiveShukla"
password="pujavrms1"
url="jdbc:oracle:thin:@localhost:1521:wbs"
inactivity-timeout="30"
/>
And JSP which I run is :
<%
* list.jsp
* Lists all the entries stored through EmployeeBean. This JSP is the only JSP
* that will actually connect to the entity bean. On success, it will save a
* reference to the entity bean in the session. So there will be one reference
* to the bean per session.
%>
<%@ page import="com.webstore.*,java.io.*,java.net.*,java.util.*,javax.naming.*,javax.rmi.*" %>
<%
// Make sure this page will not be cached by the browser
response.addHeader("Pragma", "no-cache");
response.addHeader("Cache-Control", "no-store");
// We will send error messages to System.err, for verbosity. In a real
// application you will probably not want this.
PrintStream errorStream = System.err;
// If we find any fatal error, we will store it in the "error" variable. If
// an exception is caught that corresponds with this error message, then we
// will store it in the "exception" variable.
String error = null;
Exception exception = null;
// First check if the reference to the EJB is already stored in the session.
DepartmentHome home = (DepartmentHome) session.getAttribute("DepartmentHome");
// If not, then attempt to get the initial JNDI context.
if (home == null) {
// When attempting to connect to JNDI, we store the reference to the
// initial JNDI context in this variable. We will use it to lookup the
// entity bean.
Context context = null;
try {
context = new InitialContext();
} catch (Exception e) {
exception = e;
error = "Caught \"" + exception.getClass().getName() + "\" while " +
"attempting to create the initial JNDI context.";
errorStream.println(error);
exception.printStackTrace(errorStream);
// We have specified "EmployeeBean" in the web.xml file as the name
// by which we would like to contact the EmployeeBean home interface. We will
// have to prepend "java:comp/env/", the root `directory' for enterprise
// beans.
//final String location = "java:comp/env/DepartmentBean";
if (error == null) {
try {
// Attempt to lookup an object at the specified location in the JNDI
// context.
//Object boundObject = context.lookup(location);
Object boundObject = context.lookup("Department");
// Try to convert it to an instance of EmployeeBean, the home
// interface for our bean.
home = (DepartmentHome) PortableRemoteObject.narrow(boundObject,
DepartmentHome.class);
// If we got this far, we've done it, let's save the reference to the
// Employee home interface in the session for future use by both
// this page and the other JSP pages.
session.setAttribute("DepartmentHome", home);
} catch (Exception e) {
exception = e;
error = "Caught \"" + exception.getClass().getName() + "\" while " +
"attempting to lookup the Department bean at \"" + "\".";
//location + "\".";
errorStream.println(error);
exception.printStackTrace(errorStream);
// This is the variable we will store all records in.
Collection recs = null;
if (error == null) {
try {
recs = home.findAll();
} catch (Exception e) {
exception = e;
error = "Caught \"" + exception.getClass().getName() + "\" while " +
"attempting to find all DepartmentBean entries.";
errorStream.println(error);
exception.printStackTrace(errorStream);
// Decide what the title will be.
String title;
if (error != null) {
title = "Error";
} else {
title = "com.webstore | List of entries";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE><%= title %></TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<H1><%= title %></H1>
<%
// Display the error message, if any.
if (error != null) {
%>
<P><BLOCKQUOTE><%= error %></BLOCKQUOTE>
<%
// Display the exception message, if any.
if (exception != null) {
%>
<P><BLOCKQUOTE><CODE><%= exception %></CODE></BLOCKQUOTE>
<%
} /* if */
} else {
// If there are no recs to be displayed, display a descriptive text.
if (recs.size() == 0) {
%>
<P><BLOCKQUOTE>No entries found.</BLOCKQUOTE>
<%
// Otherwise display a table with all columns, and
// display two extra choices: "Edit" and "Delete".
} else {
%>
<P><TABLE border="1" width="100%">
<TR>
<TD><STRONG>DptNo (long)</STRONG></TD>
<TD><STRONG>DptName (String)</STRONG></TD>
<TD><STRONG>Actions</STRONG></TD>
</TR>
<%
Iterator iterator = recs.iterator();
while(iterator.hasNext()) {
Department rec = (Department) PortableRemoteObject.narrow(iterator.next(),
Department.class);
long dptNo = rec.getDptno();
String dptName= rec.getDptname();
// put all pk columns in hashtable for URLEncoding
Hashtable cols = new Hashtable();
cols.put("DPTNO",Long.valueOf("dptNo"));
// URLEncode columns as params to JSP
StringBuffer buf = new StringBuffer();
Enumeration params = cols.keys();
while (params.hasMoreElements()) {
String param = (String)params.nextElement();
String value = (String)cols.get(param);
buf.append(URLEncoder.encode(param) +
"=" + URLEncoder.encode(value));
if (params.hasMoreElements())
buf.append("&");
String editURL = "dptedit.jsp?" + buf;
String deleteURL = "dptdelete.jsp?" + buf;
%>
<TR>
<TD><%= dptNo %></TD>
<TD><%= dptName %></TD>
<TD><A href="<%= editURL %>">Edit</A> <A href="<%= deleteURL %>">Delete</A></TD>
</TR>
<%
} /* for */
%>
</TABLE>
<%
} /* else */
} /* else */
// Finally display a link to the page that allows the user to add an entry
// to the address book.
%>
<P><TABLE border="1">
<TR><TD><A href="dptadd.jsp">Add entry</A></TD></TR>
</TABLE>
</BODY>
</HTML>
Please guide me..Hi Avi,
Thanks,
I have already used earlier..
the data-sources file is as under.
<data-source class="com.evermind.sql.DriverManagerDataSource" name="jdbc/DBConnection" location="jdbc/OracleCoreDS" xa-location="jdbc/xa/OracleXADS" ejb-location="com.webstore.Department" connection-driver="oracle.jdbc.driver.OracleDriver" username="RajiveShukla" password="pxujxa" url="jdbc:oracle:thin:@PRG-FG9S9G12DNZ:1521:wbs" inactivity-timeout="30"/>
</data-sources>
The username and password and sid, I can connect in the sqlPlus
Do we have to give remote server name in rmi.xml.. It is not initilizing the J2EE server if we give that.??
I am using thin driver , if any change or any settings please write me..
Thanks in advance..
Rajive
Maybe you are looking for
-
No video after upgrading to 10.6
I have a serious problem on which I would like some advice. I upgraded my MacBook Pro from 10.5 to 10.6 yesterday. Everything seemed to go fine, also downloaded 10.6.1, and only had a few older applications that wouldn't boot (bounced on the dock a f
-
What are the advantages of Tomcat 6.x in comparison to Tomcat 5.5?
Hi, What are the advantages of Tomcat 6.x in comparison to Tomcat 5.5, in terms of performance, scalability, development and deployment. Is there any particular reason for the changed directory structure in Tomcat 6.x, other than making it simplified
-
Scripted Import MRU list from Office 2010.
Hello all, i was wondering if anyone could help with this, we have a script that exports the MRUs as reg keys from office 2010, it exports the following as a .reg file on the source machine, and on the destination machine it imports the reg key so a
-
I wanna connect my Laptop to my smart panasonic TV through wireless , for this laptop need to download Intel WiDi software but when i download it error is come that " intel wifi adaptor exist' how i can proceed for wireless connection to TV
-
What is the best methodology to build modular applications?
Hello, I am working on a project that uses database access quite heavily. Now, as I am a beginner, I wanted to go a very modular approach by building one module at the time and then assemble it in the overall application. I tried to use <SWFLoader> t