Application Development 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: 

HTTP POST Is VPN required?

Former Member
0 Kudos

Hi experts!!

I am trying to post some parameters to a url (an external website).

I am getting a response 404-Not found. I have checked with the developers of the website and they are asking me if a VPN is set up between SAP server and their server.

Is VPN required for HTTP Post???

Please guide me!

Thank you!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi!

As i have been told from the external site the URL called works only inside their network. And they have set up VPN between SAP server and their server.

I now get status text NOT FOUND and code 404, and they did not receive anything..

Any ideas?????

Edited by: Grigoria Koutsogianni on Oct 13, 2010 5:50 PM

6 REPLIES 6

Former Member
0 Kudos

Hi!

I don't think so, it's necessary. I'm using the following coding, and it's working, without any VPN settings.

DATA: sysid TYPE srcsystem.
 
  DATA: command TYPE string,
        lv_application TYPE string,
        returncode TYPE  i.
 
  DATA: c1(200) TYPE c,
        c2(200) TYPE c,
        c3(200) TYPE c,
        c4(200) TYPE c,
        c5(200) TYPE c.
 
  DATA: lv_objkey_url TYPE borident-objkey,
        lv_index TYPE sy-index,
        lv_length TYPE i.
 
  CALL FUNCTION 'GET_SYSTEM_NAME'
       IMPORTING
            system_name = sysid.
 
    MOVE 'http://www.fedex.com'    "'http://www.sap.com' 
                TO c1.
 
    CONCATENATE c1 c2 c3 c4 c5 INTO command.   "here you can add your order number to the URL
    CONCATENATE 'url.dll,FileProtocolHandler'
                command
           INTO command
       SEPARATED BY space.
 
    MOVE 'rundll32' TO lv_application.
    CALL METHOD cl_gui_frontend_services=>execute
       EXPORTING
         APPLICATION            = lv_application
         PARAMETER              = command
       EXCEPTIONS
         CNTL_ERROR             = 1
         ERROR_NO_GUI           = 2
         BAD_PARAMETER          = 3
         FILE_NOT_FOUND         = 4
         PATH_NOT_FOUND         = 5
         FILE_EXTENSION_UNKNOWN = 6
         ERROR_EXECUTE_FAILED   = 7
         others                 = 8
            .
  ENDIF.

It will bring up a browser and opens the given homepage.

Try out with different HTTP addresses as well...

However if you wanted to call a web service, that's a bit different, for that, you have to create FM-s with proper parameters.

Regards

Tamá

Former Member
0 Kudos

Hi !!

I tried the following code and it seems to be working..

REPORT xx .

DATA: status_code(100),

status_text(100),

response_entity_body_length TYPE i.

*COMPONENT_DATA TYPE DATA.

TYPES: BEGIN OF text,

line(120) TYPE c,

END OF text.

DATA: request_headers TYPE TABLE OF text WITH HEADER LINE,

request TYPE TABLE OF text WITH HEADER LINE,

response_headers TYPE TABLE OF text WITH HEADER LINE,

response TYPE TABLE OF text WITH HEADER LINE.

request-line = 'FirstName=YY&Surname=hghgj&Birth=10860319&Gender=F&mail=xxxxdssd.com&Nationality=EL'.

APPEND response.

request-line = '&Address1=ddddddddd&Address2=Rafina&City=xxx&Postcode=19009&Country=el&LandTelephone=22374664556'.

APPEND response.

request-line = '&Mobiletelephone=fdfdfdfdfdf&Occupation=1&Income=1890087&Networth=10000&NetWorth=1000&Currency=1&Leverage=1'.

APPEND response.

CALL FUNCTION 'HTTP_PUT_COMPONENT'

EXPORTING

absolute_uri = 'xxxxxx-xx.xx/SERVICE/UPDATEUSER'

  • RFC_DESTINATION =

  • PROXY =

  • PROXY_USER =

  • PROXY_PASSWORD =

  • USER =

  • PASSWORD =

  • COMPONENT_LENGTH =

blankstocrlf = 'X'

IMPORTING

status_code = status_code

status_text = status_text

response_entity_body_length = response_entity_body_length

TABLES

request_headers = request_headers

response_headers = response_headers

response_entity_body = response

component_data = request

EXCEPTIONS

connect_failed = 1

timeout = 2

internal_error = 3

tcpip_error = 4

system_failure = 5

communication_failure = 6

OTHERS = 7

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Is there anywhere in SAP i can verify that the values are sent?? Like a trace or something???

Thank you!!!

0 Kudos

Hi!

If there are no exceptions, after the run of the FM, the sending should be good.

However you have to check on the receiver side, was the data transfer correct or not and all received data was ok.

Why don't you ask the developers of the reciver side?

Regards

Tamá

Former Member
0 Kudos

Hi!

As i have been told from the external site the URL called works only inside their network. And they have set up VPN between SAP server and their server.

I now get status text NOT FOUND and code 404, and they did not receive anything..

Any ideas?????

Edited by: Grigoria Koutsogianni on Oct 13, 2010 5:50 PM

0 Kudos

Sounds to me like you have a network connectivity issue - not an ABAP issue.

Talk to your network people. At the very least try and access the URL from a web browser that is running on the SAP server.

Cheers

Graham Robbo

Former Member
0 Kudos

Thank you everybody!!

The external website developers changed their URL . Everything is OK now!!