cancel
Showing results for 
Search instead for 
Did you mean: 

Help on Enhacing FITV_FPM Component

Former Member
0 Kudos

Hi,

My requirement is to give a pop up message . an error message if user enters a wrong company company code in create new expense report. Presently it is giving a dump, we dont want ot get thw dump just an error meesage and user is able to neter it again.

I know FITV_FPM is the component used, but hw to enhance it and when is not know. This is critical issue at present and need to be resolved by tpday itself.

Please help me guys.

Thanks

Pooja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pooja,

Don't enhance the FITV_FPM component.

Enhance WD component FITE_VC_GENERAL_DATA. Enhance its component controller's method ON_NAVIGATE (Post Exit) and depending on your requirement try to set value of 'rv_response'. and this post-exit, you need to write a code for the pop-up window.

That means, if you want to navigate further (OK) set 'wd_this->fpm_api->gc_response_ok' for the 'rv_response' otherwise (Cancel) set 'wd_this->fpm_api->gc_response_cancel'.

Please try this and let me know if you still facing a problem.

Thanks,

Prashant

Former Member
0 Kudos

Hello Prashant,

Thanks for the response, I have read your response in one the thread similar to this one

I tried debug the method u specified, my problem is to macth whether the company code entered in cost centre assignment w.r.t PERNR is correct or now, if not at present system crashed but i need to gv a pop up message, I am unable to get these detail in this component and in this method.

Please if you have any idea from where I'll get details of the employee and company code.

Thanks

Pooja

Former Member
0 Kudos

Hi Pooja,

Please use below pseduo code.

1. Create post-exit method for the method ON_NAVIGATE of WD component FITE_VC_GENERAL_DATA

2. Check whether the company code entered in cost centre assignment w.r.t PERNR is correct or not

3. if not create popup window with relevant message and set 'rv_response' to 'wd_this->fpm_api->gc_response_cancel'

4. if company code entered in cost centre assignment w.r.t PERNR is correct set 'rv_response' to 'wd_this->fpm_api->gc_response_ok'.

And for the details like company code, PERNR, Please always try to see the valus contained in the Assistance class attribute like 'gs_general_data', 'gc_common_rfc_input' etc.

Company code , you will get this in assistance class attribute - 'GT_COSTCENTERS'

PERNR, you will get this in assistance class attribute - 'gc_common_rfc_input-employee_number'.

Please try this and let me know if you further needs more information.

Thanks,

Prashant

Former Member
0 Kudos

just one doubt ...wont it be pre exit enhancement...as we need to check this before the std method get executed as after the execution this std method dump comes, which we need to avoid.

Former Member
0 Kudos

Hi,

It can be done in pre-exit, but one thing can happen.

If you set rv_response to 'wd_this->fpm_api->gc_response_cancel' in pre-exit and std method sets this field to 'wd_this->fpm_api->gc_response_ok.' then there is no use of our enhancement. So better to do in post-exit only.

And about the dump, can you please verify the exact place where dump is coming and try to see the long text for the same.

But, this is the only method in this WD component used all over for cheking the data by the user and validation. and if something goes wrong by the user, just set rv_reponse to 'wd_this->fpm_api->gc_response_cancel'.

Thanks,

Prashant

Former Member
0 Kudos

Hi,

Thanks for the pseudo code....it was a great help...my problem is this on_navigate is called when i press "Change cost assignment: button and not onto when i press on save draft on this change cost assignment screen.

My requirement is to check for the above thing when user clicks on Accept or save draft on thsi change assignement screen .

I have added the same line of code in the post exit of ON_NAVIGATE of FITV_VC_COST_ASSIGNEMNT as this is called when ever user changes the cost centre or the company code on the "Cost assignment change" screen.

but how to get the compoany code and trip number as using the wd_Assist it is not giving me the the new company code that user has selected, it gives me the same old comnay code, I need the cost assignment and the trip number that user has selected on the screen.

Waiting for you valuable inputs.

Pooja

Edited by: Pooja Gupta on Dec 21, 2010 4:03 AM

Former Member
0 Kudos

Hi Pooja,

When you click on 'Change Cost Assignment' button, the screen whcih arrives is another WD component. Currently I do not access to my system, so will not abel to tell you the name of component but you can able to find the same form 'More Field' option.

In this WD component you will definitely get the new company code selected by user. And for validation purpose just have alook on the BADI TRIP_WEB_CHECK. you can do number of validation by implementing this BADI.

Thanks,

Prashant

Edited by: Prashant Jagdale (Genius) on Dec 21, 2010 3:29 PM

Former Member
0 Kudos

Hi Prashant,

I am able to solve the problem...just want to ask you one thing, I am raising an exceptio as

RAISE EXCEPTION TYPE cx_wd_general

EXPORTING

textid = cx_wd_general=>cx_wd_general

msg = lv_mesg.

where lv_mesg is my default mesaage to be printed.

Now this code produce the output as

Webdynrpo Exception: Invalud COmpany code.

Is there a way by which we can remove this "WebDynproException" from the above text...means I just want to dispaly

Invalid company code .

Pooja

Former Member
0 Kudos

Hi Pooja,

You need to catch the exception taht you have raised. for your reference I am giving sample code


