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

How can I have dynamic count of lines in smartforms table field?

Hello,

I'm very new in developing smartforms, so please excuse if it's a silly question.

I created a table form in smartforms listing all entries of an article database as an internal table.

(Loop operand t_table into ls_table.)

Inside of one table field I want to list the article name and that's my problem the article description.

The problem is that there could exist unlimited description lines, but also no one.

Of course I only want to list the existing ones one per line.

I get the descriptions calling the function READ_TEXT and the information is stored in ls_txttab from type LTY_TXTTAB.

I tried to list the information by using the following code snippet.

LOOP AT ls_txttab INTO lf_text_zz.

concatenate lf_text_gz

CL_ABAP_CHAR_UTILITIES=>NEWLINE

lf_text_zz

into lf_text_gz.

ENDLOOP.

But smartforms ignores the newline char and just displays a '#' instead.

Do you have any idea how I can solve this?

I'd greatly appreciate your help.

Knud

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 14, 2011 at 11:25 AM

    Hi Knud,

    If Smartform is not accepting the new-line character, then you can just concatenate space with your dynamic text.

    say for e.g. if your description field space on smartform can accomodate maximum say 80 characters and your dynamic text holds 40 characters, then you need to concatenate remaining 40 characters as space to your dynamic text, so that, first charcter of new text will print on next line.

    also , I found one thread similar to your issue, pls have a look. It might be helpful,

    Smartform new line in a cell of a table

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Knud,

      In that case, you can simply display within loop only.

      In ur code,

      LOOP AT ls_txttab INTO lf_text_zz.

      concatenate lf_text_gz

      CL_ABAP_CHAR_UTILITIES=>NEWLINE

      lf_text_zz

      into lf_text_gz.

      ENDLOOP.

      Here, instead of concatenating and then printing it separately, u can print d current text, (lf_text_zz) within loop under a table line.

      Here, u have to take care of table line design, as to under which cell u want to print it.

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.