Skip to Content
0
Former Member
Apr 13, 2012 at 04:28 AM

SQ02 READ_TEXT ABAP Codings

1190 Views

I've written this ABAP coding at SQ02 Infosets. It is to extract the Long Text from SD Outbound Delivery long text.

[code]

v_name = LIPS-VBELN.

CALL FUNCTION 'READ_TEXT'

EXPORTING

"client = '120'

client = sy-mandt

id = 'Z014'

language = 'E'

name = v_name "'5300000001'

object = 'VBBK'

TABLES

lines = i_tline

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT i_tline INTO k_tline.

READ TABLE i_tline INDEX 1.

"IF sy-subrc = 0.

REMARKS_LN1 = k_tline-tdline.

"ENDIF.

ENDLOOP.

[/code]

Lets say i have 5 Delivery Order and the remarks long text are as follow

[code]

DO # | Long Text

---------------

DO# 01 | Text 01

DO# 02 | <none>

DO# 03 | <none>

DO# 04 | Text 04

DO# 05 | <none>

[/code]

After i run my query, i gotten such results

[code]

DO # | Long Text

---------------

DO# 01 | Text 01

DO# 02 | Text 01

DO# 03 | Text 01

DO# 04 | Text 04

DO# 05 | Text 04

[/code]

By right DO# 02, DO# 03 and DO# 05 should be empty. But it is populated from values from the previous DO

[b]

What codings should i insert to rectify this problem?[/b]