Tip

Clearing the parameter screen

When I used ABAP for interactive data entry, I had to leave then rerun the program to clear the parameters screen. To remedy this, I developed a program and procedure that can be used instead. I have attached the program written to submit another program with a variant so the parameter screen is consistent and cleared for each transaction. The two communicate via PID, the coding for the submitted ABAP is detailed in the program comments.
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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.