wire model fpm

44
12/9/13 Create Wire Model in webdynpro FPM. | SCN scn.sap.com/message/10768608#10768608 1/44 Getting Started Newsletters Store Products Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Login Register Welcome, Guest Search the Community Activity Communications Actions Brow se 0 Tweet 0 4 Replies Latest reply : Jun 20, 2013 7:43 AM by Manishekhar Singh Share Like 0 Create Wire Model in webdynpro FPM. This question has been Answered. Hi Friends, Please , Help Me How to create Wire Model by Webdynpro FPM. Please Give me Step by Step process. i have done Form, list, search and Tree but i am not geting how to do Wire Model. So Please Give me Step by step Review to create Wire Model with FPM. it's Urgent. Thanks. Pappu Mehta Edited by: Pappu Kumar Mehta on Nov 18, 2011 3:38 AM Pappu Mehta Nov 18, 2011 9:39 AM Correct Answer by Manishekhar Singh on Nov 26, 2012 7:48 AM Wire Model The wire model can be used to create running FPM application by pure configuration or at least with minimal coding effort. The runtime interdependencies between UIBBs are defined by configuration entities called “wires” which are based on reusable “connector” classes implementing the dependency semantics. The primary use cases for the wire model are object models with generic access interfaces (for example, ESF, BOPF, or BOL). A wire controls the runtime interdependencies between two UIBBs; that is, they determine the data content of the target UIBB depending on user interaction changing the “outport” of the source UIBB. Outports can be of type lead selection, selection or collection. For example, the execution of a search on a Search GUIBB will change its collection outport and may therefore change the data content of a result list displayed in a separate List GUIBB. Similarly, changing the lead selection in a list of sales orders may change the data content of another list displaying the associated sales order items. In order to be part of a wire model, a UIBB needs to implement a certain Web Dynpro interface which in turn provides a feeder model implementation. The FPM GUIBBs are automatically integrated if their feeder classes implement the feeder model interface. Application areas or object models define their own namespaces for which their connector classes, feeder model classes can be reused. Moreover, they typically need to provide a transaction handler class which manages transaction events like save, modify

Upload: nagendran-rajendran

Post on 24-Oct-2015

206 views

Category:

Documents


16 download

DESCRIPTION

Wire Model FPM

TRANSCRIPT

Page 1: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 1/44

Getting Started Newsletters Store

Products Services & Support About SCN Downloads

Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation

Login RegisterWelcome, Guest Search the Community

Activity Communications Actions

Brow se

0 Tweet 0

4 Replies Latest reply: Jun 20, 2013 7:43 AM by Manishekhar Singh

Share Like 0

Create Wire Model in webdynpro FPM.This question has been Answered.

Hi Friends,

Please , Help Me How to create Wire Model by Webdynpro FPM. Please Give me Step by Step

process.

i have done Form, list, search and Tree but i am not geting how to do Wire Model. So Please Give

me Step by step Review to create Wire Model with FPM.

it's Urgent.

Thanks.

Pappu Mehta

Edited by: Pappu Kumar Mehta on Nov 18, 2011 3:38 AM

Pappu Mehta Nov 18, 2011 9:39 AM

Correct Answer

by Manishekhar Singh on Nov 26, 2012 7:48 AM

Wire ModelThe wire model can be used to create running FPM application by pure

configuration or at least with minimal coding effort. The runtime interdependencies

between UIBBs are defined by configuration entities called “wires” which are based on

reusable “connector” classes implementing the dependency semantics. The primary use

cases for the wire model are object models with generic access interfaces (for example,

ESF, BOPF, or BOL).

A wire controls the runtime interdependencies between two UIBBs; that is, they

determine the data content of the target UIBB depending on user interaction changing the

“outport” of the source UIBB. Outports can be of type lead selection, selection or

collection. For example, the execution of a search on a Search GUIBB will change its

collection outport and may therefore change the data content of a result list displayed in a

separate List GUIBB. Similarly, changing the lead selection in a list of sales orders may

change the data content of another list displaying the associated sales order items.

In order to be part of a wire model, a UIBB needs to implement a certain Web

Dynpro interface which in turn provides a feeder model implementation. The FPM

GUIBBs are automatically integrated if their feeder classes implement the feeder model

interface.

Application areas or object models define their own namespaces for which their

connector classes, feeder model classes can be reused. Moreover, they typically need to

provide a transaction handler class which manages transaction events like save, modify

Page 2: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 2/44

or check and global message handling.

Wires are defined on the level of the floorplan configuration. For each model

UIBB contained in the floorplan configuration, a source UIBB with specified outport can

be defined. Furthermore, a connector class and, potentially, connector parameters must

be maintained.

If the floorplan contains composite components (tabbed components), the model

UIBBs contained in the tabbed components can also be wired. However, in order to

provide better reusability of composite components, it is also possible to define intrinsic

wiring for tabbed components. A tabbed component can define a model UIBB as a

“wire plug” (this is usually a master UIBB), which serves as an entry point for the wiring

of the tabbed component from the enveloping floorplan component. If a wire plug is

configured for a tabbed UIBB, only the wire plug UIBB can be wired from outside.

Transaction Handler class

The transaction interface provides methods for handling global and transactional

events. In the FPM configuration editor, one transaction handler implementation can be

assigned on the level of the wire model. However, it is not mandatory to specify. But it

can be used for wring some specific logic for Application level events.

Interface “IF_FPM_WIRE_MODEL_TRANSACTION” is implemented for

creating transaction handle class.

Method Method description

START It is called at the starting of FPM

application. It provides 3 things “FPM

Massage manger instance”, “Property

bag of FPM Application”, and

“Runtime information of FPM”. Here,

we can also specify application commit

capability.

AFTER_FLUSH This method is called after FLUSH has

been called for all current UIBBs. It

can be used to flush buffers.

AFTER_PROCESS_EVENT This method is called after

PROCESS_EVENT has been called

for all current UIBBs. It can be used

for handling transactional events for

example SAVE or CHECK.

Moreover, it can be used to collect

messages which here not handled inside

UIBBs and to forward them to the

FPM message handler.

AFTER_PROCESS_BEFORE_OUTPUT This method is called after PBO has

been called for all current UIBBs. It

can be used to collect messages at the

latest possible point in time before

screen output.

AFTER_NEEDS_CONFIRMATION This method is called after

NEEDS_CONFIRMATION has been

called for all UIBBs. It can be used to

analyze and add confirmation requests.

IS_DIRTY This method can be used to indicate a

dirty state for the work protection

mode.

Connector Class

Page 3: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 3/44

The “IF_FPM_CONNECTOR” connector interface comprises an interface,

“IF_FPM_CONNECTOR_DEF”, defining the access by the FPM framework and an

interface “IF_FPM_CONNECTOR_RUN” for runtime access by the application feeder

model.

The definition interface possesses a static attribute, “SV_NAMESPACE”,

which should be filled with the namespace (ex. ‘FPM_DEMO’ or ‘BOL’ or user

specific) in the class constructor of a connector implementation (for example in a

common superclass).

Method for “IF_FPM_CONNECTOR_DEF”

Method Method description

GET_PARAMETER_LIST Connector classes can be parameterized to

flexibly control their runtime behavior. The

parameter values are maintained for the wires

in the FPM configuration editor. A parameter

is defined by a name, its data type and a

descriptive text.

INITIALIZE With this method the connector is initialized

with the parameter values. This method is

called by the FPM runtime upon UIBB

instantiation.

GET_PARAMETER_VALUE_SET With this method, a connector implementation

can provide a value set for each parameter.

For example, in an object model a parameter

may carry the association name. For a wire

between specified UIBBs, the method may

provide a list of all associations between the

source and target business object node.

SET_INPUT Receives an object reference carrying the

actual data of the connected outport. This

method is called before the UIBB‟s PBO by

the FPM runtime.

Method for “IF_FPM_CONNECTOR_RUN”

Method Method description

GET_OUTPUT Returns an object reference carrying the actual data to

be displayed by a UIBB. This method can be called by

the UIBB at PBO for example in the GET_DATA

method of a feeder class.

IS_CREATE_ALLOWED Returns a Boolean indicator whether entity creation is

allowed. This method can be called by the UIBB at

PBO to dynamically control the activation of create

buttons for example to maintain the action usage

parameter in the GET_DATA method of a feeder

class.

CREATE_ENTITY Creates and returns a data entity which can be

arbitrarily typed. This method can be called by an

action handler of the UIBB for example in the

PROCESS_EVENT method of a feeder class.

There are total seven methods in connector interface “IF_FPM_CONNECTOR” that

should be implemented in connector class. We should also create class constructor for

setting “Namespace”. “SET_OUTPUT” and “GET_OUTPUT” is bridge between FPM

components, so these methods should be implemented properly.

Page 4: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 4/44

Wire for Free UIBBs

Wire model is implemented on Web Dynpro component by implementing

“IF_FPM_UIBB_MODEL” Web Dynpro interface. It contains only one method

“GET_MODEL_API” which is used to set “FPM Feeder Model” for Free GUIBBs. It

contains only one parameter “RO_FEEDER_MODEL”. So, we have to create a FPM

Feeder Model class and assign to that parameter.

FPM Feeder Model Class – Interface “IF_FPM_FEEDER_MODEL” is

implemented for creating Feeder Model Class.

Method for “IF_FPM_ FEEDER_MODEL”

Method Method description

GET_NAMESPACE Returns the namespace of the underlying application

area. Method is called at design time.

SET_CONNECTOR Called upon instantiation of a UIBB. It hands over the

connector (reference to

IF_FPM_CONNECTOR_RUN) which can be

