on 06-11-2008 9:45 PM
In my application, I want to use 2 ALV component usage, one to display articles, and when you select an articles, the second ALV will display the size breakdown (quota-scale).
I know how to do it using 2 tables UI element but with the ALV component usage it seems different. I have a problem with my component controller context.
I define a node articles (0:N) and a sub-node (quota-scale) (O:N also).
I define 2 usages of the ALV component. In the ALV component usage interface controller, I define my context mapping to my component controller context.
USAGE_ALV_ARTICLES
DATA node map to ARTICLES node
USAGE_ALV_QUOTA_SCALES
DATA node map to sub node ARTICLES,
I can't launch the application, it seems I can't map a subnode context to the alv component context? Maybe should I have create the quota scales not as a sub-node of articles? If I work only with the first ALV it works fine, but when I comes mapping the sub-node of my context to the second alv this is where I got the error,
this is the error that I got in st22
An exception occurred which is explained in detail below.
The exception, which is assigned to class 'CX_WD_CONTEXT_MAPPING', was not
caught and
therefore caused a runtime error.
The reason for the exception is:
The node specified in mapping ( QUOTA_SCALE) could not be found
thankx
alex
Hi Alex,
say you have two alv component usages alv1 and alv2.
and ur context is like this:
context -> articles -> quota_scales
Try this:
* create an instance of ALV component
DATA:
lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
lr_salv_wd_table_usage = wd_this->wd_cpuse_alv1( ).
IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
lr_salv_wd_table_usage->create_component( ).
ENDIF.
* get ALV component
DATA:
lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
lr_salv_wd_table = wd_this->wd_cpifc_alv1( ).
* Set data to be displayed
DATA lo_nd_articles TYPE REF TO if_wd_context_node.
* navigate from <CONTEXT> to <ARTICLES> via lead selection
lo_nd_articles = wd_context->get_child_node( name = wd_this->wdctx_articles ).
CALL METHOD lr_salv_wd_table->set_data
EXPORTING
r_node_data = lo_nd_articles.
***************************************************************
* create an instance of ALV component
DATA:
lr_salv_wd_table_usage_02 TYPE REF TO if_wd_component_usage.
lr_salv_wd_table_usage_02 = wd_this->wd_cpuse_alv2( ).
IF lr_salv_wd_table_usage_02->has_active_component( ) IS INITIAL.
lr_salv_wd_table_usage_02->create_component( ).
ENDIF.
* get ALV component
DATA:
lr_salv_wd_table_02 TYPE REF TO iwci_salv_wd_table.
lr_salv_wd_table_02 = wd_this->wd_cpifc_alv2( ).
* Set data to be displayed
DATA lo_nd_quota_scales TYPE REF TO if_wd_context_node.
* navigate from <ARTICLES> to <QUOTA_SCALES> via lead selection
lo_nd_quota_scales = lo_nd_articles->get_child_node( name = wd_this->wdctx_quota_scales ).
CALL METHOD lr_salv_wd_table_02->set_data
EXPORTING
r_node_data = lo_nd_quota_scales.
Hope this works.
Regards,
Reema.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Reema, thanks! But this is what not I was searching for, finally I found it!
Using the ALV component usage, we can't use context sub-node for binding unlike with the table UI element, so I will need to create my quota scale node as a main node and not as a sub node of articles.
Here is the link
[http://help.sap.com/saphelp_nw70/helpdata/EN/03/0048413e466e24e10000000a155106/frameset.htm]
It only contains attributes and no subnodes:
Alex
I made a mistake, here is the correction
USAGE_ALV_QUOTA_SCALES
DATA node map to sub node QUOTA_SCALE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.