Is it possible to return a figure back to the database from a web service

I have a REST web service setup that has 4 values
Is it possible to use a db call to grab these 4 values that can be used in an insert to the database?
Thanks

If it were SOAP webservices there are other ways, but a simple REST you could do it like this:
select httpuritype('http://the.server.com/the_url?the_parameters').getxml()
  from dual
/That gets you an XMLType object that you can then parse to get the results. For example using the XMLTable() function.
You can see [url http://dspsd.blogspot.dk/2012/10/find-your-way-with-httpuritype-and.html]an example of this method that I blogged about two days ago ;-)
Edit: Fixed typo HttpUriTType -> HttpUriType ;-)
Edit again: Fixed method name getxml()
Edited by: Kim Berg Hansen on Oct 19, 2012 10:01 AM
Edited by: Kim Berg Hansen on Oct 19, 2012 10:14 AM

Similar Messages

  • I can't figure out data binding from a web service.

    Hi,
    I've been trying to figure out how to connect a TreeTable control with data from a non-SAP web server. Here's what I have so far;
        I have a sample program that uses json in a variable called oData.
        I have a TreeTable control named oTable.
        I create a model;
            var oModel = new sap.ui.model.json.JSONModel();
        I feed the oData variable into it;
            oModel.setData(oData);
        Finally, I feed the oModel to the oTable;
            oTable.setModel(oModel);
    That all makes sense. What I want to do is get the data from a web service. The only examples I've been able to find show how to configure an SAP data service and then connect to that. They don't give any details of the format that the SAP data service is sending. I don't have access to an SAP system so I can't set one up to reverse-engineer the data. I'm going to be writting my own oData service for this so I need a couple of things;
        1. An example of json or xml data as it's sent from a web server.
        2. An example of how you pull that data from the web service to an SAP ui model.
    I could really use some help. I haven't been able to find any examples that make sense to me.

    Hi Joe
    Here is an small example. Maybe it is useful to you.
    In this example, I  bind the tree to /root and you can see that we have 0: 1: elements under each element recursively.
    Thanks
    -D

  • How to return jolt connection back to the joltpool?

    hi
    I used following codes to get joltconnection pool:
    SessionPool sessionPool = sessionPoolManager.getSessionPool(poolName);
         DataSet request = new DataSet(requestString.length()*2);
         request.setValue("STRING", requestString);
         Result result = sessionPool.call(serviceName, request, null);
         return (String) result.getValue("STRING", null);
    my question is : how to return jolt connection back to the joltpool? do I need
    to do that?
    when I used jdbc connection pool, I used conn.close() to return
    to jdbc connection pool. Is there any method like "close()" in
    jdbc connection?
    Wei Jiang

    Hi,
    The below is the simple source code using Pool which it is extracted from
    BEA's support web site.
    and it is helpful.
    The Pool doesn't need to return jolt connection back to the joltpool.
    because it is done by Pool Manager automatically.
    import bea.jolt.*;
    import bea.jolt.pool.*;
    public class Pho2 {
    public static void main(String argv[])
    try
    String[] adresses = new String[1];
    adresses[0] = "//aglaia:7040";
    // creation du manager et du pool par defaut
    SessionPoolManager sessionPoolManager = new SessionPoolManager();
    int i = sessionPoolManager.createSessionPool(adresses, null, 1, 3, new
    UserInfo(), null);
    SessionPool sessionPool = sessionPoolManager.getSessionPool(null);
    DataSet dataset = new DataSet();
    Result result=null;
    dataset.setValue("rhaine","coucou");
    try
    result = sessionPool.call("TOUPPER", dataset, null);
    catch(Exception Ex)
    System.out.println("session");
    Ex.printStackTrace();
    System.out.println("dataset="+dataset);
    System.out.println("result ="+result);
    System.out.println("ApplicationCode="+(new
    Integer(result.getApplicationCode())).toString());
    catch(Exception Ex)
    System.out.println(Ex.getMessage());
    Hope this helps.
    Mr, Ko.
    "wei jiang" <[email protected]> wrote in message
    news:[email protected]..
    >
    hi
    I used following codes to get joltconnection pool:
    SessionPool sessionPool = sessionPoolManager.getSessionPool(poolName);
    DataSet request = new DataSet(requestString.length()*2);
    request.setValue("STRING", requestString);
    Result result = sessionPool.call(serviceName, request, null);
    return (String) result.getValue("STRING", null);
    my question is : how to return jolt connection back to the joltpool? do Ineed
    to do that?
    when I used jdbc connection pool, I used conn.close() to return
    to jdbc connection pool. Is there any method like "close()" in
    jdbc connection?
    Wei Jiang

  • HT4623 I got the IOS 7.1 update and I don't like it. Is there any way that I can remove the update and return my software back to the way it was before I got the update?

    I got the IOS 7.1 update and I don't like it. Is there any way that I can remove the update and return my software back to the way it was before I got the update?
    Please, I really wnat to change my phone's sofeware back to IOS 7.0.6. I really don't like the IOS 7.1
    PLEASE HELP ME BEFORE THE IOS 7.1 DRIVES ME INSANE!

    Even though it wasn't me who started this thread i would like to say that i hate iOS 7.1 too
    They're back! The IOS haters.
    When you get a call it has some small icons of reminding and message and one white ugly "slide to answer" bar.*** seriously?
    People complained about the green bar in IOS 7.0.3. You can't please everyone with everything. Deal with it and move on. Or you can just get a Droid phone and suffer through the bizarre interface changes.
    A lot of people would really appreciate a release with the old interface back.
    People complained about every interface change that Apple has tried. As I said earlier, you can't please everyone with everything. The interface is what it is, learn it, deal with it, or move on to something more to your liking. I think they still make flip phones.

  • Is it possible to return an array of objects from a web service?

    I have been trying to do this for a while now, and I have come to the conclusion that it may be impossible. To demonstate what I want to do I enclose a simple java file [1]. I have deployed this with Axis 2 and I enclose the responce [2], it is obciously not wat I want.
    Is it porrible to do this? If so, how?
    Thanks for any help,
    [1]
    package org.impress;
    public class SampleObject {
         public SampleElement[] noParameters(){
              SampleElement[] retArray = new SampleElement[2];
              retArray[0] = new SampleElement();
              retArray[0].name = "one";
              retArray[0].value = "alpha";
              retArray[1] = new SampleElement();
              retArray[1].name = "two";
              retArray[1].value = "beta";
              return retArray;
         public class SampleElement {
              public String name;
              public String value;
    }[2]
    <ns:noParametersResponse>
         <ns:return type="org.impress.SampleObject$SampleElement"/>
         <ns:return type="org.impress.SampleObject$SampleElement"/>
    </ns:noParametersResponse>

    Hi
    Can anybody help me with the code of how to return a resultset from a web service. i have put the resultset data's in an object array and tried to return it, but in the client side no data comes ,,, i mean it is printed as null.... and plz tell me where to specify the return type of a object in the wsdl file....
    thanks..

  • Manage "Do not permanently delete items until you back up the database" mailbox level

    Hi,
    I need the active directory attribute name for "Do not permanently delete items until you back up the database" at mailbox level and the EMS command for enabling/disabling
    the above setting (the other settings in the following screenshot I found).
    Thanks in advance!

    Well, there are only 3 possible values I believe... 1 = database default, 2 = retain for custom period and 3 = Retain Until Backup Or Custom Period... However I have seen 2 doesn't work for some reason and if you have database default is not selected
    and keep deleted item for x days set to something else other than default and Do not permanently delete items until you back up the database is unselected then it set the value to 5 as well.... I guess other than these possible values if anything else is set
    then it will give you warning that object is corrupted.
    But yes value is other than 3 then checkbox is automatically deselected set based on what value it has... in short I would check what's the value for deletedItemFlags by setting all the possible options before coming to conclusion... ;)

  • Backing up the database and the limitations

    Hello all,
    I tried to follow the steps in the documentation to back up the database;
    On Windows: Click Start, point to Programs, point to Oracle Database 10g Express Edition, and then select Backup Database
    but I dont see Backup Database under Oracle database 10g express, here is what I have there:
    Get Help >
    Get Started
    Go To Database Home Page
    Run SQL Command Line
    Start Database
    Stop Database
    Thats all.
    What I am trying to check is, if I can change the location for backups to avoid the 2 backup limitation. Is it possible to do that?

    Well - this is the area we are having a lot of internal discussions on - so this is not final yet, but feedback would be a good thing.
    Lets say you shut the machine down mid transaction one night while there are still users connected. This would not cause disk corruption, but you had inflight transactions at the time. On restart, the database would automatically roll forward the committed transactions, and automatically rollback uncommited transactions. So your database would be consistent. You would of course lose the transactions that were uncommited. This is what we call instance recovery.
    Lets say you take a backup on Monday, using the techniques we are proposing. On Tuesday the disk crashes and dies. You are not using Raid 5 etc, so you have no disk based mirror of your data. So you go and buy a new disk, add it to the machine, re-install the database software, and then restore from Monday nights backup. This is what we call media recovery.
    Using the techniques we propose for Oracle Database XE, you will lose ALL transactions from the time of the backup (i.e Tuesday) - both committed and uncommited until you complete the restore.
    If you did not want to run the risk of losing transactions in the event of a disk crash, then you should look at one of the licensable versions, which uses a technique called archive logging to allow you to roll forward all transactions since your last (or any given backup).
    Note that for all versions however, backup is online.
    Thoughts ?

  • Why in the world would Apple make the track pad LESS useful in OS Lion?  I hate that I can't g back to the top of a web page with a singe swipe.  And of course all the other gestures are totally reversed.  IMHO, this was not an imporvement.

    Why in the world would Apple make the track pad LESS useful in OS Lion?  I hate that I can't g back to the top of a web page with a singe swipe.  And of course all the other gestures are totally reversed.  IMHO, this was not an improvement.

    No one here works for Apple.
    Go to System Preferences > Trackpad > Scroll & Zoom, and uncheck Scroll direction: Natural.

  • Is it possible to import less than ALL of the data from a PDF form developed on LiveCycle?

    Is it possible to import less than ALL of the data from a PDF form developed on LiveCycle?

    Please ask in the LiveCycle Designer forum.

  • Query on retrieving data back to the program from ALV List

    Hi Group,
    I have a requirement to send the details of the selected data as an ALV list to the user.
    Then, the user selects either 1 or 2 or all or none back to the program from the ALV.
    Thing is that,
    1) when the user selects ( Icon ) to choose all the fields, they were not getting checked and in turn, I was not been able to read the records as checked in the program ( this is for All selection records ).
    2) And also, I am not able to get the records checked ( incase of the user selects all fields ).
    In short, I should be able to read the records which were checked and process only that records.
    please let me know if you have any queries on the same.
    Thank you very much in advance for the help.
    Regards,
    Vishnu.

    hi,
    try like this
    TABLES:     ekko.
    TYPE-POOLS: slis.                           
    TYPES: BEGIN OF t_ekko,
      sel,                         "stores which row user has selected
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    DATA : BEGIN OF det_tab OCCURS 0,
            ebeln LIKE ekpo-ebeln,
           END OF det_tab.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
    fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-box_fieldname     = 'SEL'.
      "set field name to store row selection
      gd_layout-edit              = 'X'. "makes whole ALV table editable
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = gd_repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_STAT'
          is_layout                = gd_layout
          it_fieldcat              = fieldcatalog[]
          i_save                   = 'X'
        TABLES
          t_outtab                 = it_ekko
        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.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'EBELN'.
            READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
            CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'DET'.  "user presses SAVE
          CLEAR det_tab.
          REFRESH det_tab.
          LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
            MOVE-CORRESPONDING wa_ekko TO det_tab.
            APPEND det_tab.
          ENDLOOP.
          PERFORM build_cat.
          PERFORM dis_data.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  set_stat
          text
         -->RT_EXTAB   text
    FORM set_stat USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
    ENDFORM.                    "set_stat
    *&      Form  build_cat
          text
    FORM build_cat.
      CLEAR fieldcatalog1.
      REFRESH fieldcatalog1.
      fieldcatalog1-fieldname = 'EBELN'.
      fieldcatalog1-tabname = 'DET_TAB'.
      fieldcatalog1-seltext_m = 'Order No.'.
      fieldcatalog1-outputlen = 10.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR fieldcatalog1.
    ENDFORM.                    "build_cat
    *&      Form  dis_data
          text
    FORM dis_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_DS'
          it_fieldcat        = fieldcatalog1[]
          i_save             = 'X'
        TABLES
          t_outtab           = det_tab.
    ENDFORM.                    "dis_data
    here i have created one button(DET) in toolbar along with all the buttons of ALV..
    when i click on this i am getting detail list....
    reward if usefull....

  • Some data is missing while returning complex datatype from a web service

    Hi
    I am returning a complex data type from a web service. complex data type has a super class and some(not all) values from this super class are not being returned to the client. Strange part is that it giving some fields from super class and some values are not returned.
    I saw the soap response also it does not show any tag for those fields. but while creating a response i am setting some string values to those fields but i am not getting at client side.
    all the serailiastion and deseialization classes where created using ANT tasks and i have checked that all the cedec classes have been created.

    for what it's worth, the same problem was reported by one of our developers, although the string size was considerably smaller (probably less then 1 MB). According to him, soap clients generated from apache tools could connect fine and process the XML records. JDev hung. We simply changed our use case to return smaller results sets, but perhaps you could also generate your clients with WSDL2Java rather then JDev (if it is a truly a bug in JDev SOAP)? Can you add record parameters to the payload, in order to limit the results and scroll between remaining rows?

  • I received an iPhone 6 in the mail from my previous service provider but I already changed to a different provider and got an iPhone 6 thinking I wouldn't receive the phone in the mail. Should I mail it back?

    I received an iPhone 6 in the mail from my previous service provider but I already changed to a different provider and got an iPhone 6 in the meantime because my iPhone 5 stopped working and I was desperate thinking I wouldn't receive the phone in the mail. Should I mail it back or sell it?

    You aren't serious are you? Send it back. It is not yours, you do not own it, therefore selling it would constitute selling stolen goods. You would be committing a crime, and you would be screwing whomever you sold it to.
    GB

  • HT4859 If I got a new iPhone and backed up the data from the old one, it should show up once the new one is set up right? Does an "incomplete" status mean it did not back up and can not be restored to the new iPhone?

    If I got a new iPhone and backed up the date from the old one, it should show up once the new one is set up right?
    And does an "incomplete" status on iCloud mean it can't be restored to the new iPhone?
    Help please

    What I mean is still track my stolen one. I don't know if this will make sense to you but I'm thinking that if I restore the back up data on this phone..on my stolen phone it will like forget the icloud account or something and think this phone is the stolen one so when I go to track the stolen one, it will show that phone as the one I have now because I restored the back up from that phone.

  • How do I get a pop-up JDialog to return a result back to the parent frame?

    I have a button in a frame that opens up a JDialog with more buttons. Depending on the button pressed, the JDialog calculates an array and then closes the dialog. I'd like the results from the JDialog to be passed back to the parent frame. Is there any built in JDialog function allowing a passback upon closing to the parent frame or anything like that?
    If not, what's the best way to go about it?

    Is this a modal dialog? Then setVisible(true) blocks. The caller can retrieve the result after that call:
    dlg.setVisible(true);
    //now get result;

  • Is it possible to put a "logout" button on the wake-from-screensaver dialog

    Does anyone know if there's a setting or hack to put a "logout" option on the password dialogue you get when the machine wakes from sleep or screensaver (with secure option set).
    Example: When our family laptop goes to sleep or screensaver after it was open in my account, it will wake up only with my password unless I make my wife's account administrator. If I do so, she can wake the computer without repowering it, but it wakes in MY account even though she's used HER username/password. That's not what we want. We want a logout button that will take her back to the multi-account login screen without rebooting.
    Does anyone know if this is possible?
    Thanks!

    hochmand wrote:
    Does anyone know if there's a setting or hack to put a "logout" option on the password dialogue you get when the machine wakes from sleep or screensaver (with secure option set).
    Example: When our family laptop goes to sleep or screensaver after it was open in my account, it will wake up only with my password unless I make my wife's account administrator. If I do so, she can wake the computer without repowering it, but it wakes in MY account even though she's used HER username/password. That's not what we want. We want a logout button that will take her back to the multi-account login screen without rebooting.
    Does anyone know if this is possible?
    it's not possible to add a logout button but there is no need. just go to system preferences->accounts->login options and enable fast user switching. then the wake from sleep dialog will have a 'switch users" button which will take you to the login window without logging out the current user. you can log into any user from the login window.
    Thanks!

Maybe you are looking for