cancel
Showing results for 
Search instead for 
Did you mean: 

changing text in class cl_crm_bt_t_searchview_impl

former_member227595
Active Participant
0 Kudos

Hi gurus, I am trying to change the text-001 and text-002 in method EH_ONSEARCH at CL_CRM_BT_T_SEARCHVIEW_IMPL.

I've amplied the component, but I could do it, because, Do you know any nice way to change these texts ..

Thanks in advance.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member182421
Active Contributor
0 Kudos

I see two options here, one is change the translation (in the texts maintenance go to->translate) this doesn't require a standard modification but I must be aware this change will be overwritten if you apply a note/sp/etc. which involve the text object.

Another option can be modify the text directly, the advantage of this is you have control during the SPAU to keep the modifications or not.

SAP Library - Changing the SAP Standard (BC)

You can also create a custom text in the Z class and overwrite the logic where the text is called

super->redefined_method( )

* All my logic here

I did the third option when I was dealing with Window titles and worked fine

Cheers!

Luis

former_member227595
Active Participant
0 Kudos

Hi luis,

Thanks you very much!!


I've choosen the redefined option.

Regards

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Diego,

If i understood your question properly, below is the solution for that

Enhance your component then Z_*IMPL class will be created.

Then redefine the search method.

But don't call the super class method.

Copy the code from super class and place the code in the Sub class . Now you can change the text-symbols by creating new texts.

Hope it will be fine.

Regards,

Dinesh Gurram

former_member182421
Active Contributor
0 Kudos

Sorry but I must disagree, What will happen if you don't call the super and a note or SP applies to that code to...increase the some functionality or fix something? I would rather modify the text than do that, at least I have control via SPAU.

You can also create an implicit enhancement spot, at the beginning or end of the standard code, but this will lead to problems if there's a return/exit sentence, specially if you place the enhancement at the end.

Former Member
0 Kudos

Yes i agree with you . .  . Thanks Luis . .

Diego . . 

No need of changing the text symbols . . In the standard code he is setting the global variable GV_RESULT_TITLE . .

So what you do is call the super class method and after this you overwrite the GV_RESULT_TITLE value . ( Use the procedure which standard is following to fill gv_result_title by passing your own text symbols )

Regards

Dnesh Gurram

former_member182421
Active Contributor
0 Kudos

In that case I would call the super check if the gv_result title EQ TEXT-001 (standard) and if is the case replace it for my custom one, what do you think?

Former Member
0 Kudos

Directly gv_resut_title cannot be EQ to text-001 . Because gv_result_title is concatenation of different texts and message id and message number.

Better to overwrite after calling super method

former_member182421
Active Contributor
0 Kudos

REPLACE text into string?

Keep in mind if you overwrite the text you are overwriting it independently the logic inside the SUPER, the result can be, for example,  text-001, text-002 or whatever.

Former Member
0 Kudos

No i am telling to change gv_result_title.

eg : after calling super method gv_result_title = 'more entries 123 found'.

Why can't we completely overwrite gv_result_title ( which is global variable ) by our own technique with the texts required.

( Ofcourse we are doing independently . Thing is we need to change the texts . We don't need the standard text and then why do we need dependence here )

former_member182421
Active Contributor
0 Kudos

Maybe we are running in circles,

of course you can overwrite the field after calling the supper, my point is the field can have different values:

eg1: "more entries 123 found"

eg2: "Nothing found"

eg3: "blahblahblah"

If we assume the eg1 is the one which points to the text-001, in order to have control and just modify the variable according if the text-001 was used, otherwise you will be always overwriting the text, not respecting the logic inside the SUPER

Former Member
0 Kudos

we don't want to use that text ,

                                   then why do we need respect

why to change standard text , no need . .  .

Finally aim is to display our custom text ( avoiding standard text ) . Then why again to think of super . .

Should be on  strai8 line now

former_member182421
Active Contributor
0 Kudos

I'm sorry but I barely understood you last response, anyway, I believe I raised my concerns clear enough, so it's useless to discuss it further.

VishnAndr
Active Contributor
0 Kudos

Everybody can represent his view on how to "redefine" method and overwrite values. Both of you guys do have a point. Sometimes it's easier to overwrite the value, sometimes it's better to call a super-method and analyze the value deeply afterwards. Please, let the topic starter decide what he wants.

former_member182421
Active Contributor
0 Kudos

I'm not discussing what's easier or not, my worries are placed in the maintenance, how my change will affect to next SAP releases, but as I said in my latest response I there's no point on discussing it further, maybe what I missed is the sentence "let the topic started decide"