cancel
Showing results for 
Search instead for 
Did you mean: 

to capture lengthy text in purchase order ?

Former Member
0 Kudos

Hi,

I am creating a purchase order ....i want to capture Header and

Item text in PO. For that iam using read_text...but the problem

is length of the text in FM : Read_text is of just 132 Characters....if my user enters more than this how to capture those text and print it in PO ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

TDLINE is in the structure, so it is like internal table , it fecth all the data, After fetching data, You have to loop and Concatenate to another varaible.

data:V_text type char***

call function 'READ_TEXT'

exporting

  • CLIENT = SY-MANDT

id = id

language = sy-langu

name = tname

object = object

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = it_item_text_dtl

exceptions

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

others = 8

.

if sy-subrc eq 0.

loop at it_item_text_dtl into fs_item_text.

Concatenate v_text fs_item_text-tdline into v_text.

endloop.

endif.

Regards

Jana

Former Member
0 Kudos

Hi Reddy,

If you you see tdline the length of the text is just 132 chars...if my user enters more than 132 chars i couldnt capture that in

the tdline-text...this is my problem?

Former Member
0 Kudos

Hi,

yes it will retrieve total data, Just now i have tested

see example

data:v_lines type standard table of TLINE.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

id = '0001'

language = sy-langu

name = '0000000172'

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = v_lines

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

V_lines contain more than one lines, if you have data particular text node.

Regards

jana

Former Member
0 Kudos

Hi ,

If u enter more than n132 character it will break down as 132 xhar and it will store ...

so while retrieving u r getting them in internal table ...

Former Member
0 Kudos

Please try creating a test element with text type as 'Incluse Text'.

Here you can enter the details like Text Name, Text Object, Text ID and Language.

Thus you can achieve the functionality of 'Read_Text' via this type of text type in the smartforms.

Hope it helps. Provide points if useful.

Answers (4)

Answers (4)

Former Member
0 Kudos

both in sapscript and in smartform you can use the include statement for text.

the text is stored in a table so if you have more then 132 characters you have more lines. when you use the include then SAP will automatically size the output to the length of the given output-line. when there is more text then can be captured in one output-line you will have more output-lines occupied automatically.

Regards,

Guido

Former Member
0 Kudos

In the SAPScript at the text element where you want the text to print, go Insert -> Text -> Standard and fill in the values for text name, id, and language (same values you would use for the READ_TEXT FM).

Former Member
0 Kudos

If you just want to print the text why are you reading it?

You can invoke it with an INCLUDE without reading it first.

Former Member
0 Kudos

Hi Michael,

Can you tel me how to that ( to print without reading ) ?

Thanks,

Siva

Former Member
0 Kudos

*declare v_name1 as char70 and loop this one for it_tline into *wa_tline.

*suppose u want long text in main window, then create a loop in *the cell of main window

  • and proceed as below.

  • then creat a text and give &wa_TLINE-TDLINE&

clear it_Tline.

concatenate wa_OUT-ebeln wa_OUT-ebelp into v_name1.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = 'F01'

LANGUAGE = sy-langu

NAME = v_name1

OBJECT = 'EKPO'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = it_Tline

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

IF SY-SUBRC = 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

this was for smartforms.

if u r using sapscript,then u need to loop ur it_tline itab.

data : v_name1(70),

v_info4(50).

data :IT_TLINE4 LIKE TLINE OCCURS 0 WITH HEADER LINE.

loop at it_out into wa_out. " your final itab

concatenate it_OUT-ebeln it_OUT-ebelp into v_name1.

it_head-tdobject = 'EKPO'.

it_head-tdid = 'F01'.

it_head-tdspras = SY-LANGU.

IT_HEAD-TDNAME = V_NAME1.

APPEND IT_HEAD.

CALL FUNCTION 'TEXT_READ'

EXPORTING

I_HEADER = IT_HEAD

I_READONLY = 'X'

TABLES

T_LINES = IT_TLINE

EXCEPTIONS

NOTEDITED = 1

NOTFOUND = 2

ID = 3

OBJECT = 4

NAME = 5

LANGUAGE = 6

OTHERS = 7.

IF SY-SUBRC = 0.

read table it_tline. "#EC *

v_info4 = it_tline-tdline.

ENDIF.

endloop.

Sid