Make your own free website on Tripod.com

SAP PM & ABAP Code Niraj Visnoi

TabStrip Control Code Eample

Home
What is SAP ?
SAP LSMW Explained with example
SAP PM T-Codes
PM BRD/COR Maintenance
Add Your URL
User Exits & Enhancements
Best Of SAP Links
BDC Code
My Resume
SAP SmartForms Step by Step
SAP ABAP ALV Grid Explained with Example
Useful Tips
Contact Information Guest Book and Consultants List
ABAP Code
ABAP System Fields
SAPScript
SAPScript Graphics
SAPScript Print Program
ABAP ListViewer
Dialog Programming
SAP Tables
SAP ALE and IDOC
Recommended SAP ABAP Coding guidelines
SAP General ABAP
Submit Your Code
SAP Books For consultants
Free Website Submission and ROR Sitemap generator
Free Domain Search
Free HoroScope

Use of TabStrip in Selection screen with example code .

This is a example code explaining the use of TabStrip in selection screen .
 
*& Use of TabStrip and SubScreen explained
*& ---- The report shows the material on one tab
*& and plant on one tab.Pressing the execute button will show
*& the description of the material or plant as the case is.
*& TEXT-002 = Material Number
*& TEXT-003 = Plant Number.
 
REPORT   znr1 NO STANDARD PAGE HEADING
            LINE-SIZE 80 LINE-COUNT 60.
TABLES : sscrfields.
DATA  activetab(6) TYPE c .
DATA  mat_des TYPE makt-maktx.
DATA  pl_des  TYPE t001w-name1 .

SELECTION-SCREEN BEGIN OF SCREEN 001 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002 NO
INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-002 FOR FIELD matnr.
PARAMETERS matnr TYPE mara-matnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN END OF SCREEN 001.
SELECTION-SCREEN BEGIN OF SCREEN 002 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003 NO
INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-003 FOR FIELD matnr.
PARAMETERS werks TYPE t001w-werks.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block2.
SELECTION-SCREEN END OF SCREEN 002.

SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 5 LINES NO INTERVALS.
SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1
                     DEFAULT SCREEN 001.
SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2.
*                     DEFAULT SCREEN 002   .
SELECTION-SCREEN END OF BLOCK tabb1.
INITIALIZATION.
  tabs1 = text-002.
  tabs2 = text-003.
  activetab = 'TABS1'.
AT SELECTION-SCREEN .
  CASE sscrfields-ucomm.
    WHEN 'UCOMM1'.
      tabb1-prog = sy-repid.
      tabb1-dynnr   = 001.
      tabb1-activetab = 'TABS1'.
      activetab = 'TABS1' .
    WHEN 'UCOMM2'.
      tabb1-prog = sy-repid.
      tabb1-dynnr   = 002.
      tabb1-activetab = 'TABS2'.
      activetab = 'TABS2'.
  ENDCASE.
START-OF-SELECTION.
  CASE activetab.
    WHEN 'TABS1'.
      SELECT SINGLE maktx  FROM makt INTO pl_des WHERE matnr = matnr.
      WRITE: 'Material ' , matnr , mat_des .

    WHEN 'TABS2'.
      SELECT SINGLE name1  FROM t001w INTO pl_des WHERE werks = werks.
      WRITE: 'Plant ' , werks ,pl_des.

tabstrip.jpg

http://sap.niraj.tripod.com

http://sap.niraj.tripod.com

Search http://sap.niraj.tripod.com Search www

 http://sap.niraj.tripod.com      Niraj Visnoi *INDIA * niraj_visnoi@consultant.com      
 CELL No. 91 9911413767       Copyright 2006 all rights reserved