Regarding how to Read data when it is in offline in SMP 3.0
I have a big problem guyz...I am working on a hybrid Mobile App
When I am in Online I am able to read the data.When I kill the application and relaunch the app and place the App in Airplane mode and when I try to read the data It is throwing me a error in browser stating "ERR_CONN_RESET" and in the device I am getting an error such as HTTPREQUESTFAILED....
Mithun Please help us in reading the data in offline Mode.Please help us it is on high priority
Tags edited by: Jitendra Kansal (Moderator)
Yeah for sure mithun,
function read() {
if(navigator.onLine){
alert("hi");
updateStatus2("read request started");
startTime = new Date();
clearTable();
if (!haveAppId()) {
return;
var sURL = applicationContext.applicationEndpointURL + "/DateFormats";
console.log("Date Formats Fetched"+ sURL);
var oHeaders = {};
oHeaders['Authorization'] = authStr;
oHeaders['X-SMP-APPCID'] = applicationContext.applicationConnectionId; //this header is provided by the logon plugin
oHeaders['Content-Type'] = "application/xml";
oHeaders['X-CSRF-Token'] = "FETCH";
var request = {
headers : oHeaders,
requestUri : sURL,
method : "GET"
console.log("read using " + sURL);
OData.read(request, readSuccessCallback, errorCallback);
else{
sap.OData.applyHttpClient();
//OData.read(request,readSuccessCallback,errorCallback);
function readSuccessCallback(data, response) {
var endTime = new Date();
var duration = (endTime - startTime)/1000;
updateStatus2("Read " + data.results.length + " records in " + duration + " seconds");
var productsTable = document.getElementById("ProductsTable");
for (var i = 0; i < data.results.length; i++) {
var row = productsTable.insertRow(1);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.innerHTML = data.results[i].DateFormatType;
cell2.innerHTML = data.results[i].DateFormatValue;
the above is my read() function in which the data is read.
I am also attaching my openStore() method:
if (!haveAppId()) {
return;
startTime = new Date();
updateStatus2("store.open called");
var properties = {
"name": "DateFormatsOfflineStore",
"host": applicationContext.registrationContext.serverHost,
"port": applicationContext.registrationContext.serverPort,
"https": applicationContext.registrationContext.https,
"serviceRoot" : appId,
"streamParams" : "custom_header=Authorization:Basic " + btoa(applicationContext.registrationContext.user + ":" + applicationContext.registrationContext.password) + ";custom_header=X-SMP-APPCID:" + applicationContext.applicationConnectionId + ";",
"definingRequests" : {
"DateFormats" : "/DateFormats"
store = sap.OData.createOfflineStore(properties);
console.log("Offline Store Created");
//var options = {};
store.open(openStoreSuccessCallback, errorCallback/*, options*/);
console.log("Offline Store Opened");
When the device is in online , data is read absolutely fine where as in offline i am unable to read data and Http request failed error is getting displayed.....
Mithun Please help us in this on high priority
Similar Messages
-
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 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 -
How to read data after select multiple record by checkbox,
hi experts
i m using simple report with check box , and itab whcih contain records
how to read data after select multiple record by checkbox,
thanksHi Prashant,
Try using this logic.This Code displays the list with check boxes. When you check a checkbox and press a button say 'Select All' or 'De Select all' or 'Display'. It will read the data of those records.
DATA :
fs_flight TYPE type_s_flight,
fs_flight1 TYPE type_s_flight1.
* Internal tables to hold Flight Details *
DATA :
t_flight LIKE
STANDARD TABLE
OF fs_flight,
t_flight1 LIKE
STANDARD TABLE
OF fs_flight1.
SET PF-STATUS 'SELECT' .
PERFORM selection.
PERFORM displaybasic .
* AT USER COMMAND EVENT *
AT USER-COMMAND.
PERFORM selectall .
*& Form SELECTION
* Select query to reteive data from SPFLI table
* There are no interface parameters to be passed to this subroutine.
FORM selection .
SELECT carrid " Airline Code
connid " Flight Connection Number
FROM spfli
INTO TABLE t_flight.
DESCRIBE TABLE t_flight LINES w_lines .
ENDFORM. " SELECTION
*& Form DISPLAYBASIC
* Display the basic list with SPFLI data
* There are no interface parameters to be passed to this subroutine.
FORM displaybasic .
LOOP AT t_flight INTO fs_flight.
WRITE :
w_check AS CHECKBOX,
w_mark,
fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002.
ENDLOOP. " LOOP AT T_FLIGHT..
CLEAR fs_flight-carrid .
CLEAR fs_flight-connid.
ENDFORM. " DISPLAYBASIC
*& Form SELECTALL
* To check all the checkboxes with a 'selectall' push button
* There are no interface parameters to be passed to this subroutine.
FORM selectall .
CASE sy-ucomm.
WHEN 'SELECT_ALL'.
w_check = 'X'.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line .
MODIFY LINE w_line FIELD VALUE w_check .
ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
CLEAR w_line.
WHEN 'DESELECTAL'.
w_check = space.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line FIELD VALUE w_mark .
IF w_mark = space .
MODIFY LINE w_line FIELD VALUE w_check .
ENDIF. " IF W_MARK = SPACE
ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
WHEN 'DISPLAY'.
IF sy-lilli BETWEEN 4 AND w_lines .
DO w_lines TIMES.
READ LINE w_num FIELD VALUE w_check INTO w_check
fs_flight-carrid INTO fs_flight-carrid
fs_flight-connid INTO fs_flight-connid.
IF sy-subrc = 0.
IF w_check = 'X'
SELECT carrid
connid
fldate " Flight date
seatsmax " Maximum capacity in economy
seatsocc " Occupied seats in economy class
FROM sflight
INTO TABLE t_flight1
WHERE carrid = fs_flight-carrid
AND connid = fs_flight-connid.
LOOP AT t_flight1 INTO fs_flight1.
WRITE :
/ fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002,
fs_flight1-fldate UNDER text-007,
fs_flight1-seatsmax UNDER text-008,
fs_flight1-seatsocc UNDER text-009.
ENDLOOP.
ENDIF. " IF SY-SUBRC = 0
ENDIF. " IF W_CHECK = 'X'.
ADD 1 TO w_num.
ENDDO. " DO W_LINES TIMES
CLEAR w_check.
w_num = 0.
ELSE .
MESSAGE 'INVALID CURSOR POSITION ' TYPE 'E' .
ENDIF. " IF SY-LILLI BETWEEN..
ENDCASE. " CASE SY-UCOMM
ENDFORM. " SELECTALL
Much Regards,
Amuktha. -
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 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 decrypt data when you can't get the private key in Windows?
I'm very confuse. My english is poor, but I try to say my question clearly.
When browser connects to a https website which needs client certificate to authenticate the identity, the browser will send client certificate to web server.
Then the web server will use the certificate to encrypt some data and send it to browser.
Then broswer should have private key to decrypt that.
But as I know, if I install a pfx format personal certificate, I can set can't export private key, which means you can't get the private key to use it. So how can
the browser decrypt the data without private key?
By the way, what is CSP, use CSP's interface can we use CryptoAPI
to decrypt data without private key?Answer for question is "you cant"..
"How to decrypt data when you can't get the private key in Windows?"
Read more
http://msdn.microsoft.com/en-us/library/windows/desktop/aa387460(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/bb427432(v=vs.85).aspx
http://technet.microsoft.com/en-us/library/dd277320.aspx
http://en.wikipedia.org/wiki/Public-key_cryptography -
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. -
can someone help me with this....
how to read data.....and move it to internal table....
the requirement is as:
<b>Get the Participant details in an internal table IT_FINAL_PAR</b>
Loop through IT_PA0002 and move Personnel number (PERNR), Personnel ID Number (PERID), Last name (NACHN), First name (VORNA), Gender Key (GESCH), Date of Birth (GBDAT) into a final internal table for Participant data IT_FINAL_PAR.
Read the internal table IT_PA0006 to get the corresponding House Number and Street
(STRAS), City (ORT01), Postal code (PSTLZ), State (STATE), 2nd address line (LOCAT) by comparing Personnel Number (PERNR)and move those retrieved field values to the final internal table for Participant data IT_FINAL_PAR.Hi,
you could try the following:
* work areas
data: W_PA0002 like line of IT_PA0002[],
W_PA0006 like line of IT_PA0006[],
W_FINAL_PAR like line of IT_FINAL_PAR[].
loop at IT_PA0002 into W_PA0002.
clear W_FINAL_PAR.
* move values from IT_PA0002
W_FINAL_PAR-PERNR = W_PA0002-PERNR.
W_FINAL_PAR-PERID = W_PA0002-PERID.
* read address values from IT_PA0006
read table IT_PA0006 into W_PA0006 with key pernr = W_PA0002-pernr.
if sy-subrc = 0.
* move fields from IT_PA0006
W_FINAL_PAR-STRAS = W_PA0006-STRAS.
endif.
append W_FINAL_PAR to IT_FINAL_PAR.
endloop. -
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 directly from clusters
hi all,
how to read data directly from clusters
Thanx in advance,
amruta.Using macro:
RP-IMP-C2-B2.
RP-IMP-C2-B1.
RP-IMP-C2-ZL.
....etc.
For TM cluster, U also can use BAPIs like HR_TIME_RESULTS_GET
More details see SAP HR course 350(HR Programming) -
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.
-
How to read data from Logical Database ADA for more than one financia year
Hi,
I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selection screen in the field BERDATUM. How should I modify my program to read ANLCV node for more then one year ? Could anybody help me ?
Kind regards,
Zbigniew Debowski
REPORT ZWRZD075.
NODES: anlav, anlcv.
START-OF-SELECTION.
GET anlav.
WRITE:/ anlav-anln1, ' ', anlav-anln2.
GET anlcv.
WRITE:/ anlcv-kansw, ' ', anlcv-knafa, ' ', anlcv-gjahr.Hi!
Have you already tried your luck in Java Programming forum?
Regards,
Thomas -
How to read data simultaneo​usly from different cdaq modules?
Is there a way to synchronize input from separate cdaq modules?
I need to read a voltage on an NI-9219 analog input channel and a
frequency on an NI-9211 channel. As far as I can tell a single "task" can
only read input from channels on one module. Is there a way to build a task that reads data from multiple modules?
Seems to me that buffered input is useless when multiple tasks are employed. With multiple tasks you get arrays of data that are sequential, not simultaneous. Is this correct? I'm thinking that the only way to
get synchronized readings is to read each channel individually inside a
loop. But this restricts the program to low speed data
acquisition with measurements that are spaced unevenly. Right?
I want to create a data file with three columns: time, voltage,
frequency. What's the best way to get these readings at the same
instant?
Referrence to a help document or tutorial would be great.
thanks!Synchronizing measurements of different types using separate cDAQ modules can be done by making sure that the physical channels for each module IO control are selected (and separated by commas). Please review the following Developer Zone article illustrating how this can be accomplished. Cheers
1. NI-DAQmx: NI CompactDAQ Module Synchronization: http://zone.ni.com/devzone/cda/epd/p/id/5259
Regards,
Ali M
Applications Engineer
National Instruments
Maybe you are looking for
-
DVI to s-video adapter altering laptop display after connection with TV
Greetings, I recently got my MacBook Pro to display on my TV via the dvi to s-video adapter (also connected stereo sound). Everything works great, but ... after I disconnect the windows on several of my programs are altered (stretched, shortened, oft
-
How to bind an element in an arrayList to a table column
Hi everyone, I need your help. I have an ObjectListDataProvider to bind a class MyClass to a table. Inside of MyClass, there is a property called dynNumOfElements of type ArrayList. I need dynamically create the columns of the table to match the numb
-
Inserting a record in an Oracle database in Teststand
I am trying to create a new record into an Oracle database table using the insert command in Teststand 2.0. I have been able to do it using LabView. The problem is that the record does not exist as yet. So I don't what I should do in the OPEN SQL sta
-
Good day Gurus, I implemented BAPI_RE_CN_CREATE inside a BADI. The syntax that I use is CALL FUNCTION BAPI_RE_CN_CREATE IN BACKGROUND TASK. I used "IN BACKGROUND TASK" because without that, the function keeps on looping. After adding the command, th
-
"The Best Camera" app question
Just downloaded "The Best Camera" app. It's nice, but I can't get the Crop tool to work. (The tool doesn't seem to have a name, but its icon is like the Crop tool in Photoshop.) When I tap it, a box appears with the header "Square" and an Apply butto