Skip to Content
avatar image
Former Member

CRM WEB UI: Getting the current value of a certain field

Hello,

im rather new to the CRM_UI and i would really appreciate some help.

Situation:

In CRM_UI, on the PARTNER web mask i have a certain field that is NOT "connected" to any of the fields in standard CRM tables (i.e. CRMD_PARTNER). I want to save the value of this field into my own non-standard table.

For now i have this this:

In transaction BSP_WD_CMPWB i load the component BTPARTNER. I select a View called BTPARTNER/PartnerEF. Under Context i have 2 Context Nodes:

- ZBP ... in the Attributes there are listed variables that are not "directly connected" to any of the CRM tables

- BTPARTNER (Base Entity BTPartner) ... in the Attributes there are listed variables that are "directly connected" to CRMD_PARTNER

In ZBP node i defined a new field Z_TAX_VALUE. When i load the web mask, the method GET_Z_TAX_VALUE is ran, in which i read the value from my non-standard table and put it into the Z_TAX_VALUE. When i change the value on web mask and press back, the GET_Z_TAX_VALUE method is again run and i can save the changed value of Z_TAX_VALUE into my non-standard table. To read the current value of Z_TAX_VALUE i use this code in GET_Z_TAX_VALUE:


dref                 = current->get_property( 'Z_TAX_VALUE' ).

l_current_value = if_bsp_model_util~convert_to_string( data_ref         = dref

                                                                               attribute_path = attribute_path ).


Problem:

When i change the value of Z_TAX_VALUE, i have to press ENTER to save the value into Z_TAX_VALUE. Otherwise when reading the current value, old value is getting returned into l_current_value.

Example:

- Current value of a field in my non-standard table is 100

- I load the PARTNER web mask and Z_TAX_VALUE shows 100

- I change the value to 200. If i press ENTER and go back, the field in my non-standard table is getting updated to 200. If i dont press ENTER and go back, the field is not updated to the new value

What should i do ? How can i overcome this mandatory ENTER ? Should i do this completely differently ?

Thank you

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 19, 2013 at 07:57 AM

    Anyone 😔 ?

    Help much appreciated.

    Add comment
    10|10000 characters needed characters exceeded

    • I'm glad I helped somehow 😊, be carefull about how you will persist the info of the value node into the DB, for example:

      - If the user press cancel, popup is showed by stadnard, data has changed do you want to save? yes/no.

      - If you want only save the info together with the Business Transaction.

      Cheers!

      Luis

  • avatar image
    Former Member
    Nov 19, 2013 at 11:55 AM

    Hi Zoran,

    You can read the values from the from the DB in method DO_PREPARE_OUTPUT and set the value of field Z_TAX_VALUE and for inserting and updating Z_TAX_VALUE into the DB table you can use the method DO_FINISH_INPUT.

    Pradeep

    Add comment
    10|10000 characters needed characters exceeded