cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow email task's hyperlink too long?

Former Member
0 Kudos

I think this might be a simple question but I cannot seem to figure it out.

I have a workflow which simply sends a mail. In the content of the mail I

have a hyperlink going back to our crm system. I pass some parameters to this hyperlink.

The workflow works fine and the email is sent, however, the hyperlink goes onto the second line

of the mail and becomes in active. If I copy the entire hyperlink and paste it in a browser it works.

The issue is I dont want users to copy and paste, I simply want them to click on the hyperlink.

Here is a screen print of what I am talking about http://img402.imageshack.us/img402/9471/38348167.png

And here is a screen print of the actual email that is sent: http://img210.imageshack.us/img210/6424/14370746.png

I tried going into transaction PFTC (Task Maintain) I entered my task and opened it up. I went to the tab description

and hit the edit button and I changed the tag column to continuous text but that didnt work, and then I tried extended line

and that too didn't make a difference.

Here is a screen shot of that: http://img341.imageshack.us/img341/6254/37776438.png

My question is, is there any way to get the hyperlink on one line or even to have it be clickable on 2 lines?

Thanks so much.

Jon

View Entire Topic
pokrakam
Active Contributor
0 Kudos

Hi Jon,

This is a known limitation of SAPScript. There's a note that will increase your line length to 132 characters which is possibly already applied. Some workarounds:

- Use container elements to construct your URL. The SAPScript editor is limited to 80 chars so it will insert a space. Thus you need to use something like &URL_PART1&&URL_PART2&

- The total length is still limited to 132 chars, so shorten your URL by use of aliases. Aliases can be defined in SICF (talk to your internet folks if you need help). Also shorten parameter names if possible, I've ended up with stuff like

http://intranet.example.com:8080/myalias/app.htm?p1=123&p2=456&p3=789

- If all else fails you may need to develop your own sendmail method that generates and sends the email

Hope that helps,

Mike

Former Member
0 Kudos

Hi Mike,

Thanks for the answer, it sounds a bit scary though.

The issue is I cannot shorten the parameter names as they are the standard parameters by the SAP CRM

system. Passing anything else would result in a hyperlink that would not take the user to the proper business object

I have used the container elements like &SYST-HOST& etc..

https://&SYST-HOST&.nothelfer.group:8001/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-client=&SYST-MA... action=B%crm-object-keyname=OBJECT_ID%crm-object-value= &OPPORTUNITY.OBJECT_ID&%

But I cannot change much else...

This is really strange that it was developed like this, you would think the send mail option could be sent as HTML mail rather then plain text. I trust your answer but I will leave this question open for a bit more to see if anyone else has any ideas.

Thanks mike!

Jon

Former Member
0 Kudos

Mike i thought i had it workign by copying and pasting the link to a web browser but it does not work correctly.

It is due to the % signs in the URL.

https://&SYST-HOST&:8001/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-client=020%crm-object-type=BT11...

The issue is I want it to look like this in the email template of the workflow:

https://&SYST-HOST&:8001/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-client=020&crm-object-type=BT11...

The issue is the workflow does not like the & symbols for anything that is not a container item. For instance it gets confused with &crm-object-type and it comes back with an error. So I thought I'd replace anything that does not pertain to an expression or container object element with the % symbol. But that doesnt seem to be working.

Is there a way to use the & symbols but not have the error that I am getting ?

pokrakam
Active Contributor
0 Kudos

Hi Jon,

The problem is not that it was 'developed like this', as this wasn't developed for this purpose. Workflow simply integrated the SAPScript engine to edit and render the workitem texts. Wasn't exactly cutting edge back in the 90's but it was all that was available. By now it's positively stone-age, but SAP want us all to start using Adobe forms so nothing was ever updated. I wonder if expensive licensing costs for Adobe forms are a factor? Surely not...

History lesson over, the sendmail step does do limited HTML. The problem is that SAPScript has a hard limit of 80 characters/line (or thereabouts) in the editor at which is will insert a space. Internally it can manage up to 132. I think you misunderstood what I meant with container elements: you need to construct the whole thing so that it fits within 80 characters to avoid it inserting a space.

