Skip to Content
avatar image
Former Member

Use attribute PLANT from BTAdminI into BTAdminH in CRM Sales Order Screen

There is a standard field PLANT present in the Item Level in Create Sales Order screen in CRM. My requirement is to use this same field in the Header screen, so that when User enters any value in Header Plant, same value gets copied across all line items.

For this, I created a new model attribute with same name PLANT under header component BTAdminH using BOL entity BTAdminI and relationship BTItemCustExt/PLANT, since this attribute is present under BTAdminI.
Then I am able to add PLANT in the header component using Show Available Fields.
But this newly added field contains a error "BTAdminI not bound"
Since I am new to CRM ABAP, can you please help me in finding what is the issue and what have I missed while adding the attribute?

Below is the code from GET_PLANT method generated.

value = 'BTAdminI not bound'."#EC NOTEXT

if iterator is bound.
current = iterator->get_current( ).
current = collection_wrapper->get_current( ).


DATA: coll TYPE REF TO if_bol_entity_col.
DATA: entity TYPE REF TO cl_crm_bol_entity.

entity ?= current.

* while entity
coll = entity->get_related_entities(
iv_relation_name = 'BTItemCustExt' ). "#EC NOTEXT
* iv_relation_name = 'BTOrderItemAll' ).
current = coll->get_current( ).
IF current IS NOT BOUND.

dref = current->get_property( 'ZZFLD000007' ). "#EC NOTEXT
CATCH cx_crm_cic_parameter_error.

CATCH cx_sy_ref_is_initial cx_sy_move_cast_error

Thanks in advance.
Rohan Hardikar.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 07, 2017 at 07:28 AM

    Hello Rohan,

    In the get method the initial value is set to value = 'BTAdminI not bound'. then after as per your requirement you got the relation then after your getting the 'ZZFLD000007'. this value your not passed to returning perpetrator on the get method. so this is the reason the values is showing as

    'BTAdminI not bound' in that particular filed.

    and one morething once you get the value set that value in set method then only the value will be visible in the web ui.

    note: in setter method you have to set the value with there relations as you got the value in getter method.

    Thanks & Regards,

    Srinivas K.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 07, 2017 at 06:34 AM

    Hi Srinivas,

    Thanks for your help!.
    I have one more question - How to check in GET_ method of an attribute, whether SET_ method is triggered before ie I need to check whether SET_ method is triggered before GET_ method. Is it only possible through IMPORT/EXPORT or is there any direct way?

    Thanks & Regards,
    Rohan Hardikar

    Add comment
    10|10000 characters needed characters exceeded