Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Abap OOP Question

Former Member
0 Likes
914

Dear Experts!

Generally how can I use this method correctly?

Interface IF_WD_SELECT_OPTIONS has a method named ADD_SELECTION_FIELD.

Especially the import Parameter I_VALUE_HELP_TYPE is the most interesting one for me.

Because I need a special type : CO_VH_TYPE_CLOCK .

data ztest type ref to IF_WD_SELECT_OPTIONS.
create object ztest.


CALL METHOD ztest->add_selection_field
  EXPORTING
     i_id                         = 'BUKRS'
     i_value_help_type            = IF_WD_VALUE_HELP_HANDLER=>CO_VH_TYPE_CLOCK .

Please help me I dont know how to solve this requirement.

regards

sa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
886

hi max

1)I get now the message:

if_wd_value_help_handler=>CO_VH_TYPE_CLOCK

is not type compatible with formal parameter i_value_help_type

2) By the way how did you find out that you need CL_WDR_SELECT_OPTIONS ?

regards

ertas

10 REPLIES 10
Read only

Former Member
0 Likes
886

Hi

The interface is just as class without implementation, u should assign the interface to a class and then to implement the method ADD_SELECTION_FIELD or you should say us where this interface is used, a BADI?

That interface is used in the class CL_WDR_SELECT_OPTIONS

Max

Read only

0 Likes
886

Hi

Your code should be like this:

data ztest type ref to CL_WDR_SELECT_OPTIONS. 
create object ztest.
 
 
CALL METHOD ztest->IF_WD_SELECT_OPTIONS~add_selection_field
  EXPORTING
     i_id                         = 'BUKRS'
     i_value_help_type            = IF_WD_VALUE_HELP_HANDLER=>CO_VH_TYPE_CLOCK .

But I don't know the class CL_WDR_SELECT_OPTIONS

Let's know where u need to call the method above

Max

Read only

Former Member
0 Likes
886

pls can you show me that just in a small code example.

Reagrds

ilhan

Read only

Former Member
0 Likes
887

hi max

1)I get now the message:

if_wd_value_help_handler=>CO_VH_TYPE_CLOCK

is not type compatible with formal parameter i_value_help_type

2) By the way how did you find out that you need CL_WDR_SELECT_OPTIONS ?

regards

ertas

Read only

0 Likes
886

Hi

I've searched where the interface IF_WD_SELECT_OPTIONS is used.

It should be:

data ztest type ref to CL_WDR_SELECT_OPTIONS.
create object ztest.

CALL METHOD ztest->IF_WD_SELECT_OPTIONS~add_selection_field
  EXPORTING
    i_id              = 'BUKRS'
    i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE.

Anyway the parameter IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE is type string so u can also:

data ztest type ref to CL_WDR_SELECT_OPTIONS.
data: i_value_help_type type string.
create object ztest.


CALL METHOD ztest->IF_WD_SELECT_OPTIONS~add_selection_field
  EXPORTING
    i_id              = 'BUKRS'
*    i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE.
    i_value_help_type = i_value_help_type.

Max

Edited by: max bianchi on Nov 25, 2008 12:02 PM

Read only

Former Member
0 Likes
886

max thank you very much for your help but I need CO_VH_TYPE_CLOCK not

i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE.

but exactly this is my problem

i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_VH_TYPE_CLOCK

return the error:

if_wd_value_help_handler=>CO_VH_TYPE_CLOCK

is not type compatible with formal parameter i_value_help_type

Or is it not possible to use CO_VH_TYPE_CLOCK ????

regards

ertas

Read only

0 Likes
886

Hi

I don't know what CO_VH_TYPE_CLOCK means, anyway u can transfer it to a variable type string and use it for the method:

data ztest type ref to CL_WDR_SELECT_OPTIONS.
data: i_value_help_type type string.
create object ztest.

move IF_WD_VALUE_HELP_HANDLER=>CO_VH_TYPE_CLOCK to i_value_help_type.

CALL METHOD ztest->IF_WD_SELECT_OPTIONS~add_selection_field
  EXPORTING
    i_id              = 'BUKRS'
    i_value_help_type = i_value_help_type.

Max

Read only

Former Member
0 Likes
886

max,

that means there is no possiblity to use CO_VH_TYPE_CLOCK directly although it

is an attribute of IF_WD_VALUE_HELP_HANDLER.

regards

ertas

Read only

0 Likes
886

Hi Ertas

I'm sorry but I don't the interface IF_WD_SELECT_OPTIONS and the class CL_WDR_SELECT_OPTIONS, if I understand, it seems they are for WebDynpro.

So u should give more information for helping you: I don't understand what and where you need to do?

Max

Read only

Former Member
0 Likes
886

max it is very easy.

instead

data ztest type ref to CL_WDR_SELECT_OPTIONS.
data: i_value_help_type type string.
create object ztest.
 
CALL METHOD ztest->IF_WD_SELECT_OPTIONS~add_selection_field
  EXPORTING
    i_id              = 'BUKRS'
    i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE.

this

data ztest type ref to CL_WDR_SELECT_OPTIONS.
data: i_value_help_type type string.
create object ztest.
 
 
CALL METHOD ztest->IF_WD_SELECT_OPTIONS~add_selection_field
  EXPORTING
     i_id                         = 'BUKRS'
     i_value_help_type            = IF_WD_VALUE_HELP_HANDLER=>CO_VH_TYPE_CLOCK

to sum up:

no CO_PREFIX_NONE

but CO_VH_TYPE_CLOCK

OK????