accessed for data retrieval at PBO.

GET_INPORT_KEY Returns a reference to an object key which characterizes

the meta data type expected at the import (for example

the business object node). Method is called at design

time.

GET_OUTPORTS Provides a table of outports comprising the object key,

the port type an identifier and a descriptive text. Method

is called at design time.

GET_OUTPORT_DATA Returns an object reference carrying the actual data

identifier for a certain port. Method is called at runtime.

Assistance class can also be used as Feeder Model Class and reference

“WD_ASSIT” can used as Feeder model instance.

Ex: METHOD get_model_api . ro_feeder_model = wd_assist.

ENDMETHOD.

Wire for GUIBBs

Nothing special we need to do that. Interface “IF_FPM_FEEDER_MODEL” is also

implemented on feeder class for getting port support. We need to set port

manually using structure “IF_FPM_FEEDER_MODEL=>CS_PORT_TYPE”.

It contains three constants “COLLECTION”, “SELECTION” and

“LEAD_SELECTION”. It should be properly configured.

Source Codes:

Code for Transaction handler class:class ZCL_MY_TRAN_HANDLER definition

public

create public .

public section.

*"* public components of class ZCL_MY_TRAN_HANDLER

*"* do not include other source files here!!!

interfaces IF_FPM_WIRE_MODEL_TRANSACTION .

protected section.

*"* protected components of class ZCL_MY_TRAN_HANDLER

*"* do not include other source files here!!!

private section.

*"* private components of class ZCL_MY_TRAN_HANDLER

*"* do not include other source files here!!!

data MO_MSG_MAN type ref to IF_FPM_MESSAGE_MANAGER .

Page 5: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 5/44

ENDCLASS.

CLASS ZCL_MY_TRAN_HANDLER IMPLEMENTATION.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_FLUSH

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_FLUSH.

return.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_NEEDS_CONFIRMATION

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_EVENT TYPE REF TO

CL_FPM_EVENT

* | [--->] IT_UIBBS TYPE

FPM_T_UIBB_COMPONENTS

* | [<-->] CT_CONFIRMATION_REQUESTS TYPE

FPM_T_CONFIRMATION_REQUESTS

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD

if_fpm_wire_model_transaction~after_needs_confirmation.

*----- which event

CASE io_event->mv_event_id.

*----- start over

WHEN if_fpm_constants=>gc_event-start_over.

*----- raise confirmation request if state is dirty

CHECK if_fpm_wire_model_transaction~is_dirty( ) =

abap_true.

APPEND cl_fpm_confirmation_request=>go_data_loss TO

ct_confirmation_requests.

ENDCASE.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_BEFORE_OUTPUT

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method

IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_BEFORE_OUTPUT.

RETURN.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

Page 6: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 6/44

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_EVENT

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_EVENT TYPE REF TO

CL_FPM_EVENT

* | [<-()] RV_RESULT TYPE

FPM_EVENT_RESULT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_EVENT.

CASE io_event->mv_event_id.

WHEN ''.

WHEN ''.

WHEN OTHERS.

ENDCASE.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~IS_DIRTY

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RV_IS_DIRTY TYPE

BOOLE_D

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_wire_model_transaction~is_dirty.

rv_is_dirty =

cl_fpm_wire_model_col_factory=>work_protection_is_dirty( ).

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~START

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_MESSAGE_MANAGER TYPE REF TO

IF_FPM_MESSAGE_MANAGER

* | [--->] IO_APP_PARAMETER TYPE REF TO

IF_FPM_PARAMETER

* | [--->] IS_RUNTIME_INFO TYPE

FPM_S_RUNTIME_INFO

* | [<---] EV_ALLOW_FPM_COMMIT TYPE

BOOLE_D

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_WIRE_MODEL_TRANSACTION~START.

mo_msg_man = io_message_manager.

ev_allow_fpm_commit = abap_false.

endmethod.

ENDCLASS.

Code for Connector Class:class ZCL_MY_WIRE_CONNECTOR definition

public

create public .

public section.

*"* public components of class ZCL_MY_WIRE_CONNECTOR

*"* do not include other source files here!!!

interfaces IF_FPM_CONNECTOR .

Page 7: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 7/44

interfaces IF_FPM_CONNECTOR_DEF .

interfaces IF_FPM_CONNECTOR_RUN .

class-methods CLASS_CONSTRUCTOR .

protected section.

*"* protected components of class ZCL_MY_WIRE_CONNECTOR

*"* do not include other source files here!!!

data MO_COLLECTION type ref to ZCL_COLLECTION_SUPPORT .

data MV_PORT_TYPE type FPM_MODEL_PORT_TYPE .

private section.

*"* private components of class ZCL_MY_WIRE_CONNECTOR

*"* do not include other source files here!!!

ENDCLASS.

CLASS ZCL_MY_WIRE_CONNECTOR IMPLEMENTATION.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Static Public Method

ZCL_MY_WIRE_CONNECTOR=>CLASS_CONSTRUCTOR

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method CLASS_CONSTRUCTOR.

if_fpm_connector~sv_namespace = 'FPM_DEMO'. "_BY_SIMI'.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~GET_PARAMETER_LIST

* +---------------------------------------------------------

----------------------------------------+

* | [<---] ET_PARAMETER TYPE

FPM_T_PARAMETER_DEF

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_CONNECTOR_DEF~GET_PARAMETER_LIST.

*----- no parameters

RETURN.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~GET_PARAMETER_VALUE_SET

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_PARAMETER_NAME TYPE

FPM_PARAMETER_NAME

* | [--->] IR_OBJECT_KEY_SOURCE TYPE REF TO DATA

* | [--->] IR_OBJECT_KEY_TARGET TYPE REF TO DATA

* | [<---] ET_VALUE_SET TYPE

FPM_T_PARAMETER_VALUE_SET

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_connector_def~get_parameter_value_set.

*----- no parameters

RETURN.

ENDMETHOD.

Page 8: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 8/44

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~INITIALIZE

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IT_PARAMETER_VALUE TYPE

FPM_T_PARAMETER_VALUE

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_CONNECTOR_DEF~INITIALIZE.

mv_port_type = iv_port_type.

if_fpm_connector_def~mv_wire_label = 'My Identity'.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~SET_INPUT

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_INPUT TYPE REF TO OBJECT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_connector_def~set_input.

mo_collection ?= io_input.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_RUN~CREATE_ENTITY

* +---------------------------------------------------------

----------------------------------------+

* | [--->] I_INITIAL_DATA TYPE

ANY(optional)

* | [<-()] RO_RESULT TYPE REF TO OBJECT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_connector_run~create_entity.

*----- no creation

RETURN.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_RUN~GET_OUTPUT

* +---------------------------------------------------------

----------------------------------------+

* | [--->] I_FILTER_DATA TYPE

ANY(optional)

* | [<-()] RO_OUTPUT TYPE REF TO OBJECT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_connector_run~get_output.

ro_output = mo_collection.

ENDMETHOD.

Page 9: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 9/44

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_RUN~IS_CREATE_ALLOWED

* +---------------------------------------------------------

----------------------------------------+

* | [--->] I_INITIAL_DATA TYPE

ANY(optional)

* | [<-()] RV_ALLOWED TYPE

ABAP_BOOL

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_connector_run~is_create_allowed.

**----- no creation allowed

* rv_allowed = abap_false.

ENDMETHOD.

ENDCLASS.

Code for Feeder Class (List GUIBB):class ZCL_GUIBB_LIST definition

public

final

create public .

public section.

*"* public components of class ZCL_GUIBB_LIST

*"* do not include other source files here!!!

interfaces IF_FPM_GUIBB .

interfaces IF_FPM_GUIBB_LIST .

interfaces IF_FPM_FEEDER_MODEL .

protected section.

*"* protected components of class ZCL_GUIBB_LIST

*"* do not include other source files here!!!

data MO_CONNECTOR type ref to IF_FPM_CONNECTOR_RUN .

data MO_COLLECTION type ref to ZCL_COLLECTION_SUPPORT .

data:

ms_object_key TYPE c LENGTH 1 value 'A'. "#EC NOTEXT .

interface IF_FPM_FEEDER_MODEL load .

data MT_OUTPORT type IF_FPM_FEEDER_MODEL=>TY_T_PORT .

data MV_PORT_DESCRIPTION type FPM_MODEL_PORT_DESCRIPTION .

methods SET_UP_PORTS .

methods SET_UP_PORT

importing

!IV_PORT_TYPE type FPM_MODEL_PORT_TYPE .

private section.

*"* private components of class ZCL_GUIBB_LIST

*"* do not include other source files here!!!

types:

BEGIN OF sdisplay,

userid TYPE zde_userid,

password TYPE zde_pass,

name TYPE zde_empname,

role TYPE zde_role,

dob TYPE zde_dob,

doj TYPE zde_doj,

gender TYPE zde_gender,

address TYPE zde_empaddress,

phone TYPE zde_phoneno,

managerid TYPE zde_managerid,

rating TYPE zde_rating,

END OF sdisplay .

types:

tdisplay TYPE TABLE OF sdisplay .

Page 10: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 10/44

data MS_DISPLAY type SDISPLAY .

data MT_DISPLAY type TDISPLAY .

data MS_CHANGE type FPMGB_S_CHANGELOG .

data MT_CHANGE type FPMGB_T_CHANGELOG .

data FLAG type BOOLEAN value 'X'. "#EC NOTEXT .

methods GET_COLLECTION .

ENDCLASS.

CLASS ZCL_GUIBB_LIST IMPLEMENTATION.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Private Method ZCL_GUIBB_LIST->GET_COLLECTION

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD get_collection.

