cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in FPM Development

Former Member
0 Kudos

Hi Team,

I am working on one FPM development based on Web Dyn. Component "FPM_OIF_COMPONENT". My query is regarding Modifying one of the FORM UIBB to include customer specific

fields.

To summarise

I have created :
Application                                         ZEHHSS_INC_REC_QAF  (Copy of EHHSS_INC_REC_QAF)
Description                                        Custom Report Incident - Simplified
Component                                        FPM_OIF_COMPONENT

(Application) Configuration Name         ZEHHSS_INC_REC_QAF (Copy of EHHSS_INC_REC_QAF)
Description                                        Custom Application Configuration for EHHSS_INC_REC_QAF
Web Dynpro Applicat.                         ZEHHSS_INC_REC_QAF


(Component) Configuration Name          ZEHHSS_INC_REC_QAF
Description                                         Custom Component Configuration for EHHSS_INC_REC_QAF
Web Dynpro Component                      FPM_OIF_COMPONENT


It is having Many FORM UIBB and LIST UIBB with their corresponding UIBB Configurations

One of them is

Form UIBB (1.3)
Component Name: FPM_FORM_UIBB 
View: FORM_WINDOW 

Configuration Name: EHHSS_INC_REC_QAF_BINF_FRM

Feeder Class : CL_EHHSS_INC_Q_LOC_UI_FRM

Requirement : I have to add some more client specific field to his configuration. For this reason I have copied this configuraion to "ZEHHSS_INC_REC_QAF_BINF_FRM" and added custom fields to this config.

Now Need your help in suggesting where to write code/validation for custom fields. I hope I need to write code in Feeder class only..but at which place.

Please suggest

Warm regards
Krishan Bishnoi

Accepted Solutions (1)

Accepted Solutions (1)

Aliaksandr
Active Participant
0 Kudos

Hi Frishan Bishnoi,

More often for this purposes method PROCESS_EVENT is used. Because it has EV_RESULT and ET_MESSAGES parameters which help you to interrupt event execution and show messages for user. You can refer to this link for getting more details.

If you have questions don't hesitate and ask me.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Hi Aliaksandr.

Thanks for your response.

As the process_event would get trigger after user press Send or close button.

I am still not clear how to hide/unhide the group of fields based on checkbox value.

Can you please suggest on this.

Warm Regards

Krishan

Aliaksandr
Active Participant
0 Kudos

Hi Krishan,

I try to get short description of whole process.

1. Define new action in the method GET_DEFINITION of your feeder class. Use ET_ACTION_DEFINITION parameter.

method if_fpm_guibb_form~get_definition.

   field-symbols: <s_action_def> like line of et_action_definition[].

   eo_field_catalog ?= cl_abap_structdescr=>describe_by_name( 'MARA' ).

   append initial line to et_action_definition[] assigning <s_action_def>.

   <s_action_def>-id = 'CHECKBOX_ACTION'.

endmethod.

2. Assign new action to checkbox field in component configuration.

3. Catch event in the method GET_DATA and change properties of fields in parameter CT_FIELD_USAGE based on values in CS_DATA. Don't forget to set EV_FIELD_USAGE_CHANGED = 'X'.

method if_fpm_guibb_form~get_data.

   field-symbols: <s_mara>        type mara,

                  <s_field_usage> like line of ct_field_usage[].

   case io_event->mv_event_id.

     when 'CHECKBOX_ACTION'.

       assign cs_data to <s_mara>.

       read table ct_field_usage[] assigning <s_field_usage> with key name = 'MATNR'.

       if <s_mara>-retdelc = abap_true.

         <s_field_usage>-read_only = abap_true.

       else.

         <s_field_usage>-read_only = abap_false.

       endif.

       read table ct_field_usage[] assigning <s_field_usage> with key name = 'MEINS'.

       if <s_mara>-retdelc = abap_true.

         <s_field_usage>-visibility = '01'.

       else.

         <s_field_usage>-visibility = '02'.

       endif.

       ev_field_usage_changed = abap_true.

     when others.

   endcase.

endmethod.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Hi Aliaksandr,

Thanks for your detailed response. I hope you are providing help which is very-2 close to my requirement.

