Start of Content Area

Background documentation Classes in LDQ API (”Read”)  Locate the document in its SAP Library structure

 

Reader Class CL_LDQ_READER

Class CL_LDQ_READER is used to initialize the queue table when using the LDQ read functions. It implements interface IF_LDQ_READER.

The CONFIRM_QUEUE_UNITS method in this class is the only LDQ method that executes an implicit commit. All other methods in this class, and the other LDQ classes, require an explicit commit to persist their work in the database.

 

UML Display:

This graphic is explained in the accompanying text

 

Attribute Overview:

Attribute

Visibility/Level

Description

M_APPLICATION_NAME

Protected Instance

LDQ Application Name

 

Method Overview:

Method

Visibility/Level

Description

SET_QUEUE_NAME

Public Instance

The method creates an LDQ unit reader object. The method requires an LDQ queue name and returns an interface reference. The method throws an exception if the queue is being used by another reader.

SET_QUEUE_NAME_BY_OFFSET

Public Instance

Creates an LDQ unit reader object for a given queue with a given offset for the queue’s read counter. If the offset is greater than the current read counter (= attempt to skip reading some units) an exception is thrown. If the offset is smaller than the current top counter (= attempt to read units already confirmed) an exception is thrown.

CONFIRM_QUEUE_UNITS

Public Instance

Marks for deletion the units already read up to a given sequence number. If the offset counter is greater than the current read counter (= attempt to confirm a unit that has never been read) an exception is thrown. If the offset counter is smaller than the current top counter (= attempt to confirm units already confirmed) an exception is thrown.

Note: This method executes an implicit commit.

 


Unit Reader Class CL_LDQ_UNIT_READER

Class CL_LDQ_UNIT_READER provides a handle for a given LDQ queue to read one or more LDQ units. The class implements interface IF_LDQ_UNIT_READER.

UML Display:

This graphic is explained in the accompanying text

 

Attribute Overview:

No public or protected attributes.

 

Method Overview:

Method

Visibility/Level

Description

GET_NEXT_STATES

Public Instance

Reads the state of the next unit. The method requires the number of units to read and returns a table of unit states.

GET_NEXT_CONTENTS

Public Instance

Reads the content of the next unit. The method requires the number of units to read and returns a table of unit contents.

GET_TOTAL_NUMBER_OF_UNITS

Public Instance

Finds the total number of entries in the queue.

CONFIRM

Public Instance

Selects read units for deletion.

CHECK_READ_SEQUENCE

Private Static

Check the order in which the units have been read.

ON_ROLLBACK

Public Static

Roll back called LDQ units.

AFTER_COMMIT

Public Static

Delete the internal tables.

ON_COMMIT

Public Static

Deletes the read LDQ units in the database. All methods of LDQ classes persist their work in the database by an explicit commit, with the exception of the CONFIRM_QUEUE_UNITS method in the IF_LDQ_READER interface, which executes an implicit commit.

CLASS_CONSTRUCTOR

Public Static

Class constructor.

CONSTRUCTOR

Public Instance

Constructor.

 

Unit State Reader Class CL_LDQ_UNIT_STATE_READER

Class CL_LDQ_UNIT_STATE_READER reads the state data (size, format and ID) for one or more LDQ units. The class implements interface IF_LDQ_UNIT_STATE_READER.

 

UML Display:

This graphic is explained in the accompanying text

 

Attribute Overview:

No public or protected attributes.

 

Method Overview:

Method

Visibility/Level

Description

GET_FORMAT

Public Instance

The method returns the format of the LDQ unit data.

GET_UNIT_ID

Public Instance

The method returns the ID of the LDQ unit.

GET_SEQUENCE_NUMBER

Public Instance

The method returns the sequence number of an LDQ unit.

GET_SUCCESSOR_COUNT

Public Instance

The method returns the number of following units in the queue.

GET_SIZE

Public Instance

The method returns the size of the LDQ unit data.

GET_DESCRIPTION

Public Instance

The method returns the appended description of an LDQ unit.

CONSTRUCTOR

Public Instance

Constructor. The constructor requires the state of the LDQ unit.

CHECK_COMMIT_ROLLBACK

Private Instance

The method checks whether the LDQ unit is valid.

 

 

Unit Content Reader Class CL_LDQ_UNIT_CONTENT_READER

Class CL_LDQ_UNIT_CONTENT_READER reads the payload of one or more LDQ units in a given LDQ queue.


UML Display:

This graphic is explained in the accompanying text

 

Attribute Overview:

No public or protected attributes.

 

Method Overview:

Method

Visibility/Level

Description

GET_CDATA

Public Instance

The method reads character-like data. The method returns a character string.

GET_XDATA

Public Instance

The method reads binary data. The method returns a byte string.

GET_FORMAT

Public Instance

The method returns the format of the LDQ unit data.

GET_UNIT_ID

Public Instance

The method returns the ID of the LDQ unit.

GET_SEQUENCE_NUMBER

Public Instance

The method returns the sequence number of an LDQ unit.

GET_SUCCESSOR_COUNT

Public Instance

The method returns the number of the next units in the queue.

GET_DESCRIPTION

Public Instance

The method returns the appended description of an LDQ unit.

GET_SIZE

Public Instance

The method returns the size of the LDQ unit data.

CONSTRUCTOR

Public Instance

Constructor, requiring a reference to an LDQ unit reader object, the unit state and the unit data.

 

 

End of Content Area