<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pf - Status create Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536703#M1071955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sourav ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks i do that and it don't work.,&lt;/P&gt;&lt;P&gt;i put CREA_SHIP and &amp;amp; CREA_TRUCK in &lt;U&gt;Freely Assigned Function Keys&lt;/U&gt; annd activate and nothing happen.&lt;/P&gt;&lt;P&gt;what i miss?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Sep 2008 13:47:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-21T13:47:35Z</dc:date>
    <item>
      <title>pf - Status create Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536701#M1071953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i copy &amp;amp;paste this sample code to learn events in oo and i have to create pf-status &lt;/P&gt;&lt;P&gt;i do that create pf-status name VEHICLE but nothing happen ,&lt;/P&gt;&lt;P&gt;when i run the program i get just the line Click a button! and i dont see the more push butten that i add ,&lt;/P&gt;&lt;P&gt;i do that in (Freely Assigned Function Keys) way ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zztest_events.
TYPE-POOLS: icon.
*****************************************************************
* 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.                    "I_VEHICLE
*----------------------------------------------------------------
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.                    "C_SHIP DEFINITION
*----------------------------------------------------------------
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.                    "C_TRUCK DEFINITION
*----------------------------------------------------------------
CLASS status DEFINITION.
  PUBLIC SECTION.
    CLASS-EVENTS button_clicked EXPORTING value(fcode) LIKE sy-ucomm.
    CLASS-METHODS: class_constructor,
                  user_action.
ENDCLASS.                    "STATUS DEFINITION
*----------------------------------------------------------------
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.                    "C_LIST DEFINITION
*****************************************************************

*****************************************************************
* Implementations
*****************************************************************
CLASS c_ship IMPLEMENTATION.
  METHOD constructor.
    max = 30.
  ENDMETHOD.                    "CONSTRUCTOR
  METHOD i_vehicle~drive.
    CHECK ship_speed &amp;lt; max.
    ship_speed = ship_speed + 10.
    RAISE EVENT i_vehicle~speed_change
                EXPORTING new_speed = ship_speed.
  ENDMETHOD.                    "I_VEHICLE~DRIVE
  METHOD i_vehicle~stop.
    CHECK ship_speed &amp;gt; 0.
    ship_speed = 0.
    RAISE EVENT i_vehicle~speed_change
                EXPORTING new_speed = ship_speed.
  ENDMETHOD.                    "I_VEHICLE~STOP
ENDCLASS.                    "C_SHIP IMPLEMENTATION
*----------------------------------------------------------------
CLASS c_truck IMPLEMENTATION.
  METHOD constructor.
    max = 150.
  ENDMETHOD.                    "CONSTRUCTOR
  METHOD i_vehicle~drive.
    CHECK truck_speed &amp;lt; max.
    truck_speed = truck_speed + 50.
    RAISE EVENT i_vehicle~speed_change
                EXPORTING new_speed = truck_speed.
  ENDMETHOD.                    "I_VEHICLE~DRIVE
  METHOD i_vehicle~stop.
    CHECK truck_speed &amp;gt; 0.
    truck_speed = 0.
    RAISE EVENT i_vehicle~speed_change
                EXPORTING new_speed = truck_speed.
  ENDMETHOD.                    "I_VEHICLE~STOP
ENDCLASS.                    "C_TRUCK IMPLEMENTATION
*----------------------------------------------------------------
CLASS status IMPLEMENTATION.
  METHOD class_constructor.
    SET PF-STATUS 'VEHICLE'.
    WRITE 'Click a button!'.

  ENDMETHOD.                    "CLASS_CONSTRUCTOR
  METHOD user_action.
    RAISE EVENT button_clicked EXPORTING fcode = sy-ucomm.
  ENDMETHOD.                    "USER_ACTION
ENDCLASS.                    "STATUS IMPLEMENTATION
*----------------------------------------------------------------
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 &amp;gt; 0.
        READ TABLE list INDEX sy-lilli INTO line.
        CALL METHOD line-iref-&amp;gt;drive.
      WHEN 'STOP'.
        LOOP AT list INTO line.
          CALL METHOD line-iref-&amp;gt;stop.
        ENDLOOP.
      WHEN 'CANCEL'.
        LEAVE PROGRAM.
    ENDCASE.
    CALL METHOD list_output.
  ENDMETHOD.                    "FCODE_HANDLER
  METHOD list_change .
    line-speed = new_speed.
    MODIFY TABLE list FROM line.
  ENDMETHOD.                    "LIST_CHANGE
  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.                    "LIST_OUTPUT
ENDCLASS.                    "C_LIST IMPLEMENTATION
*****************************************************************

*****************************************************************
* Global data of program
*****************************************************************
DATA list TYPE REF TO c_list.
*****************************************************************
* Program Events
*****************************************************************
START-OF-SELECTION.
  CREATE OBJECT list.
  SET HANDLER: list-&amp;gt;fcode_handler,
              list-&amp;gt;list_change FOR ALL INSTANCES.
*----------------------------------------------------------------
AT USER-COMMAND.
  CALL METHOD status=&amp;gt;user_action.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Sep 2008 09:23:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536701#M1071953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-21T09:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: pf - Status create Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536702#M1071954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to create the PF-STATUS "VEHICLE" with the following function codes from your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      WHEN 'CREA_SHIP'.

      WHEN 'CREA_TRUCK'.

      WHEN 'DRIVE'.

      WHEN 'STOP'.

      WHEN 'CANCEL'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then activate the PF-STATUS. it will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Sep 2008 13:15:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536702#M1071954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-21T13:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: pf - Status create Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536703#M1071955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sourav ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks i do that and it don't work.,&lt;/P&gt;&lt;P&gt;i put CREA_SHIP and &amp;amp; CREA_TRUCK in &lt;U&gt;Freely Assigned Function Keys&lt;/U&gt; annd activate and nothing happen.&lt;/P&gt;&lt;P&gt;what i miss?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Sep 2008 13:47:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536703#M1071955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-21T13:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: pf - Status create Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536704#M1071956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don't create in function keys...use application toolbar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Sep 2008 13:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pf-status-create-problem/m-p/4536704#M1071956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-21T13:54:04Z</dc:date>
    </item>
  </channel>
</rss>