IF mo_connector IS BOUND.

mo_collection ?= mo_connector->get_output( ).

ENDIF.

IF mo_collection IS BOUND.

IF mo_collection->mv_lead_selection_index IS INITIAL.

mo_collection->set_lead_selection_index( 1 ).

ENDIF.

ENDIF.

* Inintial time

IF mo_collection IS INITIAL.

CREATE OBJECT mo_collection.

mo_collection->set_lead_selection_index( 1 ).

ENDIF.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_INPORT_KEY

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RR_OBJECT_KEY TYPE REF TO DATA

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_INPORT_KEY.

FIELD-SYMBOLS:

<ls_object_key> LIKE ms_object_key.

CREATE DATA rr_object_key LIKE ms_object_key.

ASSIGN rr_object_key->* TO <ls_object_key>.

<ls_object_key> = ms_object_key.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_NAMESPACE

* +---------------------------------------------------------

----------------------------------------+

Page 11: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 11/44

* | [<-()] RV_NAMESPACE TYPE

FPM_MODEL_NAMESPACE

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_NAMESPACE.

rv_namespace = 'FPM_DEMO'.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_OUTPORTS

* +---------------------------------------------------------

----------------------------------------+

* | [<---] ET_OUTPORT TYPE

TY_T_PORT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_OUTPORTS.

et_outport = mt_outport.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* | [--->] IV_PORT_IDENTIFIER TYPE

FPM_MODEL_PORT_IDENTIFIER

* | [<-()] RO_DATA TYPE REF TO OBJECT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA.

ro_data = mo_collection.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~SET_CONNECTOR

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_CONNECTOR TYPE REF TO

IF_FPM_CONNECTOR_RUN

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~SET_CONNECTOR.

mo_connector = io_connector.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~CHECK_CONFIG

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_LAYOUT_CONFIG TYPE REF TO

IF_FPM_GUIBB_LIST_CONFIG

* | [<---] ET_MESSAGES TYPE

FPMGB_T_MESSAGES

Page 12: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 12/44

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~CHECK_CONFIG.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~FLUSH

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IT_CHANGE_LOG TYPE

FPMGB_T_CHANGELOG

* | [--->] IT_DATA TYPE REF TO DATA

* | [--->] IV_OLD_LEAD_SEL TYPE

I(optional)

* | [--->] IV_NEW_LEAD_SEL TYPE

I(optional)

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~FLUSH.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~GET_DATA

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_EVENTID TYPE REF TO

CL_FPM_EVENT

* | [--->] IT_SELECTED_FIELDS TYPE

FPMGB_T_SELECTED_FIELDS(optional)

* | [--->] IV_RAISED_BY_OWN_UI TYPE

BOOLE_D(optional)

* | [--->] IV_VISIBLE_ROWS TYPE

I(optional)

* | [<---] ET_MESSAGES TYPE

FPMGB_T_MESSAGES

* | [<---] EV_DATA_CHANGED TYPE

BOOLE_D

* | [<---] EV_FIELD_USAGE_CHANGED TYPE

BOOLE_D

* | [<---] EV_ACTION_USAGE_CHANGED TYPE

BOOLE_D

* | [<---] EV_SELECTED_LINES_CHANGED TYPE

BOOLE_D

* | [<-->] CT_DATA TYPE DATA

* | [<-->] CT_FIELD_USAGE TYPE

FPMGB_T_FIELDUSAGE

* | [<-->] CT_ACTION_USAGE TYPE

FPMGB_T_ACTIONUSAGE

* | [<-->] CT_SELECTED_LINES TYPE

RSTABIXTAB

* | [<-->] CV_LEAD_INDEX TYPE

SYTABIX

* | [<-->] CV_FIRST_VISIBLE_ROW TYPE I

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD IF_FPM_GUIBB_LIST~GET_DATA.

DATA: lv_sel_index TYPE i,

lv_col TYPE string.

*----- get data

get_collection( ).

Page 13: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 13/44

ct_data = mo_collection->get_table( ).

ev_data_changed = abap_true.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~GET_DEFAULT_CONFIG

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_LAYOUT_CONFIG TYPE REF TO

IF_FPM_GUIBB_LIST_CONFIG

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~GET_DEFAULT_CONFIG.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~GET_DEFINITION

* +---------------------------------------------------------

----------------------------------------+

* | [<---] EO_FIELD_CATALOG TYPE REF TO

CL_ABAP_TABLEDESCR

* | [<---] ET_FIELD_DESCRIPTION TYPE

FPMGB_T_LISTFIELD_DESCR

* | [<---] ET_ACTION_DEFINITION TYPE

FPMGB_T_ACTIONDEF

* | [<---] ET_SPECIAL_GROUPS TYPE

FPMGB_T_SPECIAL_GROUPS

* | [<---] ES_MESSAGE TYPE

FPMGB_S_T100_MESSAGE

* | [<---] EV_ADDITIONAL_ERROR_INFO TYPE

DOKU_OBJ

* | [<---] ET_DND_DEFINITION TYPE

FPMGB_T_DND_DEFINITION

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~GET_DEFINITION.

DATA: ls_field_usage TYPE fpmgb_s_listfield_descr,

lt_fxdval TYPE WDR_CONTEXT_ATTR_VALUE_LIST,

ls_fxdval TYPE wdr_context_attr_value.

eo_field_catalog ?= cl_abap_structdescr=>describe_by_data(

mt_display ).

** field description

* ls_field_usage-name = 'TEXTREF'.

* ls_field_usage-technical_field = 'X'.

* APPEND ls_field_usage to et_field_description.

* CLEAR ls_field_usage-technical_field.

*

* ls_field_usage-name = 'LINKTOURL'.

* ls_field_usage-text_ref = 'TEXTREF'.

* ls_field_usage-header_label = 'linkToURL'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'TEXTVIEW'.

* ls_field_usage-header_label = 'TextView'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'INPUTFIELD'.

* ls_field_usage-header_label = 'InputField'.

Page 14: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 14/44

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'LINKTOACTION'.

* ls_field_usage-header_label = 'LinkToAction'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'BUTTON'.

* ls_field_usage-header_label = 'Button'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'IMAGE'.

* ls_field_usage-header_label = 'Image'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'DROPDOWN'.

* ls_field_usage-header_label = 'Dropdown'.

*

* ls_fxdval-text = 'Printer'.

* ls_fxdval-value = 'PRINTER'.

* APPEND ls_fxdval to lt_fxdval.

*

* ls_fxdval-text = 'Loptop'.

* ls_fxdval-value = 'LOPTOP'.

* APPEND ls_fxdval to lt_fxdval.

*

* ls_fxdval-text = 'Webcam'.

* ls_fxdval-value = 'WEBCAM'.

* APPEND ls_fxdval to lt_fxdval.

*

* ls_field_usage-fixed_values = lt_fxdval.

* APPEND ls_field_usage to et_field_description.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~PROCESS_EVENT

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_EVENT TYPE REF TO

CL_FPM_EVENT

* | [--->] IV_RAISED_BY_OWN_UI TYPE

BOOLE_D(optional)

* | [--->] IV_LEAD_INDEX TYPE

SYTABIX

* | [--->] IV_EVENT_INDEX TYPE

SYTABIX

* | [--->] IT_SELECTED_LINES TYPE

RSTABIXTAB

* | [<---] EV_RESULT TYPE

FPM_EVENT_RESULT

* | [<---] ET_MESSAGES TYPE

FPMGB_T_MESSAGES

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~PROCESS_EVENT.

*----- which event?

CASE io_event->mv_event_id.

*----- lead selection

WHEN if_fpm_guibb_list=>gc_fpm_event_on_lead_sel.

*----- manage own lead selection change

CHECK iv_raised_by_own_ui = abap_true.

Page 15: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 15/44

mo_collection->set_lead_selection_index( iv_lead_index

).

*----- all other events

WHEN OTHERS.

ENDCASE.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB~GET_PARAMETER_LIST

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RT_PARAMETER_DESCR TYPE

FPMGB_T_PARAM_DESCR

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_GUIBB~GET_PARAMETER_LIST.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB~INITIALIZE

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IT_PARAMETER TYPE

FPMGB_T_PARAM_VALUE

* | [--->] IO_APP_PARAMETER TYPE REF TO

IF_FPM_PARAMETER(optional)

* | [--->] IV_COMPONENT_NAME TYPE

FPM_COMPONENT_NAME(optional)

* | [--->] IS_CONFIG_KEY TYPE

WDY_CONFIG_KEY(optional)

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_guibb~initialize.

set_up_ports( ).

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Protected Method ZCL_GUIBB_LIST->SET_UP_PORT

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method SET_UP_PORT.

FIELD-SYMBOLS:

<ls_port> LIKE LINE OF mt_outport,

<ls_object_key> LIKE ms_object_key.

*----- collection outport

APPEND INITIAL LINE TO mt_outport ASSIGNING <ls_port>.

<ls_port>-type = iv_port_type.

CREATE DATA <ls_port>-object_key LIKE ms_object_key.

ASSIGN <ls_port>-object_key->* TO <ls_object_key>.

<ls_object_key> = ms_object_key.

<ls_port>-identifier = ms_object_key.

<ls_port>-description = mv_port_description.

Page 16: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 16/44

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Protected Method ZCL_GUIBB_LIST->SET_UP_PORTS

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD set_up_ports.

mv_port_description = 'selection outport'.

*----- selection outport

set_up_port( if_fpm_feeder_model=>cs_port_type-selection

).

mv_port_description = 'lead selection outport'.

