SAP Function Modules

RSC1_TRFC_QUEUE_READ SAP Function module







RSC1_TRFC_QUEUE_READ is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name RSC1_TRFC_QUEUE_READ into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: RSC1
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RSC1_TRFC_QUEUE_READ - RSC1 TRFC QUEUE READ





CALL FUNCTION 'RSC1_TRFC_QUEUE_READ' "
  EXPORTING
    i_osource =                 " roosource-oltpsource
    i_rfcdest =                 " roosprms-rlogsys
*   i_program =                 " sy-repid
*   i_maxsize =                 " roidocprms-maxsize
*   i_initflag = SBIW_C_FALSE   " sbiw_bool
*   i_read_only = SBIW_C_TRUE   " sbiw_bool
*   i_updmode = 'R '            " sbiwa_s_interface-updmode
*   i_last_read_tid =           " arfctid
*   i_last_read_vers =          " roosprmsc-getvers
*   i_get_read_tids = SBIW_C_TRUE  " sbiw_bool
*   i_maxluw = 0                " i
  IMPORTING
    e_last_read_tid =           " roosprmsc-gettid
    e_lines_deleted =           " i
* TABLES
*   e_t_data =                  "
*   e_t_tid =                   " arfctid
*   e_t_tidlink =               " rsc1tidlink
  EXCEPTIONS
    NO_MORE_DATA = 1            "
    ERROR_READING_QUEUE = 2     "
    ERROR_PASSED_TO_MESS_HANDLER = 3  "
    .  "  RSC1_TRFC_QUEUE_READ

ABAP code example for Function Module RSC1_TRFC_QUEUE_READ





The ABAP code below is a full code listing to execute function module RSC1_TRFC_QUEUE_READ including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_e_last_read_tid  TYPE ROOSPRMSC-GETTID ,
ld_e_lines_deleted  TYPE I ,
it_e_t_data  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_e_t_data  LIKE LINE OF it_e_t_data ,
it_e_t_tid  TYPE STANDARD TABLE OF ARFCTID,"TABLES PARAM
wa_e_t_tid  LIKE LINE OF it_e_t_tid ,
it_e_t_tidlink  TYPE STANDARD TABLE OF RSC1TIDLINK,"TABLES PARAM
wa_e_t_tidlink  LIKE LINE OF it_e_t_tidlink .


SELECT single OLTPSOURCE
FROM ROOSOURCE
INTO @DATA(ld_i_osource).


SELECT single RLOGSYS
FROM ROOSPRMS
INTO @DATA(ld_i_rfcdest).

DATA(ld_i_program) = 'some text here'.

SELECT single MAXSIZE
FROM ROIDOCPRMS
INTO @DATA(ld_i_maxsize).

DATA(ld_i_initflag) = 'some text here'.
DATA(ld_i_read_only) = 'some text here'.

DATA(ld_i_updmode) = some text here
DATA(ld_i_last_read_tid) = 'some text here'.

SELECT single GETVERS
FROM ROOSPRMSC
INTO @DATA(ld_i_last_read_vers).

DATA(ld_i_get_read_tids) = 'some text here'.
DATA(ld_i_maxluw) = 'some text here'.

"populate fields of struture and append to itab
append wa_e_t_data to it_e_t_data.

"populate fields of struture and append to itab
append wa_e_t_tid to it_e_t_tid.

"populate fields of struture and append to itab
append wa_e_t_tidlink to it_e_t_tidlink. . CALL FUNCTION 'RSC1_TRFC_QUEUE_READ' EXPORTING i_osource = ld_i_osource i_rfcdest = ld_i_rfcdest * i_program = ld_i_program * i_maxsize = ld_i_maxsize * i_initflag = ld_i_initflag * i_read_only = ld_i_read_only * i_updmode = ld_i_updmode * i_last_read_tid = ld_i_last_read_tid * i_last_read_vers = ld_i_last_read_vers * i_get_read_tids = ld_i_get_read_tids * i_maxluw = ld_i_maxluw IMPORTING e_last_read_tid = ld_e_last_read_tid e_lines_deleted = ld_e_lines_deleted * TABLES * e_t_data = it_e_t_data * e_t_tid = it_e_t_tid * e_t_tidlink = it_e_t_tidlink EXCEPTIONS NO_MORE_DATA = 1 ERROR_READING_QUEUE = 2 ERROR_PASSED_TO_MESS_HANDLER = 3 . " RSC1_TRFC_QUEUE_READ
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_last_read_tid  TYPE ROOSPRMSC-GETTID ,
ld_i_osource  TYPE ROOSOURCE-OLTPSOURCE ,
it_e_t_data  TYPE STANDARD TABLE OF STRING ,
wa_e_t_data  LIKE LINE OF it_e_t_data,
ld_e_lines_deleted  TYPE I ,
ld_i_rfcdest  TYPE ROOSPRMS-RLOGSYS ,
it_e_t_tid  TYPE STANDARD TABLE OF ARFCTID ,
wa_e_t_tid  LIKE LINE OF it_e_t_tid,
ld_i_program  TYPE SY-REPID ,
it_e_t_tidlink  TYPE STANDARD TABLE OF RSC1TIDLINK ,
wa_e_t_tidlink  LIKE LINE OF it_e_t_tidlink,
ld_i_maxsize  TYPE ROIDOCPRMS-MAXSIZE ,
ld_i_initflag  TYPE SBIW_BOOL ,
ld_i_read_only  TYPE SBIW_BOOL ,
ld_i_updmode  TYPE SBIWA_S_INTERFACE-UPDMODE ,
ld_i_last_read_tid  TYPE ARFCTID ,
ld_i_last_read_vers  TYPE ROOSPRMSC-GETVERS ,
ld_i_get_read_tids  TYPE SBIW_BOOL ,
ld_i_maxluw  TYPE I .


SELECT single OLTPSOURCE
FROM ROOSOURCE
INTO ld_i_osource.


"populate fields of struture and append to itab
append wa_e_t_data to it_e_t_data.

SELECT single RLOGSYS
FROM ROOSPRMS
INTO ld_i_rfcdest.


"populate fields of struture and append to itab
append wa_e_t_tid to it_e_t_tid.
ld_i_program = 'some text here'.

"populate fields of struture and append to itab
append wa_e_t_tidlink to it_e_t_tidlink.

SELECT single MAXSIZE
FROM ROIDOCPRMS
INTO ld_i_maxsize.

ld_i_initflag = 'some text here'.
ld_i_read_only = 'some text here'.

ld_i_updmode = some text here
ld_i_last_read_tid = 'some text here'.

SELECT single GETVERS
FROM ROOSPRMSC
INTO ld_i_last_read_vers.

ld_i_get_read_tids = 'some text here'.
ld_i_maxluw = 'some text here'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RSC1_TRFC_QUEUE_READ or its description.