cancel
Showing results for 
Search instead for 
Did you mean: 

BDC | Long Text issue in Upload

Former Member
0 Kudos

Hi there,

<b>scenario :</b>I am uploading contracts into R/3 using VA41 and in this i am supposed to upload the description into long text field which comes as a 1000 character field.

i know there are two ways one is <u>save_text</u> and the other is by <u>double clicking on the text box</u> and going to alphanumeric text editor and then recording it using code <u>TP_detail</u> which is what i have chosen.

<b>issue :</b>

in both the ways by recording and using save_text i have to split the description by fragments of 60 character <i>(alphanumeric editors line length)</i> using a logic <b>(this causes words to get split in between).</b>

is there any way to avoid this if so pls let me know.

i would sincerely appreciate any code samples for the same( i know a lot of people would have faced this issue).

Thanks in advance.

regards

Harish Ramakrishnan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use FM TEXT_SPLIT

This will split the text the way you want it. You may have to call it more than once as it does not return a table.

Test the FM and you will get what I am talking about.

Rishi

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try using the FORMAT_TEXTLINES function module.



report zrich_0002 line-size 132.

types: tsource(1000) type c.
data: isource type table of tsource with header line.

data: string type string.
data: tlines type table of tline with header line.

editor-call for isource.

loop at isource.

  tlines-tdline = isource+0(132).
  append tlines.
  tlines-tdline = isource+132(132).
  append tlines.
  tlines-tdline = isource+264(132).
  append tlines.
  tlines-tdline = isource+396(132).
  append tlines.

endloop.

skip 3.
write:/ 'THis is before formatting'.
loop at tlines.
  write:/ tlines-tdline.
endloop.

call function 'FORMAT_TEXTLINES'
 exporting
   cursor_column           = 0
   cursor_line             = 0
   endline                 = 99999
   formatwidth             = 60
   linewidth               = 1000
   startline               = 1
   language                = sy-langu
* IMPORTING
*   NEW_CURSOR_COLUMN       =
*   NEW_CURSOR_LINE         =
  tables
    lines                   = tlines
exceptions
  bound_error             = 1
  others                  = 2.


skip 3.
write:/ 'THis is after formatting'.
loop at tlines.
  write:/ tlines-tdline.
endloop.

Regards,

Rich Heilman

Answers (2)

Answers (2)

Former Member
0 Kudos

In VA41 go the Header text editor, use the menu,

1.Goto->header

2.By using the

TEXT NAME

LANGUAGE

TEXT ID

TEXT OBJECT

Upload the requried text to TLINE structure and by using

FM "SAVE_TEXT" you can update

Prabhu Rajesh.

Former Member
0 Kudos

You can also try using RKD_WORD_WRAP

Pass the single text of 1000 characters and u can split it into as many lines as you want depending on the length of each line that u want.

Sharath.