Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reading XML Webservice

Former Member
0 Likes
1,079

Hello to All,

Could you please tell me How can I read XML Webservice ?

(I mean, I want to access (http://www.tcmb.gov.tr/kurlar/200909/01092009.xml)

Thank You

Hello to All,

Could you please tell me How can I read XML Webservice ?

(I mean, I want to access (http://www.tcmb.gov.tr/kurlar/200909/01092009.xml)

Thank You

4 REPLIES 4
Read only

brad_bohn
Active Contributor
0 Likes
888

On SAPFans, you asked about rendering the XML in a useable format and I gave you an answer on how to do that using transformations. You did not ask about consuming the service itself. Is this your requirement? If so, read the help files on web services and post any questions you might have - the help files are VERY clear on how to work with web services.

Read only

Former Member
0 Likes
888

Dear Brad,

Yes, You are right, I asked same question on Sapfans ...

And I read your answer ...

But I did not find and helps files which I wanted ...

I mean, if I talk xml files like c:\xml\aaa.xml, I can read that file ... So there is no any problem readind xml file ...

But my problem is reading from a website ...

I did not find this kind an example ...

If you see this kind example or any message, would you please tell me or show the link ?

Thank You,

Regards

Read only

brad_bohn
Active Contributor
0 Likes
888

Please be clear about what you mean regarding reading a web service - do you mean consuming a web service? If so, start here:

[Consuming a Web Service|http://help.sap.com/saphelp_nw70/helpdata/EN/0d/2eac5a56d7e345853fe9c935954ff1/frameset.htm]

Read only

Former Member
0 Likes
888

Good Morning Brad,

My aim is to read a xml website ...

(When I say xml website, I want to say like http://www.tcmb.gov.tr/kurlar/200909/09092009.xml website.)

So, in my code, I am using call function HTTP_GET. (Maybe this is problem, I do not know ...)

Anyway, I am copying my code and and XSLT File here ...

Is it clear ?

Would you please try in your system ?

Thank You


*&---------------------------------------------------------------------*
*& Report  ZTMP_DOVIZ_KURLARI_TCMB_XML                                 *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*
REPORT  zfi_doviz_kurlari_tcmb_xml.

*----------------------------------------------------------------------*
*                             T A B L E S                              *
*----------------------------------------------------------------------*
TABLES: tcurr.

TYPE-POOLS abap.


*----------------------------------------------------------------------*
*                    I N T E R N A L  T A B L E S                      *
*----------------------------------------------------------------------*
TYPES: BEGIN OF text,
       line(2048),
       END OF text.
DATA: zbody   TYPE TABLE OF text WITH HEADER LINE,
      zheader TYPE TABLE OF text WITH HEADER LINE.


TYPES: BEGIN OF myrec,
        begda   TYPE char10,
        endda   TYPE char10,
        bplan   TYPE char4,
        camnt   TYPE char3,
       END OF myrec,
       myrec_table TYPE STANDARD TABLE OF myrec.
TYPES: BEGIN OF myrec_life,
        begda   TYPE char10,
        endda   TYPE char10,
        bplan   TYPE char4,
        ercst   TYPE char3,
       END OF myrec_life,
       myrec_table_life TYPE STANDARD TABLE OF myrec_life.

* This is the structure for the data from the XML file
* Dependents

TYPES:
      BEGIN OF ts_person,
        unit            TYPE char10,
        isim            TYPE char50,
        currencyname    TYPE char50,
        forexbuying     TYPE char10,
        forexselling    TYPE char10,
        banknotebuying  TYPE char10,
        banknoteselling TYPE char10,
        crossrateusd    TYPE char10,
        crossrateother  TYPE char1,
      END OF ts_person.

* Table for the XML content
DATA: gt_itab       TYPE STANDARD TABLE OF char2048.

* Table and work ares for the data from the XML file
DATA: gt_person     TYPE STANDARD TABLE OF ts_person,
      gs_person     TYPE ts_person,
      gt_tpi        TYPE char1,
      gt_ftyp       TYPE char1,
      w_myrec       TYPE myrec,
      w_myrec_life  TYPE myrec_life.

* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
      gs_result_xml TYPE abap_trans_resbind.

* For error handling
DATA: gs_rif_ex     TYPE REF TO cx_root,
      gs_var_text   TYPE string.


*----------------------------------------------------------------------*
*                           V A R I A B L E S                          *
*----------------------------------------------------------------------*
DATA: BEGIN OF data_tab OCCURS 20,
      line(255),
END OF data_tab.

*DATA: BEGIN OF itcur OCCURS 0,
*        kurst LIKE tcurr-kurst,
*        fcurr LIKE tcurr-fcurr,
*        ukurs LIKE tcurr-ukurs,
*END OF itcur.

DATA: url(256) TYPE c.
DATA: pemailadr(256) TYPE c.

DATA: ztarih LIKE sy-datum.


*----------------------------------------------------------------------*
*                  S E L E C T I O N   S C R E E N                     *
*----------------------------------------------------------------------*
PARAMETERS: gtarih LIKE sy-datum DEFAULT sy-datum.
*{   DELETE         GDPK900559                                        1
*\parameters: zproxy like  thttp-proxy default '192.168.0.12:800' .
*}   DELETE
*{   INSERT         GDPK900559                                        2
PARAMETERS: zproxy LIKE  thttp-proxy DEFAULT '' .
*}   INSERT
SELECT-OPTIONS: zuser FOR sy-uname DEFAULT sy-uname.
*PARAMETERS: zemail AS CHECKBOX DEFAULT 'X'.
*PARAMETERS: zkaydet AS CHECKBOX DEFAULT 'X'.


*----------------------------------------------------------------------*
*                  P R O G R A M    S T A R T                          *
*----------------------------------------------------------------------*
START-OF-SELECTION.

  IF gtarih IS INITIAL.
    ztarih = sy-datum.
  ELSE.
    ztarih = gtarih.
  ENDIF.


  break tanjul.

Edited by: tanjulise on Sep 10, 2009 8:56 AM

Edited by: tanjulise on Sep 10, 2009 9:00 AM

Edited by: tanjulise on Sep 10, 2009 9:13 AM

You have a mail ...