# K_LINE_ITEMS_SELECT_AND_LIST — Select and List CO Line Items

> It is the common selection and list module behind the CO line item reports (KSB1, KOB1, etc.); it reads line items for the given controlling area and object selection and shows them in an ALV. Custom reports can use it to open the standard line item list from their own selection screen, but it is not a released interface. Pass the item group and report object with the same values the standard reports use; if no data is found, the NO_DATA_SELECTED exception is raised.

- Modules: CO
- Type: Function module
- Function group: KAEP
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/k-line-items-select-and-list/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_CO_AREA | TKA01-KOKRS | Controlling area | Yes |
| I_ITEM_GROUP | KAEP_ITEM_GROUP | Line item group | Yes |
| I_REP_OBJECT | KAEP_REP_OBJECT | Report object | Yes |
| I_CALLING_REPORT | SY-REPID | Calling report | Yes |
| IT_SELECTION | KAEP_T_COSEL | Selection criteria | Yes |
| I_DISPLAY_VARIANT | KAEP_DISVARIANT | Display variant | - |
| I_NO_DISPLAY | C | Do not display list (select only) | - |
| IT_FREE_SELECTION | RSDS_TWHERE | Free selections | - |
| I_ACTUAL_VERSION | TKA09-VERSN | Actual version | - |

## Changing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| ER_ALV_GRID | CL_GUI_ALV_GRID | ALV grid object | - |
| IT_KAEPX_DATA_CARRIER | KAEPX_DATA_CARRIER_T | Data carrier table | - |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| T_ARSEL | RNG_ARCHIV | Archive selection | - |

## Exceptions

- NO_DATA_SELECTED: No data selected
- UNKNOWN_ITEM_GROUP: Unknown item group

## Call template (ABAP)

```abap
CALL FUNCTION 'K_LINE_ITEMS_SELECT_AND_LIST'
  EXPORTING
    i_co_area = lv_i_co_area
    i_item_group = lv_i_item_group
    i_rep_object = lv_i_rep_object
    i_calling_report = lv_i_calling_report
    it_selection = lv_it_selection
  CHANGING
    er_alv_grid = lv_er_alv_grid
    it_kaepx_data_carrier = lv_it_kaepx_data_carrier
  TABLES
    t_arsel = lt_t_arsel
  EXCEPTIONS
    no_data_selected = 1
    unknown_item_group = 2
    OTHERS = 3.
```

## Related tables

COBK, COEP