I tried to proceed as suggetsed by you. but getting futher issue.

To summarise

I have done implicit enhancement at the end of GET_DEFINITION method as below

2. After this I navigating to my UIBB to provide the FPM Event ID = "FIRE_ACTION()"
but seeing error there... 

"The configuration is inconsistent, the preview is not possible".

Whether I am not putting my enhancement as correct place or where I went wrong

 

Please suggest.

Warm Regards

Krishan

Aliaksandr
Active Participant
0 Kudos

Hi Krishan,

First of all you must add new fields in structure on which component configuration is based on.

You want to enhance component configuration as on screen shot below.

This component configuration based on BASIC_INFO_ALL node of EHHSS_INCIDENT business object.

The best practice in this case is adding new fields in extension include structure. If it is possible you can change this structure if not you can append new structure in it.

It doesn't need to redefine OE_FIELD_CATALOG parameter in your enhancement. Errors in component configuration is appeared for this reason. New fields is automatically added in component configuration catalog then you add them in structure.

Don't forget to check component configuration name (attribute MV_CURRENT_CONFIG_ID of class CL_EHFND_FBI_GUIBB_FORM) in your enhancement before adding new action in table.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Thanks Aliaksandr.

Yes you are right, I am using only the approach you suggested above..by adding field to the custom include. Now the above error is resolved and I am trying to handle event in get_data as suggested by you.

I will be in touch with you again..in case i face any difficulty.

Again thank you so much..for understanding my problem and providing solution as per my scenario.

Warm Regards

Krishan

Former Member
0 Kudos

Hi Aliaksandr.

Not sure..where I am making mistake...but the code is not making any effect on my screen

For testing purpose. I am trying to achieve..

When "Fire" checkbox is checed, hide below two checkbox - process fire as well as non process fire.

I have appending custom field using append structure "       INCL_EEW_EHHSS_INC_BINFA_D" to main table "EHHSSD_INC_BINFA".

Now I have done implicit enhancement to "GET_DATA" method and write code as sugested by you in the end of method

Code:

   ENHANCEMENT ZENH_GET_DEFI1.    "active version
field-symbols: <s_field_usage> like line of ct_field_usage[].
  data: s_fire type ZST_EEW_EHHSS_INC_BINFA_D.

   case io_event->mv_event_id.
     when 'FIRE_ACTION'.
       MOVE-CORRESPONDING cs_data to s_fire.
      read table ct_field_usage[] assigning <s_field_usage> with key name = 'ZZ_PROCESS_FIRE'.
       if  s_fire-zz_fire = abap_true.
         <s_field_usage>-visibility = '01'.
       endif.
      read table ct_field_usage[] assigning <s_field_usage> with key name = 'ZZ_NP_FIRE'.
       if  s_fire-zz_fire = abap_true.
         <s_field_usage>-visibility = '01'.

       ev_field_usage_changed = abap_true.
       endif.
     when others.
   endcase.
ENDENHANCEMENT.

Note : I have used "

   ev_field_usage_changed = abap_true." only ONCE in the last.

But unfortunately, when I am clicking on Fire checkbox, nothing is happening at portal. while debugging, it is changing the visible property from 02 to 01 in table "ct_field_usage".

Please suggest.

Warm regards

Krishan

Aliaksandr
Active Participant
0 Kudos

Hi Krishan,

Could you try this code in your enhancement?

data: lt_field type fpmgb_t_formfield_descr.

field-symbols: <s_data>     type any,

                <zz_fire>    type ehhsss_inc_basic_info_all-zz_fire,

                <s_field>    like line of lt_field[],

                <visibility> type wdui_visibility.

