Skip to Content
0
Former Member
Sep 22, 2012 at 09:35 PM

Select options values not updating in two view WD application

17 Views

Hi all,

I have used two views to display my records.

1st screen contains select-options for value input and second page contains records display using table.

The issue is:

When the first time I fill range tables and click search button, I get corresponding records.

But from second time onwards whenever I go back and input new range table values, the initial records only get displayed.

My process is

In the first view, In the action button I am fetching the range table values using the code:

Action Button code view1 to view2

DATA: LR_COMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
DATA : LR_RANGE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA: LT_FIELDS TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
LR_COMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).

IF LR_COMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LR_COMP_USAGE->CREATE_COMPONENT( ).
ENDIF.

LR_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
LR_HELPER = LR_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).
LR_HELPER->GET_SELECTION_SCREEN_ITEMS( IMPORTING
ET_SELECTION_SCREEN_ITEMS = LT_FIELDS ).

*READ TABLE LT_FIELDS ASSIGNING <LS_FIELD> WHERE M_ID = .

LOOP AT LT_FIELDS ASSIGNING <LS_FIELD>.
IF <LS_FIELD>-M_ID = 'BUKRS'.
FREE: LR_RANGE.
ASSIGN <LS_FIELD>-MT_RANGE_TABLE->* TO <LT_COD_TABLE>.

LR_RANGE = WD_CONTEXT->GET_CHILD_NODE( 'ITAB_SELOP_CCD' ).
LR_RANGE->BIND_TABLE( <LT_COD_TABLE> ).
ENDIF.

IF <LS_FIELD>-M_ID = 'BELNR_D'.
FREE: LR_RANGE.
ASSIGN <LS_FIELD>-MT_RANGE_TABLE->* TO <LT_DOC_TABLE>.

LR_RANGE = WD_CONTEXT->GET_CHILD_NODE( 'ITAB_SELOP_DOC' ).
LR_RANGE->BIND_TABLE( <LT_DOC_TABLE> ).
ENDIF.

IF <LS_FIELD>-M_ID = 'GJAHR'.
FREE: LR_RANGE.
ASSIGN <LS_FIELD>-MT_RANGE_TABLE->* TO <LT_FIS_TABLE>.

LR_RANGE = WD_CONTEXT->GET_CHILD_NODE( 'ITAB_SELOP_FISY' ).
LR_RANGE->BIND_TABLE( <LT_FIS_TABLE> ).
ENDIF.
ENDLOOP.

After that once I get the tables, I am sending the same to second view using assistance class.

Using assistance class to send data to next view

wd_assist->range_doc = <LT_DOC_TABLE>.

wd_assist->range_ccd = <LT_COD_TABLE>.

wd_assist->range_fis = <LT_FIS_TABLE>.

Now the problem I am facing is, the second time I come back from view 2 to view 1 and change range table values and press search, the new values are not captures in the first set of code.

Please help me with this. Points will be awarded.

Regards,

Saurabh.