Thus you need code to construct your URL in two parts, like:

URL1 = 'https://intranet.example.com:8080/myapp?'

URL2 = 'param1=123&param2=456&param3=789'

bring those back into WF and in the WI text you'd use

&URL1&&URL2&

Ugly, I know. And the whole thing expanded cannot exceed 132 chars.

A workaround if you don't want to code your own email sender is to create a simple BSP or Java app that accepts a reduced/abbreviated set of parameters and redirects the caller to the correct URL with the full params.

Edited by: Mike Pokraka on Jan 14, 2011 3:58 PM:

I note your second post, and my explanation above will solve the issue. If the URL is static you can even specify the contents of URL1/URL2 directly in workflow rather than calling a method/attribute.

Former Member
0 Kudos

Thus you need code to construct your URL in two parts, like:

URL1 = 'https://intranet.example.com:8080/myapp?'

URL2 = 'param1=123&param2=456&param3=789'

bring those back into WF and in the WI text you'd use

&URL1&&URL2&

Ugly, I know. And the whole thing expanded cannot exceed 132 chars.

Mike this doesn't sound too bad at all..you are right it does look ugly but I am desperate for a solution.

Question is where exactly would I be writing this code directly in the workflow? Please note I am totally new to workflows.

I understand the coding im just not sure where I need to write this code...

Thanks again.

former_member185167
Active Contributor
0 Kudos

Hello,

Normally you would write this code as part of an attribute of the BOR (or a method, if necessary).

Then you access the attribute in the workflow.

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Rick please excuse me from so many questions, but I am very new to this.

Can you tell me by example or sample code which screen / transaction I would be in to write this code?

Should I Just be inside of SWDD and right click the container and is there an add section that allows me to create my custom attributes?

All I would need to do is take the entire URL and place it in a variable.

Then in my workflow email item template I would put this in as an expression:

&MyExpression&

And that MyExpression would have my url: https://server:8001....&crm_object=OBJECT_ID&id=&OPPORTUNITY.ID etc etc..

But my question again is can you please give me an example or documentation or another thread where someone lists some steps to this?

Thanks again RIck, I've given you also some points for the help.

Thanks,

Jon

Former Member
0 Kudos

Hi

Please check this links

/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

http://wiki.sdn.sap.com/wiki/display/Snippets/Tosendamailattachmentwithmorethan255charactersinaline

Thanks

Arghadip

former_member185167
Active Contributor
0 Kudos

Hello,

To create an attribute, go to SWO1. Fill in your BOR (I hope you've delegated a ZBOR already, otherwise you'll have to do that too), expand Atributes, click on Create. That's how you add an attribute.

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Hi Rick,

Thanks I do see this transaction,

Im uncertain if I need to select the source as virtual or database field.

Then at the bottom it has data type reference ABAP Dictionary / Object type with further dialog boxes...

So being a newbie makes it all the more difficult on which one of these I need to select.

After I do make a selection I'd have to write some code to say

THIS_ATTRIBUTE = "http://www.myurl.com:80".

So do I just go to the "Program" button ?

Thanks again Rick, your help on this forum has been great and detailed.

Edited by: Hermiz Jon on Jan 18, 2011 3:37 PM

pokrakam
Active Contributor
0 Kudos

Hi Jon,

You need to create a subtye, not a copy.