if me->mv_current_config_id = 'EHHSS_INC_REC_QAF_BINF_FRM'.

   if io_event->mv_event_id = 'FIRE_ACTION'.

     assign cs_data to <s_data>.

     assign component 'ZZ_FIRE' of structure <s_data> to <zz_fire>.

     me->mo_view->get_fields( changing ct_fields_form = lt_field[] ).

     read table lt_field[] assigning <s_field> with table key name = 'ZZ_PROCESS_FIRE'.

     assign component <s_field>-visibility_ref of structure <s_data> to <visibility>.

     if <zz_fire> = abap_true.

       <visibility> = '01'.

     else.

       <visibility> = '02'.

     endif.

     read table lt_field[] assigning <s_field> with table key name = 'ZZ_NP_FIRE'.

     assign component <s_field>-visibility_ref of structure <s_data> to <visibility>.

     if <zz_fire> = abap_true.

       <visibility> = '01'.

     else.

       <visibility> = '02'.

     endif.

     ev_data_changed = abap_true.

   endif.

endif.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Hi Aliaksandr,

Thanks again for helping

Again getting some issues..

1.

firstly below error

mv_current_config_id is "UNKNOWN"

Replaced with

if MS_UIBB_KEY-config_id = 'ZEHHSS_INC_REC_QAF_BINF_FRM'.

so above error gone.

2 But now getting run-time error

Getting run-time error

Short text
    Field symbol has not yet been assigned.

at
       <visibility> = '01'.

Aliaksandr
Active Participant
0 Kudos

Hi Krishan,

Could you share all your code in enhancement? I did not understand about UNKNOWN.

And could you share content of lt_field[] table?

Kind regards, Aliaksandr.

Former Member
0 Kudos

Sure sir..I will give full details..here I am not to attach word documents...would it possible..that i can send to you by mail...or u can send a test mail to me at kkbishnoi2011@gmail.com

Former Member
0 Kudos

Hi Aliaksandr.

Please find steps

Class : CL_EHHSS_INC_Q_LOC_UI_FRM

Method: IF_FPM_GUIBB_FORM~GET_DATA

After clicking on this getting message

Method IF_FPM_GUIBB_FORM~GET_DATA is implemented

in class CL_EHFND_FBI_GUIBB_FORM

Inside this

   * Call the Method of the "super" class
*--------------------------------------------------------------------*
  CALL METHOD super->if_fpm_guibb_form~get_data

Class Interface      /BOFU/CL_FBI_GUIBB_FORM, method get data..

done enhancment in last of method

   ENHANCEMENT ZENH_GET_DEFI1.    "inactive version
data: lt_field type fpmgb_t_formfield_descr.
field-symbols: <s_data>     type any,
                <zz_fire>    type ehhsss_inc_basic_info_all-zz_fire,
                <s_field>    like line of lt_field[],
                <visibility> type wdui_visibility.

if me->mv_current_config_id = 'EHHSS_INC_REC_QAF_BINF_FRM'.
   if io_event->mv_event_id = 'FIRE_ACTION'.
     assign cs_data to <s_data>.
     assign component 'ZZ_FIRE' of structure <s_data> to <zz_fire>.
     me->mo_view->get_fields( changing ct_fields_form = lt_field[] ).
     read table lt_field[] assigning <s_field> with table key name = 'ZZ_PROCESS_FIRE'.
     assign component <s_field>-visibility_ref of structure <s_data> to <visibility>.
     if <zz_fire> = abap_true.
       <visibility> = '01'.
     else.
       <visibility> = '02'.
     endif.
     read table lt_field[] assigning <s_field> with table key name = 'ZZ_NP_FIRE'.
     assign component <s_field>-visibility_ref of structure <s_data> to <visibility>.
     if <zz_fire> = abap_true.
       <visibility> = '01'.
     else.
       <visibility> = '02'.
     endif.
      ev_data_changed = abap_true.
   endif.
endif.
ENDENHANCEMENT.

While activating, getting below error

Please suggest.

Warm Regards

Krishan

Aliaksandr
Active Participant
0 Kudos

Hi Krishan,

I read your emails.

