‎2007 Jun 27 7:02 AM
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
‎2007 Jun 27 7:40 AM
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
‎2007 Jun 27 7:07 AM
‎2007 Jun 27 7:13 AM
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
‎2007 Jun 27 7:09 AM
Hi,
Use the AT USER-COMMAND event.
This event is for processing a user input like button click, enter etc.
Regards,
Kate
‎2007 Jun 27 7:40 AM
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
‎2007 Jun 27 7:44 AM
Hi Shiba ,
Thanks a lot for the reply , is there some way this can be implemented without using a custom GUI Status.
Regards
Arun
‎2007 Jun 27 7:46 AM
Hi Arun,
No you require to define your own GUI if you want to put some button on application toolbar.
Regards,
Atish
‎2007 Jun 27 7:49 AM
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
‎2007 Jun 27 7:47 AM
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.