{"id":5322,"date":"2016-01-04T17:07:33","date_gmt":"2016-01-04T15:07:33","guid":{"rendered":"http:\/\/www.karadere.com\/blog\/?p=5322"},"modified":"2016-01-04T17:07:33","modified_gmt":"2016-01-04T15:07:33","slug":"sap-abap-get-http-post-method-xml-tcbm-kur-cekme","status":"publish","type":"post","link":"https:\/\/www.karadere.com\/blog\/sap-abap-get-http-post-method-xml-tcbm-kur-cekme.html","title":{"rendered":"SAP ABAP GET HTTP POST method xml tcbm kur \u00e7ekme"},"content":{"rendered":"<p>SAP abap native http fonksiyonlar\u0131 ile\u00a0SAP ABAP GET HTTP POST method xml tcbm kur \u00e7ekmek.<\/p>\n<p><a href=\"http:\/\/www.karadere.com\/blog\/abap-listbox-and-itab-or-table.html\/sap-abap-logo\" rel=\"attachment wp-att-309\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-309\" src=\"http:\/\/www.karadere.com\/blog\/uploads\/\/2010\/02\/sap-abap-logo.png\" alt=\"SAP Fiori\" width=\"230\" height=\"121\" \/><\/a><\/p>\n<pre class=\"abap\">\n\n\n\n\n\n\nREPORT  zhttp_get_post.\n\u00a0\nDATA: lv_xml TYPE STRING,\n      lv_url TYPE STRING.\n\u00a0\nDATA: lv_client TYPE REF TO if_http_client.\n\u00a0\nlv_url = 'http:\/\/www.tcmb.gov.tr\/kurlar\/today.xml'.\n\n\nCALL METHOD cl_http_client=&gt;create_by_url\n  EXPORTING\n    url                = lv_url\n  IMPORTING\n    CLIENT             = lv_client\n  EXCEPTIONS\n    argument_not_found = 1\n    plugin_not_active  = 2\n    internal_error     = 3\n    OTHERS             = 4.\nIF sy-subrc NE 0.\n  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno\n    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.\nENDIF.\n\u00a0\nlv_client-&gt;request-&gt;set_header_field( NAME  = '~request_method'\n                                        VALUE = 'GET' ).\n\u00a0\n\nCALL METHOD lv_client-&gt;send\n  EXCEPTIONS\n    http_communication_failure = 1\n    http_invalid_state         = 2\n    http_processing_failed     = 3\n    OTHERS                     = 4.\nIF sy-subrc NE 0.\n  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno\n    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.\nENDIF.\n\u00a0\n\nCALL METHOD lv_client-&gt;receive\n  EXCEPTIONS\n    http_communication_failure = 1\n    http_invalid_state         = 2\n    http_processing_failed     = 3\n    OTHERS                     = 4.\n\u00a0\n\nlv_xml = lv_client-&gt;response-&gt;get_cdata( ).\n\u00a0\nbreak serkanozc.\nDATA: l_ixml            TYPE REF TO if_ixml,\n      l_streamfactory   TYPE REF TO if_ixml_stream_factory,\n      l_istream         TYPE REF TO if_ixml_istream,\n      l_parser          TYPE REF TO if_ixml_parser,\n      l_document        TYPE REF TO if_ixml_document,\n      lv_xml_x          TYPE XSTRING.\n\u00a0\nCALL FUNCTION 'SCMS_STRING_TO_XSTRING'\n  EXPORTING\n    text           = lv_xml\n*   MIMETYPE       = ' '\n*   ENCODING       =\n IMPORTING\n   buffer         = lv_xml_x\n EXCEPTIONS\n   failed         = 1\n   OTHERS         = 2\n          .\nIF sy-subrc &lt;&gt; 0.\n  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno\n          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.\nENDIF.\n\u00a0\n\u00a0\n\nl_ixml = cl_ixml=&gt;create( ).\n\u00a0\n\nl_streamfactory = l_ixml-&gt;create_stream_factory( ).\n\u00a0\n\nl_istream = l_streamfactory-&gt;create_istream_xstring( STRING = lv_xml_x ).\n\u00a0\n\nl_document = l_ixml-&gt;create_document( ).\n\u00a0\n\u00a0\n\nl_parser = l_ixml-&gt;create_parser( stream_factory = l_streamfactory\n                                  istream        = l_istream\n                                  document       = l_document ).\n\u00a0\n\nIF l_parser-&gt;parse( ) NE 0.\n  MESSAGE 'today.xml parse problemi' TYPE 'E'.\n  EXIT.\nENDIF.\n\u00a0\nDATA: curr_node_collection  TYPE REF TO if_ixml_node_collection,\n      curr_node_iterator    TYPE REF TO if_ixml_node_iterator,\n      curr_node             TYPE REF TO if_ixml_node,\n      curr_nodemap          TYPE REF TO if_ixml_named_node_map,\n      curr_attr             TYPE REF TO if_ixml_node,\n      curr_node_list        TYPE REF TO if_ixml_node_list,\n      lv_val                TYPE STRING,\n      lv_length             TYPE i,\n      lv_indx               TYPE i.\n\u00a0\ncurr_node_collection = l_document-&gt;get_elements_by_tag_name( NAME = 'Currency' ).\ncurr_node_iterator = curr_node_collection-&gt;create_iterator( ).\ncurr_node = curr_node_iterator-&gt;get_next( ).\n\u00a0\nWHILE curr_node IS NOT INITIAL.\n\u00a0\n  curr_nodemap = curr_node-&gt;get_attributes( ).\n  curr_attr = curr_nodemap-&gt;get_named_item( NAME = 'CurrencyCode' ).\n\u00a0\n  CLEAR lv_val.\n  IF curr_attr IS NOT INITIAL.\n    lv_val = curr_attr-&gt;get_value( ).\n    WRITE 'CurrencyCode' COLOR COL_GROUP.\n    WRITE: lv_val.\n  ENDIF.\n\u00a0\n  curr_node_list = curr_node-&gt;get_children( ).\n  CLEAR lv_length.\n  lv_length = curr_node_list-&gt;get_length( ).\n  DO lv_length TIMES.\n    lv_indx = sy-INDEX - 1.\n    curr_attr = curr_node_list-&gt;get_item( lv_indx ).\n\u00a0\n    CLEAR lv_val.\n    IF curr_attr IS NOT INITIAL.\n      lv_val = curr_attr-&gt;get_name( ).\n      WRITE: lv_val COLOR COL_GROUP.\n      lv_val = curr_attr-&gt;get_value( ).\n      WRITE: lv_val.\n    ENDIF.\n\u00a0\n  ENDDO.\n\u00a0\n  curr_node = curr_node_iterator-&gt;get_next( ).\n\u00a0\n\u00a0break-point.\n  WRITE: \/.\nENDWHILE.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SAP ABAP GET HTTP POST method xml tcbm kur \u00e7ekme<\/p>\n","protected":false},"author":1,"featured_media":309,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[2,88,45],"tags":[395,1708,1789,1837,2296],"class_list":["post-5322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-2015-2016","category-abap-sap","category-sap","tag-abap","tag-post","tag-request","tag-sap","tag-xml","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"views":3485,"_links":{"self":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/comments?post=5322"}],"version-history":[{"count":0,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5322\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/media?parent=5322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/categories?post=5322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/tags?post=5322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}