*----- lead selection outport

set_up_port( if_fpm_feeder_model=>cs_port_type-

lead_selection ).

ENDMETHOD.

ENDCLASS.

Code for Assistance Class also working as Feeder Model

Class:class ZCL_FREEGUIBB_ASSIT definition

public

inheriting from CL_WD_COMPONENT_ASSISTANCE

create public .

public section.

*"* public components of class ZCL_FREEGUIBB_ASSIT

*"* do not include other source files here!!!

interfaces IF_FPM_FEEDER_MODEL .

methods BEFORE_PBO .

methods INIT

importing

!IO_ATTR_NODE type ref to IF_WD_CONTEXT_NODE .

protected section.

*"* protected components of class ZCL_FREEGUIBB_ASSIT

*"* do not include other source files here!!!

private section.

*"* private components of class ZCL_FREEGUIBB_ASSIT

*"* do not include other source files here!!!

data MO_CONNECTOR type ref to IF_FPM_CONNECTOR_RUN .

data MO_ATTR_NODE type ref to IF_WD_CONTEXT_NODE .

data MO_COLLECTION type ref to ZCL_COLLECTION_SUPPORT .

ENDCLASS.

CLASS ZCL_FREEGUIBB_ASSIT IMPLEMENTATION.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT->BEFORE_PBO

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD before_pbo.

DATA:

Page 17: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 17/44

ls_data TYPE ZCL_COLLECTION_SUPPORT=>ty_data,

lo_rtti TYPE REF TO cl_abap_structdescr,

lr_data TYPE REF TO data,

lt_prop TYPE wdr_context_prop_for_node_tab.

FIELD-SYMBOLS:

<ls_data> TYPE any,

<ls_prop> LIKE LINE OF lt_prop.

CHECK mo_attr_node IS BOUND.

IF mo_connector IS BOUND.

mo_collection ?= mo_connector->get_output( ).

ENDIF.

IF mo_collection IS BOUND.

ls_data = mo_collection->get_lead_selection( ).

ENDIF.

lo_rtti = mo_attr_node->get_node_info( )-

>get_static_attributes_type( ).

CREATE DATA lr_data TYPE HANDLE lo_rtti.

ASSIGN lr_data->* TO <ls_data>.

MOVE-CORRESPONDING ls_data TO <ls_data>.

mo_attr_node->set_static_attributes( static_attributes =

<ls_data> ).

CHECK mo_collection IS INITIAL.

mo_attr_node->get_attribute_props_for_node( IMPORTING

properties = lt_prop ).

LOOP AT lt_prop ASSIGNING <ls_prop>.

<ls_prop>-enabled = abap_false.

ENDLOOP.

mo_attr_node->set_attribute_props_for_node( lt_prop ).

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_INPORT_KEY

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RR_OBJECT_KEY TYPE REF TO DATA

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~get_inport_key.

FIELD-SYMBOLS:

<ls_object_key> TYPE any.

CREATE DATA rr_object_key TYPE c LENGTH 1.

ASSIGN rr_object_key->* TO <ls_object_key>.

<ls_object_key> = 'A'.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_NAMESPACE

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RV_NAMESPACE TYPE

FPM_MODEL_NAMESPACE

Page 18: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 18/44

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_NAMESPACE.

rv_namespace = 'FPM_DEMO_SIMI'.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_OUTPORTS

* +---------------------------------------------------------

----------------------------------------+

* | [<---] ET_OUTPORT TYPE

TY_T_PORT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~get_outports.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* | [--->] IV_PORT_IDENTIFIER TYPE

FPM_MODEL_PORT_IDENTIFIER

* | [<-()] RO_DATA TYPE REF TO OBJECT

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~get_outport_data.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~SET_CONNECTOR

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_CONNECTOR TYPE REF TO

IF_FPM_CONNECTOR_RUN

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~set_connector.

mo_connector = io_connector.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT->INIT

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IO_ATTR_NODE TYPE REF TO

IF_WD_CONTEXT_NODE

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD init.

mo_attr_node = io_attr_node.

ENDMETHOD.

ENDCLASS.

Code for Collection support class (Used for Providing Data):

Page 19: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 19/44

class ZCL_COLLECTION_SUPPORT definition

public

create private

global friends ZCL_GUIBB_LIST .

public section.

*"* public components of class ZCL_COLLECTION_SUPPORT

*"* do not include other source files here!!!

types:

BEGIN OF ty_data,

userid TYPE zde_userid,

password TYPE zde_pass,

name TYPE zde_empname,

role TYPE zde_role,

dob TYPE zde_dob,

doj TYPE zde_doj,

gender TYPE zde_gender,

address TYPE zde_empaddress,

phone TYPE zde_phoneno,

managerid TYPE zde_managerid,

rating TYPE zde_rating,

END OF ty_data .

types:

t_data TYPE STANDARD TABLE OF ty_data

WITH DEFAULT KEY .

data MV_LEAD_SELECTION_INDEX type I read-only .

methods GET_TABLE

returning

value(RT_DATA) type T_DATA .

methods GET_LEAD_SELECTION

returning

value(RS_DATA) type TY_DATA .

methods SET_TABLE

importing

!IT_DATA type T_DATA .

methods SET_LEAD_SELECTION_INDEX

importing

!IV_INDEX type I .

methods SET_ATTRIBUTE

importing

!IV_ATTRIBUTE type NAME_KOMP

!I_VALUE type ANY

!IV_INDEX type I optional .

methods GET_TOTAL_COUNT

returning

value(RV_COUNT) type I .

protected section.

*"* protected components of class ZCL_COLLECTION_SUPPORT

*"* do not include other source files here!!!

methods CONSTRUCTOR .

private section.

*"* private components of class ZCL_COLLECTION_SUPPORT

*"* do not include other source files here!!!

data MT_DATA type T_DATA .

type-pools ABAP .

data MV_IS_DIRTY type ABAP_BOOL value ABAP_FALSE. "#EC

NOTEXT .

methods CREATE_DATA .

ENDCLASS.

Page 20: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 20/44

CLASS ZCL_COLLECTION_SUPPORT IMPLEMENTATION.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Protected Method ZCL_COLLECTION_SUPPORT-

>CONSTRUCTOR

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD constructor.

create_data( ).

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Private Method ZCL_COLLECTION_SUPPORT-

>CREATE_DATA

* +---------------------------------------------------------

----------------------------------------+

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD create_data.

SELECT * INTO CORRESPONDING FIELDS OF TABLE

mt_data FROM ZPMS_EMPLOYEE.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>GET_LEAD_SELECTION

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RS_DATA TYPE

TY_DATA

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method GET_LEAD_SELECTION.

READ TABLE mt_data INDEX mv_lead_selection_index

INTO rs_data.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT->GET_TABLE

* +---------------------------------------------------------

----------------------------------------+

* | [<-()] RT_DATA TYPE T_DATA

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method GET_TABLE.

rt_data = mt_data.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>GET_TOTAL_COUNT

* +---------------------------------------------------------

----------------------------------------+

Page 21: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 21/44

* | [<-()] RV_COUNT TYPE I

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method GET_TOTAL_COUNT.

rv_count = lines( mt_data ).

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>SET_ATTRIBUTE

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_ATTRIBUTE TYPE

NAME_KOMP

* | [--->] I_VALUE TYPE ANY

* | [--->] IV_INDEX TYPE

I(optional)

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

METHOD SET_ATTRIBUTE.

DATA:

lv_index TYPE i.

FIELD-SYMBOLS:

<ls_data> LIKE LINE OF mt_data,

<lv_value> TYPE any.

CHECK mt_data IS NOT INITIAL.

IF iv_index IS INITIAL.

lv_index = mv_lead_selection_index.

ELSE.

lv_index = iv_index.

ENDIF.

READ TABLE mt_data INDEX lv_index ASSIGNING <ls_data>.

CHECK sy-subrc = 0.

ASSIGN COMPONENT iv_attribute OF STRUCTURE <ls_data> TO

<lv_value>.

CHECK sy-subrc = 0.

<lv_value> = i_value.

mv_is_dirty = abap_true.

ENDMETHOD.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>SET_LEAD_SELECTION_INDEX

* +---------------------------------------------------------

----------------------------------------+

* | [--->] IV_INDEX TYPE I

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method SET_LEAD_SELECTION_INDEX.

mv_lead_selection_index = iv_index.

endmethod.

* <SIGNATURE>-----------------------------------------------

----------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT->SET_TABLE

* +---------------------------------------------------------

----------------------------------------+

Page 22: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 22/44

2466 View s

Average User Rating

(0 ratings)

* | [--->] IT_DATA TYPE T_DATA

* +---------------------------------------------------------

-----------------------------</SIGNATURE>

method SET_TABLE.

mt_data = it_data.

IF lines( mt_data ) > 0.

mv_lead_selection_index = 1.

ENDIF.

endmethod.

ENDCLASS.

Code in WD Components for Feeder Support:

Component controller methods:method GET_MODEL_API .

ro_feeder_model = wd_assist.

endmethod.

method PROCESS_BEFORE_OUTPUT .

wd_assist->before_pbo( ).

endmethod.

method WDDOINIT .

DATA:

lo_node TYPE REF TO if_wd_context_node.

*----- navigate data node

lo_node = wd_context->get_child_node( name = wd_this-

>wdctx_data ).

wd_assist->init( lo_node ).

endmethod.

Re: Create Wire Model in webdynpro FPM.

Wire ModelThe wire model can be used to create running FPM application by pure

configuration or at least with minimal coding effort. The runtime interdependencies between

UIBBs are defined by configuration entities called “wires” which are based on reusable

