SAP Virtual/Onsite Trainings

Tips Categories:

Contribute?

What's New?

What's Hot?

Web Dynpro for ABAP Tutorials


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Create Pushbuttons on the selection screen without using PF Status

By Sailaja Tadikonda

Introduction:

Creating pushbuttons on the selection without using SET PF-STATUS

Step-by-step approach to create pushbuttons on the selection screen

Step 1:

Create a program “ZPUSH_BUTTON” in SE38 with meaning full name.

Choose Save or Enter Button.

Step 2:

Write the following code

REPORT  ZPUSH_BUTTON.

TABLES: SSCRFIELDS.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_BSART TYPE BSART DEFAULT 'XXX'.

SELECTION-SCREEN SKIP 3.
SELECTION-SCREEN PUSHBUTTON /15(10TEXT-002 USER-COMMAND CL1.
SELECTION-SCREEN PUSHBUTTON 45(10TEXT-003 USER-COMMAND CL2.
SELECTION-SCREEN END OF BLOCK B1.

DATA: L_UCOM LIKE SY-UCOMM.

AT SELECTION-SCREEN OUTPUT.
IF L_UCOM = 'CL1'.
 LOOP AT SCREEN.
 IF SCREEN-NAME CS 'P_BSART'.
   SCREEN-INPUT = 1.
   MODIFY SCREEN.
 ENDIF.
 ENDLOOP.
ELSEIF L_UCOM = 'CL2'.
 LOOP AT SCREEN.
 IF SCREEN-NAME CS 'P_BSART'.
   SCREEN-INPUT = 0.
   MODIFY SCREEN.
 ENDIF.
 ENDLOOP.
ENDIF.

AT SELECTION-SCREEN.
CASE SSCRFIELDS.
WHEN 'CL1'.
 L_UCOM = 'CL1'.
WHEN 'CL2'.
 L_UCOM = 'CL2'.
ENDCASE.

Step 3:

Execute the program.

The Initial selection screen will be displayed as below.

Case 1:

If you click on “Disable”  Button

Then the document Type will be in a non-editable mode (i.e. gray-out) as shown below

Case 2:

If you click on “Enable”  button

In that case the document type will be in editable mode

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image