Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Is Get Cursor possible in OOPS interactive reporting?

0 Likes
1,637

Hi Everyone,

Fresher here.

I wrote the similar code with oops and without oops. The issue while using oops is I'm not getting the fieldname(V1) in the get cursor line. In contrast i'm getting the Value (V2) while debugging.


AT LINE-SELECTION.
data : v1(15) type c,
v2(10) type c.
IF SY-LSIND = '1'.
get cursor field v1 value v2.
if v1 = 'LS-BUKRS'.

<Some statements.>

Thanks in Advance.

Regards,

Raj.

7 REPLIES 7
Read only

matt
Active Contributor
1,482

What do you mean by OOPs? Are you using CL_GUI_ALV_GRID or CL_SALV_TABLE? Or using the really old function modules?

If you're not using it already, try CL_SALV_TABLE. There are loads of examples of how to respond to a click or double click on the display table

Furthermore, when you're replying to an answer, use comment. Don't create another answer.

Read only

Muthu_raja
Active Participant
0 Likes
1,482

Hi Raj,

When it comes to OOPS ALV, Please use below method for interactive reporting Also please refer this OOPs ALV

CL_GUI_ALV_GRID->GET_SELECTED_ROWS( ).
Read only

1,482

Hi Raj,

1>You have to use the below code:

SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid where gr_alvgrid TYPE REF TO cl_gui_alv_grid,

2> Implement the method handle_double_click USING i_row TYPE lvc_s_rowi_column TYPE lvc_s_colis_row_no TYPE lvc_s_roid.

Read only

0 Likes
1,482

Hello again,

I appreciate your responses, that one should always go through OOPS ALV, but I was trying this for general practice and got this kind of weird output.

I too prefer ALV, but for understanding purpose I tried this.

Please justify the problem with 'INTERACTIVE OOPS' if possible.

Thanks for your all responses.

Raj.

Read only

0 Likes
1,482

Please let us know your code after AT LINE SELECTION ?? Have you used any local classes ??

when copying code please use INSERT CODE block

Read only

0 Likes
1,482

1st image is without oops; 2nd image is with oops.

" Basic List has EBELN BEDAT and LIFNR to Display.
""" Displaying Basic list ""
At line-selection.
if sy-lsind = 1.
  get cursor field v1 value v2.
  if v1 = 'LS_EKKO-EBELN'.
    "" calling methods to fetch the purchase order data based on V2.
  elseif v1 = 'LS_EKKO-LIFNR'.
    "" calling methods to fetch the vendor data based on v2.
  endif.
endif. 
"""End of the program"""
Read only

0 Likes
1,482

sorry, I added new answers..