SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Create subscreen on Selection Screen



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Sep 13, 2008 6:30 pm    Post subject: Create subscreen on Selection Screen Reply with quote

Code:
REPORT zsubscreen NO STANDARD PAGE HEADING.
* A demo program to create subscreen in your ABAP Program
* This report will display the user last login date and time.*
* Subscreen selection 1 : User Name
*                                2 : Last Login Date
*                                3 : Class Belong To
TABLES: usr02,       "Logon data
        sscrfields.  "FIELDS ON SELECTION SCREENS

*---------------------------------------------------------------
* SUBSCREEN 1
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
SELECT-OPTIONS: USERNAME FOR USR02-BNAME.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 100.

*---------------------------------------------------------------
* SUBSCREEN 2
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.
SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF SCREEN 200.

*---------------------------------------------------------------
* SUBSCREEN 3
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.
SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF SCREEN 300.
* STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT
SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub FOR 15 LINES,
                  END OF BLOCK sub.

INITIALIZATION.
* SCREEN ICON LEFT AND RIGHT

  sscrfields-functxt_01 = '(0D)'.
  sscrfields-functxt_02 = '(0E)'.
  sub-prog = sy-repid.
  sub-dynnr = 100.

START-OF-SELECTION.
  SELECT * FROM usr02 WHERE bname IN username
                        AND erdat IN lastlogi
                        AND class IN classtyp.

    WRITE: / 'User ', usr02-bname,
             'Last Login Date ', usr02-trdat,
             'Last Login Time ', usr02-ltime,
             'CLASS ', usr02-class.
  ENDSELECT.

END-OF-SELECTION.

AT SELECTION-SCREEN.
  CASE sy-dynnr.

    WHEN 100.
      IF sscrfields-ucomm = 'FC01'.
        sub-dynnr = 300.
      ELSEIF sscrfields-ucomm = 'FC02'.
        sub-dynnr = 200.
      ENDIF.

    WHEN 200.
      IF sscrfields-ucomm = 'FC01'.
        sub-dynnr = 100.
      ELSEIF sscrfields-ucomm = 'FC02'.
        sub-dynnr = 300.
      ENDIF.

    WHEN 300.
      IF sscrfields-ucomm = 'FC01'.
        sub-dynnr = 200.
      ELSEIF sscrfields-ucomm = 'FC02'.
        sub-dynnr = 100.
      ENDIF.

  ENDCASE.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.