Skip to Content

Textarea - Lines missing

Hi Gurus,

I have implemented a custom field in textarea. When user enters multiple lines (press Enter), the field able to capture first line only, other lines are missing.

For eg, if typing:

123 - Press Enter

456 - Press Enter

789 - Press Enter

when the page is refreshed, the textarea left 123 only.

i tried using the following but even worse, the field dissapeared from the page.

<textarea name="mail-text:80[]" cols="80">`repeat with r in mail-text; write (r, "\r\n"); end`</textarea>

Appreciate your opinions.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Feb 18, 2009 at 10:15 AM

    The code for your textarea looks fine. You don't say how you are reading the textarea in SAP.

    I use the following code in my PAI to read multiple lines. I hope this helps.

    DO.

    count = count + 1.

    FIELD-GET 'textareaname' count ITS_TEXT varlen.

    if sy-subrc = 0.

    • Do something with contents of its_text.

    else.

    EXIT.

    endif.

    enddo.

    Regards

    Karen

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 25, 2008 at 03:55 PM

    when i followed this, the custom field disappears.

    textarea-text-lost-in-its-when-using-carriage-retu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 04:11 PM

    Hi Glen,

    i suppose your Data where not submitted to the behind laying r/3 internal table.

    so if make the roundtrip only the workarea is filled.

    If have had a similar Problem, but i solved in the folling way:

    ITS TEMPLATE

    <p>`repeat with j in GS_TEXT-TDLINE; write (j, ""); end`</p

    Where GS_TEXT is my warkaera.

    In R/3:

    Know i read via RFC the ITS CONTENT at PAI

    Dynpro:

    PBO : * using steploop for Texttable *

    loop at gt_texttab cursor g_tk_cur

    into gs_text.

    endloop.

    PAI:

    PROCESS AFTER INPUT.

    module rfc_import_texttab.

    loop at gt_texttab.

    endloop.

    module rfc_import_texttab input.

    perform rfc_import_texttab.

    endmodule.

    FORM rfc_import_texttab.

    DATA: lwa_order TYPE twa_order_re,

    lt_savwctxt TYPE TABLE OF savwctxt,

    lwa_savtxt TYPE savwctxt,

    l_index TYPE i,

    l_remeng(15) TYPE c.

    • Importiert vollständigen Kontext vom ITS-Server

    • Beschafft Felder aus dem internen Datenpool (ITS) mit einem Zugriff

    CALL FUNCTION 'ITS_IMPORT_CONTEXT'

    TABLES

    context = lt_savwctxt

    EXCEPTIONS

    its_not_available = 1

    OTHERS = 2.

    CASE sy-subrc.

    WHEN space.

    • Texte

    READ TABLE lt_savwctxt INTO lwa_savtxt WITH KEY

    fieldname = 'GS_TEXT-TDLINE'.

    IF sy-subrc = 0.

    REFRESH gt_texttab.

    CLEAR gs_text.

    LOOP AT lt_savwctxt INTO lwa_savtxt

    WHERE fieldname = 'GS_TEXT-TDLINE'.

    MOVE lwa_savtxt-fieldcont TO gs_text-tdline.

    l_index = lwa_savtxt-fieldindex.

    INSERT gs_text INTO gt_texttab INDEX l_index.

    ENDLOOP.

    ENDIF.

    WHEN OTHERS.

    ENDCASE.

    ENDFORM.

    I'll hope this will help you.

    Regards

    Thorsten

    Add a comment
    10|10000 characters needed characters exceeded

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.