SAP Virtual/Onsite Trainings

Document Categories:

What's New?

Contribute?

Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Implement Message management in FPM

By Rakesh Dhudipala

Scenario:

Below document explains,how to display messages in FPM  

Prerequisites:

ABAP objects,ABAP WebDynpro  

Step by step Procedure:  

Go to SE80 and create Webdynpro Called as ZTEST_MESSAGE.


Go to Implemented interfaces and implement IF_UI_FPM_BUILDING_BLOCK interface.

Go to component controller and create context called CUST as node and KUNNR attribute.  

Go to MAIN View context and Map the component controller context to View controller context.

Go to layout and create input field (Customer number).

Go to Component controller attributes tab add the below attributes.

Go to Component controller WDINIT method and write the below logic

method WDDOINIT .
*  Get the reference to the IF_FPM interface.
  wd_this->mr_fpm = cl_fpm_factory=>get_instance( ).

*  Get the reference to the FPM message manager interface.
  wd_this->mr_fpm_message_manager = wd_this->mr_fpm->mo_message_manager.
endmethod.  

Go to PROCESS_EVENT and add the below logic

method PROCESS_EVENT .
    DATA lo_nd_cust TYPE REF TO if_wd_context_node.
    DATA lo_el_cust TYPE REF TO if_wd_context_element.
    DATA lv_cust TYPE kna1-kunnr.
IF io_event->mv_event_id = if_fpm_constants=>gc_event-check.
*   navigate from <CONTEXT> to <CUST> via lead selection
    lo_nd_cust = wd_context->get_child_node( name = wd_this->wdctx_cust ).

*   get element via lead selection
    lo_el_cust = lo_nd_cust->get_element( ).
    
*     get single attribute
      lo_el_cust->get_attribute(
        EXPORTING
          name =  `KUNNR`
        IMPORTING
          value = lv_cust ).
 IF lv_cust IS INITIAL.
 CALL METHOD wd_this->mr_fpm_message_manager->REPORT_MESSAGE
    EXPORTING
      IV_MESSAGE_TEXT              = 'Please Enter customer number'
      IO_COMPONENT                 = wd_this
*      IV_SEVERITY                  = GC_SEVERITY_ERROR
*      IV_LIFETIME                  = GC_LIFE_VISIBILITY_AUTOMATIC
*      IV_PARAMETERS                =
*      IR_MESSAGE_USER_DATA         =
*      IV_MESSAGE_INDEX             =
*      IO_ELEMENT                   =
*      IV_ATTRIBUTE_NAME            =
*      IV_IS_VALIDATION_INDEPENDENT =
*      IO_CONTROLLER                =
      .
 ENDIF.

ENDIF.

endmethod.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image