Dynamic context attributes and ALV
Hi all,
I already posted my question in this [thread|WD4A Dynamic ALV Table with dynamic tables;,
but in the ABAP UI programming forum, but I think it fits better in the WD4A forum.
It's dazzling that there are two forums for WD4A.
Maybe a moderator with the authorization can move my thread into this forum and delete this new thread.
Best Regards,
Marcel
Hi
I use the SALV_WD_TABLE component. I have bind my static MTX node to the INTERFACECONTROLLER_USAGE Data node in design time.
At runtime, when I modify my demo table structure, for example the number of colums or rows, in the view can I see it. But the data no. I have found a tutorial, where I can made a dynamic node from DDIC, and in this case can I show the data in the ALV table.
My big problem was, that my table is not in DDIC.
If this road is not possible, can You show me an other solution?
Thanks
Krisztian
Similar Messages
-
Using dynamic context attributes with flashisland
I recently started looking at flashislands.
Going through the SDN tutorials on this topic, I noticed that the declarations of GACDATASOURCE and GACPROPERTY properties inside web dynpro and their counterpart variables inside flex are a bit static (all naming and binding is done at design time).
So I'm asking if there's a way inside flex to dynamically capture the values of the attributes of a web dynpro context node that is bound to an ArrayCollection variable inside flex without knowing the names and the amount of the attributes of the context node?
Here's my situation:
I have a context node (REPORT_DATA) inside web dynpro that at design time has no attributes.
The attributes and their names are created dynamically at runtime.
It is even so, that over time the amount of attributes may vary.
Inside the web dynpro, the contents of this context node (REPORT_DATA) are shown in a (dynamically built) table.
Besides using the table, I'm trying to show the same contents as a piechart and as a columnchart in a flashisland.
The ROOTUIELEMENTCONTAINER of the FlashIsland view in web dynpro only contains a GACDATASOURCE element at design time.
The 'dataSource' property of this GACDATASOURCE is bound to the context node REPORT_DATA.
The 'name' property of this GACDATASOURCE is bound to an ArrayCollection variable inside flex (named dataSource).
So much for the static part created at design time.
At runtime inside web dynpro the correct GACPROPERTY's are created, based on the - over time changing - amount and the names of the context node.
Suppose my REPORT_DATA context node at runtime starts with 3 attributes: ATTR1, ATTR2 and ATTR3
Also suppose the node contains 2 elements: [ {"1_1", "1_2", "1_3"} , {"2_1", "2_2", "2_3"} ]
The dataSource variable inside flex also contains 2 entries with 3 elements each.
The code to show the value of (for example) the first element of all entries inside the ArrayCollection variable would be:
+for each( var o:Object in dataSource) {
var s:String = o.ATTR1;
Alert.show( "the 1st value = " + s ); // 1_1 for the first entry, 1_2 for the second
}+
I can then use the myAC variable inside flex as dataprovider for various other objects.
This works fine.
But inside flex I can only capture the value of an attribute when I know its name at design time (like ATTR1 in the sample code above).
And that's not what I want.
Inside flex I want to capture the value of the context attributes dynamically in a (correctly typed) flex variable without knowing the names and the amount of the context attributes.
Is this possible?
Thanks in advance for - any - response.
Bart.Hi again,
I tried the same thing by creating a dummy context node without any attributes, and adding all attributes at runtime using the add_attribute method. In that case too, it doesnt work. All the attributes are available in the dynamic attributes of the node element, but are not getting displayed.
Any help would be greatly appreciated. Thank you.
regards,
nithya -
GP context attributes and values?
Hi Everyone!
I am pretty new in the business and I'm looking for the values of the structure attributes of a gp. Like I can find IGPProcessInstance/Template/LocalParameters/Attributes (Collection)/Structures/Structureslist/elementdata/GPAttributeInfo and there I have the neccessary parameter name, but how do I get the value of this for a running instance? Where is it stored?
Thanx for all replies,
SandorAs it is possible to view the context parameters in Monitoring, I would like to create a DC that is in the portal, and it shows all the running GPs of a certain template with the local parameters of the last completed block in one table. So I wanted a general algorithm by that I can get into the block substructure and get the local parameters of a completed block of a running GP. For later developments I simply need to get the attribute values of the block6 instance.
But as I started out from the ProcessInstance, I was stopped by the block '1a0' that had no child elements available. Though there must be some.
Also if I ask for a block in the substructure using "getBlockInstance(String processId, String blockId, IUser user)" gaining the necessary BlockID from Monitoring, I can only get the template structure of that block, that has no attribute values.
I give the TemplateID of the GPs that are to be listed to the component through the application parameter field in the PortalContent. Because in the end it should be compatible with any GP structure.
Regards, Sandor -
Dynamic Context Dynamic and UI table Dynamic
Hello,
I created a dynamic context and a dynamic table that use this dynamic context. I have the following error:* * The following error text was processed in the system XAP : Could not find attribute AMOUNT2009**
The error occurred on the application server sat190_XAP_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE_INFO~GET_ATTRIBUTE of program CL_WDR_CONTEXT_NODE_INFO======CP
Method: GET_ATTRIBUTE_INFO of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
AMOUNT2009 is a new attribute that add to my context, i made the next code, can you review and say me where i have the error? I start with the second year is for this reason that i use a count.
Reading FINCATYGROUP
DATA lo_nd_fincatygroup TYPE REF TO if_wd_context_node.
DATA lo_el_fincatygroup TYPE REF TO if_wd_context_element.
DATA ls_fincatygroup TYPE wd_this->element_fincatygroup.
DATA : lv_year type STRING,
ls_attribute type wdr_context_attribute_info, "To create dynamic node in the context
lr_container TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
lr_table TYPE REF TO CL_WD_TABLE,
lr_input_field TYPE REF TO CL_WD_INPUT_FIELD,
lr_cell_editor TYPE REF TO if_wd_table_cell_editor,
lr_column TYPE REF TO CL_WD_TABLE_COLUMN,
lr_column_header TYPE REF TO CL_WD_CAPTION,
lv_headerColumn TYPE STRING,
lv_id_input_field TYPE STRING,
lv_name TYPE STRING,
lv_id_table_column TYPE STRING.
DATA: lr_node_info TYPE REF TO if_wd_context_node_info, "To get node info
lr_table_type TYPE REF TO cl_abap_tabledescr, "To get table and stuct descriptor
lr_line_type TYPE REF TO cl_abap_structdescr,
lt_components TYPE cl_abap_structdescr=>component_table, "To get component table
ls_components_line LIKE LINE OF lt_components, "One line of component table
lr_elem_type TYPE REF TO cl_abap_elemdescr.
LOOP AT lv_periods_tt INTO lv_periods_ts.
get all declared attributes
lv_periods_ts->get_static_attributes(
IMPORTING
static_attributes = ls_wa_period ).
navigate from <CONTEXT> to <FINCATYGROUP> via lead selection
lo_nd_fincatygroup = wd_context->get_child_node( name = wd_this->wdctx_fincatygroup ).
IF lv_cont = 1 OR lv_cont = 2.
lv_cont = lv_cont + 1.
ELSE.
Create dynamic context and dynamic view
get node_info
lr_rootnodeinfo = lo_nd_fincatygroup->get_node_info( ).
lv_year = ls_wa_period-zyear.
SHIFT lv_year BY 15 PLACES LEFT.
CONCATENATE 'AMOUNT' lv_year INTO lv_name.
put attributes of add_attrbute node
CONCATENATE 'Y' lv_year INTO ls_attribute-name.
ls_attribute-name = lv_name.
ls_attribute-type_name = '\TYPE=/RPM/TV_CURR_AMOUNT'.
lr_rootnodeinfo->add_attribute( "Add attribute for amount of year
EXPORTING
attribute_info = ls_attribute ).
********************* table *******************************************************
Get ROOTUIELEMENTCONTAINER
lr_container ?= view1->get_element( 'ROOTUIELEMENTCONTAINER ' ).
Get TABLEFCG
lr_table ?= view1->get_element( 'TABLEFCG' ).
Create cell_editor
CONCATENATE 'TABLEFCGIF_Y' lv_year '_EDITOR' INTO lv_id_input_field.
lr_input_field = cl_wd_input_field=>new_input_field(
id = lv_id_input_field bind_value = ls_attribute-name ).
CONCATENATE 'TABLEFCG_Y' lv_year '_EDITOR' INTO lv_headerColumn.
lr_column_header = cl_wd_caption=>new_caption( id = lv_headerColumn ).
lr_column_header->set_text( ls_attribute-name ).
Create table column
CONCATENATE 'TABLEFCG_' lv_year 'COLUMN' INTO lv_id_table_column.
lr_column = cl_wd_table_column=>new_table_column( id = lv_id_table_column ).
lr_column->set_table_cell_editor( lr_input_field ).
lr_column->set_header( lr_column_header ).
lr_table->add_grouped_column( lr_column ).
********************* end table *******************************************************
ENDIF.
ENDLOOP.
Thanx.1.
Code if the Transparent container's layout is Matrix ( method WDDOMODIFYVIEW )
data lr_container type ref to cl_wd_transparent_container.
data lr_input type ref to cl_wd_input_field.
data lr_layout_data type ref to cl_wd_matrix_head_data.
lr_container ?= view->get_element( '<Transparent container ID>' ).
lr_input = cl_wd_input_field=>new_input_field( bind_value = '<node>.<attribute>'
view = view
ID = 'INP' ).
lr_layout_data = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_input width = '100%' ).
2.
Dynamic Context Attribute in a node.
data lr_node type ref to if_wd_context_node.
data lr_info type ref to if_wd_context_node_info.
data ls_attr type WDR_CONTEXT_ATTRIBUTE_INFO.
lr_node = wd_context->get_child_node( '<Node_name>' ).
lr_info = lr_node->get_node_info( ).
ls_attr-name = '<attribute_name>'.
ls_attr-type_name = 'STRING'.
lr_info->add_attribute( ls_attr ). -
Simple Types and Context Attributes
Hello All,
Can someone be kind enough to explain the difference between using a context attribute and a Simple Type ? For example... what's the difference (and I am sure there is ) between a context attribute "Name" that is declared to be of String type and a simple type "Name" that is of built-in type String ?
from
Kwok WeiSome links on SimpleTypes and its usage.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/value help in web dynpro applications.pdf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/internationalization of web dynpro applications.pdf
Regards, Anilkumar -
Dynamically removing context attribute
Hi all,
does anybody know a better way of getting rid of dynamically created attributes than using the IWDContext.reset() functionality?
Best regards,
ChristianHi,
We had the similar requirement .We have mailed to Uwe regarding this.Please find the reply below .
there is currently no way to remove a single attribute in NW04. There is only the possibility to reset the metadata to the state that has been declared in the design time. This can be achieved using IWDContext.reset(boolean), reachable via wdContext.getAPI(). The method removes all attributes and nodes, that have been added at run time ("dynamically"), via one of the add Attribute or add Child methods of IWDNode. So, if you have added the root attribute at runtime, this method will remove it, but it removes all other dynamically added attributes and nodes, too.
NW05 will allow to remove single attributes and child nodes, but still only if they have been dynamically added before.
Regards
Anil -
Hi,
What is context attribute and how it can be used in XI?
Thanks in Advance,
Ajay.Hi,
I think it is related to web dynpro:
http://help.sap.com/saphelp_nw04/helpdata/en/76/98384162316532e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c7/a4384162316532e10000000a1550b0/frameset.htm
Regards
Suraj -
Using Search Help with ALV and Dynamic context node
The topic subject already describes my situation.
I have to create, populate and remove context nodes at runtime, and bind them to an ALV, to let user display the data or modify the data. The nodes I create are always typed with a table name, but the table name is of course, dynamic.
This is all working: what's not working is help for entries inside the ALV; since the table has foreign keys and domains with check tables or fixed values, I expected that search helps were detected and managed by the framework.
Instead, no help search is displayed except the input help based on data-type of the one "Date" input fields.
I think I have to work on the dynamic node creation, and not on the ALV itself, since the latter only takes the node/attributes information, but i could be wrong. I tried with both the two following codings:
CALL METHOD lo_nd_info_root->add_new_child_node
EXPORTING
static_element_type = vs_tabname
name = 'SAMPLE_NODE_NAME'
* is_mandatory = abap_false
* is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_false
* is_singleton = abap_false
is_initialize_lead_selection = abap_false
is_static = abap_false
RECEIVING
child_node_info = lo_nd_info_data .
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = lo_nd_info_root
node_name = 'SAMPLE_NODE_NAME'
structure_name = vs_tabname
is_multiple = abap_true ).
The result is the same...is there any way to let the ALV know what search helps it has to use, and doesn't force me to manually build a VALUE_SET to be bound on the single attributes? There are many tables, with many fields, and maintaining this solution would be very costly.I have checked with method GET_ATTRIBUTE_VALUEHELP_TYPE of interface IF_WD_CONTEXT_NODE_INFO, on an attribute which i know to have a search help (Foreign key of a check table).
The method returns 'N', that is the constant IF_WD_VALUE_HELP_HANDLER~CO_VH_TYPE_NO_HELP. So, the framework was not able to find a suitable search help.
Using method GET_ATTRIBUTE_VALUE_HELP of the same interface, on the same attribute, returns me '111', which is constant C_VALUE_HELP_MODE-AUTOMATIC.
Therefore, the WD framework knows it has to automatically detect a value help, but fails to find one.
Also, this means in my opinion that the ALV and the dynamic external mapping are not the culprits: since node creation, no help is detected for any attribute but the date. Honestly, I don't have a clue on what's happening. -
How can I bind a dynamic attribute of a context node to ALV?
Hi all,
I'm trying to show data with Webdynpor ALV, but i met a question which blocked me. The situation is that there is a static context node and it's mapped to WD ALV, while programming I create a dynamic attribute to the context node. The dynamic column can be shown on the UI, but there is no any data in it. How can i deal with it?
Thanks a lot!
Edited by: Julia Zhu on Dec 3, 2009 7:48 AMHi Julia,
Welcome to SDN.
Post it in the ABAP webdynpro forum to get quick replies. Web Dynpro ABAP
Also search in sdn as there are chances that somebody has already posted the queries related to same issue.
Regards,
Swarna Munukoti. -
Set Data from a Dynamic Context in ALV
Hi,
I've created an dynamic context and have binded the data. When I want to show this data in an dynamicly table with the following code, it works well.
cl_wd_dynamic_tool=>create_table_from_node( EXPORTING ui_parent = lo_container
table_id = 'DYN_ML_TABLE'
node = lo_nd_dyn_ml
RECEIVING table = lo_table ).
Unfortunately when I want to show the context data in an ALV table with the method set_data I will see the structure, but the binded data are lost.
lo_comp_alv = wd_this->wd_cpuse_usage_alv_dyn_ml( ).
IF lo_comp_alv->has_active_component( ) IS INITIAL.
lo_comp_alv->create_component( ).
ENDIF.
lo_comp_if_alv = wd_this->wd_cpifc_usage_alv_dyn_ml( ).
lo_comp_if_alv->set_data( lo_nd_dyn_ml ).
I've tested an manually created context node with this method, and I will see the data.
Could anybody help me?
Best Regards,
SaschaI created the node with rtti. Now, it works:
"Beschreibung zu interner Tabelle lesen
lo_tab_descr ?= cl_abap_typedescr=>describe_by_data( it_matchlist ).
"Zeilentyp zu interner Tabelle ermitteln
lo_str_descr ?= lo_tab_descr->get_table_line_type( ).
"Komponente der Zeile ausgeben, welche für die Erstellung der Knotenattribute benötigt werden
lt_comp = lo_str_descr->get_components( ).
data: ls_component type cl_abap_structdescr=>component,
lr_type type ref to cl_abap_datadescr,
lt_components type cl_abap_structdescr=>component_table,
lr_structdescr type ref to cl_abap_structdescr.
"Loop über Komponente und Einfügen in Attributenliste
loop at lt_comp into ls_comp.
lv_abs_name = ls_comp-type->absolute_name.
"Folgende Zeichen werden entfernt: '/TYPE='
shift lv_abs_name left by 6 places.
lr_type ?= cl_abap_typedescr=>describe_by_name( p_name = lv_abs_name ).
ls_component-name = ls_comp-name.
ls_component-type = lr_type .
append ls_component to lt_components.
endloop.
"Strukturtyp anhand der definierten Kompententen der internen Tabelle erzeugen
lr_structdescr = cl_abap_structdescr=>create( p_components = lt_components ).
* "Neuen Kindknoten anlegen
lo_nd_dyn_info = lo_nd_root_info->add_new_child_node( name = wd_this->gd_matchlist_nd_name
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_false
is_singleton = abap_false
is_initialize_lead_selection = abap_true
* attributes = lt_attributes
is_static = abap_false
static_element_rtti = lr_structdescr
"supply_method =
"supply_object =
"dispose_method =
"dispose_object =
"static_element_type = -
Dynamic context binding in web dynpro alv
I use dynamic context binding (see code below to show and edit the ALV table.
'DB_TABLE' is a tranparent table. It works fine.
But now this table should be expanded with additional fields which are only known at runtime and could be different from case to case.
How can I get these fields in the context dynamically?
DATA:
rootnode_info TYPE REF TO if_wd_context_node_info,
dyn_node TYPE REF TO if_wd_context_node,
tablename TYPE string.
rootnode_info = wd_context->get_node_info( ).
tablename = 'DB_TABLE'.
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename
is_multiple = abap_true ).
DATA:
stru_tab TYPE REF TO data.
FIELD-SYMBOLS: <tab> TYPE table.
CREATE DATA stru_tab TYPE TABLE OF (tablename).
ASSIGN stru_tab->* TO <tab>.
SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.
dyn_node = wd_context->get_child_node( name = tablename ).
dyn_node->bind_table( <tab> ).You should create a structure dynamically and use this as the context structure. See the coding below, where a structure is created, which contains CARRID and CONNID.
DATA: node_info type ref to if_wd_context_node_info,
struct_type TYPE REF TO cl_abap_structdescr,
table_type type ref to cl_abap_tabledescr,
comp_tab TYPE cl_abap_structdescr=>component_table,
comp LIKE LINE OF comp_tab,
my_table type ref to data,
my_row type ref to data.
field-symbols: <table> type table,
<row> type data,
<flight> type sflight.
* build a structure description from the list of single fields
comp-name = 'CARRID'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CARR_ID' ).
APPEND comp TO comp_tab.
comp-name = 'CONNID'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CONN_ID' ).
APPEND comp TO comp_tab.
* note this structure contains the fields "CONNID" and "CARRID"
struct_type = cl_abap_structdescr=>create( comp_tab ).
* now the nodeinfo is created
node_info = wd_context->get_node_info( ).
node_info = node_info->add_new_child_node(
name = 'MY_NODE'
IS_MANDATORY = ABAP_true
IS_MULTIPLE = ABAP_true
STATIC_ELEMENT_RTTI = struct_type
IS_STATIC = ABAP_false
* fill new node;
data: l_node type ref to if_wd_context_node,
l_flight type STANDARD TABLE OF sflight.
l_node = wd_context->get_child_node( 'MY_NODE' ).
l_flight = wd_assist->get_flights( ).
* if you could create a local data type, would be fine, but if you have to do it dynamically ...
struct_type = node_info->GET_STATIC_ATTRIBUTES_TYPE( ).
* create tabledescriptor from structdescription (standard table, no keys)
table_type = cl_abap_tabledescr=>create( p_line_type = struct_type ).
create data my_table type handle table_type.
assign my_table->* to <table>.
loop at l_flight assigning <flight>.
create data my_row type handle struct_type.
assign my_row->* to <row>.
move-corresponding <flight> to <row>.
append <row> to <table>.
endloop.
l_node->bind_table( <table> ). -
How to access a dynamic created attribute in a context node?
<i>Hello,</i>
<i>who could help? I can't set a value for a dynamically created attribute which is bind to a table.</i>
<i>My context of the view looks as follow (is defined in NetWeaver):</i>
- Context
- Availability (Node)
- vctxService (Attribute)
- vctxServiceDesc (Attribute)
- ... (further predefined attributes)
- ... (some have to be set dynamically as follows)
<i>Then I have added attributes dynamically in the wdDoModifyView(...) - method, as follows:</i>
for (int i = 0; i < max; i++) {
// some code to dynamically create table columns
// adding attributes dynamically
IWDAttributeInfo attrInfo = wdContext.nodeAvailability().getNodeInfo(). addAttribute("vctxAvailability_" + i, "ddic:com.sap.dictionary.string");
tv.bindText(attrInfo); // bind to TextView in table
<i>In the method onPlugFrom... I tried to set the values for the attributes "vctxAvailability_ + i" as follows:</i>
for (int i = 0; i < max; i++) {
IAvailabilityElement newAvailNodeElement = wdContext.createAvailabilityElement();
// some values will be set for the
// predefined attributes of AvailabilityNode
// newAvailNodeElement.set...( value );
// newAvailNodeElement.setVctxService( xy.getServ() );
// now the values of dynamically created and added
// attributes in AvailabilityNode will be added
// THIS DOESN'T WORK
newAvailNodeElement.setAttributeValue ("vctxAvailability_" + i, "value" + i);
<i>It would be great if someone could help me.
Thanks in advance.
Kind regards,
Carsten</i>Carsten,
Here is a sample code that creates context attributes dynamically and also sets values:
//Creates a node
IWDNodeInfo nodeInfo = wdContext.wdGetAPI().getRootNodeInfo().addChild("TestNode", null, true, true, false, true, false, true, null, null, null);
//If you want to bind the node to a model node then the
//second argument to the above method should be the
//model class.
//Creates an attribute under the node just created.
IWDAttributeInfo testAttrib = wdContext.wdGetAPI().getRootNodeInfo().getChild("TestNode").addAttribute("testAttrib", "ddic:com.sap.dictionary.string");
IWDNodeElement testNode = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION).getCurrentElement();
IWDNode testNode2 = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION);
//Now you can bind testNode with the Model Node
//You can also set a value to the newly created attribute
testNode.setAttributeValue("testAttrib", new String("Value"));
Hope this helps.
Shakeel -
How to create Node, Attributes and Table Dynamically?
Hi All,
How to create node and attributes dynamically, and with this node i want to create table dynamically?? Any related code please?
Thanks
Venkat.HI
I guess you are asking the same thing in some other post also .
use the code as mentioned there also.
data: wd_node_info type ref to if_wd_context_node_info,
wd_node type ref to if_wd_context_node,
lr_container type ref to cl_wd_uielement_container,
lv_tablename type string,
lt_db_data type ref to data,
lr_table type ref to cl_wd_table,
ls_attribute type wdr_context_attribute_info.
field-symbols: <lt_data> type any table.
wd_node_info = wd_context->get_node_info( ).
CALL METHOD WD_NODE_INFO->ADD_NEW_CHILD_NODE
EXPORTING
*STATIC_ELEMENT_TYPE = 'ZDEALER'
NAME = 'NODE'
IS_MULTIPLE = ABAP_TRUE
IS_INITIALIZE_LEAD_SELECTION = ABAP_FALSE
RECEIVING
CHILD_NODE_INFO = wd_node_info.
wd_node = wd_context->get_child_node( name = 'NODE' ).
wd_node_info = WD_node->GET_NODE_INFO( ).
data dyn_attr_info type wdr_context_attribute_info.
DYN_ATTR_INFO-NAME = 'X1'. "Attribute Name
DYN_ATTR_INFO-TYPE_NAME = 'STRING' ." Data Element(CHAR20) ( Type Of Attribute )
DYN_ATTR_INFO-NODE_INFO = wd_node_info.
CALL METHOD wd_node_info->ADD_ATTRIBUTE
EXPORTING
ATTRIBUTE_INFO = DYN_ATTR_INFO.
DYN_ATTR_INFO-NAME = 'X2'. "Attribute Name
DYN_ATTR_INFO-TYPE_NAME = 'STRING' ." Data Element(CHAR20) ( Type Of Attribute )
DYN_ATTR_INFO-NODE_INFO = wd_node_info.
CALL METHOD wd_node_info->ADD_ATTRIBUTE
EXPORTING
ATTRIBUTE_INFO = DYN_ATTR_INFO.
lr_container ?= view->get_root_element( ).
cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
" Creating internal table with the same structure as our dynamic context node
CALL METHOD CL_WD_table=>new_table
EXPORTING
bind_data_source = 'NODE'
ID = 'TABLE'
RECEIVING
control = lr_table.
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_table ).
*lr_table->bind_data_source( path = 'NODE' ).
data lr_table_col type ref to cl_wd_table_column.
data lr_table_col1 type ref to cl_wd_table_column.
data lr_text_view type ref to cl_wd_text_view.
data lr_input_field type ref to cl_wd_input_field.
DATA lr_column_name_header TYPE REF TO cl_wd_caption.
lr_input_field = cl_wd_input_field=>new_input_field(
bind_value = 'NODE.X1' ID = 'INP' ).
LR_TABLE_COL = cl_wd_table_column=>new_table_column( id = 'COL1' ).
lr_table->add_column( the_column = lr_table_col ).
lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'X1').
lr_table_col->set_table_cell_editor(
THE_TABLE_CELL_EDITOR = lr_input_field ).
lr_table_col->set_header( lr_column_name_header ).
lr_text_view = cl_wd_text_view=>new_text_view(
bind_text = 'NODE.X2' ID = 'TXT' ).
LR_TABLE_COL1 = cl_wd_table_column=>new_table_column( id = 'COL2' ).
lr_table->add_column( lr_table_col1 ).
lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'X2').
lr_table_col1->set_table_cell_editor(
THE_TABLE_CELL_EDITOR = lr_text_view ).
lr_table_col1->set_header( lr_column_name_header ).
lr_container->add_child( lr_table ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_table ).
thanks
sarbjeet singh -
Linking alv column to another context attribute
Hi,
My alv is bound to a context node, and i need to fetch data into a column from attribute existing in some other node.
Is this feasible?
Thanks & regards,
RonitaNot quite sure if I understand, but looks to me that this is possible. Your internal table is the basis of the ALV, correct. Now before, displaying the ALV, you should modify your internal table (or update) with the data from the other attribute. You can do this by using the code wizard (read context) and retrieving the data from this attribute and move it to your internal table.
You can do this in the WDDOINIT method for example. -
Default dynamic attributes and weightings on BID invitation
Based on certain business logic i need to default dynamic attributes and weightings on bid invitation transaction BBP_BID_INV,
I tried to do some code in method BBP_QUOT_CHANGE of BADI
BBP_DOC_CHANGE. The execution doesn't stop at that method as i put a breakpoint there.
However it does stop at BBP_BID_CHANGE method, i could not use this method because et_weight internal table is not available there ( i need to populate something in weightings) although ET_DYN_ATTR is available.
Question is , for what purpose BBP_QUOT_CHANGE is used ?
Let me know if you have any inputs ..
-With Thanks
Alok PathakHi,
BBP_QUOT_CHANGE method is used for QUOTATION.Whenever any change is done in the Quotation then this method is triggered.
BR,
Disha.
Pls reward pointsfor useful answers.
Maybe you are looking for
-
How do I get an app back that I took off my iphone by removing it through my desktop?
I removed the app garage band from my iphone 4 through my pc using itunes 11. I errased it from the large screen in my itunes that represented my iphone. usually, my apps would show up on the left hand side and I could sort by name and size etc. For
-
How do i solve this issue?
-
JDK 5 for 64 bit for B1ic installation on windows server 2008 64 bit
Hello to All, I want to download jdk 5 for X64 ,i have searched lot of time on gooogle and other place but not find for 64 bit. my one of the client working on windows server 2008 with 64 bit and i want to install integration component(SAP 8.81 PL 00
-
Can't Archive with Disk Utility
I want to create a .dmg of my hard drive with Disk Utility before installing 10.5. I have tried to select the device, the volume and individual folders on the drive and Disk utility won't create a .dmg of them to the same drive, a DVD or external dri
-
Incoming email settings on library
Hi! I have a SharePoint 2013 foundation environment. on this environment i have enabled the incoming email settings and succesfully tested this on a library on the root of my site collection. When i create a subsite and add a new Document library, i