cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down in a table view.

Former Member
0 Kudos
196

Table view is created using AET.

It has 5 colums.

1) product category (f4 help).

2)comp1 (which is ddlb).

Based on the f4 value selected ,the ddlb values has to be populated.

like if product category is "categor1 " selected ,the comp1 values should be "comp1 ,comp2 ,comp3,comp4" ..(taken from custom table).

for the 2nd row ,if "category 2" slected ,the comp1 values should be "comp4,comp5" ..(taken from custom table).

How can i achive this ?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the get_v, get_p methods of the attributes for this purpose. make the comp1 field as a dropdownlist in its get_p method and write logic to retreive the values based on product category in get_v method of comp1.

Thanks,

Rajini A.

Former Member
0 Kudos

data : oref_current TYPE REF TO if_bol_bo_property_access,

oref_iterator TYPE REF TO IF_BOL_BO_COL_ITERATOR ,

oref_lr_entc type ref to if_bol_bo_property_access,

oref_lr_ent1 TYPE REF TO if_bol_bo_col.

DATA: ls_ddlb TYPE bsp_wd_dropdown_line,

lt_ddlb TYPE bsp_wd_dropdown_table,

lt_ddlb1 TYPE REF TO cl_crm_uiu_ddlb,

lt_tab TYPE TABLE OF Zcomp,

lt_line1 LIKE LINE OF lt_tab,

lv_category type YADTEL00005M ,

lv_des TYPE YADTEL00005M,

lt_tab1 TYPE TABLE OF Zcomp,

wa TYPE zcomp.

oref_iterator = collection_wrapper->get_iterator( ).

if oref_iterator is bound.

oref_lr_entc = oref_iterator->get_first( ).

*IF NOT gr_proc IS BOUND.

  • CREATE OBJECT gr_proc

  • EXPORTING

  • iv_source_type = 'T'.

  • ENDIF.

while oref_lr_entc is bound.

CALL METHOD oref_lr_entc->get_property_as_string(

EXPORTING

iv_attr_name = 'YYAFLD000013'

RECEIVING

rv_result = lv_category ).

case lv_category .

when 'Process Cheese'.

clear lt_tab.

clear : lt_ddlb,ls_ddlb.

CLEAR : LT_DDLB1.

refresh : lt_ddlb.

refresh : lt_tab1.

IF lt_ddlb1 IS NOT BOUND.

CREATE OBJECT lt_ddlb1

EXPORTING

iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

SELECT * from zcomp INTO TABLE lt_tab where CATEGORY_DESC = lv_category.

ls_ddlb-key = ' '.

ls_ddlb-value = ' '.

INSERT ls_ddlb INTO TABLE lt_ddlb.

READ TABLE lt_tab INTO lt_line1 INDEX 1 .

APPEND lt_line1 TO lt_tab1.

CLEAR lt_line1.

LOOP AT lt_tab INTO lt_line1 .

APPEND lt_line1 TO lt_tab1.

CLEAR lt_line1.

ENDLOOP.

LOOP AT lt_tab1 INTO wa.

ls_ddlb-key = wa-COMPETITOR.

ls_ddlb-value = wa-COMPETITOR.

INSERT ls_ddlb INTO TABLE lt_ddlb.

ENDLOOP.

DELETE ADJACENT DUPLICATES FROM lt_ddlb.

lt_ddlb1->set_selection_table( lt_ddlb ).

endif.

  • gr_proc->set_selection_table( it_selection_table = lt_ddlb ).

rv_valuehelp_descriptor = lt_ddlb1.

when 'FS Frozen Meals/Other'.

CLEAR : LT_DDLB1.

clear lt_tab.

clear : lt_ddlb,ls_ddlb.

refresh : lt_ddlb.

refresh : lt_tab1.

IF lt_ddlb1 IS NOT BOUND.

CREATE OBJECT lt_ddlb1

EXPORTING

iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

SELECT * from zcomp INTO TABLE lt_tab where CATEGORY_DESC = lv_category.

ls_ddlb-key = ' '.

ls_ddlb-value = ' '.

INSERT ls_ddlb INTO TABLE lt_ddlb.

READ TABLE lt_tab INTO lt_line1 INDEX 1 .

APPEND lt_line1 TO lt_tab1.

CLEAR lt_line1.

LOOP AT lt_tab INTO lt_line1 .

