Code: Alles auswählen.
METHOD get_hu_on_ws.
DATA:
so_lgpla TYPE rseloption,
ls_seloption TYPE rsdsselopt,
lt_huhdr TYPE /scwm/tt_huhdr_int,
lv_max_hu TYPE int4,
lt_guid_hu TYPE /scwm/tt_guid_hu,
lt_huident TYPE /scwm/tt_ident_int.
FIELD-SYMBOLS <fs_s_huhdr> TYPE /scwm/s_huhdr_int.
ls_seloption-sign = 'I'.
ls_seloption-option = 'EQ'.
ls_seloption-low = me->ms_workstation-process_bin.
APPEND ls_seloption TO so_lgpla.
*| Check if there is a HU on the Workstation
CALL FUNCTION '/SCWM/HU_SELECT_GEN'
EXPORTING
iv_lgnum = me->ms_workstation-lgnum
ir_lgpla = so_lgpla
IMPORTING
et_huhdr = lt_huhdr
et_guid_hu = et_guid_hu
et_ident = et_huident
EXCEPTIONS
wrong_input = 1
not_possible = 2
error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
IF sy-tfill > 2.
ev_multiple_hus = 'X'.
ENDIF.
lv_max_hu = ms_workstation-max_hus + 1.
*| Check number of HUs
IF sy-tfill > lv_max_hu.
CALL METHOD me->add_message_to_log
EXPORTING
iv_msgid = 'xxx'
iv_msgty = 'E'
iv_msgno = '030'
iv_msgv2 = sy-tfill - 1
iv_msgv3 = ms_workstation-max_hus
* iv_msgv4 =
.
me->save_log( ).
MESSAGE E017.
ELSEIF sy-tfill < 2.
CALL METHOD me->add_message_to_log
EXPORTING
iv_msgid = 'xxx'
iv_msgty = 'E'
iv_msgno = '031'
iv_msgv2 = me->ms_workstation-workstation
* iv_msgv3 =
* iv_msgv4 =
.
me->save_log( ).
MESSAGE E032.
ENDIF.
DELETE lt_huhdr WHERE pmat_guid IS INITIAL.
et_huhdr = lt_huhdr.
IF iv_ret_single_hu IS NOT INITIAL.
IF sy-tfill < 3.
READ TABLE lt_huhdr ASSIGNING <fs_s_huhdr> INDEX 1.
es_single_hu = <fs_s_huhdr>.
ENDIF.
ENDIF.
IF iv_hunum IS NOT INITIAL.
READ TABLE lt_huhdr WITH KEY huident = iv_hunum ASSIGNING <fs_s_huhdr>.
IF sy-subrc EQ 0.
ev_hu_on_ws = 'X'.
ev_guid_hu = <fs_s_huhdr>-guid_hu.
ENDIF.
ENDIF.
ENDMETHOD.