Use Functin 'READ_TEXT'

*-----------------------------------------------------------------------
*
* Company XXX Company Limited
*
* ProgrameName: ZZW_SD_READ_TEXT
*
* Author: Wei_Zhu
*
* Date: 08/07/2007
*
* Description: Study SAP In Program How To Use Function 'Read Text'
*
*
*-----------------------------------------------------------------------
REPORT ZZW_SD_READ_TEXT .

Tables: VBAK.

Data: Begin Of HText.
Include Structure Thead.
Data: End Of HText.

Data: Begin Of LText Occurs 50.
Include Structure Tline.
Data: End Of LText.

Data: Begin Of DText Occurs 50.
Data: Vbeln like VBAK-VBELN.
Include Structure TLine.
Data: End Of DText.

Data: VBELN Like Thead-TDNAME.

*-----------------------------------------------------------------------
* Screen
*-----------------------------------------------------------------------
Selection-Screen Begin Of Block B1 With Frame Title Text-001.
*Select-Options P_SDNO For VBAK-VBELN No Intervals.
Parameters: P_SDNO Like VBAK-VBELN.
Selection-Screen End Of Block B1.

VBELN = P_SDNO.
*-----------------------------------------------------------------------
* Start-Of-Selection
*-----------------------------------------------------------------------
Start-Of-Selection.
Call Function 'READ_TEXT'
Exporting
Client = Sy-Mandt
ID = '0001'
Language = 'D'
Name = VBELN
Object = 'VBBK'
Importing
Header = HText
Tables
Lines = LText
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.
Else.
LOOP AT LText.
IF LText-TDLINE NE ''.
Write: / LText-TDLINE.
ENDIF.
ENDLOOP.
EndIf.

你可能感兴趣的:(Access)