on 01-21-2008 1:06 PM
I've searched as much as I could for this answer, but couldn't seem to find it. Perhaps I was putting in the wrong search strings as it really seems like something that would have been asked already?
Anyway, I would like to launch an SRM page from an ABAP program. Is there a function module or some other functionality to do it?
Currently, all I've come up with is using FM CALL_BROWSER and inserting the URL for SRM. This method only allows access to the log-in page and does not allow passing of parameters such as user ID.
Thanks in advance for any help offered.
Hello, you could try to use the class cl_gui_html_viewer
PROGRAM Z_CALL_SRM .
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
MODULE STATUS_1000 OUTPUT.
data gv_html type ref to cl_gui_html_viewer.
data gv_container type ref to cl_gui_custom_container.
data html_url(200) TYPE c.
create object gv_container
exporting
clsid =
PARENT =
STYLE =
DYNNR =
REPID =
container_name = 'CUST_CTRL'
LIFETIME = lifetime_default
AUTOALIGN =
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
LIFETIME_DYNPRO_ILLEGAL_PARENT = 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.
create object gv_html
exporting
parent = gv_container
.
if sy-subrc <> 0.
endif.
call method gv_html->load_html_document
exporting
document_url = 'http://www.google.com'
document_id = 'A.CSS'
importing
assigned_url = html_url
exceptions
document_not_found = 1
dp_error_general = 2
dp_invalid_parameter = 3.
if sy-subrc = 0.
call method gv_html->show_data
exporting
url = html_url
exceptions
cntl_error = 1.
if sy-subrc = 1.
raise cntl_error.
endif.
endif.
ENDMODULE. " STATUS_1000 OUTPUT
This piece of code is in the output module of screen 1000 and screen 1000 contains a custom control object that display the web page.
Hope this helps.
Regards, Luciano.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, it looks like there's no way to do what I'm really wanting. Thanks for the advice offered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the answer Luciano, but from what I understand of it, that's just an objects way of doing what I'm already doing. Is there any other method that will also automatically log the user into SRM?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You need to pass through the login screen. I know two ways for this, maybe there are other one.
First would be to use SSO ticket, but if you don't have the architecture designed for this, no way.
Second is to define a new webservice. In tx SICF, create your own service or define an alias for an existing service and in the tab connection, set a service user. But in that case the user log into SRM will be the service user, not the one calling the service from GUI.
It depends on the page you want to call from GUI. For a static page, there shouldn't be any problem, but if you want to execute SRM flow (create SC, navigate through catalog, ...)
Rgds,
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.