cancel
Showing results for 
Search instead for 
Did you mean: 

How to save Checkbox inputs as a Variants in WD ABAP

Former Member
0 Kudos

Hi,

I am going through this nice blog [http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID0832150950DB20043138143752756391End?blog=/pub/wlg/10731] which helped me creating varaint options for SELECT -optins fields.

Everything works fine..

Now I want to save some selection screen Check boxes , plus input fields in to this.

I have NODE called ATTR in which I have checkboxes attributes like ATT1,ATT2,ATT3 etc..

So what I was trying to pass the checkbox values by reading and then assigning it to lv_att1 but it says i cannot change value..

where am i going wrong?

method HANDLEFROM_SAVEVARIANT .

  DATA lo_nd_attr TYPE REF TO if_wd_context_node.
  DATA lo_el_attr TYPE REF TO if_wd_context_element.
  DATA ls_attr TYPE wd_this->element_attr.
  DATA lv_att1 LIKE ls_attr-att1.
** navigate from <CONTEXT> to <ATTR> via lead selection
  lo_nd_attr = wd_context->get_child_node( name = wd_this->wdctx_attr ).

* get element via lead selection
  lo_el_attr = lo_nd_attr->get_element(  ).

* get single attribute
  lo_el_attr->get_attribute(
    EXPORTING
      name =  `ATT1`
    IMPORTING
      value = lv_att1 ).


wd_this->lt_att1  = lv_att1.
wd_this->lt_range_table = lt_range_table .

  wd_this->M_HANDLER->SET_RANGE_TABLE_OF_SEL_FIELD(
             exporting I_ID = 'PS_PSPID'
                       IT_RANGE_TABLE = lt_range_table  ).

I

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Where are you facing the problem...

Former Member
0 Kudos

Lekha,

I am facing problem at

wd_this->lt_att1  = lv_att1.

Error says

Method HANDLEFROM_SAVEVARIANT

The type of "LV_ATT1" cannot be converted to the type of

"ME->WD_THIS->LT_ATT1".

Reason is I had to use TYPE WDY_BOOLEAN for check box in Attribute creation

but I have used TYPE CHAR1(also tried TYPE BOOLEAN) for method Attribute & Parameter.still have the above mentioned error.

I am thinking that this way i can pass the inputs similar to range table.

Rgds

Vara

Former Member
0 Kudos

Hi iam a starter in ABAP and i got a small error while coding that is

PARAMETERS:

  ABAP  AS CHECKBOX.

  SELECTION-SCREEN COMMENT 5(4) text-010.

  SELECTION-SCREEN END OF LINE.

  SELECTION-SCREEN BEGIN OF LINE.

  PARAMETERS:

  MM AS CHECKBOX.

  SELECTION-SCREEN COMMENT 5(4) text-011.

  SELECTION-SCREEN END OF LINE.

  selection-screen end of block nam1.

if ABAP = 'X'.

WRITE ' YOU ARE ELIGIBLE CONSULTANT'.

ENDIF.

in the above code my requirement is when i check the abap the following msg must be showed in the output screen but its not showing..

please help me if anyone knows how to do it. thank you.

And this is the part of the code if anyone want to see whole code it is attached with this thread.