How to read data from success function
Hi,
In the success function of my POST method, I want to read a property from the data parameter. This is my code:
success : function(data, response) {
console.log(data);
alert("succes");
In the JS console:
I'd like to read the Guid property.
Thanks,
RW
Please refer to the snippet..
var sServiceUrl = "http://services.odata.org/V2/(S(ryt5lxvehordgneie5t10xpe))/OData/OData.svc/" ;
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true ) ;
var oData = {
"ID" : 93 ,
"Name" : 'Test',
"Price" : '3.3'
var fnSUCCESS = function(mResponse) {
debugger ;
console.log("SUCCESS", mResponse);
console.log('ID' + mResponse.ID);
var fnERROR = function(mResponse) {
console.log("ERROR", mResponse);
oModel.create('/Products',oData,null,fnSUCCESS,fnERROR);
Once you use JSON format, things become pretty straight forward.
You can use mResponse.<PROPERTY NAME> to access the data.
In your case <PROPERTY NAME> will be 'Guid'
In short, if you are inside your success method, either you can use data.Guid or response.data.Guid to access it the Guid property
Similar Messages
-
How to read data from a function exit
Hi friends,
I have a requirement, where in i am creating a screen exit for ME51N.I am using MEREQ001 enhancement for this.It is working fine, but i am to get data in to this so as to write any code.For that i am using the function exit EXIT_SAPLMEREQ_001 in that same enhancement(thought of doing export and import).
But the data is declared in this way..
REFERENCE(IM_REQ_ITEM) TYPE REF TO IF_PURCHASE_REQUISITION_ITEM
so now it is having a method GET_DATA in which i have all the parameters required.
can anyone please tell me how to read this data...
Regards,
Thoufique.thats ok friends..i got the solution.
Regards,
Thoufique -
How to read data from an internal table into a real table?
Hello experts,
I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created. I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider. I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created. Please see code below.
TABLES MULTITAB.
DATA:
query_name TYPE RSZCOMPID,
s_cubename TYPE RSINFOPROV,
t_cell_data TYPE RRWS_T_CELL,
t_axis_data TYPE RRWS_THX_AXIS_DATA,
t_axis_info TYPE RRWS_THX_AXIS_INFO,
wa_t_cell_data like line of t_cell_data,
wa_t_axis_data like line of t_axis_data,
w_corp_tab like line of t_cell_data.
s_cubename = 'CORP_MPO1'.
query_name = 'Z_corp_test'.
CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
EXPORTING
i_infoprovider = s_cubename
i_query = query_name
i_t_parameter = query_string_tab
IMPORTING
e_cell_data = t_cell_data
e_axis_data = t_axis_data
e_axis_info = t_axis_info.
If anyone has any information to help me, I would greatly appreciate it. Thanks.Hi,
<li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
<li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
LOOP AT t_cell_data INTO wa_t_cell_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
LOOP AT t_axis_data INTO wa_t_axis_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
Thanks
Venkat.O -
How to read data from a CLUSTER STRUCTURE not cluster table.
Hi,
how to read data from a CLUSTER STRUCTURE not cluster table.
regards,
Usha.Hello,
A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
Regards,
Mansi. -
How to read data from a file that was formatted by excel?
Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?
http://jakarta.apache.org/poi/hssf/index.html
HSSF stands for Horrible Spreadsheet Format, but it still works! -
How to read data from a router by using labview
I am a beginner labview. How to read data from a router by using labview ?
What kind of data are you trying to read?
Does the router behave like a webserver that you log into? If so, search the forums for threads discussing HTML. -
How to read data from a connected modem
any one can help me? how to read data from a connected modem. The modem received real-time data from other server. The data is in text format. I can see this text when I used hyperterminal for dial up and the data is accumulated such as:
@aa1235678
@bb2135647
@cc5214367
since it is real-time data, I want to read one line each time instantly when it arrives.You need to use the Java Communications API. (http://java.sun.com/products/javacomm/index.html)
-
How to read data from a zipped MS Access file?
How to read data from a zipped MS Access file?
RPJ,
You do not need to use the Close Zip File.vi when you unzip a folder. This VI is used when you are creating a zip folder.
As for examples, I found a couple of ActiveX based MS Access examples. These programs look to be pretty basic. For more in depth example I would search Microsoft Developers Network
http://zone.ni.com/devzone/cda/epd/p/id/2188
http://zone.ni.com/devzone/cda/epd/p/id/1694
Regards,
Jon S.
National Instruments
LabVIEW R&D -
Help me, How to read data from USB ???
Help me, How to read data from USB ???
If its a disk on key or some portable hard drive than once its connected to the usb and recognized by the system you can access it through java like you would access your hard drive.
-
JTable, how to read Data from it when enter is pressed
How to read Data from JTable on Return or lost focus from cell.
Also please tell me which listener I should should.
thx for helpYou should read the tutorial about tables, cell editors and models.
Also you should not [url http://forum.java.sun.com/thread.jsp?thread=472677&forum=57&message=2186815]crosspost
Mike -
How to Read data from Infocube
Dear Friends,
I have requirement to read data from Infocube.
I know the Function module(FM) which SAP provided. The FM name is RSDRI_INFOPROV_READ.
But when i am trying to execute this FM in SE37, it giving "Error generating the test frame" message.
I called this FM in start routine, it giving error while loading.
If any using this please let me know, how to use this. If any have sample code, please share.
Thx
RajHi,
i used to check documentation all time, but this time I forgot to check.
It is well documented. thx for igniting my mind.
bye
Raj -
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 data from structure RSTXT
Hi Everyone..
I have some problem with read data from structure RSTXT.
I am using transaction code vl02n -> for delivery select <b>Item</b> in item
overview tab -> Go to -> Item -> text.
I want display "<b>RSTXT-TXLINE</b>" field in <b>ALV</b> report how it can be possible?
If anyone knows about it plz reply me with example.
Thanks in Advance.Hi,
Use FM READ_TEXT
( Once on the text, plz display it in plain page mode :
then > Go To> header : Here you'll get the FM parameters : ID, Object, Name, ... )
Sample code :
DATA: BEGIN OF TTLINE OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF TTLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = L_ID
LANGUAGE = L_LANGUE
NAME = L_BL
OBJECT = 'VBBK'
TABLES
LINES = TTLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
Regards,
Erwan -
How to read data from analog input and export it to a file using Components Works
I've made a simple application (Delphi 5 using the activeX) that read data from analog input channel 0. After I read the data, I want to export it to a file using the Components Works on a 6035E NIDAQ. (I'm not using labview and don't want to use it)
How can I do that???
Regards,
FrancisHere's a sample code to do this...
P.S.: If you read only one channel this code won't work.
function MyFunction: Integer;
var
Low, High, i, j, ChannelCount, RowCount: Integer;
Po: P;
begin
//you are reading multiple channel
ChannelCount := VarArrayHighBound(Buffer, 1);
RowCount := VarArrayHighBound(Buffer, 2);
for i := 0 to ChannelCount do begin
for j := 0 to RowCount do begin
WriteToDisk(Buffer[i, j]));
end;
end;
end; -
Hi All,
I have a requirement to read data from LDAP. Currently i am using function module - LDAP_READ to access the data in the ABAP code but there is no data populated using this FM.
Please advice if anyone know about any FM to populate the LDAP data.
Thanks and Regards
Syed Samdanitry : LDAP_OBJECT_READ
Maybe you are looking for
-
Help - How To Add Email Account To ITunes
I've added a Gmail account to my iPhone (original model using iTunes 7.7 & OS 2.0) and Entourage and Mail applications. It works fine in both applications and the iPhone. My problem is that it does not appear in the list of my older mail accounts in
-
I need to download adobe reader 9 for windows 7. Can anyone provide me with a link?
I need to download adobe reader 9 for windows 7. Can anyone provide me with a link? Anyone have a link for Adobe reader 9?
-
IPhone 5S trapped in recovery mode after mistake made in update process.
My iPhone 5S is trapped in recovery mode after I option-clicked "update" and selected the iOS 7.1 beta build 11D5099e ipsw, when I needed to option click "restore" before doing so. I'm really getting desperate because I have no backups of my iPhone a
-
Black title screen not large enough to cover video: see edges of underlying video
Hello users, I am trying to use black title screens to display names of songs which are to appear for 5 seconds before fading and then showing the performer. I have the title screen on the track 2, above the video on track 1. I can see a very slight
-
Deleting a search button from the taskbar
Hello, Microsoft, How can I delete a search button from the taskbar? I think it is unnecessary, because most of the users use only search line or win + f Thanks for answer Sincerely yours, Max-Coyote