“connector” classes implementing the dependency semantics. The primary use cases for the

wire model are object models with generic access interfaces (for example, ESF, BOPF, or

BOL).

A wire controls the runtime interdependencies between two UIBBs; that is, they

determine the data content of the target UIBB depending on user interaction changing the

“outport” of the source UIBB. Outports can be of type lead selection, selection or

collection. For example, the execution of a search on a Search GUIBB will change its

collection outport and may therefore change the data content of a result list displayed in a

separate List GUIBB. Similarly, changing the lead selection in a list of sales orders may

change the data content of another list displaying the associated sales order items.

In order to be part of a wire model, a UIBB needs to implement a certain Web

Dynpro interface which in turn provides a feeder model implementation. The FPM

GUIBBs are automatically integrated if their feeder classes implement the feeder model

interface.

Correct Answer

Manishekhar Singh Nov 26, 2012 7:48 AM (in response to Pappu Mehta)

Page 23: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 23/44

Application areas or object models define their own namespaces for which their connector

classes, feeder model classes can be reused. Moreover, they typically need to provide a

transaction handler class which manages transaction events like save, modify or check and

global message handling.

Wires are defined on the level of the floorplan configuration. For each model UIBB

contained in the floorplan configuration, a source UIBB with specified outport can be

defined. Furthermore, a connector class and, potentially, connector parameters must be

maintained.

If the floorplan contains composite components (tabbed components), the model

UIBBs contained in the tabbed components can also be wired. However, in order to

provide better reusability of composite components, it is also possible to define intrinsic

wiring for tabbed components. A tabbed component can define a model UIBB as a “wire

plug” (this is usually a master UIBB), which serves as an entry point for the wiring of the

tabbed component from the enveloping floorplan component. If a wire plug is configured

for a tabbed UIBB, only the wire plug UIBB can be wired from outside.

Transaction Handler class

The transaction interface provides methods for handling global and transactional events.

In the FPM configuration editor, one transaction handler implementation can be assigned

on the level of the wire model. However, it is not mandatory to specify. But it can be used

for wring some specific logic for Application level events.

Interface “IF_FPM_WIRE_MODEL_TRANSACTION” is implemented for

creating transaction handle class.

Method Method description

START It is called at the starting of FPM

application. It provides 3 things “FPM

Massage manger instance”, “Property

bag of FPM Application”, and “Runtime

information of FPM”. Here, we can also

specify application commit capability.

AFTER_FLUSH This method is called after FLUSH has

been called for all current UIBBs. It can

be used to flush buffers.

AFTER_PROCESS_EVENT This method is called after

PROCESS_EVENT has been called for

all current UIBBs. It can be used for

handling transactional events for example

SAVE or CHECK. Moreover, it can be

used to collect messages which here not

handled inside UIBBs and to forward

them to the FPM message handler.

AFTER_PROCESS_BEFORE_OUTPUT This method is called after PBO has been

called for all current UIBBs. It can be

used to collect messages at the latest

possible point in time before screen

output.

AFTER_NEEDS_CONFIRMATION This method is called after

NEEDS_CONFIRMATION has been

called for all UIBBs. It can be used to

analyze and add confirmation requests.

IS_DIRTY This method can be used to indicate a

dirty state for the work protection mode.

Connector Class

Page 24: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 24/44

The “IF_FPM_CONNECTOR” connector interface comprises an interface,

“IF_FPM_CONNECTOR_DEF”, defining the access by the FPM framework and an

interface “IF_FPM_CONNECTOR_RUN” for runtime access by the application feeder

model.

The definition interface possesses a static attribute, “SV_NAMESPACE”, which

should be filled with the namespace (ex. ‘FPM_DEMO’ or ‘BOL’ or user specific) in the

class constructor of a connector implementation (for example in a common superclass).

Method for “IF_FPM_CONNECTOR_DEF”

Method Method description

GET_PARAMETER_LIST Connector classes can be parameterized to

flexibly control their runtime behavior. The

parameter values are maintained for the wires in

the FPM configuration editor. A parameter is

defined by a name, its data type and a

descriptive text.

INITIALIZE With this method the connector is initialized with

the parameter values. This method is called by

the FPM runtime upon UIBB instantiation.

GET_PARAMETER_VALUE_SET With this method, a connector implementation

can provide a value set for each parameter. For

example, in an object model a parameter may

carry the association name. For a wire between

specified UIBBs, the method may provide a list

of all associations between the source and target

business object node.

SET_INPUT Receives an object reference carrying the actual

data of the connected outport. This method is

called before the UIBB‟s PBO by the FPM

runtime.

Method for “IF_FPM_CONNECTOR_RUN”

Method Method description

GET_OUTPUT Returns an object reference carrying the actual data to be

displayed by a UIBB. This method can be called by the

UIBB at PBO for example in the GET_DATA method of

a feeder class.

IS_CREATE_ALLOWED Returns a Boolean indicator whether entity creation is

allowed. This method can be called by the UIBB at PBO

to dynamically control the activation of create buttons for

example to maintain the action usage parameter in the

GET_DATA method of a feeder class.

CREATE_ENTITY Creates and returns a data entity which can be arbitrarily

typed. This method can be called by an action handler of

the UIBB for example in the PROCESS_EVENT

method of a feeder class.

There are total seven methods in connector interface “IF_FPM_CONNECTOR” that

should be implemented in connector class. We should also create class constructor for

setting “Namespace”. “SET_OUTPUT” and “GET_OUTPUT” is bridge between FPM

components, so these methods should be implemented properly.

Wire for Free UIBBs

Page 25: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 25/44

Wire model is implemented on Web Dynpro component by implementing

“IF_FPM_UIBB_MODEL” Web Dynpro interface. It contains only one method

“GET_MODEL_API” which is used to set “FPM Feeder Model” for Free GUIBBs. It

contains only one parameter “RO_FEEDER_MODEL”. So, we have to create a FPM

Feeder Model class and assign to that parameter.

FPM Feeder Model Class – Interface “IF_FPM_FEEDER_MODEL” is

implemented for creating Feeder Model Class.

Method for “IF_FPM_ FEEDER_MODEL”

Method Method description

GET_NAMESPACE Returns the namespace of the underlying application area.

Method is called at design time.

SET_CONNECTOR Called upon instantiation of a UIBB. It hands over the

connector (reference to IF_FPM_CONNECTOR_RUN)

which can be accessed for data retrieval at PBO.

GET_INPORT_KEY Returns a reference to an object key which characterizes

the meta data type expected at the import (for example the

business object node). Method is called at design time.

GET_OUTPORTS Provides a table of outports comprising the object key, the

port type an identifier and a descriptive text. Method is

called at design time.

GET_OUTPORT_DATA Returns an object reference carrying the actual data

identifier for a certain port. Method is called at runtime.

Assistance class can also be used as Feeder Model Class and reference

“WD_ASSIT” can used as Feeder model instance.

Ex: METHOD get_model_api . ro_feeder_model = wd_assist.

ENDMETHOD.

Wire for GUIBBs

Nothing special we need to do that. Interface “IF_FPM_FEEDER_MODEL” is also

implemented on feeder class for getting port support. We need to set port manually

using structure “IF_FPM_FEEDER_MODEL=>CS_PORT_TYPE”. It contains

three constants “COLLECTION”, “SELECTION” and “LEAD_SELECTION”.

It should be properly configured.

Source Codes:

Code for Transaction handler class:class ZCL_MY_TRAN_HANDLER definition

public

create public .

public section.

*"* public components of class ZCL_MY_TRAN_HANDLER

*"* do not include other source files here!!!

interfaces IF_FPM_WIRE_MODEL_TRANSACTION .

protected section.

*"* protected components of class ZCL_MY_TRAN_HANDLER

*"* do not include other source files here!!!

private section.

*"* private components of class ZCL_MY_TRAN_HANDLER

*"* do not include other source files here!!!

data MO_MSG_MAN type ref to IF_FPM_MESSAGE_MANAGER .

ENDCLASS.

Page 26: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 26/44

CLASS ZCL_MY_TRAN_HANDLER IMPLEMENTATION.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_FLUSH

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_FLUSH.

return.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_NEEDS_CONFIRMATION

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_EVENT TYPE REF TO

CL_FPM_EVENT

* | [--->] IT_UIBBS TYPE

FPM_T_UIBB_COMPONENTS

* | [<-->] CT_CONFIRMATION_REQUESTS TYPE

FPM_T_CONFIRMATION_REQUESTS

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_wire_model_transaction~after_needs_confirmation.

*----- which event

CASE io_event->mv_event_id.

*----- start over

WHEN if_fpm_constants=>gc_event-start_over.

*----- raise confirmation request if state is dirty

CHECK if_fpm_wire_model_transaction~is_dirty( ) =

abap_true.

APPEND cl_fpm_confirmation_request=>go_data_loss TO

ct_confirmation_requests.

ENDCASE.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_BEFORE_OUTPUT

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method

IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_BEFORE_OUTPUT.

RETURN.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_EVENT

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_EVENT TYPE REF TO

Page 27: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 27/44

CL_FPM_EVENT

* | [<-()] RV_RESULT TYPE

FPM_EVENT_RESULT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_WIRE_MODEL_TRANSACTION~AFTER_PROCESS_EVENT.

CASE io_event->mv_event_id.

WHEN ''.

WHEN ''.

WHEN OTHERS.

ENDCASE.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~IS_DIRTY

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RV_IS_DIRTY TYPE BOOLE_D

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_wire_model_transaction~is_dirty.

rv_is_dirty =

