cancel
Showing results for 
Search instead for 
Did you mean: 

variable in view.htm page not used anywhere - odd

Former Member
0 Kudos

Hi,

I am working in Interaction center view IRecHistory of Application CRM_IC in transaction BSP_WD_WORKBENCH.

In .htm page of this view, there is a variable declared in page attributes tab called 'gv_currentIR_disabled'.

(there is nothing Z involved, all standard)

We are facing a very odd issue, value of this variable is coming by default as blank in dev system and as 'X' in quality system.

I am not able to find where is the value of this variable getting filled in from?

Nothing comes in where-used list, i could not find this variable getting filled anywhere in controller class, or ctxt or context node class. May be I am missing something very minor here!

Any pointers please.

Thanks,

Rohit

Accepted Solutions (1)

Accepted Solutions (1)

BGarcia
Active Contributor
0 Kudos

Hi Rohit,

That variable is filled in method SET_MODELS of class CL_CRM_IC_IRECHISTORY_IMPL.


*** Enable / disable button 'Current Interaction Record'
* compare current IRec and displayed IRec
  lr_bdc ?= get_custom_controller( 'CuCoBDC' ).
* change due to introduction of BDC->CurrentCentralOneOrder [MARK]
  data: crm_icwc_test(10).
  get parameter id 'CRM_ICWC_TEST' field crm_icwc_test.
  if crm_icwc_test+3(1) eq abap_true.
    lr_cur_entity   = lr_bdc->typed_context->currentcontext->collection_wrapper->get_current( ).
  else.
    lr_cur_col_wrap = lr_bdc->typed_context->currentinteractionrecord->get_collection_wrapper( ).
    lr_cur_entity   = lr_cur_col_wrap->get_current( ).
  endif.


  lr_dsp_col_wrap = lr_bdc->typed_context->currentoneorder->get_collection_wrapper( ).
  lr_dsp_entity   = lr_dsp_col_wrap->get_current( ).
  IF lr_cur_entity = lr_dsp_entity.
*   disable button 'Current Interaction Record'
    view->set_attribute( name   = 'gv_currentIR_disabled'
                         value  = 'X' ).
  ELSE.
*   enable button 'Current Interaction Record'
    view->set_attribute( name   = 'gv_currentIR_disabled'
                         value  = space ).
  ENDIF.

From just reading the code, it seems that if the interaction record you're trying to read is the same of current interaction, it fills with an 'X'. If not, it goes blank. But you can debug it just to see the data in real time

Hope that this helps you a little more.

Kind regards,

Garcia

Former Member
0 Kudos

Oh Great!

Thanks Bruno. Exactly what I was looking for.

One query please, I have never used this set_models method, and so didn't bother looking into the code. Could you please tell where is it used for generally? Also, as the variable name didn't come in where-used list, is searching methods the only way to know where some variable in htm page is getting filled from?

Thanks again for your answer. I have awarded points, and will change it to answered with my doubts solved!

Cheers,

Rohit

BGarcia
Active Contributor
0 Kudos

Hi Rohit.

Glad to hear that you've found what you're looking for

Concerning your questions, every view in IC Webclient 5.0, has a controller class, and they almost have some page attributes.

The SET_MODELS method act's mainly to map the page attributes into class variables.

This example, is not a very good one, since in this case it is defining that the view attribute gv_currentIR_disabled will have a direct value ('X' or blank). But, check the SET_MODELS of class CL_CRM_IC_IRECREASON_IMPL. It is mapping the class atribute GT_PRIO with irecreason.htm page attribute dd_prio.

Hope that helps!

Kind regards,

Garcia

Former Member
0 Kudos

Thanks Bruno,

Very helpful reply again.

But I still don't get one thing, like in the example you mentioned, page attribute is being filled in 'SET_MODELS' method, same value we could fill using <% controller->gt_ddlb %> variable, and filled in controller method somewhere.

This way, we can find variable in where-used list as well, and fill in any method we want.

My question is, what is the difference between two approaches, which one is better, and which is/should be followed going forward in CRM 7.0 version.

Also, when does this 'Set_models' method run, i could see it runs after do_request, that is everytime this page is requested.

I know it's a lot of questions, but couldn't stop asking them all

Thanks again.

Cheers,

Rohit

BGarcia
Active Contributor
0 Kudos

Hi Rohit.

You can do it both ways. But with SET_MODELS method you can map also BOL context nodes, like in class CL_CRM_IC_IRECREASON.

There you map one context node, like typed_context->AdminH to page attribute AdminH.

So in irecreason.htm code, you'll have only <%= AdminH->get_Ordernumber( 'OBJECT_ID' ) %> instead of bigger calls like <%= controller->typed_context->AdminH->get_Ordernumber( 'OBJECT_ID' ) %>.

It's really your choice

I think this is one of the last calls before the page is displayed, so that the variables values may be mapped without any further manipulation. It's like PBO in abap reports. You can search more information in the SAP marketplace for the consultants cookbook IC Webclient for version 5.0. It will help you for sure.

Kind regards,

Garcia

Former Member
0 Kudos

Got it!

Thanks again, you have been really helpful!

Closing the thread!

Cheers,

Rohit

Answers (0)