*&---------------------------------------------------------------------*
*& Include ZCONINC3
*&---------------------------------------------------------------------*
* Source Name is ZCONINC3
FORM STATUS-LINE-MSG USING TMP-TEXT.
* Put a Message at BOTTOM OF SCREEN - to let person executing
* Interactively Know WHAT RECORD IS BEING PROCESSED
DATA: MSG_LINE(100).
MOVE TMP-TEXT TO MSG_LINE.
CONDENSE MSG_LINE.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = MSG_LINE.
ENDFORM.
FORM STATUS-LINE-MESSAGE USING TMP-RECNO TMP-TOTAL-RECNO.
* Put a Message at BOTTOM OF SCREEN - to let person executing
* Interactively Know WHAT RECORD IS BEING PROCESSED
* also Show TOTAL NUMBER OF RECORDS IN THE FILE - only know
* that is we are Processing a PC File
DATA: MSG_LINE(100).
CLEAR MSG_LINE.
MOVE 'Processed Record' TO MSG_LINE.
WRITE TMP-RECNO TO MSG_LINE+20(20).
IF NOT TMP-TOTAL-RECNO IS INITIAL.
MOVE 'of' TO MSG_LINE+45(2).
WRITE TMP-TOTAL-RECNO TO MSG_LINE+60(20).
ENDIF.
CONDENSE MSG_LINE.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = MSG_LINE.
ENDFORM.
*---------------------------------------------------------------------*
* FORM LEFT-ALIGN-FLD *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> TMP-FLD-AL *
*---------------------------------------------------------------------*
FORM LEFT-ALIGN-FLD USING TMP-FLD-AL.
********************************************************************
* Purpose - left align all data in fields **************************
********************************************************************
IF NOT TMP-FLD-AL IS INITIAL.
SHIFT TMP-FLD-AL LEFT DELETING LEADING ' '.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
* FORM MAK-NUM *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> TMP-FLD *
*---------------------------------------------------------------------*
FORM MAK-NUM USING TMP-FLD.
* If Data Contains Numerics and Spaces - make it a Number for the
* Defned Length of the Field - need the Full Numeric Value in Cases
* Where we are Reading a Data Base
DATA: LEN1 TYPE I.
DATA: TMP-FLD-MAX(30) TYPE N.
IF NOT TMP-FLD IS INITIAL
AND TMP-FLD CO ' 0123456789'.
DESCRIBE FIELD TMP-FLD LENGTH LEN1 in byte mode.
CLEAR TMP-FLD-MAX.
MOVE TMP-FLD TO TMP-FLD-MAX(LEN1).
MOVE TMP-FLD-MAX(LEN1) TO TMP-FLD.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
* FORM CONVERT-TO-MATH-NUMBER *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> FLDXX *
*---------------------------------------------------------------------*
FORM CONVERT-TO-MATH-NUMBER USING FLDXX.
* Convert a Number - so Math Can be Done Against it
TABLES: *USR01.
CLEAR *USR01.
SELECT SINGLE * FROM *USR01 WHERE BNAME EQ SY-UNAME.
IF *USR01-DCPFM EQ 'X'.
WHILE FLDXX CS ','. " '.' is a Decimal Point
REPLACE ',' WITH '' INTO FLDXX.
CONDENSE FLDXX NO-GAPS.
ENDWHILE.
ELSE.
WHILE FLDXX CS '.'. " ',' is a Decimal Point
REPLACE '.' WITH '' INTO FLDXX.
CONDENSE FLDXX NO-GAPS.
ENDWHILE.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
* FORM CHECK-TCODE-AUTHORITY *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> T-TCODE *
*---------------------------------------------------------------------*
FORM CHECK-TCODE-AUTHORITY USING T-TCODE.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'"Only People that
EXPORTING " have access to
TCODE = T-TCODE " Transaction t-tcode
EXCEPTIONS " are ALLOWED to execute
OK = 1 " this Program
NOT_OK = 2.
IF SY-SUBRC NE 1.
MESSAGE A999(ZZ) WITH 'YOU Do Not Have Authority to Execute'.
ENDIF.
ENDFORM.
TOP-OF-PAGE.
* General Purpose - Page Heading Routine
* Programming NOTE - keep this at BOTTOM OF THIS INCLUDE
* Other Programs USE THIS - and HAVE 'COLUMN HEADING INFORMATION'
* after this INCLUDE
CALL FUNCTION 'ZGEN_REP_LISTHEADER01'
EXPORTING
im_text1 = 'Routing Operation Number'
im_text2 = 'WorkCenter'.
TABLES: *VARIT.
DATA: ZCONINC3-ONETIME.
DATA: NOW-SY-PAGNO LIKE SY-PAGNO.
FORMAT INTENSIFIED OFF.
ADD 1 TO NOW-SY-PAGNO.
* WRITE: /01 SY-PRABT, "Department Receiving Report
** 35 'EXAMPLE COMPANY NAME', "Name This Customer
** 35 'SAPLABS DEMO SYSTEM', "Name This Customer
* 'Page', NOW-SY-PAGNO.
* WRITE: / SY-REPID,
* 'Run by', SY-UNAME(8), 'on', SY-DATUM, SY-UZEIT,
* 'System', SY-SYSID(4), 'Client', SY-MANDT.
* WRITE: / SY-TITLE centered.
* If Variant Used to EXECUTE THIS PROGRAM - put in Variant Description
* into Page Headings
IF NOT SY-SLSET IS INITIAL.
IF ZCONINC3-ONETIME IS INITIAL.
CLEAR *VARIT.
MOVE 'N' TO ZCONINC3-ONETIME.
SELECT * FROM *VARIT WHERE LANGU EQ SY-LANGU
AND REPORT EQ SY-REPID
AND VARIANT EQ SY-SLSET.
EXIT.
ENDSELECT.
ENDIF.
IF NOT *VARIT-VTEXT IS INITIAL.
WRITE: / 'Variant', SY-SLSET, *VARIT-VTEXT.
ENDIF.
ENDIF.
FORMAT INTENSIFIED ON
No comments:
Post a Comment