07-31-2007 3:11 AM
In a custom subscreen exit, I have an SAP picture control.
If I pass the picture control a "file" URL, i.e. a URL that begins with "file://", then the picture control loads fine. So I know there's nothing wrong with the code.
But if I pass the picture control a true web URL, i.e. a URL that begins with "http://", then the picture control doesn't load - nothing appears in the container.
I assume that what's going on is an access authorization problem - that at this site, the SAP runtime is not authorized to access the external web on its own.
Is this generally true? Does it take special authorizations for the SAP runtime to be able to access the web?
Also, if what I'm experiencing is an access authorization problem, wouldn't you think the program would short-dump or at least display an error message, rather than just displaying nothing ????
Thanks for whatever time anyone can afford to spend considering these questions.
djh
07-31-2007 3:32 AM
07-31-2007 3:32 AM
07-31-2007 3:37 AM
It would be as simple as doing pretty much the same as the picture control, but calling the SHOW_URL method of the class like so. See example program SAPHTML_DEMO1 for a complete example coding.
DATA: html_control TYPE REF TO cl_gui_html_viewer.
data: url(2048) type c.
url = 'http://www.sap.com'.
CALL METHOD html_control->show_url
EXPORTING
url = url
EXCEPTIONS
cnht_error_parameter = 1
OTHERS = 2.
REgards,
RIch Heilman
07-31-2007 3:47 AM
Rich -
I'm gonna hold off accepting that answer.
Reason is that BC412 manual specifically says in the picture control section that the URL you pass to cl_gui_picture->load_picture_with_url can be any one of the following:
1) a "file://" URL;
2) an "http://" URL;
3) an "ftp://" URL;
4) an MIME repository path.
I wouldn't think the manual would be so specific about these four types of URL's if they weren't all permissible.
Plus, of course, the HTML viewer doesn't give you zoom, stretch, center, and all the other features of the picture control.
Regards
djh
07-31-2007 3:50 AM
07-31-2007 3:52 AM
Hi aRs -
Not SAP_Picture_Demo, but something just as good.
I tested the URL using a Picture Control demo program that Uwe Schieferstein happened to write a few days ago (based on a BC412 example) when he was showing me the cl_bds_document_set->get_with_url method (the one that I wound up not being able to use.)
This program also loads a "file://" URL fine, but not an "http"//" URL.
Reason I think it's an access authorization problem is that my current customer places heavy restrictions on web access BY user id - e.g. non-salaried employees in the plants can't access the web.
So I think that to get web access, at least general web acess, the SAP runtime has to be "authorized" for this access - same as any other "user" at this site.
Regards
djh
07-31-2007 3:55 AM
Rich -
Good suggestion - I'll do the su53 first thing tomorrow. It occurred to me also, but I literally ran out of time - had to split and take the honey to the doctor.
Will try first thing in the morning, unless someone says something definitive tonight.
Thanks again.
Regards
djh
07-31-2007 4:12 AM
07-31-2007 4:13 AM
07-31-2007 4:13 AM
07-31-2007 5:14 AM
Hey Rich -
Thanks for corroborating the problem.
I was thinking about su53 - if the problem is at the site's network security level, then it's completely outside SAP, so it makes sense that su53 would not show anything - no internal SAP authorization is being violated.
It's when SAP itself tries to access the web on behalf of the SAP user that network security steps in and says something like:
"SAPADM"? "SAPADM" has no authorization to surf the web.
(Or if not "SAPADM", then whatever name the network knows the SAP runtime as ...)
Regards
djh
07-31-2007 1:43 PM
Let's test that theory. Copy and run this test program which uses an HTML control to display the SAP logo that you see at the top left of the SDN page. Can you see it?
report zrich_0001.
data: docking type ref to cl_gui_docking_container,
html_control type ref to cl_gui_html_viewer,
repid type syrepid,
url(256) type c.
parameters: p_check type c.
start-of-selection.
at selection-screen output.
repid = sy-repid.
check docking is initial.
create object docking
exporting repid = repid
dynnr = sy-dynnr
side = docking->dock_at_left
extension = 1500.
create object html_control exporting parent = docking.
url = 'https://www.sdn.sap.com/irj/portalapps/' &
'com.sap.nw.wpc.cssservice/images/logo_header.gif'.
call method html_control->show_url( exporting url = url ).
Regards,
Rich Heilman
07-31-2007 2:25 PM
Rich -
Thanks very much for providing a testbed.
No - nothing pops at all when I run your program.
Basis has informed me that if I give them the program, etc., they will research the connections and do whatever is necessary to open the firewall, etc.
So I'll leave this thread open and post back to it with progress reports on what they've done and whether it's working.
Thanks again for working this one for us (me and anyone else who's gotta do the same thing.)
djh
Dave
08-01-2007 2:09 PM
08-01-2007 2:37 PM
Hey Rich -
Thanks for getting back with confirmation of our suspicions.
Fortunately, the customer has realized that opening up the shop floors to the Web may cause future problems (even when the access is purely under program control.)
So they've agreed to restrict their GOS "URL" attachments in IW22 to "file" URLs, which as we have seen, are no problem for the picture control.
By the way, I have wound up using the HTML viewer <b>as well as</b> the Picture Control, for the following reason.
Since I have to "fit" ictures smaller to display three of them in the Picture Controls on the fifth subscreen of the custom IW22 tab, I've put in a click event on each picture control that will pass the URL to the HTML viewer, which will of course pop a full-size copy. (At this point in the code, I've always got a file URL for each attachment, because I've written any internal binary attachment to a drive for performance reasons - i.e. once I've accessed the internal binary once in SOFFDB, I write it to disk so that I never have to go into the DB again for that picture ...)
Thanks again for the guidance.
Regards
djh
08-01-2007 3:02 PM
Hey Rich -
Just thought you'd be interested to know that when I passed your program the URL of a jpg on the customer's <b>intranet</b>, the jpg popped fine.
QED.
Thanks again
djh
07-31-2007 3:45 AM