Visit the SAP Forum

Languages : English | Dutch | French | Portugese | Italian



INTERVIEW EBOOK
Get 30,000 Interview Questions & Answers in an eBook.

Interview Success Kit - Get Success in Job Interviews



Send your Resume to 6000 Companies
START YOUR WEBSITE
India's Best Web Hosting Company

Example Code For Drill Down Report


Home »ABAP Programming » Drill Down Report


"Example Code For Drill Down Report

REPORT  zmm_rept_purchorderkkb01 LINE-SIZE 80
                                 LINE-COUNT 65(3)
                                 MESSAGE-ID z_msg_class
                                 NO STANDARD PAGE HEADING.

*------------------DECLARING THE STANDARD TABLES---------------------*
TABLES : ekko, "PURCHASE ORDER : HEADER
         ekpo. "PURCHASE ORDER : ITEM

*------------------DECLARING THE INTERNAL TABLE----------------------*
DATA  : BEGIN OF it_ekko OCCURS 2,
          ebeln LIKE ekko-ebeln, "PURCHASE ORDER NUMBER
          bukrs LIKE ekko-bukrs, "COMPANY CODE
          bsart LIKE ekko-bsart, "PURCHASING DOCUMENT TYPE
          lifnr LIKE ekko-lifnr, "VENDOR
          spras LIKE ekko-spras, "LANGUAGE KEY
          zterm LIKE ekko-zterm, "PAYMENT TERMS KEY
        end of it_ekko.


