cancel
Showing results for 
Search instead for 
Did you mean: 

Help with call to URL

sap_cohort
Active Contributor
0 Kudos

Hi, I would like to present an URL to my users so they can click on it and have a window open up to the destination. This link needs to be dynamic because depending on which environment they are in the link needs to be a different address. Can anyone give me details on how I might accomplish this?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

sap_cohort
Active Contributor
0 Kudos

Hi, How can I create the Application so that the page is automatically spawed once the application is called instead of having the user click on a link? thanks!

sap_cohort
Active Contributor
0 Kudos

A Web Dynpro Guy helped out and put the following logic in the WDDOINIT Method of my default view. He also created an outbound plug "NAVBIPORTAL" of type exit on the window.


* Server HTML URL's
DATA: DEV_PORTAL TYPE STRING VALUE 'https://<dev_server:port>/irj/portal'.
DATA: QAS_PORTAL TYPE STRING VALUE 'https://<qas_server:port>/irj/portal'.
DATA: PRD_PORTAL TYPE STRING VALUE 'https://<prd_server:port>/irj/portal'.
DATA: BP_URL     TYPE STRING.

* Determine System URL to be used based on current environment
  CASE SY-SYSID.
    WHEN 'EPD'.             " Development
      BP_URL = DEV_PORTAL.
    WHEN 'EPQ'.             " Quality
      BP_URL = QAS_PORTAL.
    WHEN 'EPP'.             " Production
      BP_URL = PRD_PORTAL.
  ENDCASE.

  DATA LO_MAIN_WINDOW TYPE REF TO IG_MAIN_WINDOW .

  LO_MAIN_WINDOW = WD_THIS->GET_MAIN_WINDOW_CTR( ).
  LO_MAIN_WINDOW->FIRE_NAVBIPORTAL_PLG( URL = BP_URL ).

former_member182190
Active Participant
0 Kudos

Hi,

Its nice that you have put in your code here.

You can create a link to URL.

create an attribute of some Char50 and bind to reference property of the Link to URL UI

Element.

Depending on your Sy-sysid

u can set that attribute to either DEV_URL or QES_URL in your Wddoinit method.

Hope this solves your problem.

Regards,

Ismail.

sap_cohort
Active Contributor
0 Kudos

All this Web Dynpro Code is really foreign and I don't understand any of it yet. I did find out I can't use CALL_BROWSER. Instead I found the following snippet of code that takes care of everything. Thanks for your help!...

DATA: API_COMPONENT TYPE REF TO IF_WD_COMPONENT.

DATA: WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.

DATA: WINDOW TYPE REF TO IF_WD_WINDOW.

API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).

WINDOW_MANAGER = API_COMPONENT->GET_WINDOW_MANAGER( ).

WINDOW = WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW( URL = BP_URL MODAL = ABAP_FALSE ).

WINDOW->OPEN( ).

former_member182190
Active Participant
0 Kudos

Hi,

You can create a Link to Action in your View.

In your on action method of the UI element you can navigate to the required window

based on your requirement.

Hope this solves your problem.

Regards,

ismail.

sap_cohort
Active Contributor
0 Kudos

OK, I was thinking this route as well. I have created the action, but don't know what/how to code to call an URL in a new window. I've listed what I have so far below. Can you tell me if I'm on the right track?

Also, I Keep getting NO_BATCH Error. Any Idea what this is?

Thanks for any help.

-


DEV_URL ='https://devsystem.com:50101/irj/portal'.

QAS_URL ='https://qassystem.com:50101/irj/portal'.

PRD_URL ='https://prdsystem.com:50101/irj/portal'.

CASE SY-SYSID.

WHEN 'DEV'

BP_URL = DEV_URL.

WHEN 'QAS'.

BP_URL = QAS_URL.

WHEN 'PRD'.

BP_URL = PRD_URL.

ENDCASE.

CALL FUNCTION 'CALL_BROWSER'

EXPORTING

URL = BP_URL

NEW_WINDOW = ' X'

EXCEPTIONS

FRONTEND_NOT_SUPPORTED = 1

FRONTEND_ERROR = 2

PROG_NOT_FOUND = 3

NO_BATCH = 4

UNSPECIFIED_ERROR = 5

OTHERS = 6 .

-