Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FM read text and ALV - how to put in fieldcatalog

Hello experts,

I have been asked by my boss to modify a certain report to use ALV. Now, I have added all the fields required for fieldcatalog. Problem is, the last 3 fields value were fetched using FM READ_TEXT. Here it is:

REFRESH : lt_lines.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = '0002'

language = sy-langu

name = ls_thead-tdname

object = 'VBBP'

TABLES

lines = lt_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4.

IF sy-subrc = 0.

**- by wengbaga 03/14/2004 for SHIP-TO-PARTY

CLEAR ls_lines.

READ TABLE lt_lines INTO ls_lines INDEX 2.

WRITE (100) : ls_lines-tdline.

CLEAR ls_lines.

READ TABLE lt_lines INTO ls_lines INDEX 3.

WRITE (30) : ls_lines-tdline.

CLEAR ls_lines.

READ TABLE lt_lines INTO ls_lines INDEX 4.

WRITE (18) : ls_lines-tdline.

Now, how can I put ls_lines into fieldcatalog? I declared my fieldcatalog below. Only those 3 above remains.

FORM build_fieldcatalog.

fieldcatalog-fieldname = 'VGBEL'.

fieldcatalog-seltext_m = 'Ref. Doc.'.

fieldcatalog-col_pos = 0.

fieldcatalog-outputlen = 10.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'POSNR'.

fieldcatalog-seltext_m = 'Item'.

fieldcatalog-col_pos = 1.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'MATNR'.

fieldcatalog-seltext_m = 'Material'.

fieldcatalog-col_pos = 2.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ARKTX'.

fieldcatalog-seltext_m = 'Description'.

fieldcatalog-col_pos = 3.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'KWMENG'.

fieldcatalog-seltext_m = 'Qty'.

fieldcatalog-col_pos = 4.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ZIEME'.

fieldcatalog-seltext_m = 'Unit'.

fieldcatalog-col_pos = 5.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question