cancel
Showing results for 
Search instead for 
Did you mean: 

Header text for billing document VF03

Former Member
0 Kudos

I want to print the header textmaintained for billing no. in the smartform.

I have done the following code but all the text is not printed.

I want to print the text which i get in TEXT_LINE table after i execute this Funciotn module in a sngle line. So i have written concatenate as below. But after 256 characters it is not displaying. I declared hed_text as string, then i tried as char512. Yet it does not take . How to proceed.

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = 'Z009'

LANGUAGE = SY-LANGU

NAME = NAME_TO_PASS

OBJECT = 'VBBK'

  • IMPORTING

  • HEADER =

TABLES

LINES = TEXT_LINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

clear hed_text.

Loop at TEXT_LINE.

concatenate hed_text TEXT_LINE-TDLINE into hed_text.

endloop.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

when we write more than 255 characters in a window it wont display because it can print up to 255 characters. So try to use template in that window and then place text. so that text will be displayed in the next line.

Hope this will give you some idea.

Regards,

Aswini.

Former Member
0 Kudos

you can use an include text instead of the read_text fm.

goto the general attributes of a text element. From the drop down menu, convert the text type to include text.

The just as in read_text fm pass the parameters

text name, text object, text id and language.

Every thing will be handled automatically

OR

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

id =

language =

name =

object =

ARCHIVE_HANDLE = 0

LOCAL_CAT = ' '

IMPORTING

HEADER =

tables

lines = i_tab

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

So you want to know how get the parametrs right. This is how"

In SO10 goto goto menu -> header

here u will find all the required parametrs.

The text lines will be returned in the i_tab.

U can loop at this itab and display the data.

Former Member
0 Kudos

If you want a certain number of character i have use that for me:

In global definition:

Z010_LIB type TDLINE

Program Window:


DATA: BEGIN OF it_lines occurs 0,
        tdformat TYPE tline-tdformat,
        tdline TYPE tline-tdline,
      END OF it_lines.

DATA : str_lines like tline.
DATA : Z010_LIB1 type TDLINE.
DATA : Z010_LIB2 type TDLINE.


CALL FUNCTION 'READ_TEXT'
  EXPORTING
    id                            = 'Z010'
    language                      = SY-LANGU
    name                          = '0050000027000010'
    object                        = 'VBBP'
  tables
    lines                         = it_lines.
 .

READ TABLE it_lines into str_lines index 1.
Z010_LIB1 = str_lines-tdline+0(132).
READ TABLE it_lines into str_lines index 2.
Z010_LIB2 = str_lines-tdline+0(132).

Concatenate Z010_LIB1 Z010_LIB2 into Z010_LIB
separated by ''.

I take just the 2 line ( index 1 and 2).

If you want take all the text, use Include Text.

If you take read_text solution : use that too (if the text not exist )


select * from STXH into STXH
  where TDOBJECT = 'VBBP'
  and TDNAME = '0070000007000010'.
  Endselect.

if stxh-tdname = ''.
 ELSE.
CALL FUNCTION 'READ_TEXT'
  EXPORTING
    id                            = 'Z010'
    language                      = SY-LANGU
    name                          = '0050000027000010'
    object                        = 'VBBP'
  tables
    lines                         = it_lines.
 .

READ TABLE it_lines into str_lines index 1.
Z010_LIB1 = str_lines-tdline+0(132).
READ TABLE it_lines into str_lines index 2.
Z010_LIB2 = str_lines-tdline+0(132).

Concatenate Z010_LIB1 Z010_LIB2 into Z010_LIB
separated by ''.
endif.

Former Member
0 Kudos

Hi,

The length of the header text window in smart form may be less than 256.Thats why you are unable to print all the text. Check the length of the window once.

If that is the case, put a condition and check for length less than 256 then append text and remaining text will be appended to next line.In this way you can print all text.

Thanks,

Phani Diwakar.

Former Member
0 Kudos

instead u create text in smartforms and in that text --> General aatributes, select Include text and provide text name, text id, object and language the same way u are providing in 'read_text', it will fetch the complete text maintained and display.

u can also give dynamic text name like &variable name&.

Former Member
0 Kudos

its better u use include text. there u pass the object name id and language.

check no error if no text exist.

this ll be helpful,