SAP Function Modules

READ_ACTIVITY SAP Function module







READ_ACTIVITY 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 READ_ACTIVITY into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM READ_ACTIVITY - READ ACTIVITY





CALL FUNCTION 'READ_ACTIVITY' "
  EXPORTING
    datab =                     " csla-datab    Lower Interval Limit
    datbi =                     " csla-datbi    Upper Range Limit
    kokrs =                     " csla-kokrs    Cost center group
    lstar =                     " csla-lstar    Activity type
*   no_buffer = SPACE           "
  IMPORTING
    kz_leiste =                 " clkzl         Series of characters
    txt_flag =                  "               Texts for system language are not
  TABLES
    sel_int =                   "               Selected activity type intervals
  EXCEPTIONS
    CSLA_NOT_COMPLETE = 1       "               Requested interval is not complete
    CSLA_NOT_FOUND = 2          "               Activity type not found
    .  "  READ_ACTIVITY

ABAP code example for Function Module READ_ACTIVITY





The ABAP code below is a full code listing to execute function module READ_ACTIVITY 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_kz_leiste  TYPE CLKZL ,
ld_txt_flag  TYPE STRING ,
it_sel_int  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_sel_int  LIKE LINE OF it_sel_int .


SELECT single DATAB
FROM CSLA
INTO @DATA(ld_datab).


SELECT single DATBI
FROM CSLA
INTO @DATA(ld_datbi).


SELECT single KOKRS
FROM CSLA
INTO @DATA(ld_kokrs).


SELECT single LSTAR
FROM CSLA
INTO @DATA(ld_lstar).

DATA(ld_no_buffer) = 'some text here'.

"populate fields of struture and append to itab
append wa_sel_int to it_sel_int. . CALL FUNCTION 'READ_ACTIVITY' EXPORTING datab = ld_datab datbi = ld_datbi kokrs = ld_kokrs lstar = ld_lstar * no_buffer = ld_no_buffer IMPORTING kz_leiste = ld_kz_leiste txt_flag = ld_txt_flag TABLES sel_int = it_sel_int EXCEPTIONS CSLA_NOT_COMPLETE = 1 CSLA_NOT_FOUND = 2 . " READ_ACTIVITY
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 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_kz_leiste  TYPE CLKZL ,
ld_datab  TYPE CSLA-DATAB ,
it_sel_int  TYPE STANDARD TABLE OF STRING ,
wa_sel_int  LIKE LINE OF it_sel_int,
ld_txt_flag  TYPE STRING ,
ld_datbi  TYPE CSLA-DATBI ,
ld_kokrs  TYPE CSLA-KOKRS ,
ld_lstar  TYPE CSLA-LSTAR ,
ld_no_buffer  TYPE STRING .


SELECT single DATAB
FROM CSLA
INTO ld_datab.


"populate fields of struture and append to itab
append wa_sel_int to it_sel_int.

SELECT single DATBI
FROM CSLA
INTO ld_datbi.


SELECT single KOKRS
FROM CSLA
INTO ld_kokrs.


SELECT single LSTAR
FROM CSLA
INTO ld_lstar.

ld_no_buffer = '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 READ_ACTIVITY or its description.