cl_fpm_wire_model_col_factory=>work_protection_is_dirty( ).

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_TRAN_HANDLER-

>IF_FPM_WIRE_MODEL_TRANSACTION~START

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_MESSAGE_MANAGER TYPE REF TO

IF_FPM_MESSAGE_MANAGER

* | [--->] IO_APP_PARAMETER TYPE REF TO

IF_FPM_PARAMETER

* | [--->] IS_RUNTIME_INFO TYPE

FPM_S_RUNTIME_INFO

* | [<---] EV_ALLOW_FPM_COMMIT TYPE BOOLE_D

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_WIRE_MODEL_TRANSACTION~START.

mo_msg_man = io_message_manager.

ev_allow_fpm_commit = abap_false.

endmethod.

ENDCLASS.

Code for Connector Class:class ZCL_MY_WIRE_CONNECTOR definition

public

create public .

public section.

*"* public components of class ZCL_MY_WIRE_CONNECTOR

*"* do not include other source files here!!!

interfaces IF_FPM_CONNECTOR .

interfaces IF_FPM_CONNECTOR_DEF .

interfaces IF_FPM_CONNECTOR_RUN .

class-methods CLASS_CONSTRUCTOR .

protected section.

*"* protected components of class ZCL_MY_WIRE_CONNECTOR

*"* do not include other source files here!!!

Page 28: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 28/44

data MO_COLLECTION type ref to ZCL_COLLECTION_SUPPORT .

data MV_PORT_TYPE type FPM_MODEL_PORT_TYPE .

private section.

*"* private components of class ZCL_MY_WIRE_CONNECTOR

*"* do not include other source files here!!!

ENDCLASS.

CLASS ZCL_MY_WIRE_CONNECTOR IMPLEMENTATION.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Static Public Method

ZCL_MY_WIRE_CONNECTOR=>CLASS_CONSTRUCTOR

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method CLASS_CONSTRUCTOR.

if_fpm_connector~sv_namespace = 'FPM_DEMO'. "_BY_SIMI'.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~GET_PARAMETER_LIST

* +-----------------------------------------------------------

--------------------------------------+

* | [<---] ET_PARAMETER TYPE

FPM_T_PARAMETER_DEF

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_CONNECTOR_DEF~GET_PARAMETER_LIST.

*----- no parameters

RETURN.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~GET_PARAMETER_VALUE_SET

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_PARAMETER_NAME TYPE

FPM_PARAMETER_NAME

* | [--->] IR_OBJECT_KEY_SOURCE TYPE REF TO DATA

* | [--->] IR_OBJECT_KEY_TARGET TYPE REF TO DATA

* | [<---] ET_VALUE_SET TYPE

FPM_T_PARAMETER_VALUE_SET

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_connector_def~get_parameter_value_set.

*----- no parameters

RETURN.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~INITIALIZE

* +-----------------------------------------------------------

Page 29: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 29/44

--------------------------------------+

* | [--->] IT_PARAMETER_VALUE TYPE

FPM_T_PARAMETER_VALUE

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_CONNECTOR_DEF~INITIALIZE.

mv_port_type = iv_port_type.

if_fpm_connector_def~mv_wire_label = 'My Identity'.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_DEF~SET_INPUT

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_INPUT TYPE REF TO OBJECT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_connector_def~set_input.

mo_collection ?= io_input.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_RUN~CREATE_ENTITY

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] I_INITIAL_DATA TYPE

ANY(optional)

* | [<-()] RO_RESULT TYPE REF TO OBJECT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_connector_run~create_entity.

*----- no creation

RETURN.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_RUN~GET_OUTPUT

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] I_FILTER_DATA TYPE

ANY(optional)

* | [<-()] RO_OUTPUT TYPE REF TO OBJECT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_connector_run~get_output.

ro_output = mo_collection.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_MY_WIRE_CONNECTOR-

>IF_FPM_CONNECTOR_RUN~IS_CREATE_ALLOWED

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] I_INITIAL_DATA TYPE

Page 30: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 30/44

ANY(optional)

* | [<-()] RV_ALLOWED TYPE

ABAP_BOOL

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_connector_run~is_create_allowed.

**----- no creation allowed

* rv_allowed = abap_false.

ENDMETHOD.

ENDCLASS.

Code for Feeder Class (List GUIBB):class ZCL_GUIBB_LIST definition

public

final

create public .

public section.

*"* public components of class ZCL_GUIBB_LIST

*"* do not include other source files here!!!

interfaces IF_FPM_GUIBB .

interfaces IF_FPM_GUIBB_LIST .

interfaces IF_FPM_FEEDER_MODEL .

protected section.

*"* protected components of class ZCL_GUIBB_LIST

*"* do not include other source files here!!!

data MO_CONNECTOR type ref to IF_FPM_CONNECTOR_RUN .

data MO_COLLECTION type ref to ZCL_COLLECTION_SUPPORT .

data:

ms_object_key TYPE c LENGTH 1 value 'A'. "#EC NOTEXT .

interface IF_FPM_FEEDER_MODEL load .

data MT_OUTPORT type IF_FPM_FEEDER_MODEL=>TY_T_PORT .

data MV_PORT_DESCRIPTION type FPM_MODEL_PORT_DESCRIPTION .

methods SET_UP_PORTS .

methods SET_UP_PORT

importing

!IV_PORT_TYPE type FPM_MODEL_PORT_TYPE .

private section.

*"* private components of class ZCL_GUIBB_LIST

*"* do not include other source files here!!!

types:

BEGIN OF sdisplay,

userid TYPE zde_userid,

password TYPE zde_pass,

name TYPE zde_empname,

role TYPE zde_role,

dob TYPE zde_dob,

doj TYPE zde_doj,

gender TYPE zde_gender,

address TYPE zde_empaddress,

phone TYPE zde_phoneno,

managerid TYPE zde_managerid,

rating TYPE zde_rating,

END OF sdisplay .

types:

tdisplay TYPE TABLE OF sdisplay .

data MS_DISPLAY type SDISPLAY .

data MT_DISPLAY type TDISPLAY .

data MS_CHANGE type FPMGB_S_CHANGELOG .

data MT_CHANGE type FPMGB_T_CHANGELOG .

data FLAG type BOOLEAN value 'X'. "#EC NOTEXT .

methods GET_COLLECTION .

Page 31: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 31/44

ENDCLASS.

CLASS ZCL_GUIBB_LIST IMPLEMENTATION.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Private Method ZCL_GUIBB_LIST->GET_COLLECTION

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD get_collection.

IF mo_connector IS BOUND.

mo_collection ?= mo_connector->get_output( ).

ENDIF.

IF mo_collection IS BOUND.

IF mo_collection->mv_lead_selection_index IS INITIAL.

mo_collection->set_lead_selection_index( 1 ).

ENDIF.

ENDIF.

* Inintial time

IF mo_collection IS INITIAL.

CREATE OBJECT mo_collection.

mo_collection->set_lead_selection_index( 1 ).

ENDIF.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_INPORT_KEY

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RR_OBJECT_KEY TYPE REF TO DATA

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_INPORT_KEY.

FIELD-SYMBOLS:

<ls_object_key> LIKE ms_object_key.

CREATE DATA rr_object_key LIKE ms_object_key.

ASSIGN rr_object_key->* TO <ls_object_key>.

<ls_object_key> = ms_object_key.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_NAMESPACE

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RV_NAMESPACE TYPE

FPM_MODEL_NAMESPACE

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_NAMESPACE.

rv_namespace = 'FPM_DEMO'.

endmethod.

Page 32: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 32/44

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_OUTPORTS

* +-----------------------------------------------------------

--------------------------------------+

* | [<---] ET_OUTPORT TYPE

TY_T_PORT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_OUTPORTS.

et_outport = mt_outport.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* | [--->] IV_PORT_IDENTIFIER TYPE

FPM_MODEL_PORT_IDENTIFIER

* | [<-()] RO_DATA TYPE REF TO OBJECT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA.

ro_data = mo_collection.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_FEEDER_MODEL~SET_CONNECTOR

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_CONNECTOR TYPE REF TO

IF_FPM_CONNECTOR_RUN

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~SET_CONNECTOR.

mo_connector = io_connector.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~CHECK_CONFIG

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_LAYOUT_CONFIG TYPE REF TO

IF_FPM_GUIBB_LIST_CONFIG

* | [<---] ET_MESSAGES TYPE

FPMGB_T_MESSAGES

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~CHECK_CONFIG.

endmethod.

* <SIGNATURE>-------------------------------------------------

Page 33: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 33/44

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~FLUSH

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IT_CHANGE_LOG TYPE

FPMGB_T_CHANGELOG

* | [--->] IT_DATA TYPE REF TO DATA

* | [--->] IV_OLD_LEAD_SEL TYPE

I(optional)

* | [--->] IV_NEW_LEAD_SEL TYPE

I(optional)

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~FLUSH.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~GET_DATA

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_EVENTID TYPE REF TO

CL_FPM_EVENT

* | [--->] IT_SELECTED_FIELDS TYPE

FPMGB_T_SELECTED_FIELDS(optional)

* | [--->] IV_RAISED_BY_OWN_UI TYPE

BOOLE_D(optional)

* | [--->] IV_VISIBLE_ROWS TYPE

I(optional)

* | [<---] ET_MESSAGES TYPE

FPMGB_T_MESSAGES

* | [<---] EV_DATA_CHANGED TYPE BOOLE_D

* | [<---] EV_FIELD_USAGE_CHANGED TYPE BOOLE_D

* | [<---] EV_ACTION_USAGE_CHANGED TYPE BOOLE_D

