cancel
Showing results for 
Search instead for 
Did you mean: 

Textarea - Lines missing

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member498918
Participant
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

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

Former Member
0 Kudos

when i followed this, the custom field disappears.