try.
.....
code
.....

catch cx_wd_general into <Variable>
  Data: lv_error_text TYPE string.
lv_error_text = <Variable>->get_text( ).

  Data:
  l_message_manager type ref to if_wd_message_manager,
  ls_message TYPE symsg.

* Get reference for Message manager
  CALL METHOD gr_view_api_ref->get_message_manager
    RECEIVING
      message_manager = l_message_manager.

* Use following methods as per your requirement.
l_message_manager->report_t100_message
l_message_manager->REPORT_SUCCESS
l_message_manager->REPORT_WARNING
l_message_manager->REPORT_error_message

endtry.

Thanks,

Prashant

Former Member
0 Kudos

Hello Prashant,

Thanks for your valuable help........

My only problem left is that I want to print an error message for the invalid company code, means if the compoany code of the pernr does not match what he has selected on the screen .

Though I am raising an general type exception and message is getting generated and stopping the user on the same screen so that he can enter the data again, but message is prefixed by words "Web Dynpro Exception" which I want to remove.

I tried what you provided in above thread but not able to achieve that.

My whole idea is just to print the desired message on the screen and stopping user to move ahead and providing him option to enter the data again.

Hope to get something valuable again from you end on this as well.

Thanks

Pooja

Former Member
0 Kudos

Hi Pooja,

As I dont have access to the this portal application, I am not able to give exact point where you can do the coding, but I will surely tell you that, it can done using BADI TRIP_WEB_CHECK. Juts try to investigate on this BADI, implement relevant method and you can able to show error message on that screen itself.

Thanks,

Prashant

Former Member
0 Kudos

Hello Prashant,

Sorry to bother you again but I am facing a problem with same component.

I have tld you that I have enhaced ON_NAVIGATE method of FITV_VC_COST_ASSIGNMENT, this is working fine but now client wants that when user presses cancel button the screen get closed but this is not happening, now the same enhacement code is hit and values are compared and user is stopped to moving further becuase of the webdynpro exception.

I tried to capture the Fcode of the button but unable to do so as the values are not coming on screen.

Please help me and provide me the solution.

Pooja

Former Member
0 Kudos

Hi


but now client wants that when user presses cancel 
button the screen get closed but this is not happening

1. Which 'Cancel' button? from this component or from Main screen? i.e. FPM navigation Button

2. Screen gets closed means which screen? whole EP screen or only table pop in used in changing the cost assignment.

Please provide me upper details.

Thanks,

Prashant

Edited by: Prashant Jagdale (Genius) on Jan 14, 2011 3:15 PM

Former Member
0 Kudos

Hi,

There is no Cancel button on the Cost assignment screen, this button come from the main screen itself. And i think the main screen is from the FITV_FPM component, i put the break point onto the Action of the Cancel button in this FPM component but it is not being hit.

SO either this button is coming from the configuration or from somewhere else.

Bssicaalyy on press on Change cost centre either from the Enter the Receipot or directly from the main screen on the Create expense report, a new pop up screen for Cost Assignement opens which is FITV_VC_COST_ASSIGNEMNT.

Let me knwo if you want some more information.

Pooja

Former Member
0 Kudos

Hi Pooja,

Place a breakpoint into the method ON_NAVIGATE of WD component FITE_VC_GENERAL_DATA. See whether it is coming into the same when user clicks on 'Cancel' button from main screen. I think it should come. Observe the values of rv_responce varibale. It should be 'wd_this->fpm_api->gc_response_cancel'

Check for the value of the rv_responce and place a code to close the window insode that if condition. If you need code to close the window, please let me know.

Thanks,

Prashant

Former Member
0 Kudos

Prashant,

In aone scenario i am able to get the rv_resonse and updated the code, and now a seconf instance of the window is oepning.

Can you provide me the code for closing the window, we dont want ot open another window either...we just want to return to the main window by closing the same.

Pooja

Former Member
0 Kudos

Hi Pooja,

Create Exit outbound plug in the window. and use below code


  DATA : l_view_cntr TYPE REF TO if_wd_view_controller,
l_win_cntr TYPE REF TO if_wd_window_controller,
l_window TYPE REF TO if_wd_window,
l_parameter_list TYPE wdr_event_parameter_list,
l_parameter TYPE wdr_event_parameter,
l_val TYPE REF TO data.
  FIELD-SYMBOLS <fs> TYPE ANY.

  l_view_cntr = wd_this->wd_get_api( ).
  l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
  l_parameter-name = 'CLOSE_WINDOW'.

  CREATE DATA l_val TYPE c.
  ASSIGN l_val->* TO <fs>.
  <fs> = 'X'.
  l_parameter-value = l_val.
  INSERT l_parameter INTO TABLE l_parameter_list.
  l_win_cntr->if_wd_view_controller~fire_plug(
  EXPORTING plug_name = 'EXIT_PLUG'
  parameters = l_parameter_list ). 

You can find alternative code on SDN forum as well.

Below link may help you.

/people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications

You can avoid opening a second instance of window with the help of some configurable setting in portal

Thanks,

Prashant

Former Member
0 Kudos

can you explain what tis code doing

Former Member
0 Kudos

iam not understanding this code.once you explain this code if possiable

Answers (0)