cancel
Showing results for 
Search instead for 
Did you mean: 

Determining lead column and selected column of table

Former Member
0 Kudos

Hello,

maybe this is a general issue of understanding, but even I've studied the online help and the tutorials excessive, I did not get the point in above mentioned problem.

I have a table named TAB_SFLIGHTS, that is connected to the context DATA_SFLIGHTS. For the table I have implemented a method for the event ON_LEAD_SELECT:

method ONACTIONFILL_DETAIL_VIEW .

data: NODE type ref to IF_WD_CONTEXT_NODE,

wa_flights type sflights,

FLIGHTS type table of sflights,

NODE = WD_CONTEXT->GET_CHILD_NODE( 'DETAIL_SFLIGHTS' ).

select single * from SFLIGHTS into wa_FLIGHTS.

append wa_flights to flights.

NODE->BIND_ELEMENTS( FLIGHTS ).

endmethod.

At the moment it will show any entry from SFLIGHT in the Flight detail screen, but it should show the entry that was marked in the table.

How can I access the column values of the marked table column in this example?

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Andreas,

To get node element which is "marked" in table you need method GET_LEAD_SELECTION (http://help.sap.com/saphelp_nw04s/helpdata/en/fd/be5b4150b38147e10000000a1550b0/frameset.htm).

Best regards, Maksim Rashchynski.

Answers (2)

Answers (2)

Former Member
0 Kudos

After a few more tries I made the application run. The code might be cumbersomely, but at least it works. Any suggestions are welcome.

method ONACTIONFILL_DETAIL_VIEW .

  data: NODE_DETAILS   type ref to IF_WD_CONTEXT_NODE,
        NODE_TABLE     type ref to IF_WD_CONTEXT_NODE,
        NODE_TABLE_ROW type ref to IF_WD_CONTEXT_ELEMENT,
        WA_FLIGHTS     type SFLIGHTS,
        IT_FLIGHTS     type table of SFLIGHTS,
        WA_FLIGHTLIST  type IF_SHOW_FLIGHTS=>ELEMENT_DETAIL_SFLIGHTS.

* Ermitteln von LEAD_SELECTION in Tabelle DATA_SFLIGHTS
  NODE_TABLE     = WD_CONTEXT->GET_CHILD_NODE( 'DATA_SFLIGHTS' ).
  NODE_TABLE_ROW = NODE_TABLE->GET_LEAD_SELECTION( ).

* Lesen Feldwerte aus Tabellenzeile
  NODE_TABLE_ROW->GET_ATTRIBUTE( exporting NAME = 'CARRID' importing VALUE = WA_FLIGHTLIST-CARRID ).
  NODE_TABLE_ROW->GET_ATTRIBUTE( exporting NAME = 'CONNID' importing VALUE = WA_FLIGHTLIST-CONNID ).
  NODE_TABLE_ROW->GET_ATTRIBUTE( exporting NAME = 'FLDATE' importing VALUE = WA_FLIGHTLIST-FLDATE ).

* Detaildaten von DB lesen
  select * from SFLIGHTS into table IT_FLIGHTS
         where CARRID = WA_FLIGHTLIST-CARRID
         and   CONNID = WA_FLIGHTLIST-CONNID
         and   FLDATE = WA_FLIGHTLIST-FLDATE.

* Kontext von Detailansicht beschaffen und binden
  NODE_DETAILS = WD_CONTEXT->GET_CHILD_NODE( 'DETAIL_SFLIGHTS' ).
  NODE_DETAILS->BIND_ELEMENTS( IT_FLIGHTS ).

endmethod.

Former Member
0 Kudos

Thank you for this hint, but as I mentioned above I already studied the online help and saw that information before. Thus I would be thankful for a concrete code example. Thanks in advance.