cancel
Showing results for 
Search instead for 
Did you mean: 

Based on select-options(kunnr) in 1st view display data in ALV in 2nd view

former_member187692
Participant
0 Kudos

Hi,

     I have to display ALV data in 2nd view based on the values in select-options( of KUNNR ) from 1st view.

1.) I have created & instantiated both the components in their respective views. ( 1st view wdr_select_options and 2nd view salv_wd_table ).

2.) Mapped the context node in both the views and created buttons and plugs for outbound n inbound ( n vice versa ).

3.) External mapping is done for alv.

My problem, when tested data is not displaying in ALV (2nd view ).

My query is, is it correct to write the select query in the 1st views ( along with the bind table logic or should I add the bind table logic in 2nd view for displaying data ).

Regards,

Krishna.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member222068
Active Participant
0 Kudos

Hi Krishna,

Approach what you have followed is right,

can you debugg and check whether you are getting data for the given KUNNR.

If yes, set the data to the node.

Note: Logic can be either written in view1 or view2.

If you need to write logic in view2, then pass the data of select options throught outbound plug and write the logic in the method of INBOUND plug.

Thanks & Regards,

Sankar Gelivi

ramakrishnappa
Active Contributor
0 Kudos

Hi Krishna,

Yes, your approach is correct.

Let us say you have view1 with select options and "submit" button , view2 with alv

On click action of button "submit",

you can get data required based on the value given in select options and bind it to the context node of alv table.

After that, you fire the outbound plug, to navigate to view 2.

It should work.

Make sure that you have mapped context nodes properly.

here, are the two possibilities:


  • Are you getting blank alv with all columns & no data?

          Then the data is not bound to context node properly i.e. you context node should be mapped on to the context node "DATA" of ALV component's interface controller context

  • Are getting just empty screen instead of alv table & columns ?

          Then, you have not embedded the alv view table into the view container element of your view2

Hope this helps you.

Regards,

Rama

former_member187692
Participant
0 Kudos

Hi Rama,

My current req is similar to the previous req if u remember ( displaying alv with select-options n radio buttons ).

Here in the component usage interface controller, the external mapping is already done.

( what I did is I copied the previous component into a new one and removed my ALV from 1st view and placed it in 2nd view and embedded in window )

PS:- As u said, it's the first possibilities but the binding is already done.

ramakrishnappa
Active Contributor
0 Kudos

Hi Krishna,

Is your alv table appearing with columns or just empty screen?

Pls share the snap shots of the view2 ?

Regards,

Rama

former_member187692
Participant
0 Kudos

The ALV ( with 10 columns is displayed )

ramakrishnappa
Active Contributor
0 Kudos

Hi Krishna,


View embedding of alv component into your view container ui element looks fine.

I suspect, the data is not set to the context of your view2.

I suggest you to try the below point

  • Go to event handler of inbound plug of view 2 , and read the context node data by sing lo_node->get_static_attributes_table( ), check if data is set ?

Regards,

Rama

former_member187692
Participant
0 Kudos

This is how my code is in "handlefrom_input_view" event handler :-

  

  DATA: NODE_YCUST TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA: IT_YCUST TYPE STANDARD TABLE OF IF_OUTPUT_VIEW=>ELEMENT_YCUST,
        WA_YCUST LIKE LINE OF IT_YCUST.

  NODE_YCUST = WD_CONTEXT->GET_CHILD_NODE( NAME = 'YCUST').


  NODE_YCUST->GET_STATIC_ATTRIBUTES_TABLE(
    IMPORTING
      TABLE = IT_YCUST ).

*Process data
  LOOP AT IT_YCUST INTO WA_YCUST.
     ....

     ....

  ENDLOOP.

* Update context: bind updated data to the table context
  NODE_YCUST->BIND_TABLE( IT_YCUST ).

Well, i figured out using debugging and correcting some parts of code.

PS:-This is certainly to come in handy at some point. I have post it bcoz somebody may need it.

Regards,

Krishna.

ramakrishnappa
Active Contributor
0 Kudos

Hi Krishna,

Thats great , you found the cause for the issue.

Regards,

Rama

former_member187692
Participant
0 Kudos

Well, the previous one is fine.(resolved)

But as people say..... "some or the other problem pop up out of the blue" .

(I am still working on another issue.) Will post it, if any.

ramakrishnappa
Active Contributor
0 Kudos

Hi Krishna,

Hope this issue is resolved. Please close the discussion.

Regards,

Rama