cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in calling search helps dynamically

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Madhu2004
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks Madhu.....while testing i am getting dump.Can you tell me possible reason

OBJECTS_OBJREF_NOT_ASSIGNED_NO

<<<<<<CALL METHOD lo_node_info->set_attribute_value_help

Edited by: kiran162 on Mar 28, 2011 9:00 AM

Madhu2004
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Madhu2004
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks Madhu.Its working now.

Former Member
0 Kudos

Hi Madhu,

Do you have any idea how we can change the value help per row of a table?

I need to display the F4 help based on a field value in a row. So that means it can be different for each row. Could you please guide me?

Kind Regards,

Gayathri

Answers (0)