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

At user-command & At Line-selection

Former Member
0 Likes
1,905

Hi,

I am using ECC5 ver. of ABAP.

Can I use AT USER-COMMAND and AT LINE-SELECTION

in the same report?

I have used it but only At user command works, not At line selection.

When I remove Set pf-Status, At line selection works.

Here is my code.

*----


REPORT PF&ATLINE.

AT LINE-SELECTION.

MESSAGE 'Line Selected' TYPE 'I'.

AT USER-COMMAND.

IF sy-ucomm = 'PUSH'.

MESSAGE 'Button Pushed' type 'I'.

elseif sy-ucomm = 'EXIT'.

LEAVE PROGRAM.

ENDIF.

START-OF-SELECTION.

SET PF-STATUS 'ZRND3'.

DO 10 TIMES.

WRITE:/01 SY-INDEX HOTSPOT.

ENDDO.

END-OF-SELECTION.

*----


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,465

Hi Rajiv,

in your SET PF-STATUS 'ZRND3'.

go to FUNCTION KEYS

give 'PICK' as function key in Recommended Function Key Settings against F2 like

F2 PICK Choose

With luck,

Pritam.

11 REPLIES 11
Read only

Former Member
0 Likes
1,465

Dear,

prob is not that.Pf status has its own function it has no relation with any event.

Thanks,

jaten

Read only

0 Likes
1,465

Can you please check my code. It is not working. Why?

Read only

Former Member
0 Likes
1,465

hi,

You can use both of them in the same report.

In your case put write AT USER-COMMAND after Start-of selection.

Regards,

anirban

Read only

0 Likes
1,465

I have kept At user-command below start-of-selection but

It works only AT USER-COMMAND not AT LINE-SELECTION.

Read only

Former Member
0 Likes
1,465

Hi,

Generally AT line selection is used to scroll through the lists.

if u double click on the list and u want to show some relevant information about that line in another list we use this event.

At user command is used when you click some button particular code have to be executed then we use this event.

we can use both the events at the same time.

Read only

Former Member
0 Likes
1,466

Hi Rajiv,

in your SET PF-STATUS 'ZRND3'.

go to FUNCTION KEYS

give 'PICK' as function key in Recommended Function Key Settings against F2 like

F2 PICK Choose

With luck,

Pritam.

Read only

0 Likes
1,465

Dear Pritam,

I have done as U suggested. But in both (Button click or line selection) it goes to AT USER-COMMAND.

how can it go to AT LINE-SELECTION?

tHANKS.

Read only

0 Likes
1,465

Hi Rajiv,

Setting the PICK function code to F2 will definitely solve it..

and it triggers the at user-command and at line-selection event as per user interaction...

If it is not working properly... then there might me something wrong in your code...

can you place the code... so that we can know the exact problem

regards

padma

Read only

0 Likes
1,465

Hi Rajiv,

If you have given PICK as the function code against F2, always AT LINE-SELECTION will be triggered whenever you select a line in the list, in your case the MESSAGE 'Line Selected' will be displayed , AT LINE-SELECTION gets the highest priority in all the interactive list events.

With luck,

Pritam.

Read only

Former Member
0 Likes
1,465

hi,

U can use both in the same report.

But one thing needs to be taken care of is

In ur GUI .

IN the function key-->

In F2 write PICK & CHOOSE.

This will definetely solve ur problem.

Regards,

Aleem.

Read only

Former Member
0 Likes
1,465

Hi Rajiv,

In your PF Status.... goto function keys...

and set the function code for F2 as PICK

This helps you to use both at user-command and at line-selection in the same report.

regards

padma