It is quite difficult to offer you exactly approach (e.g. i don't like copy standard applications I prefer to customize them). I didn't work with EHS. My FMP, BOPF and FBI knowledge I got in TM projects. Currently I have access to EHS system but I can not make any changes.

I debugged GET_DEFFINITION method of Feeder class and it looks like that this approach must work for managing of visibility. For other properties (like read_only) this approach can be used.

Could you try to use code below? This code can be used only for managing read_only property but I hope it helps us to understand structure of EHS application.

data: lt_field type fpmgb_t_formfield_descr.

field-symbols: <s_data>     type any,

                <zz_fire>    type ehhsss_inc_basic_info_all-zz_fire,

                <s_field>    like line of lt_field[],

                <read_only>  type abap_bool.

if me->mo_view->/bofu/if_fbi_view~ms_node_conf-node_key = if_ehhss_inc_c=>sc_node-basic_info_all.

   if io_event->mv_event_id = 'FIRE_ACTION'.

     assign cs_data to <s_data>.

     assign component 'ZZ_FIRE' of structure <s_data> to <zz_fire>.

     me->mo_view->get_fields( changing ct_fields_form = lt_field[] ).

     read table lt_field[] assigning <s_field> with table key name = 'ZZ_PROCESS_FIRE'.

     assign component <s_field>-read_only_ref of structure <s_data> to <read_only>.

     if <zz_fire> = abap_true.

       <read_only> = abap_true.

     else.

       <read_only> = abap_false.

     endif.

     read table lt_field[] assigning <s_field> with table key name = 'ZZ_NP_FIRE'.

     assign component <s_field>-read_only_ref of structure <s_data> to <read_only>.

     if <zz_fire> = abap_true.

       <read_only> = abap_true.

     else.

       <read_only> = aba_false.

     endif.

     ev_data_changed = abap_true.

   endif.

endif.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Hi Aliaksandr,

Thanks again for your response.

I would try to implement the same and hope this would resolve the issue.

The links you made below are not working. It would be great if you can reinsert them.

"

I debugged GET_DEFFINITION method of Feeder class and it looks like that this approach must work for managing of visibility. For other properties (like read_only) this approach can be used."

Your help in this is very much appriciated.

Thanks

Krishan

Aliaksandr
Active Participant
0 Kudos

Hi Krishan,

My last code example can not hide fields (it sets read_only property). I hope it can help us to understand structure of EHS application.

About links. They are correct and refer to our answers of this theme. I try to explain what I meant.

First of all field visibility in FPM application in 95% is maintained in GET_DATA method of feeder class. It can be realized in several ways:

1. More simple way is change value of VISIBILITY field in parameter CT_FIELD_USAGE. It must be work if reference visibility field is not defined in GET_DEFINITION method.

2. If reference visibility field is defined in GET_DEFINITION method visibility must be maintained by changing value in this reference field. It can be made by direct changing of CS_DATA parameter in GET_DATA method or by triggering determination of business object.

As a result of my investigation I think you must use first approach because reference field for visibility is not defined in GET_DEFINITION method (it looks like ). You already tried this approach but it does not help you. I think some additional FBI event was triggered after this code and it restored fields properties. I adapted this code and offer you to use it again.

field-symbols: <s_data>         type any,

                <zz_fire>        type ehhsss_inc_basic_info_all-zz_fire,

                <s_field_usage>  like line of ct_field_usage[].

if me->mo_view->/bofu/if_fbi_view~ms_node_conf-node_key = if_ehhss_inc_c=>sc_node-basic_info_all.

   assign cs_data to <s_data>.

   assign component 'ZZ_FIRE' of structure <s_data> to <zz_fire>.

   read table ct_field_usage[] assigning <s_field_usage> with key name = 'ZZ_PROCESS_FIRE'.

   if <zz_fire> = abap_true.

     <s_field_usage>-visibility = cl_wd_uielement=>e_visible-none.

   else.

     <s_field_usage>-visibility = cl_wd_uielement=>e_visible-visible.

   endif.

   read table ct_field_usage[] assigning <s_field_usage> with key name = 'ZZ_NP_FIRE'.

   if <zz_fire> = abap_true.

     <s_field_usage>-visibility = cl_wd_uielement=>e_visible-none.

   else.

     <s_field_usage>-visibility = cl_wd_uielement=>e_visible-visible.

   endif.

   ev_field_usage_changed = abap_true.

endif.

I hope it helps you.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Dear Aliaksandr.

Issue got resolved now 🙂

Thanks for your detailed response , due to which i am able to resolve the issue.

Resolution : We were doing code correctly, only thing is that it was getting overwritten by FPM event sequece.

I have debugged throughly and found the correct event sequence..and that was the only magic.

Order of events

Before initial screen appears

FPM_START - Data changes

FPM_LEAVE_INITIAL_SCREEN - Data changes

FBI_SYNCUP: No change in data, value persists

FPM_EDIT : No change in data, value persists

FBI_SYNCUP : No change in data, value persists

FPM_FPM_GUIBB_LIST_ON_LEAD_SELECTI : No change in data, value persists


After inital screen appears

FIRE_ACTION : Data changes

FBI_SYNCUP : No change in data, value persists

After this I have coded almost in same way you have suggested.

I have used only events where "DATA CHANGES"..this would also improves performance.

My sample code

  FIELD-SYMBOLS: <s_field_usage> LIKE LINE OF ct_field_usage[].
DATA: s_fire TYPE zst_eew_ehhss_inc_binfa_d.
IF ms_uibb_key-config_id = 'ZEHHSS_INC_REC_QAF_BINF_FRM'.
  CASE io_event->mv_event_id.
    WHEN 'FPM_START' OR 'FPM_LEAVE_INITIAL_SCREEN' OR 'FIRE_ACTION'.
      MOVE-CORRESPONDING cs_data TO s_fire.
      READ TABLE ct_field_usage[] ASSIGNING <s_field_usage> WITH KEY name = 'ZZ_PROCESS_FIRE'.
      IF  s_fire-zz_fire = abap_true.
        <s_field_usage>-visibility = if_ehfnd_ui_constants_c=>gc_wdui_visible.
        ev_field_usage_changed = abap_true.
      ELSE.
        <s_field_usage>-visibility = if_ehfnd_ui_constants_c=>gc_wdui_invisible.
        ev_field_usage_changed = abap_true.
      ENDIF.
      READ TABLE ct_field_usage[] ASSIGNING <s_field_usage> WITH KEY name = 'ZZ_NP_FIRE'.
      IF  s_fire-zz_fire = abap_true.
        <s_field_usage>-visibility = if_ehfnd_ui_constants_c=>gc_wdui_visible.
        ev_field_usage_changed = abap_true.
      ELSE.
        <s_field_usage>-visibility = if_ehfnd_ui_constants_c=>gc_wdui_invisible.
        ev_field_usage_changed = abap_true.
      ENDIF.
    WHEN OTHERS.
  ENDCASE.
ENDIF.

Output :

Initally

And when I am clicking

Again many-2 thanks.

I have rewarded you the points.

Thanks again

Warm Regards

Krishan

former_member203480
Participant
0 Kudos

Dear Aliaksandr,

                        i have a similar requirement my requirement is to show an information message when user selects a particular value from the search help. this is a custom field which is added. in the same form .i have added the code in get definition and get data  methods as mentioned above .Finally

iam able to see the message when i enter the text  in field and press ENTER.but i want the message to be shown immediately when i select a particular text in the search help with out pressing enter.pls guide

Thanks&Regards

luxmi

Aliaksandr
Active Participant
0 Kudos

Hi Luxmi,

If you use dictionary search help FPM doesn't trigger event in such situation. As a variant you can try to trigger additional FPM event manually (inside exit-FM for search help).

Kind regards, Aliaksandr.

former_member203480
Participant
0 Kudos

Hi Aliaksandr,

                        Thanks for the inputs.I will check this and let you know also I have added a new field called location in the create environmental risk assessment screen now after creating risk assessment when I navigate to the created risk assessment (maintain risk assessment) and click on risks tab the button identify risks should be automatically clicked and the option based on location should be selected automatically and the location which is added in the first screen should be populated to the location structure automatically and this should be highlighted.pls

guide me with technical steps.

regards'

luxmi

Aliaksandr
Active Participant
0 Kudos

Hi Luxmi,

I don't have experience with "risk assessment". Your's question doesn't contain enough technical details. I recommend you to create new topic in appropriate place and send link to me. I will try to help you.

Kind regards, Aliaksandr.

former_member203480
Participant
0 Kudos

Hi Aliaksandr,

                        Thanks for your response.Please go through this link http://scn.sap.com/thread/3517291 and let me know if your thoughts.

regards

luxmi

Former Member
0 Kudos

Hi Aliaksandr,

if we have checkboxes in a custom Zcomponent( customm wedynpro component) and a field in Z configuration(ZEHHSS_INC_REC_NC_QAF_PART). How do we make the field visible or invisible based on the checkboxes.

PS: the custom webdynpro component is added as UIBB in ZEHHSS_INC_REC_NA_QAF but doesnot have any configuration of its own.

the field is added as UIBB (ZEHHSS_INC_REC_NC_QAF_FORM) in ZEHHSS_INC_REC_NA_QAF.


PFB the screenshot



ZEHHSSWDC_THEMES_NC is the component where checkboxes are present and ZEHHSS_INC_REC_NC_QAF_FORM is the configuration where fieldis present

please suggest

Thanks & regards,

Pritha

Former Member
0 Kudos

This message was moderated.

Answers (2)

Answers (2)

0 Kudos

Hi,

My question is, why din't we use Feeder Class Exit to achieve this rather than enhancing the Feeder Class Itself?

Nayan
Explorer
0 Kudos

Hi Krishnan,

Go through this developer manual

scn.sap.com/docs/DOC-30668

you will find it.

Former Member
0 Kudos

Hi Nayan,

Thanks.. I had a look on this document, but unable to find out which event trigger..when we change a value (say checkbox) when we are on same screen without pressing any submit button. Please suggest.

Warm Regards

Krishan

0 Kudos

Hi Krishan,

You don't need enhance feeder class. If you have added checkbox field for input in Form UIBB using component configuration enhancement, then you need to set FPM Event ID is FBI_DEFAULT (Flush Changes triggering insert/update) for Checkbox.

After this in Guided Procedure of determination you need to check After modify setting. Then control will stop into your determination, there you can read respective value of checkbox field.

Then According to your condition, you can hide/unhide your fields or enable/disable fields. You can explore  /BOBF/CL_LIB_H_SET_PROPERTY class.

check out the following code and snapshot

DATA : LO_PROPERTY TYPE REF TO /BOBF/CL_LIB_H_SET_PROPERTY.

  CREATE OBJECT LO_PROPERTY
    EXPORTING
      IS_CONTEXT = IS_CTX    " Context Information for Determinations
      IO_MODIFY  = IO_MODIFY.   " Interface to Change Data

you can set your field properties using following code

 

   LO_PROPERTY->SET_ATTRIBUTE_READ_ONLY(
      EXPORTING
        IV_ATTRIBUTE_NAME = <your constant interface name>=>SC_NODE_ATTRIBUTE-<your Node name>-<Fieldname>  " Name of the attribute for which the property is to be set
        IV_KEY            =  <your instance key>   " Key of the instance for which the property is to be set
    IV_VALUE          = ABAP_FALSE    " New value of this property (true/false)
    ).

 

refer the following snapshot for the same

former_member203480
Participant
0 Kudos

hi chetan .

                  it is working for check box but not for the value entered in the input field via f4 help.

I have followed your steps .if possible please check and let me know where iam going wrong

regards

luxmi

0 Kudos

Hi Lakshmi,

In Guided procedure of determination, check the Requested Node for Determination for node instance.

Kindly refer following snapshot for the same.

Thanks and regards,

Chetan P. Patil

former_member203480
Participant
0 Kudos

Hi Chetan,

                  right now the  risk assessment matrix which is being disaplayed with risk scores (numbers) these have to be populated with character values like high low severe

for eg   if the scores are     33 42 55 etc these have to be filled with the value HIGH ,LOW ,MEDIUM etc but the field which holds this values is integer  is there a way to enhance this and pass character value.

thanks&Regards

luxmi

0 Kudos

Hi Lakshmi,

To populate character values, you need to add fields in transient structure using append structure of that node. Then using determination you can populate character values.

If it is a web dynpro component then you need to enhance Web dynpro Component. There you need to add attribute for description  in context and using post exit you can populate character field.

Thanks and regards,

Chetan P. Patil


former_member203480
Participant
0 Kudos

Thanks a l ot chetan.Your answer is very useful also please let me know ur thoughts on this

http://scn.sap.com/thread/3531159

Regards

luxmi