‎2010 Jul 05 4:46 AM
Hi,
Need an advice, i need to customize the standard BACK button after report had been displayed, trying to use AT USER-COMMAND, but still not avail..
anyone can come with example will help me a lot.
Thanks
‎2010 Jul 06 3:42 AM
Hi badz lee,
Just change the function code 'BACK' to 'ZBACK' in your custom GUI staus.
Then write your own logic for the custmer needs.
Hope this code helps.
*&---------------------------------------------------------------------*
*& Report ZVK_TEST
*&
*&---------------------------------------------------------------------*
REPORT zvk_test.
TABLES:ekko."for select option only
SELECT-OPTIONS:s_ebeln FOR ekko-ebeln.
DATA:lt_ekko TYPE TABLE OF ekko,
lw_ekko TYPE ekko.
START-OF-SELECTION.
SET PF-STATUS 'STLI'."copy status STLI of program SAPMSSY0.
SET TITLEBAR 'TITLE'.
*
SELECT * INTO TABLE lt_ekko
FROM ekko
WHERE ebeln IN s_ebeln.
LOOP AT lt_ekko INTO lw_ekko.
WRITE:/ lw_ekko-ebeln,
lw_ekko-bukrs,
lw_ekko-bstyp,
lw_ekko-bsart.
ENDLOOP.
END-OF-SELECTION.
*
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'ZBACK'.
PERFORM back_function."Your logic
WHEN OTHERS.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form BACK_FUNCTION
*&---------------------------------------------------------------------*
FORM back_function .
LEAVE PROGRAM.
ENDFORM. " BACK_FUNCTION
‎2010 Jul 05 5:03 AM
‎2010 Jul 05 9:24 AM
Suhas i try this in Classical Report.
Edited by: badz lee on Jul 5, 2010 10:24 AM
‎2010 Jul 05 10:14 AM
‎2010 Jul 05 10:39 AM
Krishna, I already create the GUI status. but its skip the back button code.
Below is my code snippet.
end-of-selection.
*-----------------------------------------------------------------------
* User Command
*-----------------------------------------------------------------------
at user-command.
perform user_command using sy-ucomm.
--------------------------------------------
form user_command using in_ucomm.
case in_ucomm.
when 'CETAK'.
perform print_sapscript.
when 'BACK'.
perform print_sapscript.
endcase.
endform.
‎2010 Jul 05 11:14 AM
Hi badz lee ,
please read docu for event AT USER-COMMAND - Function Code BACK doesnt trigger AT USER-COMMAND.
Regards
REA
‎2010 Jul 05 3:21 PM
Thanks, i read the abap docu , yes i cant used At-User Command, any suggestion how can i use BACK button in the classic report program
‎2010 Jul 05 3:37 PM
Hi badz_lee,
event
AT SELECTION-SCREEN ON EXIT-COMMAND.could meet your requirements.
regards
rea
‎2010 Jul 05 4:15 PM
Hi, i had try the code, but seems not working, as the report already displayed, when i pressed back button , its not going to to the exit command
below is my code snippet
SELECTION-SCREEN: BEGIN OF BLOCK upd WITH FRAME TITLE txt2.
SELECT-OPTIONS: s_carrid FOR SFLIGHT-carrid OBLIGATORY MODIF ID r2.
SELECTION-SCREEN: END OF BLOCK upd.
INITIALIZATION.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN ON EXIT-COMMAND.
LEAVE PROGRAM.
START-OF-SELECTION.
SELECT *
INTO CORRESPONDING
FIELDS OF TABLE itab1
FROM
sflight
WHERE carrid IN s_carrid .
LOOP AT itab1.
WRITE: / itab1-carrid,
itab1-connid,
itab1-fldate,
itab1-price,
itab1-seatsmax,
itab1-seatsocc.
ENDLOOP.
‎2010 Jul 05 4:39 PM
hi badz_lee,
now i got your point, as the report already displayed = after report has been executed and list is displayed.
you should define your own status for addtional functionality instead of using the back button, nobody expects that something happens by pressing back except going one screen backwards...
regards
rea
Edited by: Ramy El-Arnaouty on Jul 5, 2010 5:55 PM
besides i think there is no way to react on the back button in a list
‎2010 Jul 06 1:47 AM
Ramy, we should wait others point of view to decide if we can customized the BACK button using GUI Status at report list
There is purpose i would like to this , but i'll ask this in another thread, its about call transaction.
Thanks.
‎2010 Jul 06 3:42 AM
Hi badz lee,
Just change the function code 'BACK' to 'ZBACK' in your custom GUI staus.
Then write your own logic for the custmer needs.
Hope this code helps.
*&---------------------------------------------------------------------*
*& Report ZVK_TEST
*&
*&---------------------------------------------------------------------*
REPORT zvk_test.
TABLES:ekko."for select option only
SELECT-OPTIONS:s_ebeln FOR ekko-ebeln.
DATA:lt_ekko TYPE TABLE OF ekko,
lw_ekko TYPE ekko.
START-OF-SELECTION.
SET PF-STATUS 'STLI'."copy status STLI of program SAPMSSY0.
SET TITLEBAR 'TITLE'.
*
SELECT * INTO TABLE lt_ekko
FROM ekko
WHERE ebeln IN s_ebeln.
LOOP AT lt_ekko INTO lw_ekko.
WRITE:/ lw_ekko-ebeln,
lw_ekko-bukrs,
lw_ekko-bstyp,
lw_ekko-bsart.
ENDLOOP.
END-OF-SELECTION.
*
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'ZBACK'.
PERFORM back_function."Your logic
WHEN OTHERS.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form BACK_FUNCTION
*&---------------------------------------------------------------------*
FORM back_function .
LEAVE PROGRAM.
ENDFORM. " BACK_FUNCTION
‎2010 Jul 06 4:14 AM
Yes it solved my current problem thanks Krishna Vatte, when creating GUI Status we need to ensure to activate the Function Code, by clicking Function Code button or F7 at the specific icon.
Thanks all for helping me on this.