Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
1,896

One of the greatest benefits of implementing Personas is the ability to add new functionality that doesn't require a developer - at least not in the traditional ABAP sense.  With the use of JavaScript, you can interact with not only the elements within the SAP screen, but with external programs.  During my presentation at TechEd last week in Las Vegas, I demonstrated how to add an email button to a customer master record.  This is very simple and can be added to any master record that has an email field.

I'm using an IDES system with Personas 2.0 for this example and have already simplified the screen.  This is the FD03 (Customer Master) transaction on the General Data screen.

From here, I added a new script button with the following steps.

Step 1 just checks to see if the email field is empty.  Step 2 then copies the value of the email field into a variable called 'email'.  Step 3 is the Javascript which concatenates the full string into a "mailto:{email_address}" argument then calls the program with the window.location.href command.

Here is the text of the JavaScript:

args.mailto = "mailto:";

args.fullmail = args.mailto.concat(args.email);

window.location.href = args.fullmail;

After saving the script and the flavor, my screen now shows the following:

And after clicking the 'Email' button, my Outlook 'New message' screen pops up with the email address prefilled. 

Since Outlook is my default email client, this works very well for me, as well as my customers who use Outlook.  One small quirk that I've found is between Internet Explorer and Google Chrome.  When clicking on the button from within IE, the Outlook window displays immediately.  When clicking on the button from Chrome, the browser prompts me with the message "Confirm Navigation.  All unsaved data will be lost" which requires me to click on "Leave Screen'.

3 Comments