cancel
Showing results for 
Search instead for 
Did you mean: 

BTPARTNER - NAME1 and NAME2 for PARTNER_NO_DESCR

Former Member
0 Kudos

Hello,

we have the requirement to display in BTPARTNER both NAME1 and NAME2 in the attribute PARTNER_NO_DESCR. But this only for Accounts not for contact persons and not for org-units.

Has one of you experts already realised something like this?

Or could one of you please provide some hinds how to realize this?

Thanks a lot.

Kind regards

Manfred

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

you can get those values like this

method GET_PARTNER_NO_DESCR.

DATA: current TYPE REF TO if_bol_bo_property_access,

lr_entity type ref to cl_crm_bol_entiy,

lr_header type ref to cl_crm_bol_enity,

lv_fct type string,

lv_name1 type ref to string,

lv_name2 type ref to string.

IF iterator IS BOUND.

current = iterator->get_current( ).

ELSE.

current = collection_wrapper->get_current( ).

ENDIF.

if current is bound.

lr_entity ?= current.

lv_fct = lr_entity->get_property_as_string( iv_attr_name = 'PARTNER_FCT' ).

if lv_fct eq '00000009' . ""#### Activity Partner

lr_header ?= lr_entity->get_related_entity( iv_relation_name = 'BTBusinessPartnerRel' ).

lv_name1 = lr_header->get_property_as_string( iv_attr_name = 'NAME1' ).

lv_name2 = lr_header->get_property_as_string( iv_attr_name = 'NAME2' ).

endif.

endif.

ENDMETHOD.

Former Member
0 Kudos

Hi,

thank you.

This works for the GET_PARTNER_NO_DESCR.

We achieved that NAME1+NAME2 is displayed in webUI.

But now we are facing problems with SET_PARTNER_NO_DESCR.

As soon as we enter a partner number in this field NAME1+NAME2 is displayed -> fine.

But at save the system gives a message "Partner does not exist".

It seem the SET_PARTNER_NO_DESCR does not work with the change in GET_PARTNER_NO_DESCR.

Any ideas for this?

Thank you

Kind regards

Manfred

Former Member
0 Kudos

hi,

you don't run your custom logic on edit mode or escape logic if user enter number.

regards

Ismail

Former Member
0 Kudos

Hi,

the method GET_PARTNER_NO_DESCR is on level of the context node class of BTPARTNER.

We do not know how to check on this level wether the View is in display mode or in edit mode.

Could you please help?

Thank you.

Kind regards

Manfred

Former Member
0 Kudos

Hi Manfred,

You can check if entity is editable. Once you change view to edit mode your entity would also be switched to change mode.

you can use method is_changable or 'is_locked' to determine entity mode.

Just have a look at GET_BUTTONS method from component BP_HEAD/BPHEADOverview, here system determines if the it is an edit mode and accordingly enables or disables save and cancel buttons.

e Regards,

Bhushan

Former Member
0 Kudos

Hi,

i still do not know how to check if the view is in edit mode or change mode at the get_method of a context node attribute.

Yes it is clear how to check this in methods of the impl class - but not how to check on level of context node class.

Thanks a lot.

Kind regards

Manfred

Former Member
0 Kudos

Hi Manfred,

Please try below code in get_xxxx method

DATA: current TYPE REF TO if_bol_bo_property_access,

lr_entity type ref to cl_crm_bol_entity.

if iterator is bound.

current = iterator->get_current( ).

else.

current = collection_wrapper->get_current( ).

endif. " This chunk of code is already there in get method

        • Add below code

lr_entity ?= current.

if lr_entity->is_changable( ) = ABAP_TRUE. " Means entity is changable and ur view is in edit mode

else.

endif.

Please let me know if this helps.

e Regards,

Bhushan

Answers (0)