cancel
Showing results for 
Search instead for 
Did you mean: 

InvalidUrlRuntimeException - mailto

Former Member
0 Kudos

Hi.

We upgraded our WAS sever 6.40 sp 9 to SP 19.We have an web-dynpro application running on them.when we click a button and email window from outlook popup but after upgrading we found that it is showing some errors.I even tried the SAP note 864842 but it did not help. the error i am getting is

com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=mailto:?subject=Notification: Mesage text&body=Hi name,%0D%0A%0D%0AI reason.%0D%0A%0D%0AReason:%0D%0A%0D%0A%0D%0ARegards,%0D%0A%0D%0Aname

at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.checkURL(AbstractURLGenerator.java:605)

at com.sap.tc.webdynpro.services.sal.url.core.URLGeneratorInternal.checkURL(URLGeneratorInternal.java:303)

at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.IFrame.getSource(IFrame.java:621)

......(more)

is there any hot fix or other solution it can be fixed?

The current code is prefectly working in SP9.

Thanks & regards,

Arun

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Kudos

Hi,

Encode spaces as %20. For example in 'Hi name'.

Omri

Former Member
0 Kudos

Thanks Omri.But that didn't help.i am getting the same error.

Former Member
0 Kudos

Please post the code that encodes the URL.

Armin

Former Member
0 Kudos

Armin,

please find the code below.

Vector emailAdrs = new Vector();

emailAdrs = wdContext.currentContextElement().getEmailAdrsVector();

Zma_Emailaddrs emlAdrsTD = null;

Vector emailDetails = new Vector();

emailDetails = wdContext.currentContextElement().getEmailDetailsVector();

Zma_Work_Time workData = null;

String strEmailRemarks = wdContext.currentContextElement().getEmailRemarks();

String strUrl = "mailto:";

String strEmailAdrs = "";

String strEmailDetails = "";

String strDate = "";

String emailSubject = wdContext.currentContextElement().getEmailSubject();

String strEmailMessage = wdContext.currentContextElement().getEmailMessage();

String strMgrName = wdContext.currentContextElement().getManagerName();

// Addition forEmail Notification Text Change

String strEmailEmployeeName = wdContext.currentContextElement().getEmailEmployeeName();

if (strEmailEmployeeName == null || strEmailEmployeeName.equalsIgnoreCase("null")) {

strEmailEmployeeName = "";

}

// End of Addition for Email Notification Text Change

if (strMgrName == null || strMgrName.equalsIgnoreCase("null")) {

strMgrName = "Approver";

}

// Setting Email Address

if (emailAdrs != null && !emailAdrs.equals("null")) {

if (emailAdrs.size() > 0) {

for (int i=0; i<emailAdrs.size(); i++) {

emlAdrsTD = (Zma_Emailaddrs)emailAdrs.get(i);

if (emlAdrsTD.getUsrid_Long() != null && !emlAdrsTD.getUsrid_Long().equals("")) {

strEmailAdrs = strEmailAdrs + emlAdrsTD.getUsrid_Long() + ";";

}

else {

strEmailAdrs = strEmailAdrs;

}

}

}

else {

strEmailAdrs = strEmailAdrs;

}

}

else {

strEmailAdrs = strEmailAdrs;

}

// Setting Email Subject

strUrl = strUrl + strEmailAdrs + "?subject=" + emailSubject;

// Setting Email Details

if (emailDetails.size() > 0) {

for (int j=0; j<emailDetails.size(); j++) {

workData = (Zma_Work_Time)emailDetails.get(j);

strDate = workData.getWork_Date().toString();

strDate = strDate.substring(8) + "." + strDate.substring(5,7) + "." + strDate.substring(0,4);

strEmailDetails = strEmailDetails + strDate + " " + workData.getZztimeid() + " " + workData.getTimestamp() + " " + strEmailRemarks + "%0D%0A";

}

//strEmailDetails = "&body=Hi,%0D%0A%0D%0APlease find the details below:%0D%0A%0D%0A" + strEmailDetails + "%0D%0A%0D%0ARegards,%0D%0A%0D%0A" + strMgrName; // This is commented to implement Email Notification Text Change

strEmailDetails = "&body=Hi " + strEmailEmployeeName + ",%0D%0A%0D%0APlease find the details below:%0D%0A%0D%0A" + strEmailDetails + "%0D%0AReason for Modification or Rejection:%0D%0A%0D%0A%0D%0ARegards,%0D%0A%0D%0A" + strMgrName; // Added part strEmailEmployeeName and %0D%0AReason for Modification or Rejection:%0D%0A for MCR

}

else {

strEmailDetails = "&body=" + strEmailMessage;

}

strUrl = strUrl + strEmailDetails;

// Call Outlook window for sending the Mail

try {

wdContext.currentContextElement().setEmailUrl(strUrl);

IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("EmailInOutlookWindow");

IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);

wdContext.currentContextElement().setEmailTempWindowReference(window);

window.open();

}

catch (Exception e) {

String msg = e.getLocalizedMessage();

if (msg == null || msg.length() == 0)

msg = e.getMessage();

if (msg == null || msg.length() == 0)

msg = e.toString();

messageMgr.reportException(msg, true);

}

Former Member
0 Kudos

Please read this thread:

Armin