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

Enter command in Classical Report

Former Member
0 Likes
1,198

Hi ,

I have a classical report with one of the fields editable , when the user modifed one of the rows and presses enter i want to do some processing , how can this be implemeted. i.e. how can i handle ENTER command in a classical report.

Regards,

Arun

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
989

Hi arun,

for this you have to set your own pf status and there in application tool bar assign some fn code to green tick(1st button in appl tool bar). Now catch the sy-ucomm value in at user-command event. When you press enter it will get the same sy-ucomm which you define in menu painter.

regards

shiba dutta

8 REPLIES 8
Read only

Former Member
0 Likes
989

Hi Arun,

Check AT USER-COMMAND.

Reward if useful!

Read only

0 Likes
989

Hi refer the following code for implementing the enter command . I think it should work.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • DATA temp1(9) TYPE n.

  • DATA: tem_qty LIKE mseg-menge.

DATA: seltab TYPE TABLE OF rsparams,

seltab_wa LIKE LINE OF seltab.

  • IF r_ucomm = '&IC1'.

CASE r_ucomm.

WHEN '/00'.

PERFORM export_xl.

ENDCASE.

ENDFORM. "USER_COMMAND

Read only

Former Member
0 Likes
989

Hi,

Use the AT USER-COMMAND event.

This event is for processing a user input like button click, enter etc.

Regards,

Kate

Read only

Former Member
0 Likes
990

Hi arun,

for this you have to set your own pf status and there in application tool bar assign some fn code to green tick(1st button in appl tool bar). Now catch the sy-ucomm value in at user-command event. When you press enter it will get the same sy-ucomm which you define in menu painter.

regards

shiba dutta

Read only

0 Likes
989

Hi Shiba ,

Thanks a lot for the reply , is there some way this can be implemented without using a custom GUI Status.

Regards

Arun

Read only

0 Likes
989

Hi Arun,

No you require to define your own GUI if you want to put some button on application toolbar.

Regards,

Atish

Read only

0 Likes
989

i think it is not possible because in classical report enter is not triggering any event and the sy-ucomm is not getting any value. So i think you have to create your own gui status to achieve the functionality.

regards

shiba dutta

Read only

former_member491305
Active Contributor
0 Likes
989

Hi Arun,

You have to set your own GUI staus and then set the function code for enter key in Function key of the GUI STATUS .After that write the code in At user-command event to handle the user-input in the list.

The following code change the color of the list line in which user has entered the telephone no for vendor.

START-OF-SELECTION.

SET PF-STATUS 'GUI_LIST1'.

SELECT * FROM lfa1 INTO TABLE it_lfa1 WHERE lifnr IN s_lifnr.

FORMAT COLOR 2 ON.

LOOP AT it_lfa1 INTO x_lfa1.

val = sy-tabix MOD 2.

IF val = 0.

FORMAT INTENSIFIED ON.

ELSE.

FORMAT INTENSIFIED OFF.

ENDIF.

WRITE :/2 x_lfa1-sel AS CHECKBOX,6 x_lfa1-lifnr,17 x_lfa1-name1,

46 x_lfa1-telf1 INPUT.

HIDE: x_lfa1-sel,x_lfa1-lifnr.

ENDLOOP.

AT USER-COMMAND.

CASE sy-ucomm .

WHEN 'ENTER'.

CLEAR cnt.

DO.

READ LINE sy-index FIELD VALUE x_lfa1-sel x_lfa1-lifnr x_lfa1-telf1.

IF sy-subrc = 0 .

MODIFY LINE sy-index FIELD VALUE x_lfa1-sel LINE FORMAT COLOR 4 INTENSIFIED ON.

ELSE.

EXIT.

ENDIF.

ENDDO.

ENDCASE.