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.

This Content Component encountered an error

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
*             (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

Dig deeper on SAP ABAP

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close