Is ABAP Objects support Header Lines?

Hello Friends,
Is ABAP Objects (Object Oriented) Supports Header Lines? If not, why Abap Objects doesn't Support?
Thanks & Regards
Sathish Kumar

Hi,
           ABAP objects does not support HEADER LINE. you will get syntax error if your use OCCURS or WITH HEADER LINE in any class methods.
ABAP objects concept was brought to proivde strict type checkings. ABAP objects is a relatively new concept. even in normal ABAP program HEADER LINE is obsolete.
Use of tables with header line might lead to some coding error specially when maintaining.
If you use CLEAR itab, it clears the work area may be you intend to clear the table.
to clear the table you have to use CLEAR itab[]. This syntax is not advised and error prone so it is not allowed in ABAP objects. Its allowed in ABAP to be consistant with old programs which still use header line.
Regards,
Sesh
Message was edited by:
        Seshatalpasai Madala

Similar Messages

  • Passing an internal table WITH HEADER LINE to abap object

    Hi. In another thread, it was explained how to pass an internal table to an abap object method. Is it possible to pass an internal table that has a header line, and RETAIN the header line once the table has been passed?
    My problem is, that I can pass the table, update it, but the read buffer is not populated when returning from the object's method. This is the result of being able to pass a STANDARD TABLE type, but not a STANDARD TABLE WITH HEADER LINE.
    This means that I have to read the table into a work area instead of doing a READ TABLE LKNA1 within the method, which is what I need to do.
    Thanks.

    Please check this sample program, notice that it is modifing the internal table and passing it back modified as well as passing the "work area" or "header line" back thru the exporting parameter.
    report zrich_0001.
    *       CLASS lcl_app DEFINITION
    class lcl_app definition.
      public section.
        types: t_t001 type table of t001.
        class-data: it001 type table of t001.
        class-data: xt001 like line of it001.
        class-methods: change_table
                                    exporting ex_wt001 type t001
                                    changing im_t001 type t_t001.
    endclass.
    data: w_t001 type t001.
    data: a_t001 type table of t001 with header line.
    start-of-selection.
      select * into table a_t001 from t001.
      call method lcl_app=>change_table
                 importing
                     ex_wt001 = w_t001
                 changing
                     im_t001  = a_t001[] .
      check sy-subrc  = 0.
    *       CLASS lcl_app IMPLEMENTATION
    class lcl_app implementation.
      method change_table.
        loop at im_t001 into xt001.
          concatenate xt001-butxt 'Changed'
               into xt001-butxt separated by space.
          modify im_t001 from xt001.
        endloop.
        ex_wt001 = xt001.
      endmethod.
    endclass.
    Regards,
    Rich Heilman

  • Error: Tables with Header line No longer Supported In WD-ABAP

    Hi folks,
               I am working on WD4A functionality.I have to use Abap code to retrive data from database and i am doing it by declaring internal table with header line in one of the Methods.I have to do manipulation on table before i can bind table to result node.I can do manipulation in Header in ABAP,but now it is no longer supported in WD4A.What can i do for this?
    Nirad.

    hi nirad.
    The example is not of much sense
    but explains the funtionality. Hope this is what you are searching for.
    data:
             lt_flights    type table of sflight.
    data:
             ls_flight     type sflight.
    select * from sflight
    into corresponding fields of table lt_flights.
    loop at lt_flights into ls_flight.
      ls_flight-price = 1000.
      modify lt_flights from ls_flight.
    endloop.
    Cheers,
    Sascha

  • List header for alv grid using abap objects

    Hai all,
          I have displayed alv grid in container control using abap objects i.e. using method set_table_for_first_display.
    now i need to display list header for this alv grid.
    please help me how to create with a sample coding.
    Thanks and regards,
    Prabu S.

    Create a splitter using CL_GUI_EASY_SPLITTER_CONTAINER with a top and bottom half.  Put the alv grid in the bottom half.  Use cl_dd_document (documented in help.sap.com )  to build the header in the top half.  Use events on CL_GUI_ALV_GRID to handle the top-of-list printing.
    Or, if available, use CL_SALV_TABLE, and read the documentation on that.  When I needed a header for my report, that's what I did.  There's plenty of good documentation about if you'll search for it.
    matt

  • Header In ALV with abap objects

    Hi friends,
    How can we print the header in abap Objects using class ??
    thanks,
    Prashant patil

    Create a local class:
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS: handle_top_of_page FOR EVENT print_top_of_page
                                   OF cl_gui_alv_grid.
      PRIVATE SECTION.
    ENDCLASS.
    *       CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_top_of_page.
      WRITE: / 'Header info'.  
      ENDMETHOD.
    ENDCLASS.
    Then in your main program before you <i>set_table_for_first_display</i>, make sure you register your event handler:
    DATA:  grid                   TYPE REF TO  cl_gui_alv_grid,
             event_receiver    TYPE REF TO  lcl_event_receiver.
        CREATE OBJECT grid EXPORTING i_parent = container.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_top_of_page FOR grid.

  • Is User Exit's support ABAP Objects?

    Hi Experts,
    Is User Exits supports ABAP Objects.  I am planning to  implement  the ABAP classes in User exits to fill Query Variables.
    Is it possible?
    Thanks & Regards

    Hi,
         Yes user Exit's support ABAP Object.
    But according to me if you want to use class then use the class into some generic function module, then that function module use in Exit. Its just for Cleanness and Simplicity of user Exit.
    Regards,

  • How to declare a header line table in class

    Hi Experts ;
    I m writing a class.I must display a picture in class. So Im find a below code
      TYPES: BEGIN OF ZW3QUERY,
              NAME(30) TYPE C,
              VALUE(255) TYPE C,
             END OF ZW3QUERY.
      data DOCKING type ref to CL_GUI_DOCKING_CONTAINER .
      data PICTURE_CONTROL_1 type ref to CL_GUI_PICTURE .
      data:
        URL(256) TYPE C .
      data QUERY_TABLE TYPE STANDARD TABLE OF ZW3QUERY 
            INITIAL SIZE 0.
      data HTML_TABLE type W3HTML .
      data RETURN_CODE type W3PARAM-RET_CODE .
      data CONTENT_TYPE type W3PARAM-CONT_TYPE .
      data CONTENT_LENGTH type W3PARAM-CONT_LEN .
      data PIC_DATA type W3MIME .
      data PIC_SIZE type I .
      data:
        SUM(4) .
      data:
        NUM1(4) .
      data:
        NUM2(4) .
    DATA: REPID LIKE SY-REPID.
      REPID = SY-REPID.
      CREATE OBJECT PICTURE_CONTROL_1
        EXPORTING
          PARENT = DOCKING.
      CHECK SY-SUBRC = 0.
      CALL METHOD PICTURE_CONTROL_1->SET_3D_BORDER
        EXPORTING
          BORDER = 5.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
        EXPORTING
          DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
      CALL METHOD PICTURE_CONTROL_1->SET_POSITION
        EXPORTING
          HEIGHT = 40
          LEFT   = 5
          TOP    = 170
          WIDTH  = 90.
      IF URL IS INITIAL.
        REFRESH QUERY_TABLE.
        QUERY_TABLE-NAME  = '_OBJECT_ID'.
        QUERY_TABLE-VALUE = 'ZBOYDAKLOGO'.
        APPEND QUERY_TABLE.
    but I must do header line decleration in code. an Error. Class not support this decleration.  . I m try create types but its not works.
    How do I traverse not can this error
    Thanks everything Regards.

    Hi Irfan,
    in ABAP-Objects you don't work with headerlines - instead you work with work-areas.
    You must define a workarea for your table like that:
    DATA:
      gw_query TYPE ZW3QUERY.
      gw_query-name ='_OBJECT_ID'.
      gw_query-value = 'ZBOYDAKLOGO'.
      APPEND gw_query TO query_table.
    Regards.

  • Header Line Logic for Field Symbols??

    Hi Experts,
    I have the logic
    DATA: Itab  TYPE REF TO DATA.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE.
    CREATE DATA Itab TYPE STANDARD TABLE OF (TABLE_NAME).
    ASSIGN Itab->* TO <itab>.
    Her I had done the dynamic logic
    select (LT_FIELDS)
           into corresponding fields of table <itab>
           from (TABLE_NAME)
          up to 100 rows
           WHERE (LT_WHERE).
    Now I am having all information in <itab>.
    Now I want to take this headerline information of <itab> and populate the same to other structure??
    How to take the <itab> as header line information by looping??

    Hi
    see this and use
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Regards
    ANJI

  • Download/upload abap objects to/from local PC

    Hi all,
            I need to download objects of a tcode (like includes, reports etc) on to PC and  upload it to different server. Can anybody please send me the programs to upload and download objects.
    Thanks in Advance

    REPORT ZUPDOWNPROGRAMS LINE-SIZE 132 LINE-COUNT 62 NO STANDARD PAGE HEADING.
      This program up / downloads from / to a local dataset
      all the components of an ABAP - i.e TEXTS, the entire CUA
      including statuses and menus, DYNPROS and source code.
      Program documentation and variants are not handled.
      INCLUDED programs are automatically handled both on upload
      or download. INCLUDE selection can be excluded or generic
      e.g only handle INCLUDES starting with ZIN*
      INCLUDES within INCLUDES also handled.
      The only restriction is on UPLOAD the INCLUDED programs must come
      from the same directory as the main program.
      On Download of course the ABAP must exist in the library.
         Note for LINUX and BATCH users
      This program was originally designed as a one off tool for
      getting ABAPS etc from a SAP R2 (IBM MVS mainframe system) into
      an R3 test system minimising the need for a large amount of
      mainframe sysprogs (anybody remember what they were !!) time
      and support to say nothing of access problems from TSO /JES2 /
      SAP R2. At that time network connections were patchy and the
      transport systems largely incompatable and not very reliable.
      This program was originally designed as a one off tool for
      Must run on Windows front end ---- If you are running SAP with
      LINUX on your work station you will have to change the WS_UPLOAD
      and WS_DOWNLOAD functions to reflect the Linux file system. The
      contents of the data sets themseleves do not need to be changed
      Program can easily be modified to run in batch and store
      the data on a UNIX host. Change the WS_UPLOAD and WS_DOWNLOAD
      to read from and write to UNIX data sets (OPEN FILE etc).
      You will also need to modify the parts of the program that get
      the DOS directory and display the Windows file paths.
      The actual abap data sets do not need to be changed.
    Rel 4.0   names can now be up to 40 bytes long
              Dynpros and CUA have changed from rel 3.1
              Tabstrips now loaded and unloaded in dynpros
       Please note restriction on 4.6 systems for users who
       have ABAP names which include '/'s in their names.
    Rel 4.6b, 4.6c Abap names can include the '/' in their names
    e.g /CUST1/CUST2/ORDER
    This causes problems when storing to a local file.
    a solution is to change the name to %CUST1%CUST2%ORDER i.e / will
    be changed to %. On upload the % should be changed back to /
    again.    This change still needs to be implemented.
    If you don't use the / in the abap name then this is not a problem.
    If file to be uploaded is in rel 3 format then names are only 8
    bytes long.
      program uses 3 datasets per abap
         1) abapname.eee     source, dynpr logic, texts, CUA stuff
         2) abapname.hhh     dynpr header
         3) abapname.fff     dynpro fields.
    because of varying lengths and contents 3 data sets are used. The
    complexity of combining all these to 1 data set would make the
    program far too complex.
      NOTE: This version of the program can only be used on
            release 4.0 or higher. Once an ABAP has been converted
            to rel 4.0 it cannot be converted back to rel 3.0
            on a release 3/3.1 system. Release 4 CUA tables
            are different.  Use release 3 version of this program
           for releases 3.0 and 3.1. Available on SAPFANS website.
      Note that data to be uploaded must have been previously downloaded
      by this program (any version since rel 2.0) - except for Initial
      Load -- see end of these comments.
             Dynpros and CUA statuses have changed since rel 3.1
       This program will handle rel 3.1 format on upload but will
       download in rel 4.0 format. To upload 3.1 format specify an 'X'
       in the rel3 parameter.
       If you have downloaded components in rel 4.0 format and you
       want to re-load to a 3.1 system  you will have to load
       the source via standard upload and re-create dynpros and the CUA
       manually.
       As names can now be longer than 8 characters you can only
       use this program if the SAP front end (SAPGUI) supports
       long file names (WIN 95/98 or WIN NT). Windows 3.x will not
       work as the underlying DOS system cannot handle long file names.
          UPLOAD function and DOS directory.
    When an ABAP is selected for UPLOAD then the DOS
    directory is read into a table. A file called ABAP.BAT is created,
    and down loaded to the 'C' drive and executed.
    This file executes a DOS DIR command and pipes the output
    into a dataset which is then uploaded into an internal
    table on SAP.
    Note on running DOS commands from ABAP
    The first time this procedure is executed you will see a DOS window
    which you will have to close manually. To get round this
    use windows explorer to select the file ABAP.BAT and then
    right mouse click on the file name. Select the
    properties window. From this click the CLOSE on EXIT box. This
    will then automatically close the DOS function after it has
    executed. (Windows restriction).
    The DOS function has not been tested using Windows 2000 so
    it might not work. OK on W95,W98,WME and Windows NT (No Thanks)
    If INCLUDE programs are wanted on UPLOAD only the specified
    directory is searched.
    Instead of entering path name manually you can click on
    the path parameter. Because of Windows restriction you will
    have to select ANY file in the relevant directory.
    The path will then be copied on to the selection screen.
    To do still : Merge 3 files to one and compress output to .ZIP file
                   fix 4.5 4.6 problem of abaps containing '/' in the name
                   possibility to automatically up / download referenced
                   function modules with selection criteria like INCLUDES
    To load the ist time into a system.
    Create program with ABAP editor and Upload the .EEE file.
    Delete ist line  (????SRCE) in the ABAP EDITOR --NOT THE DISK FILE
    Delete all the source from the line that starts ????TEXT (towards
    the end file) till the end so the last line in your source is ENDFORM.
    DO NOT ALTER THE DISK FILE. DO THESE CHANGES IN THE ABAP EDITOR.
    Save file and execute
    Use following parameters (Note the ist time you won't get proper
    text on the selection screen).
    Function      U
    Path          full dos path containing source e.g c:\abaps\
                   NOTE YOU MUST ENTER THE FINAL \ as above.
    REPID         the program name. e.g ZZJIMHXX
                   note that on the DISK you will see 3 files
                   ZZJIMHXX.EEE, ZZJIMHXX.FFF, ZZJIMHXX.HHH
                   just use the name before the dos qualifier - the
                   program will do the rest
    ignore other parameters
    The program will then load itself with all the texts etc.
    It should now be ready for use.
      Macros
    DEFINE DEFINE_TABLE.
      DATA: &1 LIKE &2 OCCURS &3 WITH HEADER LINE.
    END-OF-DEFINITION.
    DEFINE CLS.
      REFRESH &1.
      CLEAR &1.
    END-OF-DEFINITION.
    DEFINE INIT.
      IF &1 NE SPACE.
        SEARCH &1 FOR '. .'.
        IF SY-SUBRC = 0.
          WRITE '*' TO &1+SY-FDPOS(1).
        ENDIF.
        TRANSLATE &1 USING '*%'.
      ELSE.
        MOVE '%' TO &1.
      ENDIF.
    END-OF-DEFINITION.
    end of macros
    /     SAP standard tables                                        */
    TABLES: D020S,                         "Dynpro header
            D020T,                         "Dynpro title
            D021T,                         "Screen field keyword texts
            TRDIR,                         "Attribute table
            TADIR,                         "Dev. class etc.
            EUDB,                          "CUA data
            TSTC,                          "transaction data
            TITLE,                         "CUA titles
            RSMPTEXTS.                     "Function texts (rel 4.0)
    /     Work tables to hold ABAP source etc, and dynpro            */
    /     contents.                                                  */
    DATA: BEGIN OF H.                      "Header
            INCLUDE STRUCTURE D020S.
    DATA: END OF H.
    DATA: BEGIN OF H1 OCCURS 10,           "Header
          NAME(40)               TYPE C,                        "rel 4
          NUMBER(4)              TYPE N.
            INCLUDE STRUCTURE D020S.
    DATA: END OF H1.
    DATA: BEGIN OF H2 OCCURS 0,            "Rel 3  dynp. header
            CNAME(8)   TYPE C,
            CNUM(4)    TYPE C,
            NNAME(8)   TYPE C,
            NNUM(4)    TYPE C,
            FILL(51)   TYPE C,
            CDAT(6)    TYPE C,
            CTIM(6)    TYPE C,
          END OF H2.
    DATA: BEGIN OF F OCCURS 250.           "Dynpro Fields
            INCLUDE STRUCTURE D021S.
    DATA: END OF F.
    DATA: BEGIN OF F1 OCCURS 500,          "Dynpro Fields
          NAME(40)               TYPE C,                        "rel 4
          NUMBER(4)              TYPE N.
            INCLUDE STRUCTURE D021S.
    DATA: END OF F1.
    DATA: BEGIN OF OLD_F1 OCCURS 0,        "Dynpro Fields (rel 3)
          NAME(8)    TYPE C,
          NUMBER(4)     TYPE C.
            INCLUDE STRUCTURE D021SE_OLD.
    DATA: END OF OLD_F1.
    DATA: BEGIN OF F2 OCCURS 0,            "Dynpro Fields (rel 3)
          TFIL(284)  TYPE C,
          END OF F2.
    DATA: BEGIN OF M OCCURS 3.             "Match codes (if any)
            INCLUDE STRUCTURE D023S.
    DATA: END OF M.
    DATA: BEGIN OF E OCCURS 0.             "Dynpro Logic
            INCLUDE STRUCTURE D022S.
    DATA: END OF E.
    DATA: BEGIN OF E1 OCCURS 0,            "Dynpro Logic
          NAME(40)               TYPE C,                        "rel 4
          NUMBER(4)              TYPE N.
            INCLUDE STRUCTURE D022S.
    DATA: END OF E1.
    DATA: BEGIN OF T   OCCURS 0,           "prog name and dynpro nrs
          NAME(40)     TYPE C,                                  "rel 4
          NUMBER(4)    TYPE N,
    END OF T.
    DATA: BEGIN OF R   OCCURS 56,          "prog name and language
          NAME(40)     TYPE C,                                  "rel 4
          LANGUAGE(1)  TYPE C,
       END OF R.
    DATA: BEGIN OF S OCCURS 3000,
          TXT(180)               TYPE C,   "rel 4   was 132
          END OF S.
    DATA: BEGIN OF R1 OCCURS 50,           "for include programs
            NAME(40)             TYPE C,                        "rel 4
            INSTANCE(3)          TYPE P,
          END OF R1.
    DATA: BEGIN OF S1 OCCURS 3000,
          TXT(180)               TYPE C,   "   rel 4  was 132
          END OF S1.
    DATA: BEGIN OF U OCCURS 100,           "Text elements
          TXT(180)               TYPE C,   " rel 4   was 132
          END OF U.
    DATA: BEGIN OF DIR.                    "ABAP Attributes
            INCLUDE STRUCTURE TRDIR.
    DATA: END OF DIR.
    DATA: BEGIN OF DTXT.                   "Dynpro field keyword texts
            INCLUDE STRUCTURE D021T.
    DATA: END OF DTXT.
    /     This data contains all the components of the               */
    /     CUA such as menus, statuses, Pfkeys                        */
    /     As from rel 4.5 Tabstrips are automatically copied as well */
    /     The rel3 parameter must be set however to load the         */
    /     correct version of the CUA tables if uploading rel 3       */
    /     data to a rel 4 system.                                    */
    /     Rel 4.0B can  convert 3.1 and earlier CUA's                */
    /     This could change later however.                           */
    CUA Tables.
    Key of CUA tables in EUDB data set. Name is len 40 in rel 4.0
    DATA BEGIN OF EU_KEY.
            INCLUDE STRUCTURE RSEU1_KEY.
    DATA END OF EU_KEY.
        Status
    DATA BEGIN OF STA OCCURS 0.
            INCLUDE STRUCTURE RSMPE_STAT.                       " rel 4
    DATA END OF STA.
        Functions
    DATA BEGIN OF FUN OCCURS 0.
            INCLUDE STRUCTURE RSMPE_FUNT.                       "rel 4
    DATA END OF FUN.
        Menus
    DATA BEGIN OF MEN OCCURS 0.
            INCLUDE STRUCTURE RSMPE_MEN.   "rel 4.0
    DATA END OF MEN.
        Menus (texts)
    DATA BEGIN OF MTX OCCURS 0.
            INCLUDE STRUCTURE RSMPE_MNLT.  "rel 4.0
    DATA END OF MTX.
        Action Bar
    DATA BEGIN OF ACT OCCURS 0.
            INCLUDE STRUCTURE RSMPE_ACT.   "rel 4.0
    DATA END OF ACT.
        Push Buttons
    DATA BEGIN OF BUT OCCURS 0.
            INCLUDE STRUCTURE RSMPE_BUT.   "rel 4.0
    DATA END OF BUT.
        PF-Keys
    DATA BEGIN OF PFK OCCURS 0.
            INCLUDE STRUCTURE RSMPE_PFK.   "rel 4.0
    DATA END OF PFK.
        Function sets
    DATA BEGIN OF SET OCCURS 0.
            INCLUDE STRUCTURE RSMPE_STAF.  "rel 4.0
    DATA END OF SET.
        Documentation
    DATA BEGIN OF DOC OCCURS 0.
            INCLUDE STRUCTURE RSMPE_ATRT.  "rel 4.0
    DATA END OF DOC.
        Title codes with text
    DATA: BEGIN OF TIT OCCURS 0.
            INCLUDE STRUCTURE RSMPE_TITT.  "rel 4.0
    DATA: END OF TIT.
    DATA BEGIN OF FTX OCCURS 0.            "rel 4.0
            INCLUDE STRUCTURE RSMPTEXTS.
    DATA END OF FTX.
           rel 3.1 CUA components.
        Status
    DATA BEGIN OF OLD_STA OCCURS 0.
            INCLUDE STRUCTURE RSEU1_GEN.   " rel 3.1
    DATA END OF OLD_STA.
        Functions
    DATA BEGIN OF OLD_FUN OCCURS 0.
            INCLUDE STRUCTURE RSEU1_FUN.   "rel 3.1
    DATA END OF OLD_FUN.
        Menus
    DATA BEGIN OF OLD_MEN OCCURS 0.
            INCLUDE STRUCTURE RSEU1_MEN.   "rel 3.1
    DATA END OF OLD_MEN.
        Menus (texts)
    DATA BEGIN OF OLD_MTX OCCURS 0.
            INCLUDE STRUCTURE RSEU1_TXM.   "rel 3.1
    DATA END OF OLD_MTX.
        Action Bar
    DATA BEGIN OF OLD_ACT OCCURS 0.
            INCLUDE STRUCTURE RSEU1_ACT.   "rel 3.1
    DATA END OF OLD_ACT.
        Push Buttons
    DATA BEGIN OF OLD_BUT OCCURS 0.
            INCLUDE STRUCTURE RSEU1_BUT.   "rel 3.1
    DATA END OF OLD_BUT.
        PF-Keys
    DATA BEGIN OF OLD_PFK OCCURS 0.
            INCLUDE STRUCTURE RSEU1_PFK.   "rel 3.1
    DATA END OF OLD_PFK.
        Function sets
    DATA BEGIN OF OLD_SET OCCURS 0.
            INCLUDE STRUCTURE RSEU1_SET.   "rel 3.1
    DATA END OF OLD_SET.
        Documentation
    DATA BEGIN OF OLD_DOC OCCURS 0.
            INCLUDE STRUCTURE RSEU1_ETM.   "rel 3.1
    DATA END OF OLD_DOC.
        Title codes with text
    DATA: BEGIN OF OLD_TIT OCCURS 0.
            INCLUDE STRUCTURE TITLE.       "rel 3.1
    DATA: END OF OLD_TIT.
    dynamic function text
    DATA BEGIN OF FDN OCCURS 1.
            INCLUDE STRUCTURE RSEU1_FDYN.  "not req for rel 4.
    DATA END OF FDN.
    Icons
    DATA BEGIN OF FIN OCCURS 1.
            INCLUDE STRUCTURE RSEU1_ICON.  "not req for rel 4
    DATA END OF FIN.
    dynamic menu texts
    DATA BEGIN OF MDN OCCURS 1.
            INCLUDE STRUCTURE RSEU1_MDYN.  "not req for rel 4.
    DATA END OF MDN.
        Symbol list
    DATA BEGIN OF SYM OCCURS 0.
            INCLUDE STRUCTURE RSEU1_SYMB.
    DATA END OF SYM.
        Status Short text
    DATA BEGIN OF STX OCCURS 0.
            INCLUDE STRUCTURE RSEU1_CTX.
    DATA END OF STX.
        Attributes for function key settings (menu bars)  Rel 3.0
    DATA BEGIN OF ATT OCCURS 0.
            INCLUDE STRUCTURE RSEU1_HAT.
    DATA END OF ATT.
        Include-Menus
    DATA BEGIN OF INC OCCURS 3.
            INCLUDE STRUCTURE RSEU1_INC.
    DATA END OF INC.
    Last used numbers
    DATA BEGIN OF LAST.
            INCLUDE STRUCTURE RSEU1_LST.
    DATA END OF LAST.
      data for call transaction (SE41 to re-generate the CUA)
    DATA: BEGIN OF T_BDC_TAB OCCURS 0.
            INCLUDE STRUCTURE BDCDATA.     "BDC data
    DATA: END OF T_BDC_TAB.
    DATA: BEGIN OF T_MESSTAB OCCURS 0.
            INCLUDE STRUCTURE BDCDATA.
    DATA: END OF T_MESSTAB.
    /     Program data                                               */
    DATA: NUMBER(4)               TYPE N,
          OLDNUM(4)               TYPE N,
          FILESIZE                TYPE I,
          NR_OF_BYTES             TYPE I,
          I(3)                    TYPE P,
          IX(3)                   TYPE P,
          J(3)                    TYPE P,
          L(3)                    TYPE P,
          CUA-FLAG(1)             TYPE C,
          CUA_RETURN(10)          TYPE C,
          DYNPRO_MESSAGE(160)     TYPE C,
          DYNPRO_LINE             TYPE P,
          DYNPRO_WORD(30)         TYPE C,
          NUM(3)                  TYPE N,
          DYNNAME(44)             TYPE C,
          FN1(128)                TYPE C,
          FN2(128)                TYPE C,
          FN3(128)                TYPE C,
          W_ITERATE(1)            TYPE C,
          MAIN(1)                 TYPE C,
          FUNC(1)                 TYPE C,
          OLDNAME(40)             TYPE C,
          OLD-FUNC(8)             TYPE C,
          NEW-FUNC(8)             TYPE C,
          FOUND(1)                TYPE C,
          LANGUAGE                LIKE SY-LANGU,
          FIRST-TIME(1)           TYPE C VALUE 'Y',
          OK-CODE(5)              TYPE C,
          NAME(40)                TYPE C,                       "rel 4
          TXLINE(70)              TYPE C,
          LINE(132)               TYPE C.
    DATA:
          UL_FILE(128)          TYPE C,
          DL_FILE(128)          TYPE C,
          DOSLINE(72)           TYPE C.
    DATA: BEGIN OF DOSDIR OCCURS 0,
            TEXT(72),
          END OF DOSDIR.
    DATA: BEGIN OF I_PROG OCCURS 0,
          NAME(40),
          END OF I_PROG.
    DATA: BEGIN OF I_PROGT OCCURS 0,
          NAME(40),
          END OF I_PROGT.
    DATA: BEGIN OF I_INCLUDE OCCURS 0,
          NAME(40),
          HANDLED(1)   TYPE C,
          END OF I_INCLUDE.
    DATA: BEGIN OF I_INCL OCCURS 0,
          NAME(40),
          END OF I_INCL.
    DATA: BUFFER(1024).
    DATA: WINSYS(3).
    DATA: GLOBAL_FILEMASK_MASK(20), GLOBAL_FILEMASK_TEXT(20).
    DATA: GLOBAL_FILEMASK_ALL(80).
    DATA: T_FILENAME(128),
          TMP_FILENAME(128),
          T_MODE(1),
          FIELDLN     TYPE I.
    DEFINE_TABLE I_DYNPFIELDS DYNPREAD 0.  "dynpro fields to be updated
    DATA: I_FLDS LIKE HELP_VALUE OCCURS 0 WITH HEADER LINE.
    FIELD-SYMBOLS: <F>.
    /     Parameters                                                 */
    SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS REPID FOR TRDIR-NAME OBLIGATORY .
    PARAMETERS:
          FUNCTION(1)       TYPE C OBLIGATORY,  "Function
          DSNAME(40)        TYPE C,        "Data set name
          INCLUDES(1)       TYPE C DEFAULT 'N', "Resolve Includes
          IMASK(40)         TYPE C,        "Include Mask
          CLASS             LIKE TRDIR-CLAS,
          AUTHOR            LIKE TRDIR-CNAM,          "Author
          APPL              LIKE TRDIR-APPL,
          PATH(88)          TYPE C DEFAULT 'A:\',
          REL3(1)           TYPE C.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-005.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-002.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) TEXT-003.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END  OF BLOCK A1.
    /          Check users workstation is running WINDOWS,        */
    /          WINDOWS 95, or WINDOWS NT. OS/2 no good for        */
    /          this application.                                  */
    CALL FUNCTION 'WS_QUERY'
         EXPORTING
              QUERY  = 'WS'
         IMPORTING
              RETURN = WINSYS.
    IF WINSYS(2) NE 'WN'.                  "Win 3.X no good either
      WRITE: / 'Windows NT or Windows 95/98 is required'.
      EXIT.
    ENDIF.
    /          Get names of programs to be handled.               */
    /          Name can be a single value, many values or ranges  */
    /          as per standard SELECT-OPTIONS on selection screen */
    / On Download read TRDIR and store program names in a table   */
    / as per selection options.                                   */
    / On upload read the specified directory for all files of     */
    /  type .EEE from specified directory                         */
    /  compare file names with selection criteria                 */
    MOVE FUNCTION TO FUNC.
    MOVE 'Y' TO MAIN.
    CASE FUNC.
      WHEN 'U'.                            "Upload required
        PERFORM READ_DOS_DIRECTORY.
        PERFORM GET_RANGE_UL.              "Get list of progs to process
      WHEN 'D'.                            "Download required
        PERFORM GET_RANGE_DL.              "Get list of progs to process
      WHEN OTHERS.
        WRITE: / 'Function not performed due to user request'.
        EXIT.
    ENDCASE.
    SORT I_PROG.
    DELETE ADJACENT DUPLICATES FROM I_PROG.
    For download INCLUDE handling can be resolved via function
    module call.
    All Includes within Includes are also resolved by the function
    module call.
    Note that this method does not work if program itself is of type
    I (it's an include)
    In this case we can still search the source.
    IF FUNC = 'D'.
      IF INCLUDES = 'Y'.
        PERFORM GET_INCLUDES_DL.
        PERFORM PROCESS_INCLUDES_DL.
      ENDIF.
    ENDIF.
    Program list from selection criteria i.e excluding INCLUDES found
    LOOP AT I_PROG.
      MOVE I_PROG-NAME TO R1-NAME.
      APPEND R1.
      DESCRIBE TABLE R1 LINES I.
      WHILE I NE 0.
        PERFORM EXECUTE-FUNCTION.
      ENDWHILE.
      REFRESH R1.
    ENDLOOP.
    We need to check now for INCLUDES on DOWNLOAD when the INCLUDE
    program itself is of type I. In this case the function call
    will not return the INCLUDES. For example we could be
    downloading ZTESTTOP (an Include itself) which as an include
    ZTEST01.
    The process fortunately is the same as the UPLOAD function
    except of course we need to read the library instead of the
    DOS directory
    process INCLUDE modules for Upload
    On upload the procedure is more complex as Includes within
    Includes can only be resolved by scanning the code and
    searching if the program exists in the directory.
    To get all INCLUDES within INCLUDES entries in table I_INCL
    that do not exist in I_INCLUDE are copied to table I_INCLUDE
    after each entire pass of table i_INCLUDE and table is then
    re-looped through. Programs in table I_INCLUDE that have already
    been processed have a "Y" indicator set in I_INCLUDE-AVAIL.
    if  func = 'U'.
    IF INCLUDES = 'Y'.
      DESCRIBE TABLE I_INCL LINES I.
      IF I > 0.
        W_ITERATE = 'Y'.
      ELSE.
        W_ITERATE = ' '.
      ENDIF.
      WHILE W_ITERATE = 'Y'.
        PERFORM PROCESS_INCLUDES_UL.
        PERFORM LOOP_THROUGH.
        DESCRIBE TABLE I_INCL LINES I.
        IF I > 0.
          W_ITERATE = 'Y'.
        ELSE.
          W_ITERATE = ' '.
        ENDIF.
      ENDWHILE.
    endif.
    ENDIF.
    DESCRIBE TABLE I_INCLUDE LINES I.
    IF I > 0.
      SKIP 1.
      WRITE: / ' Included Programs found'.
      SKIP 1.
      LOOP AT I_INCLUDE.
        WRITE I_INCLUDE-NAME TO LINE(40).
        CONDENSE LINE.
        WRITE: / LINE(80).
      ENDLOOP.
    ENDIF.
    /       Table R contains ABAP names to up / download.            */
    /       Loop through table R and perform up / download           */
    /       for each program.                                        */
    /       Table R1 contains INCLUDE names found (if any)           */
    /       As each                                                  */
    FORM EXECUTE-FUNCTION.
      LOOP AT R1.
        MOVE-CORRESPONDING R1 TO R.
        APPEND R.
      ENDLOOP.
      REFRESH R1.
      LOOP AT R.
        REFRESH : T, E1, H1, F1, S, U.
        PERFORM PROCESS.
        MOVE 'N' TO MAIN.
      ENDLOOP.
      REFRESH R.
      DESCRIBE TABLE R1 LINES I.
    ENDFORM.
    /     Build file names for UP/DOWNLOAD                           */
    /     3 files are generated per ABAP.                            */
    /       1) ABAP    Path\PROGNAME.EEE (ABAP, Attr,Texts)          */
    /          Logic   Path\PROGNAME.EEE (Dynpro Source Logic)       */
    /          CUA     Path\PROGNAME.EEE (CUA components - keys etc) */
    /       2) Header  Path\PROGNAME.HHH (Dynpro Header)             */
    /       3) Fields  Path\PROGNAME.FFF (Dynpro Field definitions  )*/
    / ( If alternate file name specified -DSNAME- this will          */
    /   be used instead. This is only valid for the main program.    */
    /   INCLUDED programs will have file names as specified          */
    /   above).                                                      */
    /  By using this scheme it saves the user from having to         */
    /  be prompted for 3 file names.                                 */
    /  If you want multiple copies / versions on disk either         */
    /  rename the old versions or specify a different directory in   */
    /  the path parameter.                                           */
    FORM PROCESS.
      MOVE PATH TO FN1.
      CASE MAIN.
        WHEN 'Y'.
          IF DSNAME NE SPACE.
            WRITE DSNAME TO FN1+66.                             "rel 4
          ELSE.
            WRITE R-NAME TO FN1+66.                             "rel 4
          ENDIF.
        WHEN OTHERS.
          WRITE R-NAME TO FN1+66.                               "rel 4
      ENDCASE.
      MOVE FN1 TO FN2.
      MOVE FN1 TO FN3.
      WRITE '.HHH' TO FN1+124(4).                               "rel 4
      WRITE '.FFF' TO FN2+124(4).                               "rel 4
      WRITE '.EEE' TO FN3+124(4).                               "rel 4
      CONDENSE FN1 NO-GAPS.
      CONDENSE FN2 NO-GAPS.
      CONDENSE FN3 NO-GAPS.
      NAME   = R-NAME.
      CASE FUNC.
        WHEN 'D'.
          PERFORM DOWNLOAD_OBJECTS.
          CLEAR LINE.
          WRITE : 'ABAP : ' TO LINE.
          WRITE R-NAME TO LINE+8.
          WRITE 'has been unloaded' TO LINE+55.
          CONDENSE LINE.
          WRITE: / LINE.
          DESCRIBE TABLE T LINES I.
          IF I = 0.
            WRITE: / 'No Dynpros were found for unload function'.
          ELSE.
            WRITE: / 'The following Dynpros have been unloaded : '.
            PERFORM LOOP_THROUGH_T.
          ENDIF.
        WHEN 'U'.
          PERFORM UPLOAD_OBJECTS.
          DESCRIBE TABLE T LINES I.
          CASE I.
            WHEN 0.
              WRITE:  / 'No Dynpros were found for restore function'.
            WHEN OTHERS.
              WRITE: / 'The following Dynpros have been restored : '.
              PERFORM LOOP_THROUGH_T.
          ENDCASE.
          IF MAIN EQ 'Y'.
            CASE OLDNAME.
              WHEN SPACE.
                CLEAR LINE.
                WRITE : 'ABAP : ' TO LINE.
                WRITE R-NAME TO LINE+8.
                WRITE 'has been restored' TO LINE+55.
                CONDENSE LINE.
                WRITE: / LINE.
              WHEN OTHERS.
                CLEAR LINE.
                WRITE : 'ABAP : ' TO LINE.
                WRITE R-NAME TO LINE+8.
                WRITE 'has been restored - original name :'
                   TO LINE+55.
                WRITE OLDNAME TO LINE+92.
                CONDENSE LINE.
                WRITE: / LINE.
            ENDCASE.
          ELSE.
            CLEAR LINE.
            WRITE : 'ABAP : ' TO LINE.
            WRITE R-NAME TO LINE+8.
            WRITE 'has been restored' TO LINE+55.
            CONDENSE LINE.
            WRITE: / LINE.
          ENDIF.
      ENDCASE.
    ENDFORM.
    /      print progname + dynpro nrs that have been processed.     */
    FORM LOOP_THROUGH_T.
      LOOP AT T.
        CLEAR LINE.
        WRITE R-NAME TO LINE.
        WRITE T-NUMBER TO LINE+50.
        CONDENSE LINE.
        WRITE: / LINE.
      ENDLOOP.
    ENDFORM.
    /            Download Objects                                    */
    FORM DOWNLOAD_OBJECTS.
      PERFORM UNLOAD_ABAP.                 "ABAP source, texts, attr
      SELECT SINGLE * FROM TRDIR
       WHERE NAME EQ R-NAME.
      IF TRDIR-SUBC = 'I'.
        CASE INCLUDES.                     "Included file wanted
          WHEN 'Y'.
            PERFORM SCAN4-INCLUDES.
        ENDCASE.
      ENDIF.
      PERFORM UNLOAD_CUA.                  "CUA stuff
      PERFORM DOWNLOAD_DATA.               "Download EEE file to PC
      PERFORM BUILD_T.        "Build table of all dynpros in ABAP
      DESCRIBE TABLE T LINES I.
      CASE I.
        WHEN 0.            "if no dynpros exist then cannot download any
          PERFORM DOWNLOAD_DATA.           "Download EEE file to PC
        WHEN OTHERS.
          PERFORM UNLOAD_DYNPROS.          "Get Raw dynpros from SAP
          PERFORM UNLOAD_DYNPRO_COMPONENTS."Convert to table
          PERFORM DOWNLOAD_DATA.           "Download ABAP etc. to PC
          PERFORM DOWNLOAD_BIN_H1.         "Download dynpro header
          PERFORM DOWNLOAD_BIN_F1.         "Download dynpro fields
      ENDCASE.
    ENDFORM.
    /  Split ABAP up into its component parts                        */
    /                           A) Program source (72)               */
    /                           B) Texts          (132)              */
    /                           C) Attributes     (117)              */
    /                           D) CUA stuff      (Various)          */
    FORM UNLOAD_ABAP.
    /    Get ABAP language. Only required on download.               */
      SELECT SINGLE * FROM TRDIR
        WHERE NAME EQ R-NAME.
      MOVE TRDIR-RLOAD TO R-LANGUAGE.
      READ REPORT R-NAME INTO S.           "Get source into table S
      MOVE '????SRCE' TO S-TXT.
      INSERT  S INDEX 1.
    /    Text elements, Numbered texts, headings, selection texts    */
    /    Read text elements with logon language. If they don't       */
    /    exist read with the value taken from TRDIR.                 */
      READ TEXTPOOL R-NAME INTO U LANGUAGE SY-LANGU.
      IF SY-SUBRC NE 0.
        READ TEXTPOOL R-NAME INTO U LANGUAGE R-LANGUAGE.
      ENDIF.
      DESCRIBE TABLE U LINES I.
      CASE I.
        WHEN 0.
        WHEN OTHERS.
          MOVE '????TEXT' TO S-TXT.
          APPEND S.
          LOOP AT U.
            MOVE U-TXT TO S-TXT.
            APPEND S.
            DELETE U.
          ENDLOOP.
      ENDCASE.
    /    Retrieve Attributes from TRDIR and add to table S           */
    /    Change language to logged on language                       */
      MOVE '????ATTR' TO S-TXT.
      APPEND S.
      SELECT SINGLE * FROM TRDIR
             WHERE NAME EQ R-NAME.
      MOVE SY-LANGU TO TRDIR-RLOAD.
      MOVE-CORRESPONDING TRDIR TO DIR.
      MOVE DIR TO S-TXT.
      APPEND S.
    ENDFORM.
    /             retrieve CUA stuff and append to table S.          */
    FORM UNLOAD_CUA.
      MOVE R-NAME TO EU_KEY-NAME.          "Program name for CUA
      MOVE 'D' TO EU_KEY-SPRSL.            "CUA seems to want D as lang
    MOVE R-LANGUAGE TO EU_KEY-SPRSL.     "Language              "rel 2.2
    IMPORT STA FUN MEN MTX ACT BUT PFK SET LAST INC STX DOC    "rel 2.2
      IMPORT STA STX FUN MEN MTX ACT BUT PFK SET LAST INC DOC     "rel 3.0
             ATT FDN MDN SYM FIN           "rel 3.0
              FROM DATABASE EUDB(CU) ID EU_KEY.
      IF SY-SUBRC NE 0.                    "No statuses
        EXIT.
      ENDIF.
    read titles in logged on language. If not present use
    language from TRDIR.
      CASE REL3.
        WHEN SPACE.                        "(rel 4)
          SELECT * FROM RSMPTEXTS WHERE PROGNAME EQ R-NAME
                            AND SPRSL = SY-LANGU.
            MOVE-CORRESPONDING RSMPTEXTS TO FTX.
            APPEND FTX.
          ENDSELECT.
          IF SY-SUBRC NE 0.
            SELECT * FROM RSMPTEXTS WHERE PROGNAME EQ R-NAME
                              AND SPRSL = R-LANGUAGE.
              MOVE-CORRESPONDING RSMPTEXTS TO FTX.
              APPEND FTX.
            ENDSELECT.
          ENDIF.
          DESCRIBE TABLE FTX LINES I.
          IF   I > 0.
            MOVE '????FTXT' TO S-TXT.
            APPEND S.
            LOOP AT FTX.
              MOVE FTX TO S-TXT.
              APPEND S.
            ENDLOOP.
          ENDIF.
        WHEN OTHERS.
          SELECT * FROM TITLE WHERE PROGNAME   EQ R-NAME
                              AND   DDLANGUAGE EQ SY-LANGU.
            MOVE-CORRESPONDING TITLE TO TIT.
            APPEND TIT.
          ENDSELECT.
          IF SY-SUBRC NE 0.
            SELECT * FROM TITLE WHERE PROGNAME   EQ R-NAME
                                AND   DDLANGUAGE EQ R-LANGUAGE.
              MOVE-CORRESPONDING TITLE TO TIT.
              APPEND TIT.
            ENDSELECT.
          ENDIF.
      ENDCASE.
      DESCRIBE TABLE STA LINES I.
      IF   I > 0.
        MOVE '????STAT' TO S-TXT.
        APPEND S.
        LOOP AT STA.
          MOVE STA TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE FUN LINES I.
      IF   I > 0.
        MOVE '????FUNC' TO S-TXT.
        APPEND S.
        LOOP AT FUN.
          MOVE FUN TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE MEN LINES I.
      IF   I > 0.
        MOVE '????MEN1' TO S-TXT.
        APPEND S.
        LOOP AT MEN.
          MOVE MEN TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE MTX LINES I.
      IF   I > 0.
        MOVE '????MTX1' TO S-TXT.
        APPEND S.
        LOOP AT MTX.
          MOVE MTX TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE ACT LINES I.
      IF   I > 0.
        MOVE '????ACTN' TO S-TXT.
        APPEND S.
        LOOP AT ACT.
          MOVE ACT TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE BUT LINES I.
      IF   I > 0.
        MOVE '????BUTN' TO S-TXT.
        APPEND S.
        LOOP AT BUT.
          MOVE BUT TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE PFK LINES I.
      IF   I > 0.
        MOVE '????PFKY' TO S-TXT.
        APPEND S.
        LOOP AT PFK.
          MOVE PFK TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE SET LINES I.
      IF   I > 0.
        MOVE '????SETS' TO S-TXT.
        APPEND S.
        LOOP AT SET.
          MOVE SET TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      IF LAST NE SPACE.
        MOVE '????LIST' TO S-TXT.
        APPEND S.
        MOVE LAST TO S-TXT.
        APPEND S.
      ENDIF.
      DESCRIBE TABLE INC LINES I.
      IF   I > 0.
        MOVE '????INCL' TO S-TXT.
        APPEND S.
        LOOP AT INC.
          MOVE INC TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE STX LINES I.
      IF   I > 0.
        MOVE '????STXT' TO S-TXT.
        APPEND S.
        LOOP AT STX.
          MOVE STX TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE DOC LINES I.
      IF   I > 0.
        MOVE '????DOCN' TO S-TXT.
        APPEND S.
        LOOP AT DOC.
          MOVE DOC TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE TIT LINES I.
      IF   I > 0.
        MOVE '????TITL' TO S-TXT.
        APPEND S.
        LOOP AT TIT.
          MOVE TIT TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
    Next 5 tables are rel 3.0 specific  (ATT, FDN, MDN, SYM, FIN)
      DESCRIBE TABLE ATT LINES I.
      IF   I > 0.
        MOVE '????VATT' TO S-TXT.
        APPEND S.
        LOOP AT ATT.
          MOVE ATT TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE FDN LINES I.
      IF   I > 0.
        MOVE '????VFDN' TO S-TXT.
        APPEND S.
        LOOP AT FDN.
          MOVE FDN TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE MDN LINES I.
      IF   I > 0.
        MOVE '????VMDN' TO S-TXT.
        APPEND S.
        LOOP AT MDN.
          MOVE MDN TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE SYM LINES I.
      IF   I > 0.
        MOVE '????VSYM' TO S-TXT.
        APPEND S.
        LOOP AT SYM.
          MOVE SYM TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE FIN LINES I.
      IF   I > 0.
        MOVE '????VFIN' TO S-TXT.
        APPEND S.
        LOOP AT FIN.
          MOVE FIN TO S-TXT.
          APPEND S.
        ENDLOOP.
      ENDIF.
    ENDFORM.
    /

  • With header line & with out header line ?

    what is difference between with header line & without header line ?

    When you create an internal table object you can also declare a header line with the same name. You can use the header line as a work area when you process the internal table. The ABAP statements that you use with internal tables have short forms that you can use if your internal table has a header line. These statements automatically assume the header line as an implicit work area. The following table shows the statements that you must use for internal tables without a header line, and the equivalent statements that you can use for internal tables with a header line:
    Operations without header line
    Operations with header line
    Operations for all Table Types
    INSERT <wa> INTO TABLE <itab>.
    INSERT TABLE ITAB.
    COLLECT <wa> INTO <itab>.
    COLLECT <itab>.
    READ TABLE <itab> ... INTO <wa>.
    READ TABLE <itab> ...
    MODIFY TABLE <itab> FROM <wa> ...
    MODIFY TABLE <itab> ...
    MODIFY <itab> FROM <wa> ...WHERE ...
    MODIFY <itab> ... WHERE ...
    DELETE TABLE <itab> FROM <wa>.
    DELETE TABLE <itab>.
    LOOP AT ITAB INTO <wa> ...
    LOOP AT ITAB ...
    Operations for Index Tables
    APPEND <wa> TO <itab>.
    APPEND <itab>.
    INSERT <wa> INTO <itab> ...
    INSERT <itab> ...
    MODIFY <itab> FROM <wa> ...
    MODIFY <itab> ...
    Using the header line as a work area means that you can use shorter statements; however, they are not necessarily easier to understand, since you cannot immediately recognize the origin and target of the assignment. Furthermore, the fact that the table and its header line have the same name can cause confusion in operations with entire internal tables. To avoid confusion, you should use internal tables with differently-named work areas.
    The following example shows two programs with the same function. One uses a header line, the other does not.
    With header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1
    WITH HEADER LINE.
    DO 4 TIMES.
    ITAB-COL1 = SY-INDEX.
    ITAB-COL2 = SY-INDEX ** 2.
    INSERT TABLE ITAB.
    ENDDO.
    ITAB-COL1 = 2.
    READ TABLE ITAB FROM ITAB.
    ITAB-COL2 = 100.
    MODIFY TABLE ITAB.
    ITAB-COL1 = 4.
    DELETE TABLE ITAB.
    LOOP AT ITAB.
    WRITE: / ITAB-COL1, ITAB-COL2.
    ENDLOOP.
    Without header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1,
    WA LIKE LINE OF ITAB.
    DO 4 TIMES.
    WA-COL1 = SY-INDEX.
    WA-COL2 = SY-INDEX ** 2.
    INSERT WA INTO TABLE ITAB.
    ENDDO.
    WA-COL1 = 2.
    READ TABLE ITAB FROM WA INTO WA.
    WA-COL2 = 100.
    MODIFY TABLE ITAB FROM WA.
    WA-COL1 = 4.
    DELETE TABLE ITAB FROM WA.
    LOOP AT ITAB INTO WA.
    WRITE: / WA-COL1, WA-COL2.
    ENDLOOP.
    The list, in both cases, appears as follows:
    1 1
    2 100
    3 9
    The statements in the program that does not use a header line are easier to understand. As a further measure, you could have a further work area just to specify the key of the internal table, but to which no other values from the table are assigned.
    Internal table with header line
    you can use anywhere except obkect oriented concept.
    Internal table without header line :
    You should use in Object oriented concept..
    Always try to use without header line,performance point of view it is best..
    Example :
    Without header line.
    Structure
    types : begin of ty_itab ,
    matnr type mara-matnr,
    end of ty_itab.
    Internal table
    data i_itab type standard table of ty_itab .
    Work area
    data wa_itab like line of i_itab
    With header line
    data : begin of i_itab occurs 0,
    matnr like mara-matnr,
    end of i_itab
    itab with header lines are obsolete, anyway it will work but not recommended. instead use work area or more effiecient is field symbols. so donot use itab with header line.
    i will explain use of itab w/o header line.
    Data: itab1 type standard table of mara with header line occurs 0,
            itab2 type standard table of mara,
            wa_itab2 type mara.
    loop at itab1.
    "This will work fine.
    endloop.
    loop at itab2.
    "This will give erro that itabd does not hav workarea
    endloop.
    "so write
    loop at itab2 into wa_itab2.
    "This will work
    endloop.
    <b>The difference between
    whih header line and with out heater line of internal table.
    ex:-
    a) Data : itab like mara occurs 0 with header line.
    b) Data: itab like mara occurs 0.
    -While adding or retrieving records to / from internal table we have to keep the record temporarily.
    -The area where this record is kept is called as work area for the internal table.
    -The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    -Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    a) Data : itab like mara occurs 0 with header line.
    table is with header line
    b) Data: itab like mara occurs 0.
    table is without header line</b>
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • ALV Reports using Abap Objects ?

    <b>Hi All,
    I am trying to print the values in my internal table using ALV, using ABAP classes and objects. Here i am able to get the total succesfully. but i need to get subtotals also, like based on the carrid in table sflight i need subtotal of price for every carrid like 'LH' , 'SQ'.
    here is my code:</b>
    REPORT znav_report.
    DATA: alv TYPE REF TO cl_salv_table,
    value1 TYPE REF TO cl_salv_aggregations,
    value2 TYPE REF TO cl_salv_aggregation.
    DATA: BEGIN OF itab_flight OCCURS 0,
    carrid LIKE sflight-carrid,
    connid LIKE sflight-connid,
    fldate LIKE sflight-fldate,
    price LIKE sflight-price,
    paymentsum LIKE sflight-paymentsum,
    currency LIKE sflight-currency,
    END OF itab_flight.
    SELECT carrid
    connid
    fldate
    price
    paymentsum
    currency
    FROM sflight INTO TABLE itab_flight
    WHERE carrid = 'LH' OR carrid = 'SQ'.
    cl_salv_table=>factory( IMPORTING r_salv_table = alv
    CHANGING t_table = itab_flight[] ).
    CALL METHOD alv->get_aggregations
    RECEIVING
    value = value1.
    CALL METHOD value1->add_aggregation
    EXPORTING
    columnname = 'PAYMENTSUM'
    aggregation = if_salv_c_aggregation=>total
    RECEIVING
    value = value2.
    alv->display( ).
    <b>here how to get subtotals for every different carrid.
    regards,
    Navneeth.K</b>

    Hi,
    Make use of one of these statement,,,,
    <b>Either</b>
    <b>(a)</b>  select carrid connid fldate price currency planetype into table itab_flight from sflight.
    <b>or</b>
    <b>(b)</b>  select * into corresponding fields of table itab_flight from sflight.
    <b>(a)</b> is better in performace than<b> (b)</b>
    <b>But before that, please note some performance related issues with OO Context...</b>
    1. When defining an Internal table, avoid occurs specification, It is Obsolete,Make use of Initial Size n.
    2. Declare Workarea separately,since Internal table defined along with header line is Obsolete in OO Context.Its better and more robust to fill the itab and fetch the values from itab using a separate Workarea rather than the header line... So avoid header lines...
    3. When defining an internal table, follow this way ....
          Define a Linetype (Field String) using the TYPES Statement
          TYPES: begin of ty_line,
                      f1 type i,
                      f2 type i,
                      end of ty_line.
          Then define a Table type using TYPES Statement...
         TYPES: ty_lines type standard table of ty_line with default key.   
      "there is differnnce between line and lines..... make it clear..."
        Then after, define the internal table and its work area using DATA statement... as shown below..
    DATA: i_lines type ty_lines,
              wa_lines like line of i_lines
    <b>This is the standard way of defining the internal table under OO Context.,,..
    Your definition is creating a default header line....that should be avoided...</b>
    Thanks for ur patience,
    Regards..
    Mohammed Anwar..

  • Module Pool Programming using Abap Objects

    Hi gurus.,
    I need to create a module pool program with tabstrips and tablecontrols using Abap objects...plz guide me how i can achieve this... i am very much confused.. i dont know how and where to start .. plz send me documents and sample codes related to this topic..Also hoe i can implement f4 help in screen fields.. plz help me with Sample Code....
    Regards.,
    S.Sivakumar

    Hi Marcelo Ramos.,
         here is my code without using WebLOg ..
    PROGRAM  ZACR018_BOXKOD                          .
           TABLES DECLARATION
    TABLES: ZACT02_BOXKOD, ZACS018_STR, MARA.
    CONTROLS TABC TYPE TABLEVIEW USING SCREEN 102.
           END OF TABLES DECLARATION
    DEFINE DYN_DECLARE_CREATE.
    DATA: &1 TYPE REF TO &2.
    CREATE OBJECT &1.
    END-OF-DEFINITION.
    CONSTANTS C_WERKS TYPE WERKS_D VALUE '7600'.
    CONSTANTS C_REPID TYPE SY-REPID VALUE SY-REPID.
    CONSTANTS C_VERID TYPE VERID VALUE '0001'.
    CONSTANTS C_MDV01 TYPE MDV01 VALUE 'F3LB02'.
    CLASS CL_TABLE_CONTROL DEFINITION.
    PUBLIC SECTION.
    CLASS-DATA: IT_C_DISPLAY TYPE STANDARD TABLE OF ZACS018_STR.
    CLASS-DATA: WA_DISPLAY TYPE ZACS018_STR.
    CLASS-DATA: WA_COLS LIKE LINE OF TABC-COLS.
    CLASS-METHODS M1 IMPORTING WA_C_DISPLAY TYPE ZACS018_STR EXPORTING ZACS018_STR_C TYPE ZACS018_STR.
    CLASS-METHODS M2 IMPORTING ZACS018_STR_C TYPE ZACS018_STR CHANGING  IT_C_DISPLAY LIKE IT_C_DISPLAY.
    CLASS-METHODS M3 IMPORTING SAVE_OK TYPE SY-UCOMM CHANGING C_TABC TYPE CX_TABLEVIEW.
    CLASS-METHODS M4 IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
                               PATTERNSLNO    TYPE ZACT02_BOXKOD-PATTERNSLNO
                               SAVE_OK TYPE SY-UCOMM
                               CHANGING C_TABC TYPE CX_TABLEVIEW.
    ENDCLASS.
    CLASS CL_TABLE_CONTROL IMPLEMENTATION.
    METHOD M1.
    ZACS018_STR_C = WA_C_DISPLAY.
    ENDMETHOD.
    METHOD M2.
    DESCRIBE TABLE IT_C_DISPLAY.
    IF TABC-CURRENT_LINE > SY-TFILL.
        APPEND ZACS018_STR_C TO IT_C_DISPLAY.
    ELSE.
        MODIFY IT_C_DISPLAY FROM ZACS018_STR_C INDEX TABC-CURRENT_LINE.
    ENDIF.
    ENDMETHOD.
    METHOD M3.
    IF SAVE_OK = 'CHECK'.
    LOOP AT C_TABC-COLS INTO WA_COLS.
    IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
    WA_COLS-SCREEN-INPUT = 0.
    MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT C_TABC-COLS INTO WA_COLS.
    IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
    WA_COLS-SCREEN-INPUT = 1.
    MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDMETHOD.
    METHOD M4.
    IF MASTER_PATTERN IS INITIAL OR PATTERNSLNO  IS INITIAL.
    LOOP AT C_TABC-COLS INTO WA_COLS.
    IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
    WA_COLS-SCREEN-INPUT = 0.
    MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
    ENDIF.
    ENDLOOP.
    ELSE.
    IF SAVE_OK NE 'CHECK'.
    LOOP AT C_TABC-COLS INTO WA_COLS.
    IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
    WA_COLS-SCREEN-INPUT = 1.
    MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    ENDCLASS.
    INTERFACE I_DATA.
    DATA: WA_MARA TYPE MARA.
    DATA: WA_MARC TYPE MARC.
    DATA: WA_MAST TYPE MAST.
    DATA: WA_STKO TYPE STKO.
    DATA: WA_MKAL TYPE MKAL.
    DATA: IT_STPOX TYPE STANDARD TABLE OF STPOX.
    DATA: WA_STPOX TYPE STPOX.
    DATA: WA_ZACT02_BOXKOD TYPE ZACT02_BOXKOD.
    DATA: IT_C_DISPLAY TYPE STANDARD TABLE OF ZACS018_STR.
    DATA: IT_SORT_DISPLAY TYPE STANDARD TABLE OF ZACS018_STR.
    DATA: WA_DISPLAY TYPE ZACS018_STR.
    DATA: W_YIELD(5)  TYPE P DECIMALS 2.
    METHODS PARTNO_VAL IMPORTING PARTCODE TYPE ZACS018_STR-PARTCODE.
    METHODS MAINBI_VAL IMPORTING MAINB    TYPE ZACS018_STR-MAINB.
    METHODS CAVITY_VAL IMPORTING CAVITY   TYPE ZACS018_STR-CAVITY.
    METHODS GET_COMP_WT IMPORTING PARTCODE TYPE ZACS018_STR-PARTCODE EXPORTING GROSSWT TYPE ZACS018_STR-GROSSWT.
    METHODS NETWT_VAL IMPORTING NETWT TYPE ZACS018_STR-NETWT GROSSWT TYPE ZACS018_STR-GROSSWT.
    METHODS MASPAT_VAL IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN.
    METHODS PATSLNO_VAL IMPORTING PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
                                  MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN .
    METHODS MAX_REF EXPORTING VERSNO TYPE ZACT02_BOXKOD-VERSNO.
    METHODS NOOFBOX_VAL IMPORTING BMSCH TYPE ZACT02_BOXKOD-BMSCH.
    METHODS TOTTIME_VAL IMPORTING VGW01 TYPE ZACT02_BOXKOD-VGW01.
    METHODS TOTRUNWT IMPORTING IT_C_DISPLAY LIKE IT_C_DISPLAY
                     EXPORTING W_SUM_RUNWT LIKE ZACS018_STR-NETWT.
    METHODS TOTCOMP_WT  IMPORTING IT_C_DISPLAY LIKE IT_C_DISPLAY
                        EXPORTING W_SUM_COMPWT LIKE ZACS018_STR-NETWT.
    METHODS CHECK_OK IMPORTING SAVE_OK TYPE SY-UCOMM.
    METHODS SCREEN_DISPLAY IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
                                     PATTERNSLNO    TYPE ZACT02_BOXKOD-PATTERNSLNO
                                     SAVE_OK TYPE SY-UCOMM.
    METHODS DUP_CHECK IMPORTING IT_C_DISPLAY LIKE IT_C_DISPLAY.
    METHODS BOX_YLD IMPORTING W_SUM_COMPWT LIKE ZACS018_STR-NETWT
                              W_TOT_WT LIKE ZACS018_STR-NETWT
                    EXPORTING W_YIELD LIKE W_YIELD.
    ENDINTERFACE.
    CLASS CL_CONTROL_EVENTS DEFINITION.
    PUBLIC SECTION.
    CLASS-DATA: C_WERKS TYPE WERKS_D VALUE C_WERKS.
    INTERFACES I_DATA.
    ENDCLASS.
    CLASS CL_CONTROL_EVENTS IMPLEMENTATION.
    METHOD I_DATA~PARTNO_VAL.
    SELECT SINGLE * FROM MARA INTO I_DATA~WA_MARA WHERE MATNR = PARTCODE.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-001 TYPE 'E'.
    ELSE.
    IF I_DATA~WA_MARA-MTART NE 'HALB'.
    MESSAGE TEXT-002 TYPE 'E'.
    ENDIF.
    SELECT SINGLE * FROM MARC INTO I_DATA~WA_MARC WHERE MATNR = PARTCODE AND
                                                 WERKS = C_WERKS.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-003 TYPE 'E'.
    ELSE.
    IF I_DATA~WA_MARC-FEVOR NE 'KOD'.
    MESSAGE TEXT-004 TYPE 'E'.
    ENDIF.
    ENDIF.
    ENDIF.
    SELECT SINGLE * FROM MKAL INTO I_DATA~WA_MKAL WHERE MATNR = PARTCODE AND
                                           WERKS = C_WERKS  AND
                                           VERID = C_VERID  AND
                                           MDV01 = C_MDV01.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-028 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~CAVITY_VAL.
    SET CURSOR FIELD 'ZACS018_STR-CAVITY' LINE SY-STEPL.
    IF CAVITY IS INITIAL.
    MESSAGE TEXT-005 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~MAINBI_VAL.
    SET CURSOR FIELD 'ZACS018_STR-MAINB' LINE SY-STEPL.
    IF MAINB IS INITIAL.
    MESSAGE TEXT-006 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~GET_COMP_WT.
    SET CURSOR FIELD 'ZACS018_STR-PARTCODE' LINE SY-STEPL.
    *SELECT SINGLE MAST~MATNR
                MAST~WERKS
                MAST~STLAL
                STKO~DATUV
                INTO (I_DATAWA_MAST-MATNR,I_DATAWA_MAST-WERKS,I_DATAWA_MAST-STLAL,I_DATAWA_STKO-DATUV)
                FROM MAST AS MAST INNER JOIN STKO AS STKO
                ON STKOSTLNR = MASTSTLNR AND STKOSTLAL = MASTSTLAL
                WHERE  MAST~MATNR = PARTCODE AND
                       STKO~STLST = '1' AND
                       STKO~STLTY = 'M' AND
                       STKO~LKENZ  = '' AND
                       STKO~LOEKZ  = ''.
    SELECT SINGLE * FROM MAST INTO I_DATA~WA_MAST WHERE MATNR = PARTCODE AND
                                                        STLAN = '1' AND
                                                        STLAL = '01' AND
                                                        WERKS = C_WERKS.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-009 TYPE 'E'.
    ENDIF.
    *CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      PERCENTAGE       = 50
      TEXT             = TEXT-007.
    *WAIT UP TO 2 SECONDS.
    REFRESH I_DATA~IT_STPOX.
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
      FTREL                       = 'X'
      ALEKZ                       = ' '
      ALTVO                       = ' '
      AUFSW                       = ' '
      AUMGB                       = ' '
      AUMNG                       = 0
      AUSKZ                       = 'X'
      AMIND                       = ' '
      BAGRP                       = ' '
      BEIKZ                       = ' '
      BESSL                       = ' '
      BGIXO                       = 'X'
      BREMS                       = 'X'
       CAPID                       = 'PP01'
      CHLST                       = ' '
      COSPR                       = ' '
      CUOBJ                       = 000000000000000
      CUOVS                       = 0
      CUOLS                       = ' '
       DATUV                       = SY-DATUM
      DELNL                       = SPACE
      DRLDT                       = ' '
      EHNDL                       = '1'
      EMENG                       = 0
      ERSKZ                       = ' '
      ERSSL                       = ' '
      FBSTP                       = ' '
      KNFBA                       = ' '
      KSBVO                       = ' '
      MBWLS                       = ' '
      MKTLS                       = 'X'
      MDMPS                       = ' '
       MEHRS                       = ' '
      MKMAT                       = ' '
      MMAPS                       = ' '
      SALWW                       = ' '
      SPLWW                       = ' '
       MMORY                       = '0'
       MTNRV                       = PARTCODE
      NLINK                       = ' '
      POSTP                       = ' '
      RNDKZ                       = ' '
      RVREL                       = ' '
      SANFR                       = ' '
      SANIN                       = ' '
      SANKA                       = ' '
      SANKO                       = ' '
      SANVS                       = ' '
      SCHGT                       = ' '
      STKKZ                       = ' '
       STLAL                       = '01'
       STLAN                       = '1'
      STPST                       = 0
      SVWVO                       = 'X'
       WERKS                       = C_WERKS
      NORVL                       = ' '
      MDNOT                       = ' '
      PANOT                       = ' '
      QVERW                       = ' '
      VERID                       = ' '
      VRSVO                       = 'X'
    IMPORTING
      TOPMAT                      =
      DSTST                       =
      TABLES
        STB                         = I_DATA~IT_STPOX
      MATCAT                      =
    EXCEPTIONS
       ALT_NOT_FOUND               = 1
       CALL_INVALID                = 2
       MATERIAL_NOT_FOUND          = 3
       MISSING_AUTHORIZATION       = 4
       NO_BOM_FOUND                = 5
       NO_PLANT_DATA               = 6
       NO_SUITABLE_BOM_FOUND       = 7
       CONVERSION_ERROR            = 8
       OTHERS                      = 9
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT I_DATA~IT_STPOX INTO I_DATA~WA_STPOX.
    SELECT SINGLE FEVOR FROM MARC INTO I_DATA~WA_MARC-FEVOR WHERE MATNR = I_DATA~WA_STPOX-IDNRK AND
                                                           WERKS = I_DATA~WA_STPOX-WERKS AND
                                                           FEVOR = 'MLT'.
    IF SY-SUBRC EQ 0.
    GROSSWT = I_DATA~WA_STPOX-MNGLG.
    EXIT.
    ELSE.
    CLEAR GROSSWT.
    ENDIF.
    ENDLOOP.
    IF GROSSWT IS INITIAL.
    MESSAGE TEXT-008 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~NETWT_VAL.
    SET CURSOR FIELD 'ZACS018_STR-NETWT' LINE SY-STEPL.
    IF NETWT IS INITIAL.
    MESSAGE TEXT-010 TYPE 'E'.
    ELSE.
    IF NETWT >= GROSSWT.
    MESSAGE TEXT-011 TYPE 'E'.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~MASPAT_VAL.
    IF MASTER_PATTERN IS INITIAL.
    MESSAGE TEXT-014 TYPE 'E'.
    ENDIF.
    SELECT SINGLE * FROM MARA INTO I_DATA~WA_MARA WHERE MATNR = MASTER_PATTERN.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-001 TYPE 'E'.
    ELSE.
    IF I_DATA~WA_MARA-MTART NE 'FHMI'.
    MESSAGE TEXT-012 TYPE 'E'.
    ENDIF.
    SELECT SINGLE * FROM MARC INTO I_DATA~WA_MARC WHERE MATNR = MASTER_PATTERN AND
                                                 WERKS = C_WERKS.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-003 TYPE 'E'.
    ELSE.
    IF I_DATA~WA_MARC-FEVOR NE 'MLD'.
    MESSAGE TEXT-013 TYPE 'E'.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~PATSLNO_VAL.
    IF PATTERNSLNO IS INITIAL.
    MESSAGE TEXT-016 TYPE 'E'.
    ENDIF.
    SELECT SINGLE * FROM ZACT02_BOXKOD INTO I_DATA~WA_ZACT02_BOXKOD WHERE MASTER_PATTERN = MASTER_PATTERN
                                                               AND PATTERNSLNO    = PATTERNSLNO.
    IF SY-SUBRC EQ 0.
    MESSAGE TEXT-015 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~MAX_REF.
    SELECT SINGLE MAX( VERSNO ) FROM ZACT02_BOXKOD INTO VERSNO.
    VERSNO = VERSNO + 1.
    ENDMETHOD.
    METHOD I_DATA~NOOFBOX_VAL.
    IF BMSCH IS INITIAL.
    LOOP AT SCREEN.
    IF SCREEN-GROUP2 = 'BOT' AND SCREEN-NAME <> 'ZACT02_BOXKOD-PRD_ACT' AND SCREEN-NAME <> 'ZACT02_BOXKOD-SHOTS'.
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    MESSAGE TEXT-017 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~TOTTIME_VAL.
    IF VGW01 IS INITIAL.
    MESSAGE TEXT-018 TYPE 'E'.
    ENDIF.
    IF VGW01 > 480.
    MESSAGE TEXT-019 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~TOTRUNWT.
    CLEAR W_SUM_RUNWT.
    LOOP AT IT_C_DISPLAY INTO I_DATA~WA_DISPLAY.
    W_SUM_RUNWT = W_SUM_RUNWT + I_DATA~WA_DISPLAY-NETWT * I_DATA~WA_DISPLAY-CAVITY.
    ENDLOOP.
    ENDMETHOD.
    METHOD I_DATA~TOTCOMP_WT.
    CLEAR W_SUM_COMPWT.
    LOOP AT IT_C_DISPLAY INTO I_DATA~WA_DISPLAY.
    W_SUM_COMPWT = W_SUM_COMPWT + I_DATA~WA_DISPLAY-GROSSWT * I_DATA~WA_DISPLAY-CAVITY.
    ENDLOOP.
    ENDMETHOD.
    METHOD I_DATA~CHECK_OK.
    IF SAVE_OK = 'CHECK'.
    LOOP AT SCREEN.
    IF SCREEN-GROUP2 = 'BOT'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
    IF SCREEN-GROUP2 = 'BOT'.
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~SCREEN_DISPLAY.
    IF MASTER_PATTERN IS INITIAL
    OR PATTERNSLNO IS INITIAL.
    LOOP AT SCREEN.
    IF SCREEN-GROUP2 = 'BOT'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    IF SAVE_OK NE 'CHECK'.
    LOOP AT SCREEN.
    IF SCREEN-GROUP2 = 'BOT'.
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    METHOD I_DATA~DUP_CHECK. " IMPORTING IT_C_DISPLAY
    DATA: W_PARTCODE LIKE I_DATA~WA_DISPLAY-PARTCODE.
    I_DATA~IT_SORT_DISPLAY = IT_C_DISPLAY.
    SORT I_DATA~IT_SORT_DISPLAY BY PARTCODE.
    CLEAR W_PARTCODE.
    LOOP AT I_DATA~IT_SORT_DISPLAY INTO I_DATA~WA_DISPLAY.
    IF W_PARTCODE = I_DATA~WA_DISPLAY-PARTCODE.
    MESSAGE TEXT-027 TYPE 'E'.
    ENDIF.
    W_PARTCODE = I_DATA~WA_DISPLAY-PARTCODE.
    ENDLOOP.
    ENDMETHOD.
    METHOD I_DATA~BOX_YLD.
    W_YIELD = ( W_SUM_COMPWT / W_TOT_WT ) * 100.
    ENDMETHOD.
    ENDCLASS.
    inherited class for edit mode
    CLASS CL_CONTROL_EDIT DEFINITION INHERITING FROM CL_CONTROL_EVENTS .
    PUBLIC SECTION.
    METHODS GET_DATA IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
                                  PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
                     EXPORTING        VERSNO  TYPE ZACT02_BOXKOD-VERSNO
                                  CHANGING ZACT02_BOXKOD TYPE ZACT02_BOXKOD
                                           IT_C_DISPLAY  LIKE I_DATA~IT_C_DISPLAY
                                           IT_DEL_DISPLAY LIKE I_DATA~IT_C_DISPLAY
                                           TABC TYPE CX_TABLEVIEW.
    METHODS PATSLNO_VAL_CHG IMPORTING PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
                                  MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN .
    ENDCLASS.
    CLASS CL_CONTROL_EDIT IMPLEMENTATION.
    METHOD GET_DATA.
    IF MASTER_PATTERN IS NOT INITIAL AND PATTERNSLNO IS NOT INITIAL.
    IF IT_C_DISPLAY IS INITIAL.
    IF IT_DEL_DISPLAY IS INITIAL.
    SELECT SINGLE MAX( VERSNO ) FROM ZACT02_BOXKOD INTO VERSNO WHERE
                                     MASTER_PATTERN = MASTER_PATTERN AND
                                     PATTERNSLNO    = PATTERNSLNO.
    SELECT SINGLE * FROM ZACT02_BOXKOD INTO ZACT02_BOXKOD WHERE
       MASTER_PATTERN = MASTER_PATTERN AND
       PATTERNSLNO    = PATTERNSLNO    AND
       VERSNO         = VERSNO..
    SELECT PARTCODE MAINB CAVITY GROSSWT NETWT FROM ZACT02_BOXKOD INTO
                    CORRESPONDING FIELDS OF TABLE IT_C_DISPLAY WHERE
                    MASTER_PATTERN = MASTER_PATTERN AND
                    PATTERNSLNO    = PATTERNSLNO    AND
                    VERSNO         = VERSNO.
    IT_DEL_DISPLAY[] = IT_C_DISPLAY[].
    DESCRIBE TABLE IT_C_DISPLAY.
    TABC-LINES = SY-TFILL.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    METHOD PATSLNO_VAL_CHG.
    SELECT SINGLE * FROM ZACT02_BOXKOD INTO I_DATA~WA_ZACT02_BOXKOD WHERE MASTER_PATTERN = MASTER_PATTERN
                                                               AND PATTERNSLNO    = PATTERNSLNO.
    IF PATTERNSLNO IS INITIAL.
    MESSAGE TEXT-016 TYPE 'E'.
    ENDIF.
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-022 TYPE 'E'.
    ENDIF.
    ENDMETHOD.
    ENDCLASS.
    inheriting for display
    CLASS CL_CONTROL_DISPLAY DEFINITION INHERITING FROM CL_CONTROL_EDIT .
    PUBLIC SECTION.
    METHODS GET_DISPLAY_DATA IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
                                       PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
                                       VERSNO TYPE ZACT02_BOXKOD-VERSNO
                              CHANGING IT_C_DISPLAY LIKE I_DATA~IT_C_DISPLAY
                                       ZACT02_BOXKOD TYPE ZACT02_BOXKOD
                                       TABC TYPE CX_TABLEVIEW.
    ENDCLASS.
    CLASS CL_CONTROL_DISPLAY IMPLEMENTATION.
    METHOD GET_DISPLAY_DATA.
    SELECT SINGLE * FROM ZACT02_BOXKOD INTO ZACT02_BOXKOD WHERE
       MASTER_PATTERN = MASTER_PATTERN AND
       PATTERNSLNO    = PATTERNSLNO    AND
       VERSNO         = VERSNO..
    IF SY-SUBRC <> 0.
    MESSAGE TEXT-026 TYPE 'E'.
    ENDIF.
    SELECT PARTCODE MAINB CAVITY GROSSWT NETWT FROM ZACT02_BOXKOD INTO
                    CORRESPONDING FIELDS OF TABLE IT_C_DISPLAY WHERE
                    MASTER_PATTERN = MASTER_PATTERN AND
                    PATTERNSLNO    = PATTERNSLNO    AND
                    VERSNO         = VERSNO.
    DESCRIBE TABLE IT_C_DISPLAY.
    TABC-LINES = SY-TFILL.
    ENDMETHOD.
    ENDCLASS.
    DATA: O_CONTROL_EVENTS TYPE REF TO CL_CONTROL_EVENTS.
    DATA: O_CONTROL_EVENTS_EDIT TYPE REF TO CL_CONTROL_EDIT.
    DATA: O_CONTROL_EVENTS_DISPLAY TYPE REF TO CL_CONTROL_DISPLAY.
           SELECTION SCREEN
           END OF SELECTION SCREEN
           VARIABLE DECLARATION         BEGIN WITH W_
    DATA: OK_CODE TYPE SY-UCOMM,
          SAVE_OK TYPE SY-UCOMM.
    DATA: W_TOT_WT LIKE ZACS018_STR-NETWT,
          W_SUM_COMPWT LIKE ZACS018_STR-NETWT,
          W_SUM_RUNWT LIKE ZACS018_STR-NETWT,
          W_YIELD(5)  TYPE P DECIMALS 2.
    DATA: W_TIMLO TYPE SY-TIMLO,
          W_MODE  TYPE SY-UCOMM.
    DATA: W_SCREEN_NO TYPE SY-DYNNR.
           END OF VARIABLE DECLARATION
           WORK AREAS DECLARATION         BEGIN WITH WA_
    DATA: WA_DISPLAY TYPE ZACS018_STR.
           END OF WORK AREAS DECLARATION
           INTERNAL TABLES          BEGIN WITH IT_
    DATA: IT_DISPLAY TYPE ZACS018_STR OCCURS 0.
    DATA: IT_DISPLAY_PRD TYPE ZACS018_STR OCCURS 0.
    DATA: IT_DEL_DISPLAY TYPE ZACS018_STR OCCURS 0.
    DATA: IT_ZACT02_BOXKOD TYPE ZACT02_BOXKOD OCCURS 0 WITH HEADER LINE.
    DATA: IT_ZACT02_BOXKOD_DEL TYPE ZACT02_BOXKOD OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF IT_F4MASTERPAT OCCURS 0,
          MASTER_PATTERN LIKE ZACT02_BOXKOD-MASTER_PATTERN,
          END OF IT_F4MASTERPAT.
    DATA: BEGIN OF IT_F4PATSLNO OCCURS 0,
          MASTER_PATTERN LIKE ZACT02_BOXKOD-MASTER_PATTERN,
          PATTERNSLNO    LIKE ZACT02_BOXKOD-PATTERNSLNO,
          VERSNO         LIKE ZACT02_BOXKOD-VERSNO,
          END OF IT_F4PATSLNO.
    DATA: IT_EXCLUDE TYPE TABLE OF SY-UCOMM..
    DATA : IT_DYNPRO LIKE  DYNPREAD OCCURS 0 WITH HEADER LINE.
           END OF INTERNAL TABLES DECLARATIONS
    LOAD-OF-PROGRAM.
    CREATE OBJECT O_CONTROL_EVENTS.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    SAVE_OK = OK_CODE.
    CLEAR OK_CODE.
    W_MODE = SAVE_OK.
    CASE SAVE_OK.
    WHEN 'CREATE'.
    CALL SCREEN 101.
    WHEN 'CHANGE'.
    CREATE OBJECT O_CONTROL_EVENTS_EDIT.
    CALL SCREEN 101.
    WHEN 'DISPLAY'.
    APPEND 'SAVE'  TO IT_EXCLUDE.
    APPEND 'CHECK' TO IT_EXCLUDE.
    APPEND 'ADD'   TO IT_EXCLUDE.
    CREATE OBJECT O_CONTROL_EVENTS_DISPLAY.
    CALL SCREEN 101.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0102  OUTPUT
          text
    MODULE STATUS_0102 OUTPUT.
    CALL METHOD CL_TABLE_CONTROL=>M3 EXPORTING SAVE_OK = SAVE_OK CHANGING C_TABC = TABC.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~CHECK_OK EXPORTING SAVE_OK = SAVE_OK.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~SCREEN_DISPLAY EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
                                     PATTERNSLNO    = ZACT02_BOXKOD-PATTERNSLNO
                                     SAVE_OK = SAVE_OK.
    CALL METHOD CL_TABLE_CONTROL=>M4 EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
                                               PATTERNSLNO    = ZACT02_BOXKOD-PATTERNSLNO
                                               SAVE_OK        = SAVE_OK
                                               CHANGING C_TABC = TABC.
    DESCRIBE TABLE IT_DISPLAY.
    IF TABC-LINES <= 1.
    IF SY-TFILL = 0.
    TABC-LINES = 1.
    ENDIF.
    ENDIF.
    IF SAVE_OK NE 'CHECK'.
    IF ZACT02_BOXKOD-TOOL_ACT <> 'X'.
    CLEAR ZACT02_BOXKOD-PRD_ACT.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'ZACT02_BOXKOD-PRD_ACT'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'ZACT02_BOXKOD-PRD_ACT'.
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~TOTRUNWT EXPORTING IT_C_DISPLAY = IT_DISPLAY
                                           IMPORTING W_SUM_RUNWT = W_SUM_RUNWT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~TOTCOMP_WT  EXPORTING IT_C_DISPLAY = IT_DISPLAY
                                           IMPORTING W_SUM_COMPWT = W_SUM_COMPWT.
    CLEAR W_TOT_WT.
    W_TOT_WT = W_SUM_RUNWT + W_SUM_COMPWT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~BOX_YLD EXPORTING W_SUM_COMPWT = W_SUM_COMPWT
                                               W_TOT_WT = W_TOT_WT
                                                 IMPORTING W_YIELD = W_YIELD.
    IF W_MODE <> 'CREATE'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'ZACT02_BOXKOD-SHOTS'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF W_MODE = 'DISPLAY'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'ADD' OR SCREEN-NAME = 'ICON_DELETE'.
    SCREEN-INPUT = '0'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDMODULE.                 " STATUS_0102  OUTPUT
    *&      Module  STATUS_0101  OUTPUT
          text
    MODULE STATUS_0101 OUTPUT.
      SET PF-STATUS 'STANDARD' EXCLUDING 'SAVE'.
      IF W_MODE = 'CREATE'.
      SET TITLEBAR  'STANDARD'.
      ELSEIF W_MODE = 'DISPLAY'.
      SET TITLEBAR  'STD_DIS'.
      ELSE.
      SET TITLEBAR 'STD_EDIT'.
      ENDIF.
      IF SAVE_OK = 'CHECK'.
      DESCRIBE TABLE IT_DISPLAY.
      IF SY-TFILL > 0.
      SET PF-STATUS 'STANDARD'.
      ENDIF.
      ENDIF.
      IF W_MODE = 'DISPLAY'.
      SET PF-STATUS 'STANDARD' EXCLUDING IT_EXCLUDE.
      ENDIF.
    IF ZACT02_BOXKOD-MASTER_PATTERN IS NOT INITIAL AND
       ZACT02_BOXKOD-PATTERNSLNO    IS NOT INITIAL.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'TOP'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF W_MODE = 'DISPLAY'.
    IF ZACT02_BOXKOD-VERSNO IS INITIAL.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'ZACT02_BOXKOD-VERSNO'.
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'ZACT02_BOXKOD-VERSNO'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDMODULE.                 " STATUS_0101  OUTPUT
    *&      Module  USER_COMMAND_0102  INPUT
          text
    MODULE USER_COMMAND_0102 INPUT.
    SAVE_OK = OK_CODE.
    CLEAR OK_CODE.
    CASE SAVE_OK.
    WHEN 'ADD'.
    DESCRIBE TABLE IT_DISPLAY.
    IF SY-TFILL >= TABC-LINES.
    IF TABC-LINES < 16.
    TABC-LINES = SY-TFILL + 1.
    ENDIF.
    ENDIF.
    WHEN 'DEL'.
    LOOP AT IT_DISPLAY INTO WA_DISPLAY WHERE MARK = 'X'.
    DELETE IT_DISPLAY INDEX SY-TABIX.
    ENDLOOP.
    DESCRIBE TABLE IT_DISPLAY.
    IF SY-TFILL >= 1.
    TABC-LINES = SY-TFILL.
    ELSE.
    TABC-LINES = 1.
    ENDIF.
    WHEN 'CHECK'.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~DUP_CHECK EXPORTING IT_C_DISPLAY = IT_DISPLAY.
    WHEN 'SAVE'.
    W_TIMLO = SY-TIMLO.
    IF W_MODE = 'CREATE'.
    PERFORM CREATE_SAVE.
    ENDIF.
    IF W_MODE = 'CHANGE'.
    PERFORM EDIT_SAVE.
    ENDIF.
    ENDCASE.
    IF W_MODE = 'DISPLAY'.
    SAVE_OK = 'CHECK'.
    ENDIF.
    ENDMODULE.                 " USER_COMMAND_0102  INPUT
    *&      Module  MOD_TABLE  INPUT
          text
    MODULE MOD_TABLE INPUT.
    CALL METHOD CL_TABLE_CONTROL=>M2 EXPORTING ZACS018_STR_C = ZACS018_STR CHANGING IT_C_DISPLAY = IT_DISPLAY.
    ENDMODULE.                 " MOD_TABLE  INPUT
    *&      Module  ASSIGN  OUTPUT
          text
    MODULE ASSIGN OUTPUT.
    CALL METHOD CL_TABLE_CONTROL=>M1 EXPORTING WA_C_DISPLAY = WA_DISPLAY IMPORTING ZACS018_STR_C = ZACS018_STR.
    ENDMODULE.                 " ASSIGN  OUTPUT
    *&      Module  CHK_PARTCODE  INPUT
          text
    MODULE CHK_PARTCODE INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~PARTNO_VAL EXPORTING PARTCODE = ZACS018_STR-PARTCODE.
    ENDMODULE.                 " CHK_PARTCODE  INPUT
    *&      Module  CHK_CAVITY  INPUT
          text
    MODULE CHK_CAVITY INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~CAVITY_VAL EXPORTING CAVITY = ZACS018_STR-CAVITY.
    ENDMODULE.                 " CHK_CAVITY  INPUT
    *&      Module  CHK_MAINB  INPUT
          text
    MODULE CHK_MAINB INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~MAINBI_VAL EXPORTING MAINB = ZACS018_STR-MAINB.
    ENDMODULE.                 " CHK_MAINB  INPUT
    *&      Module  GET_COMP_WT  INPUT
          text
    MODULE GET_COMP_WT INPUT.
    IF W_MODE <> 'DISPLAY'.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~GET_COMP_WT EXPORTING PARTCODE = ZACS018_STR-PARTCODE
                                              IMPORTING GROSSWT  = ZACS018_STR-GROSSWT.
    ENDIF.
    ENDMODULE.                 " GET_COMP_WT  INPUT
    *&      Module  CHK_NETWT  INPUT
          text
    MODULE CHK_NETWT INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~NETWT_VAL EXPORTING NETWT = ZACS018_STR-NETWT
                                                    GROSSWT = ZACS018_STR-GROSSWT.
    ENDMODULE.                 " CHK_NETWT  INPUT
    *&      Module  CHK_MPAT  INPUT
          text
    MODULE CHK_MPAT INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~MASPAT_VAL EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN.
    ENDMODULE.                 " CHK_MPAT  INPUT
    *&      Module  CHK_SLNO  INPUT
          text
    MODULE CHK_SLNO INPUT.
    IF W_MODE = 'CREATE'.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~PATSLNO_VAL EXPORTING PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
                                  MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN .
    ELSEIF W_MODE = 'CHANGE' .
    CALL METHOD O_CONTROL_EVENTS_EDIT->PATSLNO_VAL_CHG EXPORTING PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
                                  MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN .
    CALL METHOD O_CONTROL_EVENTS_EDIT->GET_DATA EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
                                  PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
                                  IMPORTING VERSNO  = ZACT02_BOXKOD-VERSNO
                                  CHANGING ZACT02_BOXKOD = ZACT02_BOXKOD
                                           IT_C_DISPLAY  =  IT_DISPLAY
                                           IT_DEL_DISPLAY = IT_DEL_DISPLAY
                                           TABC          = TABC.
    ELSE.
    CALL METHOD O_CONTROL_EVENTS_DISPLAY->PATSLNO_VAL_CHG EXPORTING PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
                                  MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN .
    ENDIF.
    ENDMODULE.                 " CHK_SLNO  INPUT
    *&      Module  MAX_VER  INPUT
          text
    MODULE MAX_VER INPUT.
    IF W_MODE = 'CREATE'.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~MAX_REF IMPORTING VERSNO = ZACT02_BOXKOD-VERSNO.
    ENDIF.
    IF W_MODE = 'DISPLAY'.
    IF ZACT02_BOXKOD-VERSNO IS INITIAL.
    MESSAGE TEXT-023 TYPE 'E'.
    ENDIF.
    IF ZACT02_BOXKOD-MASTER_PATTERN IS NOT INITIAL AND
        ZACT02_BOXKOD-PATTERNSLNO IS NOT INITIAL AND
        ZACT02_BOXKOD-VERSNO IS NOT INITIAL.
    CALL METHOD O_CONTROL_EVENTS_DISPLAY->GET_DISPLAY_DATA EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
                                  PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
                                  VERSNO  = ZACT02_BOXKOD-VERSNO
                                  CHANGING ZACT02_BOXKOD = ZACT02_BOXKOD
                                           IT_C_DISPLAY  =  IT_DISPLAY
                                           TABC          = TABC.
    ENDIF.
    ENDIF.
    ENDMODULE.                 " MAX_VER  INPUT
    *&      Module  CHK_NOBOXES  INPUT
          text
    MODULE CHK_NOBOXES INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~NOOFBOX_VAL EXPORTING BMSCH = ZACT02_BOXKOD-BMSCH.
    ENDMODULE.                 " CHK_NOBOXES  INPUT
    *&      Module  CHK_TOTTIME  INPUT
          text
    MODULE CHK_TOTTIME INPUT.
    CALL METHOD O_CONTROL_EVENTS->I_DATA~TOTTIME_VAL EXPORTING VGW01 = ZACT02_BOXKOD-VGW01.
    ENDMODULE.                 " CHK_TOTTIME  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'INITIAL'.
      SET TITLEBAR 'STANDARD_MAIN'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  EXIT_PROGRAM  INPUT
          text
    MODULE EXIT_PROGRAM INPUT.
    LEAVE TO TRANSACTION 'ZAC16'.
    ENDMODULE.                 " EXIT_PROGRAM  INPUT

  • ABAP objects for transfer/update rules - does this apply to include stateme

    I have a question about the new requirement for the code in the update/transfer rules to be written in ABAP Objects standards.  Does this still apply if in your update rules you using include programs?  Does this mean that when we upgrade we will have to follow the ABAP Objects standards (ie no header lines)?

    Routines will method based.
    In addition to what Chetan has sent, check this how to also.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • ABAP Objects and BADI

    HI
    Can anyone give me the link for ABAP Objects and BADI'S.
    I would like to have ABAP Objects with Example as well as BADIS.
    Please tell me as iam new to those.
    Thanks in advance

    Hi,
    ABAP objects have an elaborated list plz mention specific objects u want to know.
    These are few of the links which I got through the sdn.sap for the objects like ALV,LSMW,IDOCS, etc..
    Start with this.Refer this
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Reports
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SAPScripts
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    Debugging Document.
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    List of all BAPIs
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    Remote Function Call:
    RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
    RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
    RFCs manage the communication process, parameter transfer and error handling.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Refer this
    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    http://www.techinterviews.com/?p=198
    http://www.techinterviews.com/?p=326
    http://www.sap-img.com/abap/answers-to-some-abap-interview-questions.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.geekinterview.com/Interview-Questions/SAP-R-3/ABAP
    http://sap.ittoolbox.com/documents/popular-q-and-a/abap-sample-interview-questions-3240
    http://www.sap-img.com/abap/abap-interview-question.htm
    http://www.allinterview.com/Interview-Questions/ABAP.html
    links for OO ABAP.
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com.
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    some more materials.
    Go through the following Documents Links & Materials for ABAP Objects
    check the below links lot of info and examples r there
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/sap.user72/blog/2005/05/10/a-small-tip-for-the-beginners-in-oo-abap
    /people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
    /people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    these links
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/07/09/understandingABAPObjects&
    Please visit the following links:
    http://service.sap.com/erp
    http://solutionbrowser.erp.sap.fmpmedia.com/ (Functional prespective)
    http://service.sap.com/instguides --> mySAP Business Suite Applications --> mySAP ERP --> mySAP ERP 2005 --> Upgrade
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOVC/LOVC.pdf
    For Functionality Differences pls refer to the below site -
    http://solutionbrowser.erp.sap.fmpmedia.com/
    FOR BADI'S:
    Check this blogs 2 find a BADI:
    How to find if we have a BADI in Transaction VB02
    Re: BADI for screen enhancement in MM01  transaction
    Re: BADI and User exits
    How To Define a New BAdI Within the Enhancement Framework (Some Basics About the BAdI,BAdI Commands in ABAP,
    When to Use a BAdI?)
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    How to implement a BAdI And How to Use a Filter
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    Introducing Business Add-Ins
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f3202186-0601-0010-6591-b832b1a0d0de
    How to implement BAdi in Enhancement Framework
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702
    Business Add-Ins
    http://help.sap.com/saphelp_47x200/helpdata/en/ee/a1d548892b11d295d60000e82de14a/frameset.htm
    BAdI: Customer-Defined Functions in the Formula Builder
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    Difference Between BADI and User Exits
    http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
    To Use BADI - Business Add In you need to Understand ABAP OO Interface Concept
    http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
    You can check the links for Step by Step Badi Implemntation
    (very helpful self learning docs).
    BADI Step by Step Implementation.
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/63ee7f486cc143a560799d8803ce29/content.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/srm/badi-general+information&
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    The specified item was not found.
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    http://www.allsaplinks.com/badi.html
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-serieshttps:///people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework /people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    http://www.esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40921dd7-d5cf-2910-1894-bb62316afbd1
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    http://esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    http://esnips.com/doc/365d4c4d-9fcb-4189-85fd-866b7bf25257/customer-exits--badi.zip
    http://esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt
    http://help.sap.com//saphelp_470/helpdata/EN/eb/3e7cee940e11d295df0000e82de14a/frameset.htm
    Difference Between BADI and User Exits
    http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Undesratsnding abap objects

    hi
    can any one provide basic material for underatanding object oriented in abap...with many sample programs(preferably)....u can also provide me links....
    thank you,
    Ginni

    Methods in ABAP Objects - Example
    The following example shows how to declare, implement, and use methods in ABAP Objects.
    Overview
    This example uses three classes called C_TEAM, C_BIKER, and C_BICYCLE. A user (a program) can create objects of the class C_TEAM. On a selection screen, the class C_TEAM asks for the number of members of each team.
    Each object in the class C_TEAM can create as many instances of the class C_BIKER as there are members in the team. Each instance of the class C_BIKER creates an instances of the class C_BICYCLE.
    Each instance of the class C_TEAM can communicate with the program user through an interactive list. The program user can choose individual team members for actions. The instances of the class C_BIKER allow the program user to choose the action on a further selection screen.
    Constraints
    The ABAP statements used for list processing are not yet fully available in ABAP Objects. However, to produce a simple test output, you can use the following statements:
    WRITE [AT] /<offset>(<length>) <f>
    ULINE
    SKIP
    NEW-LINE
    Note: The behavior of formatting and interactive list functions in their current state are not guaranteed. Incompatible changes could occur in a future release.
    Declarations
    This example is implemented using local classes, since selection screens belong to an ABAP program, and cannot be defined or called in global classes. Below are the definitions of the two selection screens and three classes:
    Global Selection Screens
    SELECTION-SCREEN BEGIN OF: SCREEN 100 TITLE TIT1, LINE.
      PARAMETERS MEMBERS TYPE I DEFAULT 10.
    SELECTION-SCREEN END OF: LINE, SCREEN 100.
    SELECTION-SCREEN BEGIN OF SCREEN 200 TITLE TIT2.
      PARAMETERS: DRIVE    RADIOBUTTON GROUP ACTN,
                  STOP     RADIOBUTTON GROUP ACTN,
                  GEARUP   RADIOBUTTON GROUP ACTN,
                  GEARDOWN RADIOBUTTON GROUP ACTN.
    SELECTION-SCREEN END OF SCREEN 200.
    Class Definitions
    CLASS: C_BIKER DEFINITION DEFERRED,
           C_BICYCLE DEFINITION DEFERRED.
    CLASS C_TEAM DEFINITION.
      PUBLIC SECTION.
      TYPES: BIKER_REF TYPE REF TO C_BIKER,
             BIKER_REF_TAB TYPE STANDARD TABLE OF BIKER_REF
                                               WITH DEFAULT KEY,
             BEGIN OF STATUS_LINE_TYPE,
               FLAG(1)  TYPE C,
               TEXT1(5) TYPE C,
               ID       TYPE I,
               TEXT2(7) TYPE C,
               TEXT3(6) TYPE C,
               GEAR     TYPE I,
               TEXT4(7) TYPE C,
               SPEED    TYPE I,
             END OF STATUS_LINE_TYPE.
      CLASS-METHODS: CLASS_CONSTRUCTOR.
      METHODS: CONSTRUCTOR,
               CREATE_TEAM,
               SELECTION,
               EXECUTION.
      PRIVATE SECTION.
      CLASS-DATA: TEAM_MEMBERS TYPE I,
                  COUNTER TYPE I.
      DATA: ID TYPE I,
            STATUS_LINE TYPE STATUS_LINE_TYPE,
            STATUS_LIST TYPE SORTED TABLE OF STATUS_LINE_TYPE
                                          WITH UNIQUE KEY ID,
            BIKER_TAB TYPE BIKER_REF_TAB,
            BIKER_SELECTION LIKE BIKER_TAB,
            BIKER LIKE LINE OF BIKER_TAB.
      METHODS: WRITE_LIST.
    ENDCLASS.
    CLASS C_BIKER DEFINITION.
      PUBLIC SECTION.
      METHODS: CONSTRUCTOR IMPORTING TEAM_ID TYPE I MEMBERS TYPE I,
               SELECT_ACTION,
               STATUS_LINE EXPORTING LINE
                           TYPE C_TEAM=>STATUS_LINE_TYPE.
      PRIVATE SECTION.
      CLASS-DATA COUNTER TYPE I.
      DATA: ID TYPE I,
            BIKE TYPE REF TO C_BICYCLE,
            GEAR_STATUS  TYPE I VALUE 1,
            SPEED_STATUS TYPE I VALUE 0.
      METHODS BIKER_ACTION IMPORTING ACTION TYPE I.
    ENDCLASS.
    CLASS C_BICYCLE DEFINITION.
      PUBLIC SECTION.
      METHODS: DRIVE EXPORTING VELOCITY TYPE I,
               STOP  EXPORTING VELOCITY TYPE I,
               CHANGE_GEAR IMPORTING CHANGE TYPE I
                           RETURNING VALUE(GEAR) TYPE I
                           EXCEPTIONS GEAR_MIN GEAR_MAX.
      PRIVATE SECTION.
      DATA: SPEED TYPE I,
            GEAR  TYPE I VALUE 1.
      CONSTANTS: MAX_GEAR TYPE I VALUE 18,
                 MIN_GEAR TYPE I VALUE 1.
    ENDCLASS.
    Note that none of the three classes has any public attributes. The states of the classes can only be changed by their methods. The class C_TEAM contains a static constructor CLASS_CONSTRUCTOR. C_TEAM and C_BIKER both contain instance constructors.
    Implementations
    The implementation parts of the classes contain the implementations of all of the methods declared in the corresponding declaration parts. The interfaces of the methods have already been defined in the declarations. In the implementations, the interface parameters behave like local data.
    Methods of Class C_TEAM
    The following methods are implemented in the section
    CLASS C_TEAM IMPLEMENTATION.
    ENDCLASS.
    CLASS_CONSTRUCTOR
      METHOD CLASS_CONSTRUCTOR.
        TIT1 = 'Team members ?'.
        CALL SELECTION-SCREEN 100 STARTING AT 5 3.
        IF SY-SUBRC NE 0.
          LEAVE PROGRAM.
        ELSE.
          TEAM_MEMBERS = MEMBERS.
        ENDIF.
      ENDMETHOD.
    The static constructor is executed before the class C_TEAM is used for the first time in a program. It calls the selection screen 100 and sets the static attribute TEAM_MEMBERS to the value entered by the program user. This attribute has the same value for all instances of the class C_TEAM.
    CONSTRUCTOR
      METHOD CONSTRUCTOR.
        COUNTER = COUNTER + 1.
        ID = COUNTER.
      ENDMETHOD.
    The instance constructor is executed directly after each instance of the class C_TEAM is created. It is used to count the number of instance of C_TEAM in the static attribute COUNTER, and assigns the corresponding number to the instance attribute ID of each instance of the class.
    CREATE_TEAM
      METHOD CREATE_TEAM.
        DO TEAM_MEMBERS TIMES.
          CREATE OBJECT BIKER EXPORTING TEAM_ID = ID
                                        MEMBERS = TEAM_MEMBERS.
          APPEND BIKER TO BIKER_TAB.
          CALL METHOD BIKER->STATUS_LINE IMPORTING LINE = STATUS_LINE.
          APPEND STATUS_LINE TO STATUS_LIST.
        ENDDO.
      ENDMETHOD.
    The public instance method CREATE_TEAM can be called by any user of the class containing a reference variable with a reference to an instance of the class. It is used to create instances of the class C_BIKER, using the private reference variable BIKER in the class C_TEAM. You must pass both input parameters for the instance constructor of class C_BIKER in the CREATE OBJECT statement. The references to the newly-created instances are inserted into the private internal table BIKER_TAB. After the method has been executed, each line of the internal table contains a reference to an instance of the class C_BIKER. These references are only visible within the class C_TEAM. External users cannot address the objects of class C_BIKER.
    CREATE_TEAM also calls the method STATUS_LINE for each newly-created object, and uses the work area STATUS_LINE to append its output parameter LINE to the private internal table STATUS_LIST.
    SELECTION
      METHOD SELECTION.
        CLEAR BIKER_SELECTION.
        DO.
          READ LINE SY-INDEX.
          IF SY-SUBRC <> 0. EXIT. ENDIF.
          IF SY-LISEL+0(1) = 'X'.
            READ TABLE BIKER_TAB INTO BIKER INDEX SY-INDEX.
            APPEND BIKER TO BIKER_SELECTION.
          ENDIF.
        ENDDO.
        CALL METHOD WRITE_LIST.
      ENDMETHOD.
    The public instance method SELECTION can be called by any user of the class containing a reference variable with a reference to an instance of the class. It selects all of the lines in the current list in which the checkbox in the first column is selected. For these lines, the system copies the corresponding reference variables from the table BIKER_TAB into an additional private internal table BIKER_SELECTION. SELECTION then calls the private method WRITE_LIST, which displays the list.
    EXECUTION
      METHOD EXECUTION.
        CHECK NOT BIKER_SELECTION IS INITIAL.
        LOOP AT BIKER_SELECTION INTO BIKER.
          CALL METHOD BIKER->SELECT_ACTION.
          CALL METHOD BIKER->STATUS_LINE IMPORTING LINE = STATUS_LINE.
          MODIFY TABLE STATUS_LIST FROM STATUS_LINE.
        ENDLOOP.
        CALL METHOD WRITE_LIST.
      ENDMETHOD.
    The public instance method EXECUTION can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method calls the two methods SELECT_ACTION and STATUS_LINE for each instance of the class C_BIKER for which there is a reference in the table BIKER_SELECTION. The line of the table STATUS_LIST with the same key as the component ID in the work area STATUS_LINE is overwritten and displayed by the private method WRITE_LIST.
    WRITE_LIST
      METHOD WRITE_LIST.
        SET TITLEBAR 'TIT'.
        SY-LSIND = 0.
        SKIP TO LINE 1.
        POSITION 1.
        LOOP AT STATUS_LIST INTO STATUS_LINE.
          WRITE: / STATUS_LINE-FLAG AS CHECKBOX,
                   STATUS_LINE-TEXT1,
                   STATUS_LINE-ID,
                   STATUS_LINE-TEXT2,
                   STATUS_LINE-TEXT3,
                   STATUS_LINE-GEAR,
                   STATUS_LINE-TEXT4,
                   STATUS_LINE-SPEED.
        ENDLOOP.
      ENDMETHOD.
    The private instance method WRITE_LIST can only be called from the methods of the class C_TEAM. It is used to display the private internal table STATUS_LIST on the basic list (SY-LSIND = 0) of the program.
    Methods of Class C_BIKER
    The following methods are implemented in the section
    CLASS C_BIKER IMPLEMENTATION.
    ENDCLASS.
    CONSTRUCTOR
      METHOD CONSTRUCTOR.
        COUNTER = COUNTER + 1.
        ID = COUNTER - MEMBERS * ( TEAM_ID - 1).
        CREATE OBJECT BIKE.
      ENDMETHOD.
    The instance constructor is executed directly after each instance of the class C_BIKER is created. It is used to count the number of instance of C_BIKER in the static attribute COUNTER, and assigns the corresponding number to the instance attribute ID of each instance of the class. The constructor has two input parameters - TEAM_ID and MEMBERS - which you must pass in the CREATE OBJECT statement when you create an instance of C_BIKER.
    The instance constructor also creates an instance of the class C_BICYCLE for each new instance of the class C_BIKER. The reference in the private reference variable BIKE of each instance of C_BIKER points to a corresponding instance of the class C_BICYCLE. No external user can address these instances of the class C_BICYCLE.
    SELECT_ACTION
      METHOD SELECT_ACTION.
        DATA ACTIVITY TYPE I.
        TIT2 = 'Select action for BIKE'.
        TIT2+24(3) = ID.
        CALL SELECTION-SCREEN 200 STARTING AT 5 15.
        CHECK NOT SY-SUBRC GT 0.
        IF GEARUP = 'X' OR GEARDOWN = 'X'.
          IF GEARUP = 'X'.
            ACTIVITY = 1.
          ELSEIF GEARDOWN = 'X'.
            ACTIVITY = -1.
          ENDIF.
        ELSEIF DRIVE = 'X'.
          ACTIVITY = 2.
        ELSEIF STOP = 'X'.
          ACTIVITY = 3.
        ENDIF.
        CALL METHOD BIKER_ACTION( ACTIVITY).
      ENDMETHOD.
    The public instance method SELECT_ACTION can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method calls the selection screen 200 and analyzes the user input. After this, it calls the private method BIKER_ACTION of the same class. The method call uses the shortened form to pass the actual parameter ACTIVITY to the formal parameter ACTION.
    BIKER_ACTION
      METHOD BIKER_ACTION.
        CASE ACTION.
          WHEN -1 OR 1.
            CALL METHOD BIKE->CHANGE_GEAR
                              EXPORTING CHANGE = ACTION
                              RECEIVING GEAR = GEAR_STATUS
                              EXCEPTIONS GEAR_MAX = 1
                                         GEAR_MIN = 2.
            CASE SY-SUBRC.
              WHEN 1.
                MESSAGE I315(AT) WITH 'BIKE' ID
                                      ' is already at maximal gear!'.
              WHEN 2.
                MESSAGE I315(AT) WITH 'BIKE' ID
                                      ' is already at minimal gear!'.
            ENDCASE.
          WHEN 2.
            CALL METHOD BIKE->DRIVE IMPORTING VELOCITY = SPEED_STATUS.
          WHEN 3.
            CALL METHOD BIKE->STOP IMPORTING VELOCITY = SPEED_STATUS.
        ENDCASE.
      ENDMETHOD.
    The private instance method BIKER_ACTION can only be called from the methods of the class C_BIKER. The method calls other methods in the instance of the class C_BICYCLE to which the reference in the reference variable BIKE is pointing, depending on the value in the input parameter ACTION.
    STATUS_LINE
      METHOD STATUS_LINE.
        LINE-FLAG = SPACE.
        LINE-TEXT1 = 'Biker'.
        LINE-ID = ID.
        LINE-TEXT2 = 'Status:'.
        LINE-TEXT3 = 'Gear = '.
        LINE-GEAR  = GEAR_STATUS.
        LINE-TEXT4 = 'Speed = '.
        LINE-SPEED = SPEED_STATUS.
      ENDMETHOD.
    The public instance method STATUS_LINE can be called by any user of the class containing a reference variable with a reference to an instance of the class. It fills the structured output parameter LINE with the current attribute values of the corresponding instance.
    Methods of Class C_BICYCLE
    The following methods are implemented in the section
    CLASS C_BICYCLE IMPLEMENTATION.
    ENDCLASS.
    DRIVE
      METHOD DRIVE.
        SPEED = SPEED  + GEAR * 10.
        VELOCITY = SPEED.
      ENDMETHOD.
    The public instance method DRIVE can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method changes the value of the private attribute SPEED and passes it to the caller using the output parameter VELOCITY.
    STOP
      METHOD STOP.
        SPEED = 0.
        VELOCITY = SPEED.
      ENDMETHOD.
    The public instance method STOP can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method changes the value of the private attribute SPEED and passes it to the caller using the output parameter VELOCITY.
    CHANGE_GEAR
      METHOD CHANGE_GEAR.
        GEAR = ME->GEAR.
        GEAR = GEAR + CHANGE.
        IF GEAR GT MAX_GEAR.
          GEAR = MAX_GEAR.
          RAISE GEAR_MAX.
        ELSEIF GEAR LT MIN_GEAR.
          GEAR = MIN_GEAR.
          RAISE GEAR_MIN.
        ENDIF.
        ME->GEAR = GEAR.
      ENDMETHOD.
    The public instance method CHANGE_GEAR can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method changes the value of the private attribute GEAR. Since the formal parameter with the same name obscures the attribute in the method, the attribute has to be addressed using the self-reference ME->GEAR.
    Using the Classes in a Program
    The following program shows how the above classes can be used in a program. The declarations of the selection screens and local classes, and the implementations of the methods must also be a part of the program.
    REPORT OO_METHODS_DEMO NO STANDARD PAGE HEADING.
    Declarations and Implementations
    Global Program Data
    TYPES TEAM TYPE REF TO C_TEAM.
    DATA: TEAM_BLUE  TYPE TEAM,
          TEAM_GREEN TYPE TEAM,
          TEAM_RED   TYPE TEAM.
    DATA  COLOR(5).
    Program events
    START-OF-SELECTION.
      CREATE OBJECT: TEAM_BLUE,
                     TEAM_GREEN,
                     TEAM_RED.
       CALL METHOD: TEAM_BLUE->CREATE_TEAM,
                   TEAM_GREEN->CREATE_TEAM,
                   TEAM_RED->CREATE_TEAM.
      SET PF-STATUS 'TEAMLIST'.
      WRITE '                   Select a team!             ' COLOR = 2.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'TEAM_BLUE'.
          COLOR = 'BLUE '.
          FORMAT COLOR = 1 INTENSIFIED ON INVERSE ON.
           CALL METHOD TEAM_BLUE->SELECTION.
        WHEN 'TEAM_GREEN'.
          COLOR = 'GREEN'.
          FORMAT COLOR = 5 INTENSIFIED ON INVERSE ON.
           CALL METHOD TEAM_GREEN->SELECTION.
        WHEN 'TEAM_RED'.
          COLOR = 'RED '.
          FORMAT COLOR = 6 INTENSIFIED ON INVERSE ON.
           CALL METHOD TEAM_RED->SELECTION.
        WHEN 'EXECUTION'.
          CASE COLOR.
            WHEN 'BLUE '.
              FORMAT COLOR = 1 INTENSIFIED ON INVERSE ON.
               CALL METHOD TEAM_BLUE->SELECTION.
              CALL METHOD TEAM_BLUE->EXECUTION.
            WHEN 'GREEN'.
              FORMAT COLOR = 5 INTENSIFIED ON INVERSE ON.
               CALL METHOD TEAM_GREEN->SELECTION.
              CALL METHOD TEAM_GREEN->EXECUTION.
            WHEN 'RED '.
              FORMAT COLOR = 6 INTENSIFIED ON INVERSE ON.
               CALL METHOD TEAM_RED->SELECTION.
              CALL METHOD TEAM_RED->EXECUTION.
          ENDCASE.
      ENDCASE.
    The program contains three class reference variables that refer to the class C_TEAM. It creates three objects from the class, to which the references in the reference variables then point. In each object, it calls the method CREATE_TEAM. The method CLASS_CONSTRUCTOR of class C_TEAM is executed before the first of the objects is created. The status TEAMLIST for the basic list allows the user to choose one of four functions:
    When the user chooses a function, the event AT USER-COMMAND is triggered and public methods are called in one of the three instances of C_TEAM, depending on the user’s choice. The user can change the state of an object by selecting the corresponding line in the status list.

