PARAMETERS p_subty TYPE p9901-subty OBLIGATORY.
*----------------------------------------------------------------------*
* Eventos de Pantalla *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_subty.
DATA: BEGIN OF gt_matchcode OCCURS 0,
subty TYPE subty,
stext TYPE t591s-stext,
END OF gt_matchcode.
DATA lt_return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.
IF gt_matchcode[] IS INITIAL.
SELECT subty stext FROM t591s
APPENDING CORRESPONDING FIELDS OF TABLE gt_matchcode
WHERE sprsl = sy-langu
AND infty = '9901'.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'SUBTY'
window_title = 'Conceptos'
value_org = 'S'
TABLES
value_tab = gt_matchcode
return_tab = lt_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE lt_return_tab INDEX 1.
MOVE lt_return_tab-fieldval TO p_subty.
ENDIF.
* Eventos de Pantalla *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_subty.
DATA: BEGIN OF gt_matchcode OCCURS 0,
subty TYPE subty,
stext TYPE t591s-stext,
END OF gt_matchcode.
DATA lt_return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.
IF gt_matchcode[] IS INITIAL.
SELECT subty stext FROM t591s
APPENDING CORRESPONDING FIELDS OF TABLE gt_matchcode
WHERE sprsl = sy-langu
AND infty = '9901'.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'SUBTY'
window_title = 'Conceptos'
value_org = 'S'
TABLES
value_tab = gt_matchcode
return_tab = lt_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE lt_return_tab INDEX 1.
MOVE lt_return_tab-fieldval TO p_subty.
ENDIF.
No hay comentarios:
Publicar un comentario