Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Transformation attribute HREF in table loop

Former Member
0 Kudos

Hi,


I am working on a simple transformation that includes a table loop.  One field in the table is a URL (variable value based on the table field value).  I have found help on how to assign the URL value as a HREF link.  It is working in that it shows the link correctly in my output.

However, I would like this URL to have a text mask, as is normally possible in <a href="link">Help</a> where 'Help' is displayed instead of the link.  But I cannot figure out how to do this in a table loop.

This is my code (within table tags):

          <tt:loop ref=".INSTR">
            <tr>
              <td>
                <tt:value ref="$ref.INSTR_NUMBER"/>
              </td>
              <td>
                <tt:value ref="$ref.INSTR_TEXT"/>
              </td>
              <td>
                <tt:value ref="$ref.INSTR_NOTES"/>
              </td>
              <td>
                <a><tt:attribute name="href" value-ref="$ref.INSTR_LINK"/>
                      <tt:value ref="$ref.INSTR_LINK"/></a>
              </td>
            </tr>
          </tt:loop>

I've tried putting the text into various places between the <a> and </a> tags but nothing works.  I only need a hard-coded text, not taken from the table, not variable - the same text for each item.

Does anyone know how this can be done?

Best regards,

Christine

1 ACCEPTED SOLUTION

Former Member

I have figured out what I was doing wrong, and have it working now.

For anyone interested, this is what it should have looked like (and SAP Help on this was not very useful):

              <td>

                <a><tt:attribute name="href" value-ref="$ref.INSTR_LINK"/>

                      <tt:value ref="$ref.INSTR_LINK_TEXT"/></a>

              </td>

...where I added a text field to my table and populated it with the text I wanted for the link.

Simple, it just wasn't obvious to me.

1 REPLY 1

Former Member

I have figured out what I was doing wrong, and have it working now.

For anyone interested, this is what it should have looked like (and SAP Help on this was not very useful):

              <td>

                <a><tt:attribute name="href" value-ref="$ref.INSTR_LINK"/>

                      <tt:value ref="$ref.INSTR_LINK_TEXT"/></a>

              </td>

...where I added a text field to my table and populated it with the text I wanted for the link.

Simple, it just wasn't obvious to me.