DATA  : BEGIN OF it_ekpo OCCURS 2,           ebeln LIKE ekpo-ebeln, "PURCHASE ORDER NUMBER           ebelp LIKE ekpo-ebelp, "PURCHASE ORDER NUMBER           werks LIKE ekpo-werks, "PLANT           matnr LIKE ekpo-matnr, "MATERIAL NUMBER           matkl LIKE ekpo-matkl, "MATERIAL GROUP         END OF it_ekpo. DATA: it_ebeln LIKE ekko-ebeln OCCURS 0 WITH HEADER LINE. *DATA: it_ebeln_high LIKE ekko-ebeln OCCURS 0 WITH HEADER LINE. DATA: p_ebeln       TYPE i. *------------------Declaring the selection screen--------------------* SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001. SELECT-OPTIONS : s_ebeln FOR ekko-ebeln. PARAMETER      : p_limit TYPE i. SELECTION-SCREEN END OF BLOCK blk1. *INCLUDE z_incl_purorderkkb01_sub_f01. *--------------------------------------------------------------------* *  Validation for  number of records to be printed                   * *--------------------------------------------------------------------* *AT SELECTION-SCREEN ON p_limit. *  IF p_limit IS INITIAL. *    MESSAGE e011. *  ENDIF. *  IF p_limit GT sy-linct. *    MESSAGE e010. *  ENDIF. *----------------------------------------------------------------------* *        Search help for purchase document number (s_ebeln-low)        * *----------------------------------------------------------------------* AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebeln-low.   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'     EXPORTING       input  = s_ebeln-low     IMPORTING       output = s_ebeln-low.   perform form_search_help.   IF sy-subrc <> 0.     CASE sy-subrc.       WHEN 2.         LEAVE TO SCREEN 1000.     ENDCASE.   ELSE.     LOOP AT it_ebeln.       IF sy-tabix = p_ebeln.         s_ebeln-low = it_ebeln.         EXIT.       ENDIF.     ENDLOOP.   ENDIF. *----------------------------------------------------------------------* *        Search help for purchase document number (s_ebeln-high)       * *----------------------------------------------------------------------* AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebeln-high.   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'     EXPORTING       input  = s_ebeln-high     IMPORTING       output = s_ebeln-high.   perform form_search_help.   IF sy-subrc <> 0.     CASE sy-subrc.       WHEN 2.         LEAVE TO SCREEN 1000.     ENDCASE.   ELSE.     LOOP AT it_ebeln.       IF sy-tabix = p_ebeln.         s_ebeln-high = it_ebeln.         EXIT.       ENDIF.     ENDLOOP.   ENDIF. *----------------------------------------------------------------------* *                   Start-of-selection event                           * *----------------------------------------------------------------------* START-OF-SELECTION. *----------------------To attach a user interface----------------------* SET PF-STATUS '0010'. *---------To fetch the data for the basic list-------------------------*     SELECT ebeln                   "PURCHASE ORDER NUMBER            bukrs                   "COMPANY CODE            bsart                   "PURCHASING DOCUMENT TYPE            lifnr                   "VENDOR            spras                   "LANGUAGE KEY            zterm                   "PAYMENT TERMS KEY      up to p_limit rows      into table it_ekko from ekko      where ebeln in s_ebeln.      REFRESH it_ekpo. *---------To fetch the data for the secondary list-----------------------* if it_ekpo is initial.     SELECT ebeln "PURCHASE ORDER NUMBER            ebelp "PURCHASING DOCUMENT TYPE            werks "PLANT            matnr "MATERIAL NUMBER            matkl "MATERIAL GROUP     FROM ekpo  INTO TABLE it_ekpo for all entries in it_ekko     WHERE ebeln EQ it_ekko-ebeln. endif. *----------------------------------------------------------------------* *                   End-of-selection event                             * *----------------------------------------------------------------------* END-OF-SELECTION. *---------To display the data for the basic list-----------------------*    format color 4 intensified off.   LOOP AT it_ekko.     WRITE :/ sy-vline, it_ekko-ebeln UNDER text-002, 18 sy-vline,                                                     "PURCHASE ORDER NUMBER                        it_ekko-bukrs UNDER text-003, 27 sy-vline,                                                     "COMPANY CODE                        it_ekko-bsart UNDER text-004, 38 sy-vline,                                                     "PURCHASING DOCUMENT TYPE                        it_ekko-lifnr UNDER text-005, 50 sy-vline,                                                     "VENDOR                        it_ekko-spras UNDER text-006, 62 sy-vline,                                                     "LANGUAGE KEY                        it_ekko-zterm UNDER text-007, 80 sy-vline.                                                     "PAYMENT TERMS KEY   hide : it_ekko-ebeln.   ENDLOOP.   WRITE :/ sy-uline(80). *----------------------------------------------------------------------* *                To generate the detailed lists                        * *----------------------------------------------------------------------* AT LINE-SELECTION.   CASE sy-lsind.     WHEN 1.       SET PF-STATUS '0011'. *---------To display the data for the secondary list-----------------------* WINDOW STARTING AT 10 10        ENDING   AT 90 30.     format color 5 intensified off.   LOOP AT it_ekpo where ebeln = it_ekko-ebeln .     WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline,                                                      "PURCHASE ORDER NUMBER                        it_ekpo-ebelp UNDER text-008, 30 sy-vline,                                                      "PO ITEM NUMBER                        it_ekpo-werks UNDER text-009, 45 sy-vline,                                                      "PLANT                        it_ekpo-matnr UNDER text-010, 60 sy-vline,                                                      "MATERIAL NUMBER                        it_ekpo-matkl UNDER text-011, 80 sy-vline.                                                      "MATERIAL GROUP   ENDLOOP.   WRITE :/ sy-uline(80).   ENDCASE.   CASE sy-ucomm.     WHEN 'EXIT' OR 'CANC' OR 'BACK'.        LEAVE TO SCREEN 0.   ENDCASE. *----------------------------------------------------------------------* *                    At user-command event                             * *----------------------------------------------------------------------* AT USER-COMMAND.   CASE sy-ucomm.     WHEN 'SELE' OR 'LIST1'.       IF sy-lsind = 1.       SET PF-STATUS '0011'. *---------To display the data for the secondary list-----------------------* WINDOW STARTING AT 10 10        ENDING   AT 90 30.        format color 5 intensified off.   LOOP AT it_ekpo where ebeln = it_ekko-ebeln .     WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline, "PURCHASE ORDER NUMBER                        it_ekpo-ebelp UNDER text-008, 30 sy-vline, "PO ITEM NUMBER                        it_ekpo-werks UNDER text-009, 45 sy-vline, "PLANT                        it_ekpo-matnr UNDER text-010, 60 sy-vline, "MATERIAL NUMBER                        it_ekpo-matkl UNDER text-011, 80 sy-vline. "MATERIAL GROUP   ENDLOOP.   WRITE :/ sy-uline(80).   endif.   ENDCASE.   CASE sy-ucomm.     WHEN 'EXIT' OR 'CANC' OR 'BACK'.        LEAVE TO SCREEN 0.   ENDCASE. *----------------------------------------------------------------------* *                    Top-of-page for basic list                        * *----------------------------------------------------------------------* TOP-OF-PAGE.  format color 3 intensified off.   WRITE :/ sy-uline(80).   WRITE :/    sy-vline,            03 sy-repid,            60 text-015,               sy-uname,            80 sy-vline.   WRITE :/ sy-vline, 03 sy-datum,            35 text-012,            60 text-014,               sy-pagno,            80 sy-vline.   WRITE :/ sy-uline(80).   WRITE :/ sy-vline, text-002, 18 sy-vline, "PURCHASE ORDER NUMBER                      text-003, 27 sy-vline, "COMPANY CODE                      text-004, 38 sy-vline, "PURCHASING DOCUMENT TYPE                      text-005, 50 sy-vline, "VENDOR                      text-006, 62 sy-vline, "LANGUAGE KEY                      text-007, 80 sy-vline. "PAYMENT TERMS KEY   WRITE :/ sy-uline(80). *----------------------------------------------------------------------* *              Top-of-page for secondary list                          * *----------------------------------------------------------------------* TOP-OF-PAGE DURING LINE-SELECTION. format color 2 intensified off. WINDOW STARTING AT 10 10        ENDING   AT 90 30.   WRITE :/ sy-uline(80).   WRITE :/   sy-vline,           03 sy-repid,           60 text-015,              sy-uname,           80 sy-vline.   WRITE :/   sy-vline,           03 sy-datum,           35 text-013,           60 text-014,              sy-pagno,           80 sy-vline.   WRITE :/ sy-uline(80).   WRITE :/ sy-vline, text-014, 15 sy-vline, "PURCHASE ORDER NUMBER                      text-008, 30 sy-vline, "PO ITEM NUMBER                      text-009, 45 sy-vline, "PLANT                      text-010, 60 sy-vline, "MATERIAL NUMBER                      text-011, 80 sy-vline. "MATERIAL GROUP   WRITE :/ sy-uline(80). *----------------------------------------------------------------------* *                    End-of-page event                                 * *----------------------------------------------------------------------* END-OF-PAGE.   WRITE :/    sy-vline,            03 text-016,               p_limit,            60 text-014,               sy-pagno,            80 sy-vline.   write:/ sy-uline(80). INCLUDE Z_INCLUDE_PURCHORDERKKB01. form form_search_help . REFRESH it_ebeln.   CLEAR it_ebeln.   CLEAR P_ebeln.   SELECT ebeln FROM ekko INTO TABLE it_ebeln.   CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'     EXPORTING       endpos_col   = 21       endpos_row   = 35       startpos_col = 12       startpos_row = 1       titletext    = text-012     IMPORTING       choise       = P_ebeln     TABLES       valuetab     = it_ebeln     EXCEPTIONS       break_off    = 1       OTHERS       = 2.
A D V E R T I S E M E N T

