*&---------------------------------------------------------------------*
*& Report YTEST_SLZ_02
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT YTEST_SLZ_02.
TABLES:TBTCO,TBTCP.
TYPES:BEGIN OF TY_JOBLOG,
JOBNAME TYPE TBTCP-JOBNAME,
JOBCOUNT TYPE TBTCP-JOBCOUNT,
STEPCOUNT TYPE TBTCP-STEPCOUNT,
PROGNAME TYPE TBTCP-PROGNAME,
VARIANT TYPE TBTCP-VARIANT,
END OF TY_JOBLOG,
BEGIN OF TY_OUTPUT,
JOBNAME TYPE TBTCP-JOBNAME,
JOBCOUNT TYPE TBTCP-JOBCOUNT,
STEPCOUNT TYPE TBTCP-STEPCOUNT,
PROGNAME TYPE TBTCP-PROGNAME,
VARIANT TYPE TBTCP-VARIANT,
STATUS TYPE TBTCO-STATUS,
STATUS1 TYPE c LENGTH 3,
SDLUNAME TYPE TBTCO-SDLUNAME,
SDLSTRTDT TYPE TBTCO-SDLSTRTDT,
STRTDATE TYPE TBTCO-STRTDATE,
STRTTIME TYPE TBTCO-STRTTIME,
ENDDATE TYPE TBTCO-ENDDATE,
ENDTIME TYPE TBTCO-ENDTIME,
COLOR TYPE CHAR4,
END OF TY_OUTPUT.
DATA:LT_TBTCO TYPE STANDARD TABLE OF TBTCO,
LT_TBTCP TYPE STANDARD TABLE OF TY_JOBLOG,
GT_OUTPUT TYPE STANDARD TABLE OF TY_OUTPUT.
DATA GT_JOBLOGTBL TYPE STANDARD TABLE OF TBTC5.
DATA:
IS_LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT_2 TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT LIKE LINE OF IT_FIELDCAT,
G_FOS TYPE I.
DATA: T_EVENTS TYPE SLIS_T_EVENT.
SELECTION-SCREEN BEGIN OF BLOCK A.
SELECT-OPTIONS:S_JNAME FOR TBTCO-JOBNAME NO INTERVALS,
S_UNAME FOR TBTCO-SDLUNAME NO INTERVALS,
S_PNAME FOR TBTCP-PROGNAME NO INTERVALS.
SELECT-OPTIONS:S_DATE FOR TBTCO-SDLSTRTDT.
SELECTION-SCREEN END OF BLOCK A.
START-OF-SELECTION.
PERFORM FRM_GET_JOBINFO.
PERFORM FRM_EDIT_OUTPUT.
PERFORM FRM_ALV_DISPLAY.
*&---------------------------------------------------------------------*
*& Form FRM_GET_JOBINFO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_GET_JOBINFO .
SELECT * FROM TBTCO INNER JOIN TBTCP ON TBTCO~JOBNAME = TBTCP~JOBNAME AND TBTCO~JOBCOUNT = TBTCP~JOBCOUNT
INTO CORRESPONDING FIELDS OF TABLE LT_TBTCO
WHERE TBTCO~JOBNAME IN S_JNAME
AND TBTCO~SDLSTRTDT IN S_DATE
AND TBTCO~SDLUNAME IN S_UNAME
AND TBTCP~PROGNAME IN S_PNAME.
IF LT_TBTCO[] IS NOT INITIAL.
SELECT JOBNAME JOBCOUNT STEPCOUNT PROGNAME VARIANT
INTO CORRESPONDING FIELDS OF TABLE LT_TBTCP FROM TBTCP
FOR ALL ENTRIES IN LT_TBTCO
WHERE JOBNAME = LT_TBTCO-JOBNAME
AND JOBCOUNT = LT_TBTCO-JOBCOUNT
AND STEPCOUNT = LT_TBTCO-STEPCOUNT.
ENDIF.
ENDFORM. " FRM_GET_JOBINFO
*&---------------------------------------------------------------------*
*& Form FRM_EDIT_OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_EDIT_OUTPUT .
DATA: LS_TBTCO TYPE TBTCO,
转载于:https://www.cnblogs.com/shilz/p/5584345.html