* | [<---] EV_SELECTED_LINES_CHANGED TYPE BOOLE_D

* | [<-->] CT_DATA TYPE DATA

* | [<-->] CT_FIELD_USAGE TYPE

FPMGB_T_FIELDUSAGE

* | [<-->] CT_ACTION_USAGE TYPE

FPMGB_T_ACTIONUSAGE

* | [<-->] CT_SELECTED_LINES TYPE

RSTABIXTAB

* | [<-->] CV_LEAD_INDEX TYPE SYTABIX

* | [<-->] CV_FIRST_VISIBLE_ROW TYPE I

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD IF_FPM_GUIBB_LIST~GET_DATA.

DATA: lv_sel_index TYPE i,

lv_col TYPE string.

*----- get data

get_collection( ).

ct_data = mo_collection->get_table( ).

ev_data_changed = abap_true.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~GET_DEFAULT_CONFIG

* +-----------------------------------------------------------

--------------------------------------+

Page 34: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 34/44

* | [--->] IO_LAYOUT_CONFIG TYPE REF TO

IF_FPM_GUIBB_LIST_CONFIG

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~GET_DEFAULT_CONFIG.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~GET_DEFINITION

* +-----------------------------------------------------------

--------------------------------------+

* | [<---] EO_FIELD_CATALOG TYPE REF TO

CL_ABAP_TABLEDESCR

* | [<---] ET_FIELD_DESCRIPTION TYPE

FPMGB_T_LISTFIELD_DESCR

* | [<---] ET_ACTION_DEFINITION TYPE

FPMGB_T_ACTIONDEF

* | [<---] ET_SPECIAL_GROUPS TYPE

FPMGB_T_SPECIAL_GROUPS

* | [<---] ES_MESSAGE TYPE

FPMGB_S_T100_MESSAGE

* | [<---] EV_ADDITIONAL_ERROR_INFO TYPE DOKU_OBJ

* | [<---] ET_DND_DEFINITION TYPE

FPMGB_T_DND_DEFINITION

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~GET_DEFINITION.

DATA: ls_field_usage TYPE fpmgb_s_listfield_descr,

lt_fxdval TYPE WDR_CONTEXT_ATTR_VALUE_LIST,

ls_fxdval TYPE wdr_context_attr_value.

eo_field_catalog ?= cl_abap_structdescr=>describe_by_data(

mt_display ).

** field description

* ls_field_usage-name = 'TEXTREF'.

* ls_field_usage-technical_field = 'X'.

* APPEND ls_field_usage to et_field_description.

* CLEAR ls_field_usage-technical_field.

*

* ls_field_usage-name = 'LINKTOURL'.

* ls_field_usage-text_ref = 'TEXTREF'.

* ls_field_usage-header_label = 'linkToURL'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'TEXTVIEW'.

* ls_field_usage-header_label = 'TextView'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'INPUTFIELD'.

* ls_field_usage-header_label = 'InputField'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'LINKTOACTION'.

* ls_field_usage-header_label = 'LinkToAction'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'BUTTON'.

* ls_field_usage-header_label = 'Button'.

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'IMAGE'.

* ls_field_usage-header_label = 'Image'.

Page 35: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 35/44

* APPEND ls_field_usage to et_field_description.

*

* ls_field_usage-name = 'DROPDOWN'.

* ls_field_usage-header_label = 'Dropdown'.

*

* ls_fxdval-text = 'Printer'.

* ls_fxdval-value = 'PRINTER'.

* APPEND ls_fxdval to lt_fxdval.

*

* ls_fxdval-text = 'Loptop'.

* ls_fxdval-value = 'LOPTOP'.

* APPEND ls_fxdval to lt_fxdval.

*

* ls_fxdval-text = 'Webcam'.

* ls_fxdval-value = 'WEBCAM'.

* APPEND ls_fxdval to lt_fxdval.

*

* ls_field_usage-fixed_values = lt_fxdval.

* APPEND ls_field_usage to et_field_description.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB_LIST~PROCESS_EVENT

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_EVENT TYPE REF TO

CL_FPM_EVENT

* | [--->] IV_RAISED_BY_OWN_UI TYPE

BOOLE_D(optional)

* | [--->] IV_LEAD_INDEX TYPE SYTABIX

* | [--->] IV_EVENT_INDEX TYPE SYTABIX

* | [--->] IT_SELECTED_LINES TYPE

RSTABIXTAB

* | [<---] EV_RESULT TYPE

FPM_EVENT_RESULT

* | [<---] ET_MESSAGES TYPE

FPMGB_T_MESSAGES

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_GUIBB_LIST~PROCESS_EVENT.

*----- which event?

CASE io_event->mv_event_id.

*----- lead selection

WHEN if_fpm_guibb_list=>gc_fpm_event_on_lead_sel.

*----- manage own lead selection change

CHECK iv_raised_by_own_ui = abap_true.

mo_collection->set_lead_selection_index( iv_lead_index

).

*----- all other events

WHEN OTHERS.

ENDCASE.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB~GET_PARAMETER_LIST

Page 36: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 36/44

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RT_PARAMETER_DESCR TYPE

FPMGB_T_PARAM_DESCR

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_GUIBB~GET_PARAMETER_LIST.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_GUIBB_LIST-

>IF_FPM_GUIBB~INITIALIZE

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IT_PARAMETER TYPE

FPMGB_T_PARAM_VALUE

* | [--->] IO_APP_PARAMETER TYPE REF TO

IF_FPM_PARAMETER(optional)

* | [--->] IV_COMPONENT_NAME TYPE

FPM_COMPONENT_NAME(optional)

* | [--->] IS_CONFIG_KEY TYPE

WDY_CONFIG_KEY(optional)

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_guibb~initialize.

set_up_ports( ).

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Protected Method ZCL_GUIBB_LIST->SET_UP_PORT

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method SET_UP_PORT.

FIELD-SYMBOLS:

<ls_port> LIKE LINE OF mt_outport,

<ls_object_key> LIKE ms_object_key.

*----- collection outport

APPEND INITIAL LINE TO mt_outport ASSIGNING <ls_port>.

<ls_port>-type = iv_port_type.

CREATE DATA <ls_port>-object_key LIKE ms_object_key.

ASSIGN <ls_port>-object_key->* TO <ls_object_key>.

<ls_object_key> = ms_object_key.

<ls_port>-identifier = ms_object_key.

<ls_port>-description = mv_port_description.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Protected Method ZCL_GUIBB_LIST->SET_UP_PORTS

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD set_up_ports.

mv_port_description = 'selection outport'.

*----- selection outport

Page 37: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 37/44

set_up_port( if_fpm_feeder_model=>cs_port_type-selection ).

mv_port_description = 'lead selection outport'.

*----- lead selection outport

set_up_port( if_fpm_feeder_model=>cs_port_type-

lead_selection ).

ENDMETHOD.

ENDCLASS.

Code for Assistance Class also working as Feeder Model

Class:class ZCL_FREEGUIBB_ASSIT definition

public

inheriting from CL_WD_COMPONENT_ASSISTANCE

create public .

public section.

*"* public components of class ZCL_FREEGUIBB_ASSIT

*"* do not include other source files here!!!

interfaces IF_FPM_FEEDER_MODEL .

methods BEFORE_PBO .

methods INIT

importing

!IO_ATTR_NODE type ref to IF_WD_CONTEXT_NODE .

protected section.

*"* protected components of class ZCL_FREEGUIBB_ASSIT

*"* do not include other source files here!!!

private section.

*"* private components of class ZCL_FREEGUIBB_ASSIT

*"* do not include other source files here!!!

data MO_CONNECTOR type ref to IF_FPM_CONNECTOR_RUN .

data MO_ATTR_NODE type ref to IF_WD_CONTEXT_NODE .

data MO_COLLECTION type ref to ZCL_COLLECTION_SUPPORT .

ENDCLASS.

CLASS ZCL_FREEGUIBB_ASSIT IMPLEMENTATION.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT->BEFORE_PBO

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD before_pbo.

DATA:

ls_data TYPE ZCL_COLLECTION_SUPPORT=>ty_data,

lo_rtti TYPE REF TO cl_abap_structdescr,

lr_data TYPE REF TO data,

lt_prop TYPE wdr_context_prop_for_node_tab.

FIELD-SYMBOLS:

<ls_data> TYPE any,

<ls_prop> LIKE LINE OF lt_prop.

CHECK mo_attr_node IS BOUND.

IF mo_connector IS BOUND.

mo_collection ?= mo_connector->get_output( ).

ENDIF.

Page 38: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 38/44

IF mo_collection IS BOUND.

ls_data = mo_collection->get_lead_selection( ).

ENDIF.

lo_rtti = mo_attr_node->get_node_info( )-

>get_static_attributes_type( ).

CREATE DATA lr_data TYPE HANDLE lo_rtti.

ASSIGN lr_data->* TO <ls_data>.

MOVE-CORRESPONDING ls_data TO <ls_data>.

mo_attr_node->set_static_attributes( static_attributes =

<ls_data> ).

CHECK mo_collection IS INITIAL.

mo_attr_node->get_attribute_props_for_node( IMPORTING

properties = lt_prop ).

LOOP AT lt_prop ASSIGNING <ls_prop>.

<ls_prop>-enabled = abap_false.

ENDLOOP.

mo_attr_node->set_attribute_props_for_node( lt_prop ).

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_INPORT_KEY

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RR_OBJECT_KEY TYPE REF TO DATA

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~get_inport_key.

FIELD-SYMBOLS:

<ls_object_key> TYPE any.

CREATE DATA rr_object_key TYPE c LENGTH 1.

