Code: Alles auswählen.
REPORT ZPM_TEST2.
TYPE-POOLS VRM.
DATA L_VALUE TYPE VRM_VALUE.
DATA T_VALUES TYPE VRM_VALUES.
PARAMETERS: P_AUART TYPE RIWO00-AUART AS LISTBOX VISIBLE LENGTH 40
USER-COMMAND TEST DEFAULT 'FWSR'.
"Auftragsart
PARAMETERS: P_ILART TYPE CAUFVD-ILART AS LISTBOX VISIBLE LENGTH 30.
"IH-Leistungsart
*----------------------------------------------------------------------
* AUART
*----------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_AUART.
TYPES: BEGIN OF TY_AUART,
AUART TYPE T003O-AUART,
TXT TYPE T003P-TXT,
END OF TY_AUART.
DATA: IT_AUART TYPE TABLE OF TY_AUART WITH HEADER LINE.
DATA: WA_AUART TYPE TY_AUART.
DATA: WA_TITEL TYPE C LENGTH 50.
CLEAR IT_AUART.
SELECT A~AUART
TXT
FROM T003O AS A INNER JOIN T003P AS B ON A~AUART = B~AUART
INTO CORRESPONDING FIELDS OF TABLE IT_AUART
WHERE AUTYP = '30'.
LOOP AT IT_AUART INTO WA_AUART.
CONCATENATE WA_AUART-AUART
'-'
WA_AUART-TXT
INTO WA_TITEL SEPARATED BY SPACE.
L_VALUE-KEY = WA_AUART-AUART.
L_VALUE-TEXT = WA_TITEL.
APPEND L_VALUE TO T_VALUES.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_AUART'
VALUES = T_VALUES.
*---------------------------------------------------------------------
* ILART
*---------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ILART.
TYPES: BEGIN OF TY_ILART,
ILART TYPE T350I-ILART,
ILATX TYPE T353I_T-ILATX,
END OF TY_ILART.
DATA: IT_ILART TYPE TABLE OF TY_ILART WITH HEADER LINE.
DATA: WA_ILART TYPE TY_ILART.
DATA: WA_LISTE TYPE C LENGTH 40.
SELECT A~ILART
ILATX
FROM T350I AS A INNER JOIN T353I_T AS B ON A~ILART = B~ILART
INTO CORRESPONDING FIELDS OF TABLE IT_ILART
WHERE AUART = P_AUART.
CLEAR: L_VALUE, T_VALUES.
LOOP AT IT_ILART INTO WA_ILART.
CONCATENATE WA_ILART-ILART
'-'
WA_ILART-ILATX
INTO WA_LISTE SEPARATED BY SPACE.
L_VALUE-KEY = SY-TABIX.
L_VALUE-TEXT = WA_LISTE.
APPEND L_VALUE TO T_VALUES.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_ILART'
VALUES = T_VALUES.