Code: Alles auswählen.
IF 1 = 0.
MESSAGE e000(zmm_checks).
ENDIF.
cl_message_mm=>create( EXPORTING
im_msgid = 'ZMM_CHECKS'
im_msgty = 'E'
im_msgno = 000
im_force_collect = cl_mmpur_constants=>yes ).
Folgende Benutzer bedankten sich beim Autor jocoder für den Beitrag (Insgesamt 3):
black_adept • Elekam • Thomas R.
Code: Alles auswählen.
METHOD IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM .
DATA forbidden_material_group TYPE RANGE OF matkl.
TRY.
ztvarvc_reader=>get_select_option( EXPORTING name = 'ZME_FORBIDDEN_MATERIAL_GROUP'
IMPORTING select_option = forbidden_material_group ).
IF im_item->get_data( )-matkl IN forbidden_material_group.
cl_contextfield_mm=>set_current_field( mmmfd_mat_grp ).
IF 1 = 0.
MESSAGE e000(zmm_checks).
ENDIF.
cl_message_mm=>create( EXPORTING
im_msgid = 'ZMM_CHECKS'
im_msgty = 'E'
im_msgno = 000
im_force_collect = cl_mmpur_constants=>yes ).
im_item->invalidate( ).
ENDIF.
##NO_HANDLER
CATCH zcx_tvarvc.
ENDTRY.
ENDMETHOD.
Code: Alles auswählen.
class ZTVARVC_READER definition
public
final
create public .
public section.
class-methods GET_SELECT_OPTION
importing
!NAME type TVARVC-NAME
exporting
!SELECT_OPTION type STANDARD TABLE
raising
ZCX_TVARVC .
class-methods GET_PARAMETER
importing
!NAME type TVARVC-NAME
exporting
!VALUE type ANY
raising
ZCX_TVARVC .
protected section.
private section.
ENDCLASS.
CLASS ZTVARVC_READER IMPLEMENTATION.
method GET_PARAMETER.
SELECT low UP TO 1 ROWS FROM tvarvc INTO value
WHERE name = name AND type = 'P'.
ENDSELECT.
IF sy-subrc <> 0.
zcx_tvarvc=>parameter_not_found( name ).
ENDIF.
endmethod.
method GET_SELECT_OPTION.
DATA: var TYPE tvarvc.
CLEAR: select_option.
SELECT sign opti low high FROM tvarvc INTO CORRESPONDING FIELDS OF var
WHERE name = name AND type = 'S'.
APPEND INITIAL LINE TO select_option ASSIGNING FIELD-SYMBOL(<s_option>).
ASSIGN COMPONENT 'SIGN' OF STRUCTURE <s_option> TO FIELD-SYMBOL(<sign>).
ASSERT sy-subrc = 0.
<sign> = var-sign.
ASSIGN COMPONENT 'OPTION' OF STRUCTURE <s_option> TO FIELD-SYMBOL(<option>).
ASSERT sy-subrc = 0.
<option> = var-opti.
ASSIGN COMPONENT 'LOW' OF STRUCTURE <s_option> TO FIELD-SYMBOL(<low>).
ASSERT sy-subrc = 0.
<low> = var-low.
ASSIGN COMPONENT 'HIGH' OF STRUCTURE <s_option> TO FIELD-SYMBOL(<high>).
ASSERT sy-subrc = 0.
<high> = var-high.
ENDSELECT.
IF sy-subrc <> 0.
zcx_tvarvc=>select_option_not_found( name ).
ENDIF.
endmethod.
ENDCLASS.