ASSIGN rr_object_key->* TO <ls_object_key>.

<ls_object_key> = 'A'.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_NAMESPACE

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RV_NAMESPACE TYPE

FPM_MODEL_NAMESPACE

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method IF_FPM_FEEDER_MODEL~GET_NAMESPACE.

rv_namespace = 'FPM_DEMO_SIMI'.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_OUTPORTS

* +-----------------------------------------------------------

--------------------------------------+

* | [<---] ET_OUTPORT TYPE

TY_T_PORT

Page 39: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 39/44

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~get_outports.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_PORT_TYPE TYPE

FPM_MODEL_PORT_TYPE

* | [--->] IV_PORT_IDENTIFIER TYPE

FPM_MODEL_PORT_IDENTIFIER

* | [<-()] RO_DATA TYPE REF TO OBJECT

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~get_outport_data.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT-

>IF_FPM_FEEDER_MODEL~SET_CONNECTOR

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_CONNECTOR TYPE REF TO

IF_FPM_CONNECTOR_RUN

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD if_fpm_feeder_model~set_connector.

mo_connector = io_connector.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_FREEGUIBB_ASSIT->INIT

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IO_ATTR_NODE TYPE REF TO

IF_WD_CONTEXT_NODE

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD init.

mo_attr_node = io_attr_node.

ENDMETHOD.

ENDCLASS.

Code for Collection support class (Used for Providing Data):class ZCL_COLLECTION_SUPPORT definition

public

create private

global friends ZCL_GUIBB_LIST .

public section.

*"* public components of class ZCL_COLLECTION_SUPPORT

*"* do not include other source files here!!!

types:

BEGIN OF ty_data,

userid TYPE zde_userid,

password TYPE zde_pass,

name TYPE zde_empname,

Page 40: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 40/44

role TYPE zde_role,

dob TYPE zde_dob,

doj TYPE zde_doj,

gender TYPE zde_gender,

address TYPE zde_empaddress,

phone TYPE zde_phoneno,

managerid TYPE zde_managerid,

rating TYPE zde_rating,

END OF ty_data .

types:

t_data TYPE STANDARD TABLE OF ty_data

WITH DEFAULT KEY .

data MV_LEAD_SELECTION_INDEX type I read-only .

methods GET_TABLE

returning

value(RT_DATA) type T_DATA .

methods GET_LEAD_SELECTION

returning

value(RS_DATA) type TY_DATA .

methods SET_TABLE

importing

!IT_DATA type T_DATA .

methods SET_LEAD_SELECTION_INDEX

importing

!IV_INDEX type I .

methods SET_ATTRIBUTE

importing

!IV_ATTRIBUTE type NAME_KOMP

!I_VALUE type ANY

!IV_INDEX type I optional .

methods GET_TOTAL_COUNT

returning

value(RV_COUNT) type I .

protected section.

*"* protected components of class ZCL_COLLECTION_SUPPORT

*"* do not include other source files here!!!

methods CONSTRUCTOR .

private section.

*"* private components of class ZCL_COLLECTION_SUPPORT

*"* do not include other source files here!!!

data MT_DATA type T_DATA .

type-pools ABAP .

data MV_IS_DIRTY type ABAP_BOOL value ABAP_FALSE. "#EC

NOTEXT .

methods CREATE_DATA .

ENDCLASS.

CLASS ZCL_COLLECTION_SUPPORT IMPLEMENTATION.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Protected Method ZCL_COLLECTION_SUPPORT-

>CONSTRUCTOR

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD constructor.

create_data( ).

ENDMETHOD.

Page 41: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 41/44

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Private Method ZCL_COLLECTION_SUPPORT-

>CREATE_DATA

* +-----------------------------------------------------------

--------------------------------------+

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD create_data.

SELECT * INTO CORRESPONDING FIELDS OF TABLE

mt_data FROM ZPMS_EMPLOYEE.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>GET_LEAD_SELECTION

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RS_DATA TYPE TY_DATA

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method GET_LEAD_SELECTION.

READ TABLE mt_data INDEX mv_lead_selection_index

INTO rs_data.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT->GET_TABLE

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RT_DATA TYPE T_DATA

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method GET_TABLE.

rt_data = mt_data.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>GET_TOTAL_COUNT

* +-----------------------------------------------------------

--------------------------------------+

* | [<-()] RV_COUNT TYPE I

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method GET_TOTAL_COUNT.

rv_count = lines( mt_data ).

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>SET_ATTRIBUTE

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_ATTRIBUTE TYPE

Page 42: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 42/44

NAME_KOMP

* | [--->] I_VALUE TYPE ANY

* | [--->] IV_INDEX TYPE

I(optional)

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

METHOD SET_ATTRIBUTE.

DATA:

lv_index TYPE i.

FIELD-SYMBOLS:

<ls_data> LIKE LINE OF mt_data,

<lv_value> TYPE any.

CHECK mt_data IS NOT INITIAL.

IF iv_index IS INITIAL.

lv_index = mv_lead_selection_index.

ELSE.

lv_index = iv_index.

ENDIF.

READ TABLE mt_data INDEX lv_index ASSIGNING <ls_data>.

CHECK sy-subrc = 0.

ASSIGN COMPONENT iv_attribute OF STRUCTURE <ls_data> TO

<lv_value>.

CHECK sy-subrc = 0.

<lv_value> = i_value.

mv_is_dirty = abap_true.

ENDMETHOD.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT-

>SET_LEAD_SELECTION_INDEX

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IV_INDEX TYPE I

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method SET_LEAD_SELECTION_INDEX.

mv_lead_selection_index = iv_index.

endmethod.

* <SIGNATURE>-------------------------------------------------

--------------------------------------+

* | Instance Public Method ZCL_COLLECTION_SUPPORT->SET_TABLE

* +-----------------------------------------------------------

--------------------------------------+

* | [--->] IT_DATA TYPE T_DATA

* +-----------------------------------------------------------

---------------------------</SIGNATURE>

method SET_TABLE.

mt_data = it_data.

IF lines( mt_data ) > 0.

mv_lead_selection_index = 1.

ENDIF.

endmethod.

ENDCLASS.

Code in WD Components for Feeder Support:

Component controller methods:method GET_MODEL_API .

ro_feeder_model = wd_assist.

Page 43: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 43/44

endmethod.

method PROCESS_BEFORE_OUTPUT .

wd_assist->before_pbo( ).

endmethod.

method WDDOINIT .

DATA:

lo_node TYPE REF TO if_wd_context_node.

*----- navigate data node

lo_node = wd_context->get_child_node( name = wd_this-

>wdctx_data ).

wd_assist->init( lo_node ).

endmethod.

Like (0)

Re: Create Wire Model in webdynpro FPM.

Dear all,

Wiring between components can be done mainly by two type of FPM class.

Transaction Handler class: It is implemented globally for a FPM Application.

However, it is not mandatory to specify. So, you can make an application without using

any transaction handler.

Use interface IF_FPM_WIRE_MODEL_TRANSACTION

Connector Class: It is main and mandatory part for implementing wire model. Here

you can specify the Namespace and this namespace plays big role for passing data.

Namespace: The definition interface possesses a static attribute,

“SV_NAMESPACE”, which should be filled with the namespace (ex. ‘FPM_DEMO’

or ‘BOL’ or user specific such as XYZ_NS) in the class constructor of a connector

implementation.

Wire for Free UIBBs

Wire model is implemented on Web Dynpro component by implementing

“IF_FPM_UIBB_MODEL” Web Dynpro interface. It contains only one method

“GET_MODEL_API” which is used to set “FPM Feeder Model” for Free GUIBBs. It

contains only one parameter “RO_FEEDER_MODEL”. So, we have to create a FPM

Feeder Model class and assign to that parameter.

FPM Feeder Model Class – Interface “IF_FPM_FEEDER_MODEL” is

implemented for creating Feeder Model Class.

Assistance class can also be used as Feeder Model Class and reference

“WD_ASSIT” can used as Feeder model instance.

Ex: METHOD get_model_api .

ro_feeder_model = wd_assist.

ENDMETHOD. Wire for GUIBBs: Nothing special we need to do that. Interface

“IF_FPM_FEEDER_MODEL” is also implemented on feeder class for getting port

support. We need to set port manually using structure

Manishekhar Singh Nov 26, 2012 8:20 AM (in response to Manishekhar Singh)

Page 44: Wire Model FPM

12/9/13 Create Wire Model in webdynpro FPM. | SCN

scn.sap.com/message/10768608#10768608 44/44

Follow SCNSite Index Contact Us SAP Help Portal

Privacy Terms of Use Legal Disclosure Copyright

0 Tweet 0Share Like 0

“IF_FPM_FEEDER_MODEL=>CS_PORT_TYPE”. It contains three constants

“COLLECTION”, “SELECTION” and “LEAD_SELECTION”. It should be properly

configured.

In addition of this, create collection handler class that will be passed between

components for retrieving and fetching data.

Like (0)

Re: Create Wire Model in webdynpro FPM.

Hi Manishekhar Singh ,

While I appreciate the info you provided in a few discussions, I've found it a bit complicated

to follow and understand. Why don't you write a nice Blog or How To Document on this

subject?

Cheers,

Custodio

Like (0)

Custodio de Oliveira Jun 20, 2013 6:03 AM (in response to Manishekhar Singh)

Re: Create Wire Model in webdynpro FPM.

Dear Custodio de Oliveira,

I was also thinking to make some document. I will surely share with you.

Thanks,

Mani

Like (1)

Manishekhar Singh Jun 20, 2013 7:43 AM (in response to Custodio de Oliveira)