cancel
Showing results for 
Search instead for 
Did you mean: 

Condition For Button Display

Former Member
0 Kudos
170

Hi All,

I have new requirement that create push button to reject all line items in complaint page.

I have done all changes. Now button is functioning as expected.

Issue is button display by default in the initial page even we have not entered any order number in that page. Here i need to set some conditon that if item list is not empty then need to display the button.

Component : ICCMP_BT_BUTTON

View : ButtonBar

Context Node : BTADMINI

Item List from Another Component & View

Component : ICCMP_BTITEM

View : ItemList

Context Node : BTADMINI

How can i set condition in HTM page whether Node(BTADMINI) is empty or not. How can i access here.

Note : Button Component as well have Contextnode (BTADMINII).

Hope you got the detailed issue.

Thank you,

Cha

View Entire Topic
VishnAndr
Active Contributor
0 Kudos

Hello Cha.

You always can write ABAP code in htm here. So you can do it as following:

<% lv_some_variable = controller->typed_context->btadmini.
if lv_some_variable .....
%>
// here you html code
<% endif. %>

Former Member
0 Kudos

Hi Anderi,

I am receving the Syntax error that "Protected method ' typed_context ' " not access here.

and one more issue, custom button created.

This code used in Event Handle Method.

lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_current( ).

In the above code "lr_entity" is empty whereas "collection_wrapper" is empty. Whis is the reason for collection wrapper empty.

Thank you,

Cha

VishnAndr
Active Contributor
0 Kudos

> I am receving the Syntax error that "Protected method ' typed_context ' " not access here.

Make it Public attribute in view controller class.

> This code used in Event Handle Method.

>

> lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_current( ).

>

> In the above code "lr_entity" is empty whereas "collection_wrapper" is empty.

It means that you node BTADMINI is empty.

By the way, could you pleas ellaborate how do you create your button? It seems, that you do not need to do manipulations in HTM page. Just may be in the GET_BUTTONS method.

Former Member
0 Kudos

HI Andrei,

This Button Development has been done by some other folks.

Initially button has been display only in Sales order page. Now we want the same in Complaints page as well. In HTM page, he set conditon for sales order process type. Now i have added Complaint process type along with condition.

After the change able to see the button in Complaints page as weel but issue is, in event handle method lr_entity has not get filled only for complaints but for Sales order "lr_entity" gets filled and working fine.

lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_current( ).

Here BTADMINI has value but "Collectio_Wrapper" doesn't have the value. Please sugges where else we need to make change.

Thank you,

Cha

VishnAndr
Active Contributor
0 Kudos

If the statement above lr_entity is not getting bound then it means that there is nothing in collection, i.e. there are no items. May be you chould try to test on other document which has items.

Former Member
0 Kudos

I checked for other document as well. Still COlletion_Wrapper is empty. But for Statndard order able to see the value in collection wrapper.

Is there anything else other place which we need to make the code change?

VishnAndr
Active Contributor
0 Kudos

Check that there are any items in DB table CRMD_ORDERADM_I for documents you're checking.

Other way: check in BOL Browser that there is something in adminH for your documents at all.

Former Member
0 Kudos

Checked other standard events i.e. pressed Change Button at that time Collection_Wrapper get filled.

>>check in BOL Browser that there is something in adminH for your documents at all. <<

Can you please Explain on this.

Note : Standard order from Different COmponetn & COmplaints is from Different Component. Do we need to make any change on "ON_NEW_FOUCS" method.

Edited by: Chabalan on Oct 21, 2011 3:28 PM

Former Member
0 Kudos

Waiting for your Reply.

Noticed that when we click the custom button Header (BTADMIH) is populating but (BTADMINI) is not populating. For Header Collection Wrapper is filling and item not filling.

lr_entity ?= me->typed_context->btadminH->collection_wrapper->get_current( ). " Working(BTADINH)"

lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_current( ). "Not Working(BTADINI)"

And Header Class is enhanced (Zclass) but Item Class has not enhanced (CL Class).

Now you might have some ideas.

Thank you,

Cha

VishnAndr
Active Contributor
0 Kudos

You always can check in BOL Browser (tx. genil_bol_browser in GUI) what you're looking for (I mean values: they are there or not).

Ok, then. As far as I remember btadmini node in ICCMP_BTITEM\ItemList is bound to the node in component controller. If so you can check there how it's populated in general and why it's not populated in your case.

You always can write something in ON_NEW_FOCUS and retrieve related entities of btadminh to btadmini from focus_bo there. But as I mentioned above if btadmini is bound to the node in component controler it should be populated there or through the component usage and component interface.

Former Member
0 Kudos

Hi Andreai,

Thank you, as per your suggestion, created bound in "WD_USGE_INITIALIZE" method, initially in this method for Button usage only "BTADMINH" bound was there. Now added BTADMINI as well.

BTADMINI Entity gets populated now. Issue is backend is not updated with the value we are passing from UI.

We have a button in frontend which is used to reject all items of the order.

But if we click the button, item (BTADMINI) entity get filled now, using the entity, calling the execute method with the value of "SetRejectReason" but if we look at the beckend item status still in Open and not "Reject".

Event handle method Code (In Button Component)

lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_current( ).

ls_param-name = 'REASON'. "#EC NOTEXT

ls_param-value = iv_rejection_code.

APPEND ls_param TO lt_param.

lr_entity->execute(

iv_method_name = 'setRejectionReason'

it_param = lt_param ).

Button COMP : ICCMP_BT_Button

Main COMP : ICCMP_BT_COM ( Which has Item Structure as well, here Button component has been called)

My assumption, BTADMINI instance only might be populatuing without value. Can you please suggest what is the issue

Thank you,

Cha

VishnAndr
Active Contributor
0 Kudos

Unfortunately,

I couldn't locate such method "setRejectionReason" for BTAdminI. It seems that it's your custom method. Try to debug it and understand its logic.