Get Cbo Entries

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

*&---------------------------------------------------------------------*

*& Class Name : ZCL_STP_E022_PO_CHANGES


*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* Method Name : GET_CBO_ENTRIES
* Author : Anupam Kumar Thakur
* Date : 06/19/2023
* Transport # : DS4K905622
*----------------------------------------------------------------------*
* Description: : This method will get the CBO entries
*----------------------------------------------------------------------*
* MODIFICATION HISTORY
*----------------------------------------------------------------------*
* Transport | Charm No | Author ID | Date | Description *
*
*----------------------------------------------------------------------*
METHOD get_cbo_entries.
CONSTANTS: lc_constants TYPE c LENGTH 20 VALUE 'Z_STP_E022_CONS',
lc_seperator TYPE c VALUE '|'.
* lc_per_low TYPE c LENGTH 20 VALUE
'Z_STP_E022_PERC_LOW',
* lc_per_high TYPE c LENGTH 20 VALUE
'Z_STP_E022_PERC_HIGH',
* lc_threshold_amt TYPE c LENGTH 20 VALUE 'Z_STP_E022_TH_AMT',
* lc_total_value TYPE c LENGTH 20 VALUE 'Z_STP_E022_TT_VAL'.

DATA: lt_cbo TYPE ztt_cbo_const_names.

DATA(lo_cbodata) = NEW zcl_util_cbo_data( iv_name = gc_stp ). "create


object for cbo class

CLEAR : lt_cbo[].

** Populating cbo name in table lt_cbo


* lt_cbo = VALUE #( ( name = lc_per_low ) ( name = lc_per_high ) ( name =
lc_threshold_amt ) ( name = lc_total_value ) ).
lt_cbo = VALUE #( ( name = lc_constants ) ).

IF lt_cbo IS NOT INITIAL.


** Fetch cbo constants
CALL METHOD lo_cbodata->fetch_constants(
EXPORTING
it_name = lt_cbo
IMPORTING
et_constant = gt_cbo_data
).
ENDIF.

IF gt_cbo_data IS NOT INITIAL.


** Get constants
gv_constants = VALUE #( gt_cbo_data[ name = lc_constants ]-high
OPTIONAL ).
SPLIT gv_constants AT lc_seperator INTO gv_total_value gv_threshold_amt
gv_perc_high gv_perc_low.

* gv_perc_low = VALUE #( gt_cbo_data[ name = lc_per_low ]-low


OPTIONAL ).
* gv_perc_high = VALUE #( gt_cbo_data[ name = lc_per_high ]-low
OPTIONAL ).
* gv_threshold_amt = VALUE #( gt_cbo_data[ name = lc_threshold_amt ]-
low OPTIONAL ).
* gv_total_value = VALUE #( gt_cbo_data[ name = lc_total_value ]-low
OPTIONAL ).
ENDIF.
ENDMETHOD.

You might also like