on 03-28-2011 6:21 AM
Hi all,
I am using below code for calling search helps in wddoinit method of component controller.But i am not getting search help.
data lo_node_info type ref to if_wd_context_node_info.
node_info = node->get_node_info( ).
if ls_bapi_partners-PARVW = 'AB' .
CALL METHOD lo_node_info->set_attribute_value_help
EXPORTING
name = 'PARNR'
value_help_mode = '121'
value_help = 'DEBI'.
elseif ls_bapi_partners-PARVW = 'VF' .
CALL METHOD lo_node_info->set_attribute_value_help
EXPORTING
name = 'PARNR'
value_help_mode = '121'
value_help = 'KRED'.
endif
Thanks
Kiran
HI,
Check the below 2 options;
1) If any one of the conditions is true.
2) If the name of the name of the attribute is correct.
3) Check if search help is deactivated to the node attribute. If yes select it as automatic.
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
lo_node_info doesnot have the object assigned. It has null value. So when you access the method will null object you will get the dump mentioned by you.
What you can do is:
Check if the node instance is reteived using WD_CONTEXT->GET_CHILD_NODE method.
After this get NODE_INFO uisnG GET_NODE_INFO methid of IF_WD_CONTEXT_NODE.
Madhu
Thanks Madhu...if i am writing NODE_INFO type ref to IF_WD_CONTEXT_NODE then i am getting error in value set.Can you check this below code:
******Value Set for DDBK
data: NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
NODE type ref to IF_WD_CONTEXT_NODE.
NODE = WD_CONTEXT->GET_CHILD_NODE( 'BAPI_PARTNERS' ).
*NODE_INFO = NODE->GET_NODE_INFO( ).
data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST ,
L_VALUE type WDR_CONTEXT_ATTR_VALUE.
L_VALUE-VALUE = 'AB'.
L_VALUE-TEXT = 'AB Department Resp.'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'AG'.
L_VALUE-TEXT = 'SP Sold-to party '.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'WE'.
L_VALUE-TEXT = 'SH Ship-to party'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'LF'.
L_VALUE-TEXT = 'VN Vendor'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'ZB'.
L_VALUE-TEXT = 'ZB Engineer'.
INSERT L_VALUE into table LT_VALUESET.
NODE_INFO->SET_ATTRIBUTE_VALUE_SET(
NAME = 'PARVW'
VALUE_SET = LT_VALUESET ).
******Calling search helps dynamically
*data: NODE_INFO type ref to IF_WD_CONTEXT_NODE.
data lo_node_info type ref to if_wd_context_node_info.
NODE_INFO = NODE->GET_NODE_INFO( ).
if ls_bapi_partners-PARVW = 'AB' .
if sy-subrc = 0.
<<<<<<CALL METHOD lo_node_info->set_attribute_value_help
EXPORTING
name = 'PARNR'
value_help_mode = '121'
value_help = 'KRED'.
endif.
HI,
SET_ATTRIBUTE_VALUE_SET and SET_ATTRIBUTE_VALUE_HELP: both this methods belong to IF_WD_CONTEXT_NODE_INFO interface, so they should be called using the NODE_INFO instance only.
So get the NODE_INFO instance soon after getting the NODE instance and use the same for the 2 methods.
So your code should look like below:
******Value Set for DDBK
data: NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
NODE type ref to IF_WD_CONTEXT_NODE.
NODE = WD_CONTEXT->GET_CHILD_NODE( 'BAPI_PARTNERS' ).
NODE_INFO = NODE->GET_NODE_INFO( ).
data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST ,
L_VALUE type WDR_CONTEXT_ATTR_VALUE.
L_VALUE-VALUE = 'AB'.
L_VALUE-TEXT = 'AB Department Resp.'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'AG'.
L_VALUE-TEXT = 'SP Sold-to party '.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'WE'.
L_VALUE-TEXT = 'SH Ship-to party'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'LF'.
L_VALUE-TEXT = 'VN Vendor'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'ZB'.
L_VALUE-TEXT = 'ZB Engineer'.
INSERT L_VALUE into table LT_VALUESET.
NODE_INFO->SET_ATTRIBUTE_VALUE_SET(
NAME = 'PARVW'
VALUE_SET = LT_VALUESET ).
******Calling search helps dynamically
if ls_bapi_partners-PARVW = 'AB' .
if sy-subrc = 0.
CALL METHOD *NODE_INFO->*set_attribute_value_help
EXPORTING
name = 'PARNR'
value_help_mode = '121'
value_help = 'KRED'.
endif.
Regards,
MAdhu
Edited by: madhu reddy on Mar 28, 2011 2:01 PM
User | Count |
---|---|
85 | |
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.