HTTP_POST Function

Hello All,
I am trying to use the HTTP_POST function to send a table to a outside source.   Can someone tell my what parameters I have to have filled and with what before I  can call the function succesfully.   Thanks.
Gabriel

Could you please post the error here so ppl can help you.
Also if this error is unavoidable then you can handle it in method itself...
Regards,
BJ

Similar Messages

  • Using Function module HTTP_POST with SSL anonymous

    Does anybody know how I can use the function module HTTP_POST called from ABAP  but to use SSL communication using the anonymous client.
    I think by default it uses the DEFAULT standard client for communication.
    Is there anyway that the HTTP_POST function module can use a type 'G' connection in SM59.
    I have tried to use the newer cl_http_client but for some reason the server I'm connecting to does not like the HTTP_POST that is sent via this mechanism. The only difference I can see is that the header fields i set using  cl_http_client come out in lowercase.
    content-type: application/x-www-form-urlencoded; charset="UTF-8"
    content-length: 288
    Whereas using HTTP_POST I can define the header fields exactly how they should be displayed e.g.
    Content-type: application/x-www-form-urlencoded; charset="UTF-8"
    Content-length: 288
    Does anybody know how to rectify this
    thanks,

    Hi Agasti,
    Use class CL_HTTP_CLIENT. there is a method SET_HEADER_FIELD , u can use POST in that.
    It will be something like below:
    data: client type ref to if_http_client.
    ur code to call the webservice API (method CREATE or CREATE_BY_URL
    CALL METHOD client->request->set_header_field
    EXPORTING
    name = '~request_method'
    value = 'POST'.
    It will work.
    cheers,
    Hema.

  • HTTP_POST to .aspx URL/form

    Hi Folks,
    My requirement is to post data to an aspx form from ABAP program. After searching in the forums, I decided to use HTTP_POST function module to achieve the goal.
    Now when I execute my program, I do get the status as 'OK' and status code of '200' but data is not getting posted to the form. The way I have been trying to pass data is - I have a structure with field names same as the form field names. I populate the corresponding values in the local work area and append it to request_body table. Which I have come to realize may not be the correct way. I also tried passing the data same way to request header, that did not work either.
    Does someone have example code on how to use HTTP_POST? or suggestions? I tried where-used on the FM, but could not find anything discreet.
    Or at a higher level, is this approach right to post data?
    Thanks! 
    #HTTP #POST #ASPX #ASPNET #ASP

    Thanks Aarif!
    I did come across this post. I can reach the HTTP service. Trying to make the parameters values work. But still not able to.  

  • Portal application can't read request info

    hi all,
    i use  portal application for change portal user's infos.but when i sent request info,
    request.getServletRequest().getInputStream() method is cutting my sending line after 90. character.
    in R3 side i use HTTP_POST function and fill request info (table paramater).
    i tried to send 2 line(less than 90 character) in request info, but i can't read second line in java code.
    Is IPortalComponentRequest accept only 90 character ?
    how can i solve this problem , any idea ?
    my code is below, variable "str" is filling only first 90 character;
         protected void doOnNodeReady(
                   IPortalComponentRequest request,
                   IEvent event) {
         String str = "";
         try {
              InputStream is = request.getServletRequest().getInputStream();
              InputStreamReader isr = new InputStreamReader(is);
              int c;
              while ((c = isr.read()) > -1) {
              str = str + (char) c;
                } catch (java.io.IOException ex) {
                 str = "Error accessing input stream";
    thanks

    New discovery...If I shut down all instances of IE on my machine, then reopen my test form, it works. Once. The second time I try it I get the same peculiar behavior again, until I again shut down all instances of IE.

  • Calling Portal Application Components

    Due to formatting restrictions w/in Portal Application building, I need to be able to create (for example) a report where all headings are blank.
    I'd like to then embed the invocation of the report from a Dynamic Page, where the page will contain all of the formatting for the column headings.
    I've tried embedding the call two ways:
    1) <ORACLE>call RPT_0717092052.show()</ORACLE>
    2) <ORACLE>CALL PORTAL30.RPT_0717092052.show (
    p_arg_names => PORTAL30.wwv_standard_util.string_to_table2('_show_header:_max_rows:_portal_max_rows'),
    p_arg_values => PORTAL30.wwv_standard_util.string_to_table2('YES:25:25'))</ORACLE>
    Neither seems to work.
    Anyone have any ideas how to make this work??

    <i>What I want is to call portal application on background (not to call browser).</i>
    you can use CL_HTTP_CLIENT class or HTTP_GET or HTTP_POST function modules for the same. (but you need to pass the user id /pwd in the program) (ITS doesnt fit your case)
    check out the demo programs.
    for CL_HTTP_CLIENT
    RSHTTP01
    HTTP_GET/POST
    RSHTTP20  
    RSHTTP70  
    RSHTTP90  
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

  • Calling portal application via it 's url from R/3 (with authentication)?

    Hello,
    how to call portal application by its url from R/3 (using ABAP)? How to avoid authentication screen?
    Best regards,
    Josef Motl

    <i>What I want is to call portal application on background (not to call browser).</i>
    you can use CL_HTTP_CLIENT class or HTTP_GET or HTTP_POST function modules for the same. (but you need to pass the user id /pwd in the program) (ITS doesnt fit your case)
    check out the demo programs.
    for CL_HTTP_CLIENT
    RSHTTP01
    HTTP_GET/POST
    RSHTTP20  
    RSHTTP70  
    RSHTTP90  
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

  • Need example of  BlackBerry "browser push" in ABAP (ERP)

    I'm looking to perform a "browser channel push" from ERP to the BlackBerry BES/MDS.  I have all the ABAP completed for the HTML content itself, but I'm struggling with the HTTP message to the MDS.  Anyone have an example I can work off of?  I'll take either a HTTP_POST function module exmaple, or a HTTP_REQUEST method example.
    Thanks

    Jay, what is your exact requirement? Is the Java application external to your Tomcat (Turnkey), acting as a separate application? If so, then yes, JMS is the only way you can "subscribe" to a destination in BlazeDS. However, I have a feeling that you are looking for a way to control the subscription to a destination yourself within BlazeDS?

  • System_failure error with the function module HTTP_POST

    Hi Friends,
      While executing the function module "HTTP_POST" ,sometime we are getting the error "System_Failure" exception.
    Can anyone tell what could be the reason for this exception,any configurations need to be done on SAP???
    For this FM we are passing the RFC destination"SAPHTTPA" as one of the paratmeter and
    The two import paramters we are passing to this FM are
    URI : 
    http://10.74.40.31:8686/ArchiveBridge/?informaticaArchive&contRep=IA&sumFile=MYTA_SUMMARY_20090820063258.sum
    Destintion : SAPHTTPA
    Thanks all in advance.
    Regards
    Dharmaraju

    Hi,
    Check if any proxy is maitained in the client by going into transaction
    SICF-> Goto-> HTTP Client Proxy -> HTTP LOG TAB.
    If there is anything maintained under Host name and port, if yes you need to specify the IP address while calling FM HTTP_POST
    under PROXY as
    192.168.0.1:8080  where first part is IP address & 2nd part(8080) is port.
    Also test connection for SAPHTTPA under SM59 to see if its properly configured.
    Regards,
    Amit

  • Abap function module http_post and umlaut characters

    I am using abap function module HTTP_POST to frame xml and send the data to our middleware system 'CASTIRON'.
    Everything works fine but when there are any umlaut characters in xml, the function HTTP_POPST is unable to transmit the data and is creating SM21 updation failures. We are on ECC 6.0 unicode system.
    Any help is vey much appreciated.

    Are you using a CDATA tag to encapsulate your data. Try doing it.

  • Function HTTP_POST. (SAP lacking documenation )

    Gurus,
    I am wondering why SAP does not provide documentation properly in english for the function modules. I wanted to know whats the use of function module HTTP_POST but due to lack of documentation, I have to search all around the universe.
    Can someone please tell me whats the use of function HTTP_POST ?
    Regards,
    Jainam.

    Login into your system with login language as DE and then se37--> http_post and you can find documentation. and cut & paste in google translation tool and translate to english

  • Call function HTTP_POST fails with error...

    <b>NiHostToAddr proxy error: NIEHOST_UNKNOWN</b>
    I could not figure out what's going on. Could not find any informatin about this error.
    Help please.
    Thanks,
    Andrei

    which site you are calling, is it on intranet or internet?
    if its internet do you use proxy if so did you pass the proxy details?
    for sample programs you can check out the programs starting with
    RSHTTP*
    Regards
    Raja

  • How to send an XML file via HTTP_POST

    I have an ABAP program that creates an XML file and I need to somehow post this XML file to a webserver and read the HTTP Response that it sends back.  I see that there is a function module called HTTP_POST but I've never used it before.  I also see that there are a number of ABAP Objects related to HTTP.  Has anyone done this before. 
    I'm on SAP 4.7 (6.20)
    Thank you,

    I went to www.fedex.com and exported their SSL cert.  I then imported it into SAP via STRUST.  However, I still get the same http_communication_error.  The XML needs to be posted to this address:  'https://gatewaybeta.fedex.com:443/GatewayDC'
    Here is my code:
    Note: wf_string contains the XML
    CALL METHOD cl_http_client=>create
      EXPORTING
        host          = 'https://gatewaybeta.fedex.com'
        service       = '443'
        scheme        = '2'
       proxy_host    =  wf_proxy
       proxy_service =  wf_port
      IMPORTING
        client        = http_client.
    http_client->propertytype_logon_popup = http_client->co_disabled.
    wf_user = '' .
    wf_password = '' .
    proxy server authentication
    CALL METHOD http_client->authenticate
      EXPORTING
        proxy_authentication = 'X'
        username             = wf_user
        password             = wf_password.
    CALL METHOD http_client->request->set_header_field
      EXPORTING
        name  = '~request_method'
        value = 'POST'.
    CALL METHOD http_client->request->set_header_field
      EXPORTING
        name  = '~server_protocol'
        value = 'HTTP/1.1'.
    CALL METHOD http_client->request->set_header_field
      EXPORTING
        name  = '~request_uri'
        value = 'https://gatewaybeta.fedex.com:443/GatewayDC'.
    CALL METHOD http_client->request->set_header_field
      EXPORTING
        name  = 'Content-Type'
        value = 'text/xml; charset=utf-8'.
    CALL METHOD http_client->request->set_header_field
      EXPORTING
        name  = 'Content-Length'
        value = txlen.
    *CALL METHOD http_client->request->set_header_field
    EXPORTING
       name  = 'SOAPAction'
       value = 'https://gatewaybeta.fedex.com:443/GatewayDC'
    CALL METHOD http_client->request->set_cdata
      EXPORTING
        data   = wf_string
        offset = 0
        length = rlength.
    CALL METHOD http_client->send
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2.
    CALL METHOD http_client->receive
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3.
    CLEAR wf_string1 .
    wf_string1 = http_client->response->get_cdata( ).

  • Using UTL_HTTP.GET_RESPONSE function (PL/SQL)

    Hello,
    I have a problem using the UTL_HTTP.GET_RESPONSE (URL, 'POST') function while I try to call a function that returns an XML;
    The function returning my XML is:
    FUNCTION MyFunction return XMLTYPE is
    begin
    return XMLTYPE('<PROVA>test</PROVA>');
    end MyFunction;
    To perform the http call I use this function:
    FUNCTION POST(URL VARCHAR2, DATA_IN CLOB) RETURN CLOB IS
    BEGIN
    DECLARE
    DATA_OUT CLOB;
    PIECE VARCHAR2(4000);
    AMT PLS_INTEGER := 4000;
    POS PLS_INTEGER := 1;
    HTTP_REQ UTL_HTTP.REQ;
    HTTP_RESP UTL_HTTP.RESP;
    BEGIN
    HTTP_REQ := UTL_HTTP.BEGIN_REQUEST (URL, 'POST');
    UTL_HTTP.SET_HEADER(HTTP_REQ, 'content-length', LENGTH(DATA_IN));
    LOOP
    DBMS_LOB.READ(DATA_IN,AMT,POS,PIECE);
    UTL_HTTP.WRITE_TEXT(HTTP_REQ, PIECE);
    EXIT WHEN AMT < 4000;
    POS := POS + AMT;
    AMT := 4000;
    END LOOP;
    HTTP_RESP := UTL_HTTP.GET_RESPONSE (HTTP_REQ);
    BEGIN
    LOOP
    UTL_HTTP.READ_TEXT(HTTP_RESP, PIECE);
    DATA_OUT := DATA_OUT || PIECE;
    END LOOP;
    EXCEPTION WHEN UTL_HTTP.END_OF_BODY THEN NULL;
    END;
    UTL_HTTP.END_RESPONSE (HTTP_RESP);
    RETURN DATA_OUT;
    END;
    END;
    The script pl/sql that calls the preceding function is:
    declare
    v_resp CLOB;
    v_url VARCHAR2(4000);
    begin
    v_url := 'http:// ... /meters.export_table.MyFunction'
    v_resp := POST(v_url, '-');
    end;
    After this call to my url, the variabile v_resp contains the following error message:
    "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>400 Bad Request</TITLE>
    </HEAD><BODY>
    <H1>Bad Request</H1>
    Your browser sent a request that this server could not understand.<P>
    mod_plsql: /pls/prjsi/meters.export_table.MyFunction HTTP-400 Missing '=' in query string or post form<P>
    <HR>
    <ADDRESS>Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at websvil.aem.torino.it Port 80</ADDRESS>
    </BODY></HTML>"
    Do you know how I can get my XML? What is the problem in that call http for my function?
    Thanks

    Hello !
    I have not understand exactly what have you try to achieve with your code , but i thing there are few things misunderstood in your code ,
    so i'm posting this very basic but working example in hope that it will help you
    SQL>
    SQL>
    SQL> conn scott/tiger
    Connected.
    SQL>
    SQL>
    SQL> create or replace procedure http_test is
      2  begin
      3    htp.p('<PROVA>test</PROVA>');
      4  end http_test;
      5  /
    Procedure created.
    SQL> CREATE OR REPLACE function HTTP_POST return varchar2 is
      2 
      3    req  utl_http.req;
      4    resp utl_http.resp;
      5   
      6    v_txt varchar2(1024);
      7   
      8  BEGIN
      9   
    10    req  := UTL_HTTP.begin_request ('http://localhost:7777/pls/my_utf8/http_test'
    11                                   ,'POST','HTTP/1.1');
    12    Utl_Http.Set_Authentication ( r => req, username => 'scott', password => 'tiger'
    13                                , scheme => 'Basic', for_proxy => false );
    14    resp := UTL_HTTP.get_response  (req);
    15    utl_http.read_text(resp,v_txt);
    16    utl_http.end_response(resp);
    17    return v_txt;
    18  END;
    19  /
    Function created.
    SQL> select http_post from dual;
    HTTP_POST
    <PROVA>test</PROVA>
    SQL> T

  • How to pass parameter in   HTTP_POST or  HTTP Class

    I want to use HTTP_POST to pass xml info by http_post. I want to pass a simple parameter and receive it in a JSP first for test. I assign the value in the following way:
    TYPES: BEGIN OF text,
             line(256),
           END OF text.
    DATA xml  TYPE TABLE OF text WITH HEADER LINE.
    xml-line = 'apple=aaa'.
    APPEND xml.
    and then ...
      CALL FUNCTION 'HTTP_POST'
        TABLES
          REQUEST_ENTITY_BODY         = xml
          response_entity_body        = response
          response_headers            = response_headers.
    then I use a JSP to receive the parameter, but what I get from "apple" is null.
    <br>Param APPLE
         <%
         String apple=request.getParameter("apple");
         out.println(apple);
         %>
    QUESTION:
    1 Is this way correct for passing a parameter via a HTTP? It seems I failed to pass a parameter.What is the correct way?
    2 If I want to pass a whole xml string, what format should I organize my data stream?Maybe I should use cl_http_client to make it?

    Hi Yichao,
    Refer the following thread:
    Re: Manual HTTP POST from ABAP
    Hope this will help you.
    Regards,
    Nitin.

  • Post a File to a web server using HTTP_POST

    Hello,
    I have to generate a program to post a file ".TXT" to a web server using a HTTP POST with multipart form and a couple of variables (user, password).
    I was investigating and I found that I can do it using SAPHTTP but I dont know how to work with the FM HTTP_POST.
    Does anyone have a sample code?
    Thanks
    Ariel

    sample usage:
      CALL FUNCTION 'HTTP_POST'
        EXPORTING
          ABSOLUTE_URI                = IM_OFX_CONTROL_DATA-ADDRESS
          REQUEST_ENTITY_BODY_LENGTH  = RESPONSE_ENTITY_BODY_LENGTH
          RFC_DESTINATION             = IM_OFX_CONTROL_DATA-HTTP_RFCDEST
          USER                        = IM_OFX_CONTROL_DATA-HTTP_USER
          PASSWORD                    = IM_OFX_CONTROL_DATA-HTTP_PASSWORD
          BLANKSTOCRLF                = 'X'
        IMPORTING
          STATUS_CODE                 = STATUS
          STATUS_TEXT                 = STATUS_TEXT
          RESPONSE_ENTITY_BODY_LENGTH = RLENGTH
        TABLES
          REQUEST_ENTITY_BODY         = LT_REQUEST
          RESPONSE_ENTITY_BODY        = RESPONSE
          RESPONSE_HEADERS            = LT_RESPONSE_HEADERS
          REQUEST_HEADERS             = LT_HTTP_HEADERS
       EXCEPTIONS
            OTHERS                      = 1.
    Refer the programs:
    LFPIFF02            
    LOFXALSU04          
    LPRGN_URL_RESPONSEU01
    LSBCCU01            
    LSFTPU09            
    for some idea.
    regards,
    ravi

Maybe you are looking for

  • Regarding Customized evaluation path in OM

    Hi experts, This is Prasanna. i have created customized relationship as "HAS TALENTED PARTICIPANT" and evaluation path as "AZTI".i have assined this relationship between two object types that are D(course type) and P(person). In PP01 transaction i tr

  • I accidentally deleted the contents folder  of BootCamp

    Ok so I was trying to install windows 7 through Bootcamp using an USB and iso file. But somewhy in my Bootcamp there wasn't the option for it so I downloaded an alternative contents folder which allowed me to do so. After I got to the part of partiti

  • Change iten property when Add Row button pressed

    hi, I have advance table on one update page. There are two requirements on that page: 1. One key Item has to be READ_ONLY for saved rows. It can be changed when new row added using Add New Row button. I followed Changing UI properties (SPEL) example.

  • Iphoto '08 is crashing at startup

    Iphoto '08 is crashing at startup. I get a message "do you still want to imort "5" pictures?" Yes or no? When I hit yes it crashes. When I started hitting "no" it would start up but now "no" crashes as well. All this started after upgrading to Leopar

  • Currency divided by quantity

    Hi, I am trying to divide a currency field with quantity field and want to store the result in currency field or decimal field. I tried it as below... DATA: l_field1 LIKE J_1IEXCDTL-EXBAS,       l_field2 LIKE j_1iexcdtl-menge,       l_field3 TYPE p D