How to read records from Database view
Hi folks,
well...let me know, y im getting error as : V_T52EL is not defined in the ABAP dictionary as Table , Projection view or Database view.
But actually here this View Type is : Maitenance View.
SELECT KOART
from V_T52EL
where ENDDA GE SY-DATUM AND
SYMKO EQ T030-BWMOD.
plz let me know..guys.
Regards,
Kumar
Hello,
Maitenace View reocird can be viewed only through Tcode SM30
Vasanth
Similar Messages
-
How to retrive data from database views or projection views
how to retrive data from database views or projection views
Hi chintam,
1. Very simple
2. Just like normal select statement.
3. Select * from VIEWNAME.
4. (Instead of the tablename, we just have to give the viewname)
regards,
amit m. -
How to read records from Relationship table using ABAP API's
Hi All,
I need to retrieve the records from Relationship table. In Java API's I came to know there is an option to retrieve this. I could not find anything in ABAP API's. Is there any option in ABAP API's to do this.
Please Suggest.
Thank You,
Gajendra.Hi Gajendra,
You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
You will find all these methods in the following interface
Interface : IF_MDM_CORE_SERVICES
Hope it helps.
*Please reward points if found useful.
Thanks and Regards
Nitin Jain -
How to select value from database view with * in wher clause
Hi ,
I ahve a database view with some fields.
Now my requirement is to serach a single row on the basis of process type.
Process type can have values like ZBA,ZBC,ZBD,ZBE or similarly anything starting with ZB.
Now i know that starting two letters will be ZB , but dont knwo the last letter.
So how should i use select query for the same?
Should i use like operator for the same?
regards
PGhi,
u can use character '%'.sample code like this
SELECT reltype
instid_a
catid_a
instid_b
FROM /dbm/ord_docflow
INTO TABLE it_link
FOR ALL ENTRIES IN it_pnwtyh
WHERE instid_a = it_pnwtyh-instid_a AND
instid_b LIKE 'QMSM%' AND
typeid_a = 'BUS2400' AND
typeid_b = 'BUS2400' AND
catid_a = 'BO' AND
catid_b = 'BO' AND
reltype = 'VONA'.
this is similar to using* while we fetch values from table.in the above code only i no QMSM rest values not sure,so used QMSM% -
How to read data from database to applet
hi i am writing a program below which reads data from mysql database successfully ;
import java.sql.*;
import java.lang.*;
import java.util.*;
public class Read_Capital_country_from_database {
public static void main (String args[] ){
int index,mess;
String country_arr[] = new String[250];
String capital_arr[] = new String[250];
int i = 0 ;
String URL = "jdbc:mysql://localhost/allusers";
String user = "shadab";
String password ="shadab@123";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(URL,user,password);
for( SQLWarning warn = conn.getWarnings(); warn != null; warn = warn. getNextWarning() )
System.out.println( "SQL Warning:" ) ;
System.out.println( "State : " + warn.getSQLState() ) ;
System.out.println( "Message: " + warn.getMessage() ) ;
System.out.println( "Error : " + warn.getErrorCode() ) ;
String sql = "select * from country_capital";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while( rs.next() ) {
System.out.println( rs.getString(1) );
System.out.println(" " +rs.getString(2) );
System.out.println();
catch (SQLException se){
System.out.println( "SQL Exception:" ) ;
System.out.println("Exception - raju");
while( se != null )
System.out.println( "State : " + se.getSQLState() ) ;
System.out.println( "Message: " + se.getMessage() ) ;
System.out.println( "Error : " + se.getErrorCode() ) ;
se = se.getNextException() ;
catch( Exception e )
System.out.println( e ) ;
java Read_Capital_country_from_database
OUT PUT OF ABOVE PROGRAM IS :
INDIA NEW DELHI
PAKISTAN ISLAMABAD
AFGHANISTAN KABUL
BUT SAME PROGRAM WHEN I GO TO WRITE IN APPLET
THIS TIME APPLET DOES OPEN BUT ERROR SHOWS ON STANDARD OUT PUT
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
THIS IS THE PROGRAM WRITTEN FOR JAVA APPLET
import java.sql.*;
import java.lang.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Read_Capital_country_from_database extends Applet {
Choice country, capital;
String msg=" ", msg1;
int index,mess;
String country_arr[] = new String[250];
String capital_arr[] = new String[250];
char chr;
int i = 0;
public void init() {
country = new Choice();
capital = new Choice();
String URL = "jdbc:mysql://localhost/allusers";
String user = "shadab";
String password ="shadab@123";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(URL,user,password);
for( SQLWarning warn = conn.getWarnings(); warn != null; warn = warn. getNextWarning() )
System.out.println( "SQL Warning:" ) ;
System.out.println( "State : " + warn.getSQLState() ) ;
System.out.println( "Message: " + warn.getMessage() ) ;
System.out.println( "Error : " + warn.getErrorCode() ) ;
String sql = "select * from country_capital";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while( rs.next() ) {
country_arr[i] = rs.getString(1);
country.add(country_arr);
capital_arr[i] = rs.getString(2);
capital.add(capital_arr[i]);
i++;
catch (SQLException se){
System.out.println( "SQL Exception:" ) ;
System.out.println("Exception - raju");
while( se != null )
System.out.println( "State : " + se.getSQLState() ) ;
System.out.println( "Message: " + se.getMessage() ) ;
System.out.println( "Error : " + se.getErrorCode() ) ;
se = se.getNextException() ;
catch( Exception e )
System.out.println( e ) ;
add(country);
add(capital);It doesn't make sense to read a database directly from an applet. If an applet needs data from a database is should request if from the server which the applet is located on and the server should do the actual database actions.
The whole point of applets is that they require no installation on the client machine. If you have to change policy files or the like, you might as well install a Swing application. Furthermore accessing a database tends to depend on how the client is set up on the network. Any sensible network has firewall settings that block access to the database ports to any external access (and, again, if you are limiting the facility to a few internal machines then why not just install a program on them). -
How to Read records from structure to internal table
HI,
Can any body know how to read the records from structure to internal table at runtime.
please give me sample program if possible.
thanks in advance
KPif your internal table is having the same structure as the structure you are reading the values from then you can directly assign like..
internatable table work area or header line = structure.
or else if they are different assign field by field like
internal table-field1 = structure-field1.
internal table-field2 = structure-field2.
award points if it helps. -
How Can i Read data From Maintainance View
I Want read data from Maintainance View. i written select query
SELECT *
FROM J_1yyyyV
INTO TABLE GT_BUSPLACE.
WHERE BUPLA = LV_BUPLA.
this is giving following error
"J_1yyyyV" is not defined in the ABAP Dictionary as a table,
projection view, or database view.
Can you help me Please.
Thanks in Advance.
Regards,
Raj.Hi raj,
maintainance view is a nothing but combinations of table using join on some fields..
see the relation ship between the joins..
if you want to write selection query ..go to se11 -->enter view name >and open tab>
Table/Join conditions--> see the table's involved and join conditons between tables.
and write the select query same as like the Table/Join conditions in se11..now you can acheive the
table maintainance fields..
Prabhudas -
How to delete records from standard maintenance view
Dear Sir/Madam,
i want to delete records from standard view " v_mmim_rep_cust "
This is a standard maintenance view , used in MBLB report.
here i found the records with different report name but same fields as shown below...
REPORT TABLE NAME FIELD NAME
RM07DOCS MKPF BKTXT
RM07DOCS MKPF BLDAT
RM07DOCS MKPF BUDAT
RM07DOCS MSEG ANLN1
RM07DOCS MSEG ANLN2
RM07DOCS MSEG APLZL
YRM07DOCS MKPF BKTXT
YRM07DOCS MKPF BLDAT
YRM07DOCS MKPF BUDAT
YRM07DOCS MSEG ANLN1
YRM07DOCS MSEG ANLN2
YRM07DOCS MSEG APLZL
I WANT TO DELETE THE RECORDS FROM THE VIEW WITH REPORT = YRM07DOCS.
PLEASE HELP ME.
Thanks in Advance,
Dastagiri.Dear Sir,
when i did so , it displays a message that " entry mseg zeile must not be deleted ".
hense i went through writing a program to delete the records from table mmim_rep_cust
but it says that record not found.
program logic :
delete from mmim_rep_cust
where report in report
and TABNAME in TABNAME.
if sy-subrc = 0.
write ' RECORDS DELETED SUCCESSFULLY'.
else.
write ' RECORD NOT FOUND'.
endif.
please guide me to delete the records from the view.
Thanks in advance,
Dastagiri. -
Using ResultSet to read records from multiple tables
Im using a ResultSet object to read records from tables.
I have a database with 5 tables. Initially, I got it to work fine with one of those tables. What Im exactly trying to do is check if there is a record in a table which matches a given string, and if it does, display some text on some JTextFields. I got that to work fine with one table.
Problem is, how do I get it to work with all 5 tables at the same time?
i.e. instead of searching through one table, I want it to look through all 5 tables and look for the matches.
Any help greatly appreciated.
ThanksAfter the first interaction with the first table, I
used a stmt.getMoreResults() followed by instructions
to get data from the second table, and so on.
Worked fine.Sounds remarkably inefficient. (Potential for lots of network traffic.)
is this another way of doing it?Sounds more like a document search type of thing than a database query. What about Lucene? Could it help here?
% -
Fetch records from Database based on Input value
Hi Experts,
In my mobile application, I have designed one input field with F4 help or input assist. I need to fetch records from database based on that input and need to display records in table.
My question is:
How to fetch the records from database/back end based on the input value and display them as table format as we are doing in SAP ABAP?
Here, I need to fetch the records based on input value available in the UI screen and pass that value to gateway, fetch the records from database and need to bind with table in SAPUI5.
Kindly share the whole process flow with sample code for this requirement. Hope I have explained the requirement in detail.
Thanks In Advance..
Regards,
Arindam Samanta.Hi,
Try something like this.
In this, I am passing From date, To date, RelGrp, RelStr, Uname as input. Then I am storing those values in variables and passing this data in Odata request.
OData.read({ requestUri: "http://xxxx:8000/sap/opu/odata/sap/Z188_PO_SRV/pos?$filter=Docdate le datetime'"
+ todateformat+"T00:00:00' and Docdate ge datetime'"
+ fromdateformat+"T00:00:00' and RelGrp eq '"
+ relcode +"'and RelStr eq '"
+ relstg +"'and Uname eq '"
+ username+ "' "},
function (data) {
console.log(data);
When we are giving correct inputs it will goes to Success function and get the data from back end.
In console we can see the data.
Hope this will helps to you.
Thanks&Regards
Sridevi -
CMP Entity Bean from dataBase views
Hi forum,
I Have to migrate an existing application to JEE (with EJB3).
In this application there are a lot of dataBase views.
I'm new in EJB3 and I don't know how to structure cleanly entity beans (Specially when it are created from dataBase views).
My problem is that for each query made from the same dataBase view I almost have to create a new entity bean with a different @Id.
What can I do to to avoid it?
I had thought to genrate a new @Id (attribute not persistent) but I think is not possible. It's right ?
Someone can help me ?
Thanks"CMP provides you with database independence and less coding efforts."
BMP is not database dependent, unless you invoke database specific things in your SQL (something I do not do). CMP on the otherhand is inherently appserver specific (which was it's goal when BEA, IBM, et al. came up with it), and still limits your design possibilities. See this thread for an example:
http://forum.java.sun.com/thread.jsp?forum=13&thread=318785
As for less coding effort, that is a relative statment. Yes a simple CMP bean requires less coding to develop the first time. I personally view a few lines of SQL to load and store the data as being fairly trivial. But that needs to be offset with the problems inherent in using appserver specific CMP implementations.
As an example, try mapping WebSphere CMP to a pre-existing database without using IBM's IDE. It's an incredible pain in the ass since WebSphere does not come with a "meet-in-the-middle" solution. Any J2EE developer that has had the experience of working with different appservers (especially if they have had to port an app, as I have) can attest to the complications that arise with each implementation.
A BMP bean, written with non-DB-specific SQL, is the most portable, most flexible approach to EntityBeans. Yes, it requires the developer to be able to write some SQL, which should not take a significant amout of time. WRT queries, you have to write them, either SQL, EQL, or some appserver specific format.
As an aside, the use of code generators to simplify the creation of EJBs lends itself well to BMP. By using a (or writing your own) code generator, you can mitigate the annoying SQL bugs that creep up early in development. -
Fetch last record from database table
hi,
how to fetch last record from database table.
plz reply earliest.
Regards,
Jyotsna
Moderator message - Please search before asking - post locked
Edited by: Rob Burbank on Dec 11, 2009 9:44 AMabhi,
just imagine the table to be BSEG or FAGLFLEXA... then what would be performance of the code ?
any ways,
jyotsna, first check if you have a pattern to follow like if the primary key field have a increasing number range or it would be great if you find a date field which stores the inserted date or some thing..
you can select max or that field or order by descending using select single.
or get all data.. sort in descending order.(again you need some criteria like date).
read the first entry. using read itab index 1 -
Problem When deleting record from database
Hi ,
I have a question. Firstly I'm using VB
I have a problem about deleting any record from access database , That's the code I'm use it for add new item and it's work but it's not work when I tried to edit any rows " it's not want to Save" but work for add new Item.
Try
Me.Validate()
Me.CustomerBindingSource.EndEdit()
Me.CustomerTableAdapter.Update(Me.KonoDataSet.Customer)
MsgBox("Update Successful")
Catch ex As Exception
MsgBox("Update Failed")
End Try
And That's my code for Deleting any record from database But it's not work and that's a problem.
CustomerBindingSource.RemoveCurrent()
CustomerBindingSource.EndEdit()
Me.CustomerTableAdapter.Update(Me.KonoDataSet.Customer)
Can anybody help me about that issue ?Hi kono20006000,
Your issue seems really strange. I would recommend you make a troubleshooting.
1.Made sure your code works with the single copy of the database. You could check if it scans hard drive for the database file name and check if it modifies dates on found files. You could check if you operate with the same database.
2. Use the application update the record at the form_load event to see if it would work correctly.
3.Check the table in update statement and the table in add statement.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
How to extraxct data from a view.
hi,
i'm tying to extrct data from a view vbdka, with select. but i;m getting a syntax error that it anot a DB Table or DB view, pls tell me how to extract data from that view.
thanks.hi,
just check out if u have declared the table or not n see if it is not a structure also
madhuri. -
Urgent help with simple BPEL process for reading data from database
Hello there,
I need help with BPEL project.
i have created a table Employee in Database.
I did create application, BPEL project and connection to the database properly using Database Adapter.
I need to read the records from the database and convert into xml fomat and it should to go approval for BPM worklist.
Can someone please describe me step by step what i need to do.
Thx,
DpsI have created a table in Database with data like Empno,name,salary,comments.
I created Database Connection in jsp page and connecting to BPEL process.
It initiates the process and it goes automatically for approval.
Please refer the code once which i created.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.Map" %>
<%@page import="com.oracle.bpel.client.Locator" %>
<%@page import="com.oracle.bpel.client.NormalizedMessage" %>
<%@page import="com.oracle.bpel.client.delivery.IDeliveryService" %>
<%@page import="javax.naming.Context" %>
<%@page import="java.util.Hashtable" %>
<%@page import="java.util.HashMap" %>
<%@ page import="java.sql.*"%>
<%@ page import= "jspprj.DBCon"%>
<html>
<head>
<title>Invoke CreditRatingService</title>
</head>
<body>
<%
DBCon dbcon=new DBCon();
Connection conn=dbcon.createConnection();
Statement st=null;
PreparedStatement pstmt=null;
Hashtable env= new Hashtable();
ResultSet rs = null;
Map payload =null;
try
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "opmn:ormi://localhost:port:home/orabpel");//bpel server
env.put("java.naming.security.principal", "username");
env.put("java.naming.security.credentials", "password");//bpel console
Locator locator = new Locator("default","password",env);
IDeliveryService deliveryService =
(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
java.util.HashMap map = new HashMap();
st=conn.createStatement();
out.println("connected");
String query1="Select * from EMPLOYEE";
rs=st.executeQuery(query1);
/*reading Data From Database and converting into XML format
so that no need of going to BPEL console and entering the details.
while (rs.next()){
String xml1 = "<AsynchBPELProcess1ProcessRequest xmlns='http://xmlns.oracle.com/AsynchBPELProcess1'>"+
"<Empno>"+rs.getString(1)+"</Empno>"+
"<EmpName>"+rs.getString(2)+"</EmpName>"+
"<Salary>"+rs.getString(3)+"</Salary>"+
"<Comments>"+rs.getString(4)+"</Comments>"+
"</AsynchBPELProcess1ProcessRequest>";
out.println(xml1);
nm.addPart("payload", xml1 );
// EmployeeApprovalProcess is the BPEL process in which human task is implemented
deliveryService.post("EmployeeApprovalProcess", "initiate", nm);
// payload = res.getPayload();
out.println( "BPELProcess CreditRatingService executed!<br>" );
// out.println( "Credit Rating is " + payload.get("payload") );
//Incase there is an exception while invoking the first server invoke the second server i.e lsgpas13.
catch(Exception ee) {
//("BPEL Server lsgpas14 invoking error.\n"+ee.toString());
%>
</body>
</html>
Its working fine.And i want it for Bulk approvals.please help me step by step procedure if any other way to implement this.
Maybe you are looking for
-
my tnsping is ok. C:\>tnsping erptst TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 12-╧و╙ع╚ ╤-2006 16:28:47ع↕ Copyright (c) 1997, 2003, Oracle. All rights reserved. Used parameter files: N:\sqlnet.ora Used TNSNAMES adapter t
-
Hello ABAPers, I have this code: SELECT ebeln bukrs FROM ekko INTO TABLE it_ekko FOR ALL ENTRIES IN idata WHERE ebeln = idata-vbeln_p. LOOP AT idata WHERE ebeln IS NOT INITIAL. READ TABLE it_ekko WITH KEY ebeln = idata-ebeln
-
Missing computername in output of script
My goal is to produce a quick report that the techs can use to find inconsistencies involving Adobe Flash and other installs. I have the following code and it works as far as giving the information, but I am missing the computer name. I don't think I
-
Omwb hangs after entering source-db details [ibm db2]
hi, as there is no possibility to use migration workbench on linux to migrate db2 v7 udb, i have to run it on windows. i cant connect to the source-db via db2 command line, the repository gets installed, plugins are found - everything seems to be ok
-
Error in Sales Transaction in CRM 4.0 ?
Hi All, We are working on CRM 4.0 i have created a sales transaction in WEB and transaction will see in CRM and it is getting downloaded to R/3. But when I go back to CRM and check Sales Transaction it is showing me error as "An error has occured in