A D V E R T I S E M E N T

S A P - R E S O U R C E S


Get Free SAP Resources:

Are you looking for:
  • SAP Jobs
  • Free SAP eBooks
  • SAP Softwares
  • SAP Tutorials
  • ERP Implementation Examples
Enter Email Address:
(Enter your email address above and we will instantly send you the download link to you, when you confirm your email.)
Search SAP Resources:
discussionDiscussion Center
Discuss
Discuss

Query

Feedback
Yahoo Groups
Y! Group
Sirfdosti Groups
Sirfdosti
Contact Us
Contact
Sign in

User Name:
Password:
Forget password? | Register


INTERVIEW EBOOK

Get 30,000 Interview Questions & Answers in an eBook.

Interview Success Kit - Get Success in Job Interviews


Send your Resume to 6000 Companies

SAP Resources

  • SAP Articles
  • SAP Books
  • SAP Certifications
  • SAP Companies
  • SAP Study Materials
  • SAP Events
  • SAP Faqs
  • SAP Jobs
  • SAP Job Consultants
  • SAP Links
  • SAP News
  • SAP Sample Papers
  • SAP Interview Questions
  • SAP Training Institutes
  •  
    SAP Tutorial

  • Introduction
  • SAP History
  • SAP Facts
  • SAP Tables
  • SAP Function
  • SAP Report
  • Reasons To Use SAP
  • SAP Landscape
  • SAP Transaction Code
  • SAP Lotus Notes Integration
  • Business Connector and XML
  • Enterprise Release 4.7

  • SAP Training Institutes

  • SAP Training Institutes
  • Job Consultants Address
  • SAP Companies Address

  • Business Process Cycle

  • Analyze
  • Design
  • Implement
  • Operate
  • Optimize
  • Skills And Education

  • Logistics Module

  • Sales and Distribution
  • Quality Management
  • Materail Management
  • Plant Maintenance
  • Financial Modules (FI/CO)
  • Project system
  • Production Planning
  • Service Management

  • SAP NetWeaver

  • Introduction
  • Object Model
  • Interoperability
  • Creating Web Apps
  • Java Connector
  • Advantages & Conclusion
  • Life Cycle Management
  • Composite Application Framework

  • SAP Tools

  • SQL Trace Tool
  • SAP CRM
  • SAP SRM
  • SAP SCM
  • SAP ERP
  • SAP BW

  • SAP Modules

  • SAP FI Module
  • SAP CO Module

  • SAP Technical

  • SAP ITS Architecture
  • Financial Management
  • Manufacturing Planning and Execution
  • Customer Order Management
  • Lackbox Processing
  • SD and Financial Accounting Integration
  • SAP - HR (Human Resource)

  • SAP Miscellanous

  • Web Application Server(WAS)
  • Data Archiving
  • Mobile Engine
  • SAP Script
  • SAP Transactions
  • SAP Business Warehouse(BW)

  • SAP Reference

  • SAP Facts
  • SAP Tables
  • SAP Function
  • SAP Report
  • SAP Landscape

  • SAP Others

  • SAP Treasury
  • SAP Finance
  • SAP WAS
  • SAP Data Archiving
  • SAP ALE
  • SAP EDI
  • SAP Exchange
  • SAP X-APPS
  • SAP Applications Components
  • SAP Software
  • Dunning
  • SAP IDES
  • SAP Payroll Basics
  • SAP BASIS and Security Authorization
  • SAP Backup
  • SAP Router

  • ABAP Tutorials

  • Introduction
  • ABAP Transaction
  • ABAP Function
  • ABAP File Processing
  • ABAP Objects
  • ABAP Syntax
  • ABAP Queries
  • SAPMail Using ABAP
  • ABAP Programming Hints

  • SAP Projects & Codes

  • Finding the user-exits
  • Purchase Order Display
  • Batch Input
  • Dynamic Open SQL
  • Creating Extract Dataset
  • Reading database tables
  • Load table from a UNIX file
  • Create subscreen

  • SAP Resources

  • SAP Books
  • SAP Links

  • Interview Question



  • Common Interview Que.
  • ABAP Interview Que.
  • ERP Interview Que.
  • HR Interview Que.
  • MM Interview Que.
  • PP Interview Que.
  • ALE Interview Que.
  • EDI Interview Que.
  • Basis Interview Questions
  • SAP-SD Interview Questions
  • FI&CO Interview Questions
  • BW Interview Questions
  • CRM Interview Questions
  • Interview Questions

  • Careers at SAP

  • Careers in SAP (SAP Jobs)
  • Advertise
  •