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 line-selection and user command

Former Member
0 Likes
799

hi,

is it possible to use both at line selecion and at user command at a time.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
761

Hi Kiran,

Yes, it is possible to use both at line selecion and at

user command at a time.

AT LINE-SELECTION.

Event in interactive reporting

This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.

The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.

AT USER-COMMAND.

Event in interactive reporting

This event is executed whenever the user presses a function key in the list or makes an entry in the command field.

DATA: NUMBER1 TYPE I VALUE 20,

NUMBER2 TYPE I VALUE 5,

RESULT TYPE I.

START-OF-SELECTION.

WRITE: / NUMBER1, '?', NUMBER2.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'ADD'.

RESULT = NUMBER1 + NUMBER2.

WHEN 'SUBT'.

RESULT = NUMBER1 - NUMBER2.

WHEN 'MULT'.

RESULT = NUMBER1 * NUMBER2.

WHEN 'DIVI'.

RESULT = NUMBER1 / NUMBER2.

WHEN OTHERS.

WRITE 'Unknown function code'.

EXIT.

ENDCASE.

WRITE: / 'Result:', RESULT.

After entry of a function code, the appropriate processing is performed under the event AT USER-COMMAND and the result is displayed in the details list.

Reward points if helpful,

Rgds,

Sumana

7 REPLIES 7
Read only

Former Member
0 Likes
761

Kiran,

Yes you can write. As such USER COMMAND can have more functionality than just than what LINE SELECTION does.

Regards,

Ravi

Read only

Former Member
0 Likes
761

Hi

At line-selection is used when you click on the list. If you have made any field as HOTSPOT On or double click on the list, this event would be triggered.

AT USER-COMMAND will be triggered when you click on Push Buttons or menu buttons, like BACK, EXIT, CANCEL or any button defined in PF Status.

Regards,

Navneeth

PS: Please award points if helpful

Read only

0 Likes
761

Hi Kiran,

PL check the example program DEMO_LIST_AT_USER_COMMAND. It demonstrates the use of both the events.

~Suresh

Read only

Former Member
0 Likes
761

Hi kiran,

To make AT-LINE-SELECTION to work together with AT USER COMMAND, set F2 and F9 to PICK in the GUI Status(Menu Painter) under Function keys.

Regards,

Arun Sambargi.

Read only

Former Member
0 Likes
762

Hi Kiran,

Yes, it is possible to use both at line selecion and at

user command at a time.

AT LINE-SELECTION.

Event in interactive reporting

This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.

The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.

AT USER-COMMAND.

Event in interactive reporting

This event is executed whenever the user presses a function key in the list or makes an entry in the command field.

DATA: NUMBER1 TYPE I VALUE 20,

NUMBER2 TYPE I VALUE 5,

RESULT TYPE I.

START-OF-SELECTION.

WRITE: / NUMBER1, '?', NUMBER2.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'ADD'.

RESULT = NUMBER1 + NUMBER2.

WHEN 'SUBT'.

RESULT = NUMBER1 - NUMBER2.

WHEN 'MULT'.

RESULT = NUMBER1 * NUMBER2.

WHEN 'DIVI'.

RESULT = NUMBER1 / NUMBER2.

WHEN OTHERS.

WRITE 'Unknown function code'.

EXIT.

ENDCASE.

WRITE: / 'Result:', RESULT.

After entry of a function code, the appropriate processing is performed under the event AT USER-COMMAND and the result is displayed in the details list.

Reward points if helpful,

Rgds,

Sumana

Read only

abdul_hakim
Active Contributor
0 Likes
761

hi kiran,

you can use it very well without any issues.

AT LINE-SELECTION is triggered whenever the user double clicks the list line.

AT USER-COMMAND will be triggered for user defined function codes..

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
761

Hi,

Yes.USER COMMAND can have more functionality under 'CASE' structure.While At line selection is just an event on the list.