cancel
Showing results for 
Search instead for 
Did you mean: 

Select options values not updating in two view WD application

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Saurabh Banerjee,

                                   You should create a range node in component controller so that it will be global and will be visible for both views. Then have to bind table from which view select-option is displayed as you have done.

          Hope this might help you.

Cheers,

Dineshwar Singh Eswar.

chengalarayulu
Active Contributor
0 Kudos

Saurabh,

It seems you have written Bindings code in WDDOINIT of view-2. if yes, please write those in INBOUND PLUG of view-2. if the nodes are global, then you can write on Search action also.

hope this helps.

Former Member
0 Kudos

Hi,

You can try INVALIDATE your 3 context nodes 'ITAB_SELOP_CCD' , 'ITAB_SELOP_CCD' and 'ITAB_SELOP_DOC' when you click Back button in View 2 .

You may write this in Handle<Inbound Plug name> method in View 1.

Also try calling this below method

RESET_ALL_SELECTION_FIELDS (Resets Range Table of All Selection Fields)

from LR_HELPER ( ref of IF_WD_SELECT_OPTIONS).

Regards,

Rohit