on 02-27-2014 1:34 PM
Hiya,
I have a Z table that I have used as a basis for creating the context in my web Dynpro.
The context is then used as the binding for a Web Dynpro table.
I now would like to add an additional column to the table - to hopefully display a pretty icon, if another column contains a tick in a checkbox.
I thought I'd simply add an additional attribute to the context and then bind that as a column to the table...
However because I have bound the context to a Z table (see above) I can't add any more attributes to the context:
I need to keep the context bound to the Z table as that is how quantities, currencies and the positions of decimals are determined.
Is there any way I can add an additonal column to by table?
Thanks in advance for any ideas.
Hi,
You either don't have to create additional fields in Ztable or create a new structure. For the context node, simply delete the dictionary structure; in your case, ZVENDOR. delete the ZVENDOR in context node properties and press enter. Then you can add extra attributes in the context node and your existing attributes still point to the dictionary structure ( for ex: EBELN would still point to ZVENDOR-EBELN)
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
That's what I mention. Your attributes would still point to the Dictionary structure fields even after removing the dictionary structure.
For the context node, just remove the ZVENDOR in dictionary structure ( and press enter or you can click on the dictionary icon and remove the reference to dictionary structure ). And even after removing the ZVENDOR, your attributes would still point to the dictionary structure fields ( you can check by clicking on any attribute) so that the currency and quantity decimals would retain.
Hope this helps u,
Regards,
Kiran
Thanks for the reply Kiran and I'm sorry if I wasn't making myself clear.
I understand that the references to the data dictionary will remain but I also need the corresponding unit and currency fields and this link is only maintained if the data dictionary is maintained in the context. Otherwise I get a value of 10,000.000 when I should see 10,000 because the link to Unit (MEINS), in the data dictionary, is lost.
Thanks again for taking the time to reply.
Hi,
In the context node( after removing dictionary structure), what is the type of attribute MEINS point to ( I hope its ZVENDOR-MEINS )!
If not, I guess, while creating the context node, you didn't gave the Dictionary structure?
While creating context node, give the dictionary structure to create attributes from dictionary structure fields, then remove the dictionary structure in the context node, which allows you to add attributes in the context node.
Revert back for further clarifications.
Regards,
Kiran
Hi Robert,
In the properties of the node 'RFQ_REPLY', remove the dictionary structure. Once if you remove the structure, you will be allowed to add attributes to the node.
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
Simple approach:
You can add new fields into ZTABLE, and then add the attributes to the context node from the ZTABLE.
let me know if any further assistance required.
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
Thanks for the reply.
It's good to know that it's not a straightforward thing to do...
How about we approach it another way:
Basically in the table there is a column which has a boolean value i.e. X or ''.
This is read from the database and and I have set the column as type checkbox.
When a row has a checkbox that is ticked is there an easy way to display an icon when the checkbox is ticked?
Hi Robert,
The simple way of resolving your issue is as below
- Create an attribute "SOURCE" in context node
- Add a column as "ICON_COL" into table
- Add a IMAGE cell editor "ICON_VAL" and bind the property "ImageSource" to context attribute "SOURCE"
- For check box, create an action "CHEK", and add to the event "OnToggle"
- Write the below code in event handler method "ONACTIONCHECK"
METHOD onactioncheck .
DATA lv_read_only TYPE wdy_boolean.
DATA lv_icon_source TYPE string.
DATA lo_element TYPE REF TO if_wd_context_element.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
lo_element->get_attribute(
EXPORTING
name = 'FUNC_REVIEW'
IMPORTING
value = lv_read_only " DATA
).
IF lv_read_only EQ abap_true.
lv_icon_source = '~Icon/Add'.
ELSE.
lv_icon_source = '~Icon/Remove'.
ENDIF.
lo_element->set_attribute(
EXPORTING
value = lv_icon_source
name = 'SOURCE'
).
ENDMETHOD.
Hope this helps you.
Regards,
Rama
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.