Application Development 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: 

How to remove default cursor position in first cell of oo alv grid ?

vijay_sharma12
Explorer
0 Kudos

Hi ,

    I have tried few methods to remove default cursor position in oo alv grid:  set_current_cell_via_id , set_focus , set_enable  and in layout I have passed no_rowmark = 'X' but still I didn't find any solution to remove the default cursor position in oo alv grid.

Thanks and regards.

9 REPLIES 9

former_member195402
Active Contributor
0 Kudos

Hi,

if you are using class CL_GUI_ALV_GRID or similar and call your ALV screen with CALL SCREEN nnnn, then you can try the following:

Give a field name to the OK_CODE field on that screen, for example OKCOD.

Use  SET CURSOR FIELD 'OKCOD'. in last PBO module.

Please check if this works.

Also you can try to use SET CURSOR col lin for a direct cursor position.

Regards,

Klaus

0 Kudos

Hi Klaus,

     Thanks for your response, I am having only one screen in my program and I am displaying an Alv. I need to disable the default cursor position in that screen instead of setting to a field .

      I didn't get your solution. can you explain it clearly.

Thanks and regards ,

vijay

0 Kudos

Hi Vijay,

this is no solution but an idea. If you have an own ALV screen defined in SE51, then you can assign a field name to the OK code field in the element list in SE51 (the field is of type OK.

If it has a name assigned, you can use the ABAP command

SET CURSOR FIELD xxxx.

This command must be processed at the end of the PBO flow logic in your ALV screen.

Regards,

Klaus

0 Kudos

Hi Klaus,


   Thanks for your response, i have tried it but it doesn't seems to work .


Thanks and Regards,

Vijay

Former Member
0 Kudos

Hi,

u can try : set_current_cell_via_id to  set cursor where u want.

0 Kudos

Hi snehal ,

   I know set_current_cell_via_id will set cursor where ever I want, if I pass 0. Then also it will show cursor on 1st  cell of alv. I need is disable the cursor .

Thanks,

Vijay

raymond_giuseppi
Active Contributor
0 Kudos

Use of set_current_cell_via_id and set_focus should have allowed you to move the cursor where you want, so could you post relevant code or explain when and how you called those, did you forget to also call CL_GUI_CFW=>FLUSH?

Regards,

Raymond

0 Kudos

Hi Raymond ,

I need to remove the default cursor in first cell.

Thanks ,

Vijay.

0 Kudos

That is not a requirement, shouldn't requirement be I want to put the cursor there?

(e.g the SET CURSOR FIELD 'OK_CODE' already suggested by Klaus.)

Regards,

Raymond