cancel
Showing results for 
Search instead for 
Did you mean: 

Running SAP Transaction from Portal

0 Kudos

Hello, Is there any way to tell from within the ABAP program whether it has been executed from the Portal or from within SAP?

Thanks a lot, Ashley.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You could try coding in you ABAP program in java script:

var URLname = window.top.location.href;
if (URLname == "http://host:port/irj/portal...")
   ....its running through Portal
else
   ....its stand alone

I have'nt tried this though. Could you try it and let me know.

0 Kudos

Hi Prem,

Thanks you for your advice. I am going to try this just as soon as I can figure out how to code the java script into my ABAP program.

Thanks, Ashley

0 Kudos

Hi Prem,

I coded the javascript in my ABAP but it doesn't seem to like the line:

var URLname = window.top.location.href;

I get an error when executing the script:

ReferenceError: window is not defined

Not sure if it's possible to use this in ABAP...

Thanks

Ashley

Former Member
0 Kudos

Hi Ashley,

Can you check this topic: on how to use javascript in abap editors.

Because if you are viewing your transaction through ITS its perfectly OK to have Javascript in it.

Regards,

Prem.

P.S.

Or, Are you into Portal development. And may I please know what eaxctly is the purpose of knowing whether your transaction is running in portal?

You could also try making a Java iView (Abstract Portal Component -> JSP). And in your JSP create an IFRAME tage to hold the ITS URL to your transaction. Above the IFRAME create the script tags to hold the window.location code. This will definitely work as its a JSP.

e.g.

<html>

<script language = "JavaScript">

.... your js code....

</script>

<body>

<iframe src = "http://...your its url to the abap program z transaction..."></iframe>

</body>

</html>

Message was edited by:

Prem Mascarenhas

0 Kudos

Hi Prem,

I have an ALV report that can be run by the user from within SAP or triggered from an Iview on the Portal. We are just starting to use Portals and this is the only Iview in our Portal at the moment. I have found that when you interact with the ALV (eg click on checkbox) the value of the checkbox is different depending on whether you are running from the portal or within SAP. That is why I would like to know from within the ABAP where the program was triggered from so I can run the appropriate routine to get the value of the checkbox.

I did manage to run a javascript routine from the ABAP and get a return value (as shown in the link you sent). But when I try and get the URL using the window.top.location.href , when the javascript executed it did not recognize that.

Thanks,

Ashley

Answers (3)

Answers (3)

darren_bambrick2
Active Participant
0 Kudos

CALL FUNCTION 'ITS_PING'

EXCEPTIONS

its_not_available = 1

OTHERS = 2.

if sy-subrc = 0.

  • You are running on web

endif.

0 Kudos

created two transaction codes for program. one is run from portal and one is run from backend. i can then check the transaction code in the program.

0 Kudos

We can run SAP transaction thru Portal.

Create an iview with the standard template SAP TRANSACTION IVIEW.

There it will ask the details to which transaction it has to navigate.

After the Iview Creation go to System administration and create an SAP system.

Then go to User mapping and give the logon details of SAP and map the user with that logon for the corresponding created system...