Maybe you are looking for

  • How to create a dynamic radiobutton in webdynpro dynamically

    HI, I want to create radiobutton in webdynpro dynamically.But this button in not enabled.Code:-      IWDNodeInfo info =wdContext.getNodeInfo().addChild("RadioBUttonDymanicNode",null,true,false,true,false,false,true,null,null,null);      IWDRadioButto

  • Problem with variable in the woorkbook selection screen.

    Hi All, I have Problem with Variable in the selection screen. I have four variable in the report in this sequence <b>Plant (optional), calendar month (mandatory),  material (optional), Customer (mandatory). </b> In Development system, I changed the q

  • Microsoft Word Templates in Foreign Language

    I just bought Microsoft Office 2008 for my Macbook (with Leopard) and I was looking at the Project Gallery templates and if I open up any of the templates for Microsoft Word, all of the words are in different languages and I cannot even look at the t

  • How can I copy protect a Labview application?

    We have a high value Labview 7.1 application that we want to copy protect.  Are there any third party software solutions available that work with Labview and provide hardware locked copy protection?  We want to prevent a single license key from being

  • Internet Blackmail HELP ME PLEASE!

    My Skype Username [Removed to maintain confidentiality] -  Last night/ earily this morning A stranger messaged myskype account last night and I thought nothing of it because I used to recieve stranger messages on other messagers like yahoo. They said