
My requirment was to create a new columns in the Item view of Interaction center and populate it with the quantity of the product ordered in the past. The column title should be filled with the order date. Here I am not going in details about the product proposal rather I will just explain how we can change the column title with current date.
Step1: Use the Enhancement workbench tr. BSP_WD_CMPWB, Enhance your component and create a new value attribute.
Step2: Once you complete the Wizard, your newly created attribute should show in the Attribute list as shown below.
Step3: Now double click on the GET_M_ method of the attribute, System generated code will look some thing like this.
Step4: Comment out the system generated code and insert following code
DATA: p_flddescr TYPE dfies.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'ZCRMT_PROD_PROP_HIST_QTY01'
langu = 'E'
all_types = 'X'
IMPORTING
dfies_wa = p_flddescr
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
p_flddescr-reptext = sy-datum.
p_flddescr-scrtext_s = sy-datum.
p_flddescr-scrtext_m = sy-datum.
p_flddescr-scrtext_l = sy-datum.
CREATE OBJECT metadata
TYPE
cl_bsp_metadata_simple
EXPORTING
info = p_flddescr.
Step5: Redefine the method GET_TABLE_LINE_SAMPLE of your context node and add all the attributes you have added in the context node as shown below.
Step6: make the field available in your view by changing the configuration of the view. When the field will display in the IC Web screen it will look something like this.
You can see the dynamic column title .
One thing I observed that the dynamic colunm title was loading up for the first time but after that it was keeping the value in the buffer and was not refreshing so every time I was loading the page I was getting the same date value for the column title. I found the reason after some debugging and I had to refresh the buffer for my custom variable every time by enhancing the standard class CL_BSP_DLC_VIEW_DESCRIPTOR.
Once I refreshed the the buffed for my custom fields every thing works fine as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |