Abap command doubt

Hi folks..
One doubt.. In one of my program. I've used one command which is as follows .
uom_s[] = uom[].
where uom is a structure like  bapi_marm_ga  and
uom_s is a structure like bapi_marm.
all the relevant values got copied to uom_s table. but in uom_s there is field GTIN_VARIANT which gets populated automatically with value '00'. whereas there was no corresponding value in GTIN_VARIANT  in uom table.
but there were two fields ( both type n ) in uom which were having '000000' and '00' value which has no corresponding field in uom_s. so how this command work which has populated a field automatically.
GTIN_VARIANT in uom and uom_s are type c field length 2.
so how this command works ...
I hope I'm clear.

yes my problem is solved. I've cleared that field explicitly
thanks anyway

Similar Messages

  • Comparison between ABAP command statements in different versions

    Hi,
    I'm looking for information on version wise difference in ABAP statements. Can someone provide help in this area.
    I need a list of Commands along with there syntax in different versions of ABAP (ECC 5.0 and 4.7).
    Is there any system table where this information is maintained?
    Regards,
    Gajendra Bhatt

    Hi Gajendra ,
    I doubt if SAP has some document which shows the history of all ABAP commands as to how they behaved in which version. The only option you have is go through the following notes and compile the info manually -
    0000178452 Release upgrade from 4.0 to 4.5 for customers prog
    0000452229 Release upgrade from 6.10 to 6.20 for customer pro
    0000178725 Release upgrade from 4.5 to 4.6 for customer progr
    0000689951 Release upgrade from 6.20 to 6.40 for customer pro
    0000178482 Rel. upgrade from 3.0 to 4.0 for customer programs
    0000857904 0003 0.460 Upgrade from Release 6.40 to 7.0: Customer program
    0000367676 0061 0.450 Release upgrade from 4.6 to 6.10 for customer prog
    0000099025 0004 0.340 Change from 4.0A/B to 4.5A for customer programs 
    Cheers.

  • In ECC 6.0 I am getting Slin Error -ABAP command is obsolete

    Hi All,
    In Hr ABAP we will start basic coding with
    TABLES pernr . 
    infotypes:0002.  
    By using this I am getting the following SLIN Error :
    Program:  ZHCP0026  Row:     32
    he current ABAP command is obsolete
    Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
    types, not "LIKE" or "STRUCTURE".
    nternal Message Code: MESSAGE G/B
    (The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
    EXTENDED CHECK OFF/ON)
    INFOTYPES : 0380,
    The current ABAP command is obsolete
    Tables with headers are no longer supported in the OO context.
    Internal Message Code: MESSAGE G1D
    (The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
    EXTENDED CHECK OFF/ON)
    Can some one help me , how to rectify this slin error ?
    Thanks,
    Suresh.
    Edited by: suresh kumar on Feb 25, 2009 2:22 PM

    Hi Suresh,
    Am too facing the same problem. if you could find a solution, pls let me know.

  • How to run others applications with abap commands

    Is there a mothed that can use it to run an application with abap statement?
    for example: how to open a text file in program with abap command?
    thank you very much.

    CALL FUNCTION '<b>WS_EXECUTE'</b>
    EXPORTING
      DOCUMENT                 = ' '
      CD                       = ' '
       <b>COMMANDLINE</b>              = ''
      INFORM                   = ' '
      <b> PROGRAM                 </b> = 'NOTEPAD'
      STAT                     = ' '
      WINID                    = ' '
      OSMAC_SCRIPT             = ' '
      OSMAC_CREATOR            = ' '
      WIN16_EXT                = ' '
      EXEC_RC                  = ' '
    IMPORTING
      RBUFF                    =
    EXCEPTIONS
      FRONTEND_ERROR           = 1
      NO_BATCH                 = 2
      PROG_NOT_FOUND           = 3
      ILLEGAL_OPTION           = 4
      GUI_REFUSE_EXECUTE       = 5
      OTHERS                   = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Here...
    In the <b>CommandLine</b> you can give the path where the file is located like for Example
    C:\Test\Hello.txt.
    In the <b>Program</b> you need to give the application that you want to open that file.
    if helpful reward points...
    Regards,
    Vivekananda Varma Dandu

  • ABAP SQL Doubt

    Hi ABAP Gurus,
    Please help me in solving following ABAP SQL doubt.
    In the table Zonfig there are two fields: FNAME and REQFLAG
    FNAME.....REQFLAG
    S1...........X
    S2...........X
    S3..........._
    S4...........X
    Other table T_Zconfig has one field : XNAME
    XNAME
    S1
    S3
    Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.
    That is in this case for FNAME S1 and S2 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S2.
    Points will be surly awarded...
    Thanks.

    Hi ABAP Gurus,
    Please help me in solving following ABAP SQL doubt.
    In the table Zonfig there are two fields: FNAME and REQFLAG
    FNAME.....REQFLAG
    S1...........X
    S2...........X
    S3..........._
    S4...........X
    Other table T_Zconfig has one field : XNAME
    XNAME
    S1
    S3
    Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.
    That is in this case for FNAME S1 and S3 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S3.
    Points will be surly awarded...
    Thanks.

  • Obsolete ABAP commands

    hi friends,
    Is it poosible to find out what are the Obsolete ABAP commands and Statements by comparing two different versions? an old version and an advanced version??
    Is it stored in any table?
    Pls Help
    Regards
    Dinesh

    Hi,
    Just check this link
    http://www.nikat.org/www.geocities.com/victorav15/sapr3/abapobs.html
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb33cc358411d1829f0000e829fbfe/content.htm
    You may have an overview wirth Solution Browser tool (at the solution point of view) in order to compare functionality between your current system and the ERP 2005.
    at:
    http://solutionbrowser.erp.sap.fmpmedia.com/
    You can get the detailed release information from the following link.
    http://service.sap.com/releasenotes.
    A release note is a brief explanation of new features or changes to the system since the last software release. A release note typically describes a new function or an existing function that has been enhanced or changed.
    Regards,
    Padmam.

  • The current ABAP command is obsolete

    Hi Experts,
    please let me know how this error can be removed.
    The current ABAP command is obsolete                                           
    The variant " WITH KEY k" is no longer supported in the OO context. Use an    
    explicit key specification instead . . . .                                    
    Internal Message Code: READ 022                                                
    (The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET    
    EXTENDED CHECK OFF/ON)                                                        
    Thanks and Regards,
    Johny

    Hi Experts,
    Iam having no key to compare with.
    The scenario is as follows:
    *If it is PaymentLot,retrieve Payment method,Gpart,Banknumber,Bank accountnumber,paymentcard number and amount
    from DFKKZP and DFKKOP for the cleared document
    CALL FUNCTION 'FKK_PAYMENT_BATCH_FIND_PAYMENT'
    EXPORTING
    i_opbel = wa_cleareditem-augbl
    IMPORTING
    e_dfkkzp = et_dfkkzp
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    IF sy-subrc <> 0. "#EC NEEDED
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF et_dfkkzp-bankl IS NOT INITIAL. "Check for Bank key and Card number
    lv_bankl = et_dfkkzp-bankl.
    ENDIF.
    IF et_dfkkzp-ccnum IS NOT INITIAL.
    lv_ccnum = et_dfkkzp-ccnum.
    ENDIF.
    IF et_dfkkzp-bankl IS INITIAL AND et_dfkkzp-ccnum IS INITIAL. "If both bank key and Card number are initial
    e_pymet = c_pymet. "Populate payment method as 'K'
    ENDIF.
    *For the obtained Business partner,fetch Bankdetails id and Payment card id from
    *exporting parameters of F.M 'FKK_BUPA_READ_SINGLE'
    CALL FUNCTION 'FKK_BUPA_READ_SINGLE'
    EXPORTING
    i_partner = lv_partner
    i_xbank = 'X'
    i_xccard = 'X'
    TABLES
    t_bank = it_bank
    t_ccard = it_ccard
    EXCEPTIONS
    partner_not_found = 1
    partner_in_role_not_found = 2
    internal_error = 3
    OTHERS = 4.
    IF sy-subrc <> 0. "#EC NEEDED
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE it_bank INTO wa_bank WITH KEY bankl = lv_bankl BINARY SEARCH. "Pick the entry which has bankl value as from et_dfkkzp
    IF sy-subrc = 0.
    e_pymet = c_pymetb.
    e_bkvid = wa_bank-bkvid.
    ENDIF.
    READ TABLE it_ccard INTO wa_ccard WITH KEY ccnum = lv_ccnum BINARY SEARCH. "Pick the entry which has ccnum value as from et_dfkkzp
    IF sy-subrc = 0.
    e_pymet = c_pymetd.
    e_ccard_id = wa_ccard-ccard_id.
    ENDIF.
    ENDIF.
    ENDFORM. " ORIGINKEY_V1

  • ABAP Command

    Hi friends,
         is there any ABAP command or Function module to run the another ABAP Program(not Transaction code or area menu).
    Thanks & Good regards,
    vallamuthu.M

    Hi,
    You can use SUBMIT statement with VIA SELECTION-SCREEN option. Please check this sample code.
    SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH paramet eq 'Selection 1'
                          WITH selecto IN seltab
                          WITH selecto ne 3
                          AND RETURN.
    Regards,
    Ferry Lianto

  • ABAP command "import from database..."

    Can someone in this forum explain to me the low level  details behind the ABAP command "import from database"?
    The select in tables like stxl, indx, moni just retrieves data in hex format for the fields of type raw or lraw.
    But the command import from database works fine!
    What's the magic? Compression? Hash algorithms? etc?
    Thanks!

    When you import a field from a database, it should be the same name and format when it was exported. These databases are a cluster table where data is stored in raw. I assumed it will read the cluster portion of the record and convert it into the field structure byte by byte. These tables have field CLUSTR which store the byte size of the record. So if you are willing to program the read, where you find out the length of the field you want to IMPORT, then read that number of byte from the cluster data, move it to the field you are importing, you should be able to do your own read. However, if we can do it in 1 statement using IMPORT, we don't need to program it.
    Cluster table is used to save space since you don't need to create a new database record for each line of internal table you stored into them. Hope this helps.

  • Re : The ABAP Command

    Is there is any ABAP Command such that my input is program name and output is the program output

    Hi ,
         There is no such ABAP command, but you can create a function module and call it from anywhere with your import parametres. You can get back the output using export parameteres of function module. Syntax is as below.
    CALL FUNCTION 'XYZ'
    IMPORTING
    EXPORTING
    Also, You can call a public Method implemeted in a class.
    Regards,
    Harpal

  • What are abap commands that link to a layout set

    hi
    what are abap commands that link to a layout set

    Hi,
    Script Commands:
    ADDRESS : Formatting of Address
    BOTTOM, ENDBOTTOM : Define Footer text in a window
    BOX, POSITION, SIZE : Boxes, Lines and Shading
    CASE, ENDCASE : Case Distinction
    DEFINE : Value assignment to text symbols
    HEX, ENDHEX : Hexadecimal values
    IF, ENDIF : Conditional text output
    INCLUDE : Include other texts
    NEW-PAGE : Explicit forms feed
    NEW-WINDOW : Next window main
    PRINT-CONTROL : Insert print control character
    PROTECT...ENDPROTECT : Protect from page break
    RESET : Initialize outline paragraphs
    SET COUNTRY : Country-specific formating
    SET DATE MASK : Formating of date fields
    SET SIGN : Position of +/- sign
    SET TIME MASK : Formating of time fields
    STYLE : Change style
    SUMMING : Summing variables
    TOP : Set header text in window MAIN
    Regards,
    Bhaskar

  • ABAP HR DOUBTS

    Hi ,
      I have some doubts  in ABAP-HR.Please clarify my doubts.
    1) Provide and end provide statements are obsolate.Shall we use select in place of provide and provide?.
    2) what are the important macros in ABAP HR?
    3)Do we have to use logical data base if we are using macros?.
    Moderator message: please do not ask interview-type questions, search for available information.
    Edited by: Thomas Zloch on Jan 6, 2011 10:57 AM

    Hi Shakir,
       First of all you have to assign logical database name say PNP in the attributes of the program. After assigning the logical data base, you can see teh button below with HR REPORT CATEGORY. Click on that and select Master dat(infotypes) radio button. After that go for f4 help to see the existed HR report categories. From that you select one which contains the fields you want. If you are not able to find Hr report category with the fields you want then you need to create your own report category with the fields you want.
    If you want to select only active employees
    RP-PROVIDE-FROM-LAST p0000 space pn-begda pn-endda.
    CHECK P0000-STAT2 = '3'.
    note: '3' or some other value based on the values stored in infotype 0000 for the employment status.
    if employee is not active then it will skip that employee and selects the next employee.

  • ABAP command IMPORT/EXPORT

    Hi!
    I would like to know whats the replacement for the IMPORT and export commands used in 4.7c  in ECC6. Can anyone tell me whats the replacement commands for import and export command that is used in abap/4 4.7c for ECC6.
    Thanks

    Hi Aarav,
    there is nothing like replacement for import/export.there is another statements to transferdata which are Set/Get.
    when you are working with sap you have sessions.so in between session if you want to transfer data then you will use set/get parameters.import/export are used within the session.means you opened se38 and written a program and then go back to se38 initial screen and entered another program name and in that program you want the data which is in the previous program you have written in the se38 in same session.
    reward points if helpful.

  • ABAP Mapping doubt

    Hi.
    I'm trying to do an abap mapping. I've read weblogs from Robert Eijpe. The samples contained in the weblog worked fine but i have a doubt.
    ABAP class had a parameter called SOURCE. This parameter contains the XML but i think is contained in only one line. In the sample weblog, the XML is contained in an internal table.
    Question is ... how can i transform this SOURCE of 1 line into an internal table?
    Thanks.

    Hi Inigo,
    Please look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/frameset.htm
    Hope it helps you!
    cheers,
    Prashanth

  • Abap Objects doubts.

    Hi Experts.
    Plz give me some details for the following questions.
    1. what is abstract class.
    2. give me some example program using inheritance.
    3. Some sample programs using events.
    4. Narrow casting & wide casting.. And describe the use of it.
    5. How to declare internal table in ABAP OOPS.
    6. What is the use of table type.?
    7. What is instance.?
    8. Explain friend class.
    Thank in advance.
    Points will be given for the answers.
    regards,
    J.Joe

    HI
    <b>1. what is abstract class.</b>
    Abstract classes are normally used as an incomplete blueprint for concrete (that is, non-abstract) subclasses, for example to define a uniform interface.
    Classes with at least one abstract method are themselves abstract.
    Static methods and constructors cannot be abstract.
    You can specify the class of the instance to be created explicitly: CREATE OBJECT <RefToAbstractClass> TYPE <NonAbstractSubclassName>.
    Abstarct classes themselves can’t be instantiated ( althrough their subclasses can)
    Reference to abstract classes can refer to instance of subclass
    Abstract (instance) methods are difined in the class , but not implemented
    They must be redefined in subclasses
    CLASS LC1 DEFINAITION ABSTARCT
    PUBLIC SECTION
    METHODS ESTIMATE ABSTARCT IMPORTING…
    ENDCLASS.
    <b>2. give me some example program using inheritance.</b>
    The following simple example shows the principle of inheritance within ABAP Objects. It is based on the Simple Introduction to Classes. A new class counter_ten inherits from the existing class counter.
    REPORT demo_inheritance.
    CLASS counter DEFINITION.
      PUBLIC SECTION.
        METHODS: set IMPORTING value(set_value) TYPE i,
                 increment,
                 get EXPORTING value(get_value) TYPE i.
       PROTECTED SECTION .
        DATA count TYPE i.
    ENDCLASS.
    CLASS counter IMPLEMENTATION.
      METHOD set.
        count = set_value.
      ENDMETHOD.
      METHOD increment.
        ADD 1 TO count.
      ENDMETHOD.
      METHOD get.
        get_value = count.
      ENDMETHOD.
    ENDCLASS.
    CLASS counter_ten DEFINITION INHERITING FROM counter.
      PUBLIC SECTION.
        METHODS increment REDEFINITION .
        DATA count_ten.
    ENDCLASS.
    CLASS counter_ten IMPLEMENTATION.
      METHOD increment.
        DATA modulo TYPE I.
         CALL METHOD super->increment .
        write / count.
        modulo = count mod 10.
        IF modulo = 0.
          count_ten = count_ten + 1.
          write count_ten.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    DATA: count TYPE REF TO counter,
          number TYPE i VALUE 5.
    START-OF-SELECTION.
       CREATE OBJECT count TYPE counter_ten .
      CALL METHOD count->set EXPORTING set_value = number.
      DO 20 TIMES.
        CALL METHOD count->increment.
      ENDDO.
    The class COUNTER_TEN is derived from COUNTER. It redefines the method INCREMENT. To do this, you must change the visibility of the COUNT attribute from PRIVATE to PROTECTED. The redefined method calls the obscured method of the superclass using the pseudoreference SUPER->. The redefined method is a specialization of the inherited method.
    The example instantiates the subclass. The reference variable pointing to it has the type of the superclass. When the INCREMENT method is called using the superclass reference, the system executes the redefined method from the subclass.
    <b>3. Some sample programs using events.</b>
    Events in ABAP Objects - Example
    The following example shows how to declare, call, and handle events in ABAP Objects.
    Overview
    This object works with the interactive list displayed below. Each user interaction triggers an event in ABAP Objects. The list and its data is created in the class C_LIST. There is a class STATUS for processing user actions. It triggers an event BUTTON_CLICKED in the AT USER-COMMAND event. The event is handled in the class C_LIST. It contains an object of the class C_SHIP or C_TRUCK for each line of the list. Both of these classes implement the interface I_VEHICLE. Whenever the speed of one of these objects changes, the event SPEED_CHANGE is triggered. The class C_LIST reacts to this and updates the list.
    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 interfaces and classes. Below are the declarations of the interfaces and classes:
    Interface and Class declarations
    INTERFACE I_VEHICLE.
      DATA     MAX_SPEED TYPE I.
      EVENTS SPEED_CHANGE EXPORTING VALUE(NEW_SPEED) TYPE I.
      METHODS: DRIVE,
               STOP.
    ENDINTERFACE.
    CLASS C_SHIP DEFINITION.
      PUBLIC SECTION.
      METHODS CONSTRUCTOR.
      INTERFACES I_VEHICLE.
      PRIVATE SECTION.
      ALIASES MAX FOR I_VEHICLE~MAX_SPEED.
      DATA SHIP_SPEED TYPE I.
    ENDCLASS.
    CLASS C_TRUCK DEFINITION.
      PUBLIC SECTION.
      METHODS CONSTRUCTOR.
      INTERFACES I_VEHICLE.
      PRIVATE SECTION.
      ALIASES MAX FOR I_VEHICLE~MAX_SPEED.
      DATA TRUCK_SPEED TYPE I.
    ENDCLASS.
    CLASS STATUS DEFINITION.
      PUBLIC SECTION.
       CLASS-EVENTS BUTTON_CLICKED EXPORTING VALUE(FCODE) LIKE SY-UCOMM.
      CLASS-METHODS: CLASS_CONSTRUCTOR,
                    USER_ACTION.
    ENDCLASS.
    CLASS C_LIST DEFINITION.
      PUBLIC SECTION.
      METHODS: FCODE_HANDLER FOR EVENT BUTTON_CLICKED OF STATUS
                                 IMPORTING FCODE,
               LIST_CHANGE   FOR EVENT SPEED_CHANGE OF I_VEHICLE
                                 IMPORTING NEW_SPEED,
               LIST_OUTPUT.
      PRIVATE SECTION.
      DATA: ID TYPE I,
            REF_SHIP  TYPE REF TO C_SHIP,
            REF_TRUCK TYPE REF TO C_TRUCK,
            BEGIN OF LINE,
              ID TYPE I,
              FLAG,
              IREF  TYPE REF TO I_VEHICLE,
              SPEED TYPE I,
            END OF LINE,
            LIST LIKE SORTED TABLE OF LINE WITH UNIQUE KEY ID.
    ENDCLASS.
    The following events are declared in the example:
    The instance event SPEED_CHANGE in the interface I_VEHICLE
    The static event BUTTON_CLICKED in the class STATUS.
    The class C_LIST contains event handler methods for both events.
    Note that the class STATUS does not have any attributes, and therefore only works with static methods and events.
    Implementations
    Below are the implementations of the methods of the above classes:
    Implementations
    CLASS C_SHIP IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        MAX = 30.
      ENDMETHOD.
      METHOD I_VEHICLE~DRIVE.
        CHECK SHIP_SPEED < MAX.
        SHIP_SPEED = SHIP_SPEED + 10.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = SHIP_SPEED.
      ENDMETHOD.
      METHOD I_VEHICLE~STOP.
        CHECK SHIP_SPEED > 0.
        SHIP_SPEED = 0.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = SHIP_SPEED.
      ENDMETHOD.
    ENDCLASS.
    CLASS C_TRUCK IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        MAX = 150.
      ENDMETHOD.
      METHOD I_VEHICLE~DRIVE.
        CHECK TRUCK_SPEED < MAX.
        TRUCK_SPEED = TRUCK_SPEED + 50.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = TRUCK_SPEED.
      ENDMETHOD.
      METHOD I_VEHICLE~STOP.
        CHECK TRUCK_SPEED > 0.
        TRUCK_SPEED = 0.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = TRUCK_SPEED.
      ENDMETHOD.
    ENDCLASS.
    CLASS STATUS IMPLEMENTATION.
      METHOD CLASS_CONSTRUCTOR.
        SET PF-STATUS 'VEHICLE'.
        WRITE 'Click a button!'.
      ENDMETHOD.
      METHOD USER_ACTION.
        RAISE EVENT BUTTON_CLICKED EXPORTING FCODE = SY-UCOMM.
      ENDMETHOD.
    ENDCLASS.
    CLASS C_LIST IMPLEMENTATION.
      METHOD FCODE_HANDLER .
        CLEAR LINE.
        CASE FCODE.
          WHEN 'CREA_SHIP'.
            ID = ID + 1.
            CREATE OBJECT REF_SHIP.
            LINE-ID = ID.
            LINE-FLAG = 'C'.
            LINE-IREF = REF_SHIP.
            APPEND LINE TO LIST.
          WHEN 'CREA_TRUCK'.
            ID = ID + 1.
            CREATE OBJECT REF_TRUCK.
            LINE-ID = ID.
            LINE-FLAG = 'T'.
            LINE-IREF = REF_TRUCK.
            APPEND LINE TO LIST.
          WHEN 'DRIVE'.
            CHECK SY-LILLI > 0.
            READ TABLE LIST INDEX SY-LILLI INTO LINE.
            CALL METHOD LINE-IREF->DRIVE.
          WHEN 'STOP'.
            LOOP AT LIST INTO LINE.
              CALL METHOD LINE-IREF->STOP.
            ENDLOOP.
          WHEN 'CANCEL'.
            LEAVE PROGRAM.
        ENDCASE.
        CALL METHOD LIST_OUTPUT.
      ENDMETHOD.
      METHOD LIST_CHANGE .
        LINE-SPEED = NEW_SPEED.
        MODIFY TABLE LIST FROM LINE.
      ENDMETHOD.
      METHOD LIST_OUTPUT.
        SY-LSIND = 0.
        SET TITLEBAR 'TIT'.
        LOOP AT LIST INTO LINE.
          IF LINE-FLAG = 'C'.
            WRITE / ICON_WS_SHIP AS ICON.
          ELSEIF LINE-FLAG = 'T'.
            WRITE / ICON_WS_TRUCK AS ICON.
          ENDIF.
          WRITE: 'Speed = ', LINE-SPEED.
        ENDLOOP.
      ENDMETHOD.
    ENDCLASS.
    The static method USER_ACTION of the class STATUS triggers the static event BUTTON_CLICKED. The instance methods I_VEHICLEDRIVE and I_VEHICLESTOP trigger the instance event I_VEHICLE~SPEED_CHANGE in the classes C_SHIP and C_TRUCK.
    Using the Classes in a Program
    The following program uses the above classes:
    REPORT OO_EVENTS_DEMO NO STANDARD PAGE HEADING.
    Global data of program
    DATA LIST TYPE REF TO C_LIST.
    Program events
    START-OF-SELECTION.
      CREATE OBJECT LIST.
      SET HANDLER: LIST->FCODE_HANDLER,
                  LIST->LIST_CHANGE FOR ALL INSTANCES.
    AT USER-COMMAND.
      CALL METHOD STATUS=>USER_ACTION.
    The program creates an object of the class C_LIST and registers the event handler method FCODE_HANDLER of the object for the class event BUTTON_CLICKED, and the event handler method LIST_CHANGE for the event SPEED_CHANGE of all instances that implement the interface I_VEHICLE.
    <b>4. Narrow casting & wide casting.. And describe the use of it.</b>
    <b>Narrowing Cast</b>
    The assignment of a subclass instance to a reference variable of the type "reference to superclass" is described as a narrowing cast, because you are switching from a more detailed view to a one with less detail.
    Description up-cast is also used.
    <b>use</b>
    A user who is not interested in the finer points of cars, trucks, and busses (but only, for example, in the fuel consumption and tank gauge) does not need to know about them. This user only wants and needs to work with (references to) the lcl_vehicle class. However, in order to allow the user to work with cars, busses, or trucks, you generally need a narrowing cast.
    <b>Widening cast</b>
    The widening cast logically represents the opposite of the narrowing cast. The widening cast cannot be checked statically, only at runtime. The Cast Operator ?= (or the equivalent MOVE ... ?TO … ) must be used to make this visible.
    It changes from a less detailed view to one with more detail.
    <b>use</b>
    The client, the car rental company  wants to execute a function for specific vehicles form the list (vehicle_list).  For example, the client wants to ascertain the truck with the largest cargo capacity.  However, not all vehicles are in the trucks list, it also includes references to cars and busses.
    <b>5. How to declare internal table in ABAP OOPS.</b>
    BEGIN OF LINE,
              ID TYPE I,
              FLAG,
              IREF  TYPE REF TO I_VEHICLE,
              SPEED TYPE I,
            END OF LINE,
    <b>6. What is the use of table type.?</b>
    Please check the SAP help , as all these things are provided in detail in it .
    In case you find it difficult to find it or search for it here is the link
    http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
    <b>7. What is instance.?</b>
    Instance methods are called using CALL METHOD <reference>-><instance_method>.
    Static methods (also referred to as class methods) are called using CALL METHOD <classname>=><class_method>.
    If you are calling a static method from within the class, you can omit the class name.
    You access instance attributes using <instance>-><instance_attribute>
    <b>8. Explain friend class.</b>
    In rare cases, classes have to work together so closely that they need access to their protected and private components. To avoid making these components available to all users, there is the concept of friendship between classes.
    To do this you use the FRIENDS additions to the CLASS statement, in which all classes and interfaces that are to be provided friendship are listed
    In principle, providing friendship is one-sided: A class providing friendship is not automatically a friend of its friends. If a class providing friendship wants to access the non-public components of a friend, this friend has to explicitly provide friendship to it.
    Classes that inherit from friends and interfaces that contain a friend as a component interface also become friends. However, providing friendship, unlike the attribute of being a friend, is not inherited. A friend of a superclass is therefore not automatically a friend of its subclasses.
    <b>Reward if usefull</b>

Maybe you are looking for