cancel
Showing results for 
Search instead for 
Did you mean: 

Display Result in FPM_LIST_UIBB_ATS

Former Member
0 Kudos

Hello FPM Expert,

I have one small doubt related to Webdynpro and FPM.

Doubt:- i have two Independent Components. Search(Webdynpro Component) and Result list(FPM_LIST_UIBB_ATS). Both are Independent to each other.

and i cogigured both component  in FPM_OVP_COMPONENT.

based upon the search crieteria in Search componet , coresponding result should display in Result list(FPM_LIST_UIBB_ATS).

           But while i give  some material number and click on Search button (This stuff is in webdynpro componet ) the result should display in   FPM_LIST_UIBB_ATS component. i am trying to use IF_FPM_APP_CONTROLLER. But i didnt find any proper  way to implement it.

For that any body has  any sample documents or solution ? any body can help me on this?

Thanks in advance!!

Accepted Solutions (1)

Accepted Solutions (1)

RobinV
Participant
0 Kudos

Hi Rakesh,

I had the same problem that you described. How to share data between GUIBB's?

Unfortunately SAP doesn't provides a framework for this. The answer from SAP is that you should create a singleton class which stores the data you want to share between the GUIBB's.

Well I think this solution is crap, so I have created my own connection framework for that, but that is a little bit out of scope for now.

The best thing you can do is to create a parameter in the GUIBB and call a class that combines a factory and singleton design pattern with that parameter. the factory/singleton should return a central data instance where you can store your data you want to share with other GUIBB's. This look a lot like the singleton approach, but when you use a parameter and a factory, then u can use you GUIBB with more configurations in the same application or use it in a totally different application. Your GUIBB will be reusable and I think that is the idea of GUIBB's.

You have also Wires, but a Wire provides only access to one other GUIBB so that is not really an option. Wires are mainly created to notify an other GUIBB that an event occurred, for example lead selection changed.

Best regards,

Robin Vleeschhouwer

RV SAP Consultancy

Former Member
0 Kudos

Hello Robin.

Thanks for Your reply.

This information is really helpful for me.

Can you please provide me some documents/information(how to use) for factory and singleton design pattern.

so that i can go through and will try to implement the same in my application.

Thnaks

Rakesh.

RobinV
Participant
0 Kudos

Hi Rakesh,

You can find more information about the singleton factory at:

http://zevolving.com/2012/02/abap-objects-design-patterns-singleton-factory/

Best regards,

Robin Vleeschhouwer

Answers (4)

Answers (4)

singhmanishekhar
Explorer
0 Kudos

I am attaching my example that passing data between GUIBB and Free UIBB.

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.



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 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!!!

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
* +-------------------------------------------------------------------------------------------------+
* | [--->] 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        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 .
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.


* <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>---------------------------------------------------------------------------------------+
* | 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
* +-------------------------------------------------------------------------------------------------+
* | [--->] 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'.
*  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
* +-------------------------------------------------------------------------------------------------+
* | [<-()] 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
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.

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
* +--------------------------------------------------------------------------------------</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,
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.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_COLLECTION_SUPPORT->CREATE_DATA
* +-------------------------------------------------------------------------------------------------+
* +--------------------------------------------------------------------------------------</SIGNATURE>

singhmanishekhar
Explorer
0 Kudos

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 “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.

singhmanishekhar
Explorer
0 Kudos

Dear All,

    If you want to implement Wire model to pass data between components, I will give a proper example for doing this.

Former Member
0 Kudos

Hi Manishekhar,

thanks for your reply.

If  through Wire model , this can be done  . Please give an example.i will try to implement .

Thanks

Rakesh..

Former Member
0 Kudos

Dear Rakesh,

Sharing Data between UIBBs from different Components

When the UIBBs of an application are implemented in several components, there is

often the need to share data between these components. Technically, there are several

approaches which you can take to achieve this. This is described in the following

For this purpose, the FPM offers Shared Data components.

This is an optional FPM feature which meets most applications’ demands. However,

if needed, it can be replaced by other technical alternatives as described in “Other

Options for Sharing Data”.

Using a Shared Data Component

A shared data component is a Web Dynpro component which implements the

IF_FPM_SHARED_DATA interface. This interface contains no methods or attributes but

serves as a marker interface only. Each component (e.g. UIBB,

FPM_OIF|GAF_CONF_EXIT component) which wants to use a shared data

component needs to declare a usage to the shared data component. For this, the

technical type of the usage does not need to refer to IF_FPM_SHARED_DATA (this

would mean that it would not have accessible methods/attributes) but link to the

actual component itself. The lifecycle handling is now handled completely by the

FPM. Whenever a component is instantiated by the FPM (e.g. a UIBB which is

configured for a given screen), the FPM analyzes all usages of that component. If it

detects a usage pointing to a component which implements the IF_FPM_SHARED_DATA

interface, a singleton of this shared data component is automatically attached to the

usage.

As a result, an application must proceed as follows to share data using the shared data

interface:

Create a component which implements the IF_FPM_SHARED_DATA interface.

This component contains methods to retrieve data from the business logic and

exposes the extracted UI data via its Web Dynpro context or interface

methods.

Each component accessing this shared data defines a usage of the shared data

component. This usage is automatically instantiated by the FPM.

The consuming component can now communicate with the shared data

component via Web Dynpro context mapping, attribute access or method calls.

Other Options for sharing Data

There are other options to share data between Web Dynpro components besides the

FPM shared data concept. There are occasions when it is best not to use a Shared Data

component, as detailed below:

There is already an application-specific API available which serves as a ‘data

container’ and can be accessed by several components.

The data needs to be shared not only between Web Dynpro components but

also between other entities, such as ABAP OO classes, function groups, etc.

The amount of data to be shared is so large that putting it into a Web Dynpro

context would result in performance and memory consumption issues.

In these cases, the application can consider using techniques such as the following:

An ABAP OO class which is accessible as a singleton, so that all consumers

share the same instance.

A function group with appropriate function modules.