* ----------------------------------------------------------------------------
Append New Component: RPLM_QIMT_CODSELECT_COMP (ex : CODESELECT)
* ----------------------------------------------------------------------------
Propriety Controller
* ----------------------------------------------------------------------------
Add component in Input Help of context (ex: CODESELECT for fields MNGRP & MNCOD – from table QMMA)
* ----------------------------------------------------------------------------
Add Attribute: IF_WD_CONTEXT_ELEMENT (ex: LV_CURRENT_ELEMENT)
* ----------------------------------------------------------------------------
Append 2 Methods
1 Open (from CODESELECT component)
Select default values (and save context in attribute LV_CURRENT_ELEMENT)
2 Close (from CODESELECT component)
Return values selected (and use this user selection)
DATA: L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
DATA: L_REF_INTERFACECONTROLLER TYPE REF TO IWCI_RPLM_QIMT_CODSELECT_COMP.
DATA: LT_CODE_IN TYPE RPLM_TT_QPK1CODEGRP.
DATA: LR_VH_ELEMENT TYPE REF TO IF_WD_CONTEXT_ELEMENT,
LV_VH_ATTRIBUTE_INFO TYPE WDR_CONTEXT_ATTRIBUTE_INFO.
L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_CODESELECT( ).
IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
L_REF_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
L_REF_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_CODESELECT( ).
CLEAR: LR_VH_ELEMENT.
CALL METHOD L_REF_INTERFACECONTROLLER->GET_CONTEXT
IMPORTING
ER_F4_CONTEXT_ELEMENT = LR_VH_ELEMENT
EV_F4_ATTRIBUTE_INFO = LV_VH_ATTRIBUTE_INFO.
WD_THIS->LV_CURRENT_ELEMENT = LR_VH_ELEMENT.
CLEAR LT_CODE_IN.
APPEND YOUR CODEGROUP TO LT_CODE_IN[].
L_REF_INTERFACECONTROLLER->START_CODE_SELECT(
IV_CODE = '*'
IV_CODEGRUPPE = '*'
IV_KATALOGART = 'A' => A = Activity, …
IV_MULTISELECT = ABAP_FALSE
IT_CODEGRUPPEN = LT_CODE_IN ).
* Ex for ALV – LT_IT_QMMA
* ----------------------------------------------------------------------------
CLEAR: LR_ELEMENT.
LR_ELEMENT = WD_THIS->LV_CURRENT_ELEMENT.
CHECK LR_ELEMENT IS NOT INITIAL.
CLEAR DV_INDEX.
CHECK LR_ELEMENT IS NOT INITIAL .
CALL METHOD LR_ELEMENT->GET_INDEX
RECEIVING
MY_INDEX = DV_INDEX.
CHECK DV_INDEX IS NOT INITIAL.
LO_ND_IT_QMMA = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_IT_QMMA ).
CHECK LO_ND_IT_QMMA IS NOT INITIAL.
CLEAR LT_IT_QMMA.
LO_ND_IT_QMMA->GET_STATIC_ATTRIBUTES_TABLE( IMPORTING TABLE = LT_IT_QMMA ).
CLEAR LS_IS_QMMA.
READ TABLE LT_IT_QMMA INTO LS_IS_QMMA INDEX DV_INDEX.
CHECK SY-SUBRC EQ 0.
CHECK LS_IS_QMMA IS NOT INITIAL.
MOVE : SY-MANDT TO LS_IS_QMMA-MANDT,
LV_QMNUM TO LS_IS_QMMA-QMNUM,
LS_CODES_SELECTED-KATALOGART TO LS_IS_QMMA-MNKAT,
LS_CODES_SELECTED-CODEGRUPPE TO LS_IS_QMMA-MNGRP,
LS_CODES_SELECTED-CODE TO LS_IS_QMMA-MNCOD,
LS_CODES_SELECTED-KURZTEXTCD TO LS_IS_QMMA-MATXT.
MODIFY LT_IT_QMMA FROM LS_IS_QMMA INDEX DV_INDEX.
CHECK SY-SUBRC EQ 0.
LO_ND_IT_QMMA->BIND_TABLE( NEW_ITEMS = LT_IT_QMMA SET_INITIAL_ELEMENTS = ABAP_TRUE ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |