cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a new URL from Service File

Former Member
0 Kudos

Hai,

My generated HTML code is like this,

`SAP_DynproLayerBegin(002,006,006,001)`

`SAP_Button("SUBMIT")`

`SAP_DynproLayerEnd()`

`SAP_DynproLayerBegin(011,006,006,001)`

`SAP_Button("EXIT")`

`SAP_DynproLayerEnd()`

How do I link the code which u have said to the above code.

<input type="button" name="b1" value="Go to Google" onclick="javascript:window.open('http://www.google.com', '_self');">

I have designed Submit and Exit in R/3 screen and generated the templated. When EXIT button is clicked the service file should be closed and new URL should be opened.

Regards,

H.K.Hayath Basha.

=========================================================

Hai All,

I have requirement in which when a user clicks a button in internet service file(R/3 program published as service file), i need to open a new URL in the same window. Please let me know how to do that.

Thanks & Regards,

H.K.Hayath Basha.

Re: Opening a new URL from Service File

Posted: Sep 16, 2006 7:28 AM Reply E-mail this post

is it a webrfc or webgui application? if its webgui, did you generate html template or does this run without the generated html template?

Raja

Re: Opening a new URL from Service File

Posted: Sep 16, 2006 9:32 PM Reply E-mail this post

Hai Raja,

Its a webgui application. I created a service file and generated HTML template.

Regards,

Basha

Durairaj Athavan Raja

Re: Opening a new URL from Service File

Posted: Sep 17, 2006 12:33 AM Reply E-mail this post

you can insert the following code in your html template (where you want your button to appear).

<input type="button" name="b1" value="Go to Google" onclick="javascript:window.open('http://www.google.com', '_self');">

Regards

Raja

=========================================================

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

in this case you need to add the following code in the ABAP program.

 IF sy-ucomm eq 'EXIT' . "exit buttons FCODE
    CALL FUNCTION 'ITS_PING'
      EXCEPTIONS
        its_not_available = 1
        OTHERS            = 2.
    IF sy-subrc =  0.

      DATA: redirect_url TYPE savwctxt-fieldcont ,
            redirect_get_parameters TYPE STANDARD TABLE OF savwctxt .
      MOVE: 'http://www.google.com' TO redirect_url .

      CALL FUNCTION 'ITS_BROWSER_REDIRECT'
        EXPORTING
          redirect_url                 = redirect_url
*     NOCACHE                      = 0
        TABLES
          redirect_get_parameter       = redirect_get_parameters
*   EXCEPTIONS
*     ITS_NOT_AVAILABLE            = 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.
    ENDIF .

  ENDIF .

Regards

Raja

PS: Kindly do not open multiple threads for the same issue

Answers (0)