See the doco on [extending BOR objects|http://help.sap.com/saphelp_nw73/helpdata/en/c5/e4adcc453d11d189430000e829fbbd/frameset.htm] and there's also a [tutorial|http://help.sap.com/saphelp_nw73/helpdata/en/c5/e4adcc453d11d189430000e829fbbd/frameset.htm] too.

Or - depending on your ABAP skills - you could ignore the whole BOR busines and create a class using functional methods to return the info you need.

Cheers,

Mike

Former Member
0 Kudos

Ok I got into the ZBUSCRMOPP sub type and I've delegated this in SWO6 (thanks to the info from Rick for that one).

Now I can see the attributes and I can right click and create.

I get a popup create with ABAP dictionary fields.

I say no to this and I get a popup for attribute and name description etc.

I can fill those in but is the source Virtual I take it?

Im a bit confused by the Data Type Reference, I assume I should select Object type and enter BUS2000111 ?

Are those settings correct ?

Here is the code it created:


GET_PROPERTY CRMWEBLINK CHANGING CONTAINER.
SWC_SET_ELEMENT CONTAINER 'CRMWebLink' OBJECT-CRMWEBLINK.
END_PROPERTY.

Can I just change this code to something like this:


GET_PROPERTY CRMWEBLINK CHANGING CONTAINER.
SWC_SET_ELEMENT CONTAINER 'CRMWebLink' OBJECT-CRMWEBLINK.
OBJECT-CRMWEBLINK = 'http://myURL?default.htm&myParam1=....". 
END_PROPERTY.

??

I tried doing that and it is throwing error. How can I set this attribute ?

Edited by: Hermiz Jon on Jan 18, 2011 4:39 PM

Edited by: Hermiz Jon on Jan 18, 2011 5:07 PM

pokrakam
Active Contributor
0 Kudos

Other way round:

GET_PROPERTY CRMWEBLINK CHANGING CONTAINER.   " start or property code
OBJECT-CRMWEBLINK = 'http://myUR...'.    " assign value to variable OBJECT-CRMWEBLING
SWC_SET_ELEMENT CONTAINER 'CRMWebLink' OBJECT-CRMWEBLINK.   "put variable into container that gets returned to whoever queries the attribute
END_PROPERTY.  "end of property code

Former Member
0 Kudos

I had tried that too like so:


GET_PROPERTY CRMWEBLINK CHANGING CONTAINER.   " start or property code
OBJECT-CRMWEBLINK = 'http://myUR...'.    " assign value to variable OBJECT-CRMWEBLING
SWC_SET_ELEMENT CONTAINER 'CRMWebLink' OBJECT-CRMWEBLINK.   "put variable into container that gets returned to whoever queries the attribute
END_PROPERTY.  "end of property code

And I always seem to get "OBJECT-CRMWEBLINK and C are not mutually convertible in a unicode program. program.

Is this all ok ?

Former Member
0 Kudos

Mike,

Besides my current error, do you know if this attribute source should be "Virtual".

I currently set it to virtual.

For attribute properties, I left them all unchecked.

For Data Type Reference

I dont know if I need to set it to ABAP Dictionary and provide a table and reference field.

The other Data type reference type is "Object Type" with an inverse attribute field.

In any event so far I have selected Virtual and for data type reference I have selected Object type and entered BUS2000111

Which I dont think this is right because when I go to the workflow I see CRMWebLink (my attribute) but it looks like it is related to the CRM opportunity.

I think all I want to do is have a plain old text field where I assign it the value of my url.

I hope I am making sense :(...

Thanks,

Jon

pokrakam
Active Contributor
0 Kudos

Data attribute = table field.

Virtual attribute = own code <== correct.

Data type = what you want the attribute to represent. In your case text up to 80 characters, so CHAR80 will do. Remember you will need split your URL across two attributes because SAPScript inserts a space

Former Member
0 Kudos

Ok this is puzzling the hell out of me and pissing me off extremly :)...ok had to get that out of me.

Here is what I did, I created 2 attributes C1 and C2.

for C1 I did this:


GET_PROPERTY C1 CHANGING CONTAINER.
DATA:
c1(50) TYPE c VALUE '.nomythelfer.group:8001/sap/bc/bsp/sap/crm_ui_start',
c2(30) TYPE c VALUE '/default.htm?sap-client=020',
c3(80) TYPE c.
CONCATENATE c1 c2 INTO c3.
OBJECT-C1 = c3.
  SWC_SET_ELEMENT CONTAINER 'C1' OBJECT-C1.
END_PROPERTY.

For C2 I did this:


GET_PROPERTY C2 CHANGING CONTAINER.
DATA:
c1(30) TYPE c VALUE '&crm-object-type=BT111_OPPT',
c2(20) TYPE c VALUE '&crm-object-value=',
c3(50) TYPE c.
CONCATENATE c1 c2 INTO c3.
OBJECT-C2 = c3.
  SWC_SET_ELEMENT CONTAINER 'C2' OBJECT-C2.
END_PROPERTY.

I tested this in the workflow and I just added my 2 fields

&Opportunity.C1& with a space and then &Opportunity.C2& and it does show the values correctly C1 returns:

.nomythelfer.group:8001/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-client=020

And C2 returns &crm-object-type=BT111_OPPT&crm-object-value

So now when I try to put it in my workflow as an entire string I have:

https://&SYST-HOST&&OPPORTUNITY.C1&&OPPORTUNITY.C2&&OPPORTUNITY.BUSINESSPROCESS&;

And I check my syntax it says:

Closing symbol '&' expected (pos. 51) in expresssion '&OPPORTUNITY.BUSINESS'

but this doesnt make sense...if I space them each out it checks out correctly.

So I know the data is right... but the issue is when I put them back together into one string and test to get the email it comes up split between various lines like so:

https://losvuxtr1.nomythelfer.group:8001/sap/bc/bsp/sap/crm_ui_start/default.

htm?sap-client=020&crm-object-type=BT111_OPPT&crm-object-value=&OPPORTUNITY.BUSINESSPROCESS&

Puts it on 2 lines and then it does not out put the business process GUID at the end...I really despise this

Edited by: Hermiz Jon on Jan 18, 2011 7:41 PM

Former Member
0 Kudos

I think the issue is that my URL even with adding these attributes is more then 80 characters, in fact even with the custom coding of additional attributes the url will end up being more then 150 characters hence there is no way to get around this.

Even If I applied a note to further the character count to 132, I am still passing this number.

I think this is the limitation you mentioned in your first post thread, where you said there is a limit, even if I create attributes, the outcome still depends on what these attributes contain, and if they are long strings then it will skip to another line..

Maybe I cant do this :(.

Jon

pokrakam
Active Contributor
0 Kudos

Jon,

Keep at it, you're almost there. The missing "&" in your example is at position 81 in the ine, which is not a coincidence.

The task builder has it's own user-friendly editor to hide SAPScript, but for this type of stuff it's better to use the SAPScript editor. Goto -> Change Editor.

And yes the total URL cannot exceed 132. An alias is a quick way to shorten the app name - use SICF to reduce /sap/bc/bsp/sap/crm_ui_start to /crmstart. If it's still too long then see my earlier comment about building a custom BSP/Java app to redirect a shortened version with custom parameter names.

Cheers,

Mike

Former Member
0 Kudos

Wow MIKE

I finally finally finally got it...I must be dreaming because such a small issue took me so long :(...gone are the days where i could whip up C# or .net applications and deploy them and enter the world of SAP 😆

I finally trimmed down the entire url and was able to use SICF as you mentioned and created a very short alias.

Man I cant believe this is working....

THANKS

Full (10) Points awarded! You are the man .

pokrakam
Active Contributor
0 Kudos

Happy to help, appreciate good detail in the question and effort to work it out, something that's often lacking in these forums.

It's ridiculous that we still rely on SAPScript, but there you go... If you're that way inclined you could write little URL generator/splitter classes and make the whole thing a bit more generic, but at least you got the idea.

If you're going to have more dealings with workflow (it's not all as backward as that!), I would suggest getting a copy of the second edition of "Practical Workflow for SAP" from SAP Press. I'm allowed to promote it as I don't get royalties - in fact, they go to charity, so you'd also be doing a good deed!

Cheers,

Mike

Former Member
0 Kudos

Mike I have to do about 5 more workflows much more advanced then this :).

I will pick up a copy today, does it matter if I purchase from Amazon ?

Thanks again

Jon

pokrakam
Active Contributor
0 Kudos

No doesn't matter where you get it from. Even more important if you're going to be building a few of them. And if much of this is from scratch I'd also recommend going the OO route rather than BOR objects, particularly as you seem to already be familiar with OO.

Have fun,

Mike

p619793
Active Participant
0 Kudos

Hello John and Mike,

I see that you had resolved this issue with SICF internal alias. Can you please tell me what exact setting you created in SICF. I don't have much idea on internet alias. Also how to use that alias in a workflow task container since for me container element value is taking max 255 chars url string.

Thanks in advance for any help.