Skip to Content
author's profile photo Former Member
Former Member

Dynamic TASK DESCRIPTION (internal table)

Hi there,

Does anyone know how to create a dynamic task description using an INTERNAL TABLE? My idea here is that I want to build up an internal table of HTML so that the task description can be nicely displayed in OUTLOOK.

I obvioulsy know how to put variables into the task description BUT how do I handle LOOPING at an internal table?

I have looked at the SAPSCRIPT but no luck on a "loop command"...

I have thought of something stupid - perhaps I call a PERFORM <subroutine> in another program and print out the '&variable&' in that code......BUT I know it won'y work like that.....

Surely creating a task description from an internal table can't be so hard?

Any advise would be greatly appreciated 😉

Lynton

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 03:45 AM

    I hope you are using Multiline and as we know multiline container has only one field. You need not do any type of loop. You just mention the Mutiline container element and write code that is specific to Task Description.

    Thanks

    Arghadip

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Arghadip,

      I have tried what you said......I created a multiline container element, populated it with the HTML I require for outlook and it does NOT work.

      So for example I have the following defined in the container:

      LT_TASK_DESCRIPTION (multiline, reference table = PRICAT_K005, reference field = TEXT_LINE)

      So I populate the container element LT_TASK_DESCRIPTION like follows:

      BEGIN_METHOD CREATE_TASK_DESCRIPTION CHANGING CONTAINER.

      DATA: LT_DESC TYPE TABLE OF pricat_k005-text_line,

      LV_BUFFER(40) TYPE c.

      SWC_GET_ELEMENT CONTAINER 'LT_TASK_DESCRIPTION' LT_DESC.
      APPEND '<html><head><title>Bob The Builder</title>'

      TO LT_DESC.
      APPEND '</head><body><center>'

      TO LT_DESC.

      APPEND '<font size="4">'

      TO LT_DESC.

      APPEND 'Mickey Mouse and Teddy Bear were here...</font></p>'

      TO LT_DESC.

      APPEND '<table border="0"><tr><td width="50%">'

      TO LT_DESC.

      APPEND 'Date</td><td width="50%">'

      TO LT_DESC.

      WRITE sy-datum TO lv_buffer. APPEND lv_buffer TO LT_DESC.
      APPEND '</td></tr><tr><td width="50%">Time</td><td width="50%">'

      TO LT_DESC.

      WRITE sy-uzeit TO lv_buffer. APPEND lv_buffer TO LT_DESC.
      APPEND '</td></tr></table>'

      TO LT_DESC.

      SWC_SET_ELEMENT CONTAINER 'LT_TASK_DESCRIPTION' LT_DESC.

      END_METHOD.

      And in the task description I have put the internal table...

      &LT_TASK_DESCRIPTION&

      And all I get in the TASK DESCRIPTION is:

      <html><head><title>Bob The Builder</title>

      So another words just the "header line" if you want to call it that.....

      Any ideas how to LOOP at the table in the TASK DESCRIPTION?

      Any help would be appreciated 😉

      Lynton

  • Posted on Jan 29, 2008 at 05:43 PM

    Hi Lynton,

    From SWDD, double-click on the task (WI) for which you'd like to print the description dynamically. On tab "Work Item Display", note that there are some demo functions available.

    You said: "I want to build up an internal table of HTML so that the task description can be nicely displayed in OUTLOOK". So in this case, SWl0_PREVIEW_DEMO_HTML (one of the demo functions available) might be of interest - as in any other function module, you can loop at your internal table to build-up your description.

    Regards,

    Andre Sousa

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi there,

      Unfortunately it doesn't work that way, it will display the HTML in the business workplace BUT when the EMAIL gets sent out it ONLY has the task description....no HTML.....

      I am still digging...

      Lynton

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.