We run SAP 4.0B.
REPORT ZBCU_SUBMIT_PROGRAM MESSAGE-ID Z9. ************************************************************************ " Program name: ZBCU_SUBMIT_PROGRAM * Description: This utility "Submits" a program continually until told * to stop. By submitting with a variant, the screen can be cleared * between runs. This and submitted program must use the same PID code, * unique to the submitted program and not the same as any SAP PID, * to decide what to do: submit again or end. This program and the * series of submits should be transparent to the user - they should not * see the submit program which is hooked to the transaction code. *----------------------------------------------------------------------- * Originally written to run program ZCKI_MGR_CHECK_ENTRY *----------------------------------------------------------------------- * Programs logic coding sequence: * ZBCU program | PIDValue | Submitted program * Startup | " " | * | " " | Initialization: Get PIDValue *
Requires Free Membership to View
(A) | " " | Init: IF F or E, Leave to ZBCU
* | | using LEAVE TO SCREEN 0
* (B) | "E" | Init: Set PIDValue to 'E'
* | "F" | At end of processing, set pid "F"
* IF = "E" End | "E" | both programs end
* else set to "H" | "H" |
* submit prog. | "H" |
* | |
* Note (A): When the PID is not "E", ZBCU will submit it again with
* the variant, in essence clearing the parameter screen. When an ABAP
* program is run, it does INIT again but does not clear parameters.
* This way it will leave when done to let submit clear things.
* Note (B): Initialization leaves if PID is "F" (the program finished
* something, need to re-submit to clear the screen) or "E"nd. Then it
* sets PID to "E"nd. If nothing else is done, it will not be submitted
* again and both programs will end.
************************************************************************
* 12/12/2003 DRKahn DEVK912052 Initial coding.
************************************************************************
SELECTION-SCREEN: BEGIN OF BLOCK BL1 WITH FRAME.
PARAMETERS: PPROGRAM(80) TYPE C
DEFAULT 'ZCKI_MGR_CHECK_ENTRY',
PVARIANT(50) TYPE C DEFAULT 'TEST1',
PPIDNAME(20) TYPE C DEFAULT 'ZMAE'.
SELECTION-SCREEN: END OF BLOCK BL1.
************************************************************************
DATA: PID_VALUE(1) TYPE C.
************************************************************************
* S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
************************************************************************
* E N D - O F - S E L E C T I O N
END-OF-SELECTION.
PERFORM P1000-PROCESS-PIDS.
*---------------------------------------------------------------------*
* FORM P1000-PROCESS-PIDS *
*---------------------------------------------------------------------*
FORM P1000-PROCESS-PIDS.
* Setup: clear the PID value to start off clean.
CLEAR: PID_VALUE.
SET PARAMETER ID PPIDNAME FIELD PID_VALUE.
* Keep submitting the program until the PID is set to 'E'nd
* using a variant to consistently present the parameter screen.
WHILE PID_VALUE <> 'E'.
SET PARAMETER ID PPIDNAME FIELD 'H'.
SUBMIT (PPROGRAM)
VIA SELECTION-SCREEN
USING SELECTION-SET PVARIANT
AND RETURN.
GET PARAMETER ID PPIDNAME FIELD PID_VALUE.
ENDWHILE.
* Clear the PID value until needed
CLEAR: PID_VALUE.
SET PARAMETER ID PPIDNAME FIELD PID_VALUE.
LEAVE TO SCREEN 0.
ENDFORM.
**END OF PROGRAM C:DRKFIZSUBMIT_PROGRAM.TXT
This was first published in January 2004

Join the conversationComment
Share
Comments
Results
Contribute to the conversation