APPEND lt_line1 TO lt_tab1.

CLEAR lt_line1.

ENDLOOP.

LOOP AT lt_tab1 INTO wa.

ls_ddlb-key = wa-COMPETITOR.

ls_ddlb-value = wa-COMPETITOR.

INSERT ls_ddlb INTO TABLE lt_ddlb.

ENDLOOP.

DELETE ADJACENT DUPLICATES FROM lt_ddlb.

lt_ddlb1->set_selection_table( lt_ddlb ).

endif.

  • gr_proc->set_selection_table( it_selection_table = lt_ddlb ).

rv_valuehelp_descriptor = lt_ddlb1.

when others.

CLEAR : LT_DDLB1.

clear lt_ddlb.

IF lt_ddlb1 IS NOT BOUND.

CREATE OBJECT lt_ddlb1

EXPORTING

iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

endif.

rv_valuehelp_descriptor = lt_ddlb1.

endcase.

oref_lr_entc = oref_iterator->get_next( ).

endwhile.

endif.

Tried this way..but the DDLB for every row is showing the same values.

Former Member
0 Kudos

Hi,

try the below hint.

Dont use the while loop(no need to loop through teh collection) and read the current row from the collection using the idex as

oref_lr_entc ?= me->collection_wrapper->find( iv_index = lv_index ).

Thanks,

Rajini A.

Former Member
0 Kudos

Thanks Rajini

Now for every row in a table view how will i set the values?

DDLB?

i need to use set_property ?

oref_lr_entc ?= me->collection_wrapper->find( iv_index = lv_index ).

what shd be lv_index?

Former Member
0 Kudos

Hi,

I think you dont have to do thsi for entire row at once. when you select a particular row for, that row dropdown will be populated. iv_index is importing parameter in get_v method.

please see the method GET_V_PARTNER_FCT in view BT111H_OPPT/SalesteamList for better understanding.

Thanks,

Rajini A.

Former Member
0 Kudos

Thanks rajini ....

sloved by

lv_index = iv_index.

oref_lr_entc ?= me->collection_wrapper->find( iv_index = lv_index ).

if oref_lr_entc is bound.

oref_lr_entc->get_property_as_value( EXPORTING iv_attr_name = 'YYAFLD000013' IMPORTING ev_result = lv_category ).

if lv_category is not initial.

clear lt_tab.

clear : lt_ddlb,ls_ddlb.

CLEAR : LT_DDLB1.

refresh : lt_ddlb.

refresh : lt_tab1.

IF lt_ddlb1 IS NOT BOUND.

CREATE OBJECT lt_ddlb1

EXPORTING

iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

SELECT * from zcomp INTO TABLE lt_tab where CATEGORY_DESC = lv_category.

ls_ddlb-key = ' '.

ls_ddlb-value = ' '.

INSERT ls_ddlb INTO TABLE lt_ddlb.

READ TABLE lt_tab INTO lt_line1 INDEX 1 .

APPEND lt_line1 TO lt_tab1.

CLEAR lt_line1.

LOOP AT lt_tab INTO lt_line1 .

APPEND lt_line1 TO lt_tab1.

CLEAR lt_line1.

ENDLOOP.

LOOP AT lt_tab1 INTO wa.

ls_ddlb-key = wa-COMPETITOR.

ls_ddlb-value = wa-COMPETITOR.

INSERT ls_ddlb INTO TABLE lt_ddlb.

ENDLOOP.

DELETE ADJACENT DUPLICATES FROM lt_ddlb.

lt_ddlb1->set_selection_table( lt_ddlb ).

endif.

  • gr_proc->set_selection_table( it_selection_table = lt_ddlb ).

rv_valuehelp_descriptor = lt_ddlb1.

else.

CLEAR : LT_DDLB1.

clear lt_ddlb.

IF lt_ddlb1 IS NOT BOUND.

CREATE OBJECT lt_ddlb1

EXPORTING

iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

endif.

rv_valuehelp_descriptor = lt_ddlb1.

endif.

else.

CLEAR : LT_DDLB1.

clear lt_ddlb.

IF lt_ddlb1 IS NOT BOUND.

CREATE OBJECT lt_ddlb1

EXPORTING

iv_source_type = if_bsp_wd_valuehelp_pldescr=>source_type_table.

endif.

rv_valuehelp_descriptor = lt_ddlb1.

endif.

Answers (0)