Skip to Content

button added in screen 1000 doesn't work

hello experts,

I added a button in the screen 1000 of a report, following the instructions below of one of the member:

satya Gadde Mar 19, 2014 9:10 AM (in response to ABAP Consult)

Hi,

Please follow These steps,

First execute Your report, after that click on System -> status

copy the Program(GUi) and GUI status

Go to Se41

Click on Copy Status button

Provide the From program and status as as copied above and provide To Program (your program name) ans status (zstat).

Active it.

In your Report Provide the name for  I_CALLBACK_PF_STATUS_SET.

form STATUS USING i_extab TYPE slis_t_extab.

   set PF-STATUS 'ZSTAT'.

ENDFORM.

Write the code for Back Button in usercommand.

form user USING V1 TYPE sy-ucomm

                 V2 TYPE slis_selfield.

CASE V1.

WHEN 'BACK'.

       leave TO SCREEN 1000.

endcase.

endform.

So When I click on that button called DCLI, I hope to find that value on sy-ucomm but it doesn't appear.

I want to add some code after click in DCLI.

I haven't done  the last instruction about creating a form user......

I'm looking forward to hearing from you.

Thanks.

Capture1.PNG (31.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Oct 07, 2015 at 12:08 PM

    Hi Elina,

    Please share your code and I can check.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 07, 2015 at 02:14 PM

    It is better to use factory method of the class cl_salv_table.

    data: lo_table type ref to cl_salv_table,

              lo_events TYPE REF TO  cl_salv_events_table,

              lo_error_log TYPE REF TO cl_log.


    Copy the status from the standard one and add your own button in application toolbar.

    Set pf-status in the report as

    lo_table->set_screen_status(    report = sy-repid
                                      pfstatus = 'Z STANDARD'
                                 set_functions = 2 ).


    Then use event class  to perform your action in the output as

    lo_events = lo_table->get_event( ).


    Then create the object for the local class.

    set the handler for the event as :

    SET HANDLER lo_error_log->handle_user_command FOR lo_events.


    The sample code for the events using local class is:


    CLASS cl_log DEFINITION.

       PUBLIC SECTION.
         METHODS handle_user_command FOR EVENT if_salv_events_functions~added_function
         OF cl_salv_events_table.

    ENDCLASS. 


    In the implementation of the local class , write the functionality u needed.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2015 at 07:42 AM

    Hi experts,

    I haven't solved a problem yet,

    here is what i have done:

    Copied from standard status %_00 of program RSSYSTDB to my z program(sample report not an ALV) and z status,

    Added new button in the z status with icon and etc in attributes,

    called the new z status in my z program...

    I can see new button when I run my transaction, but

    Sy-ucomm is not catching  value of the new button,

    Code I have added for new button is not working,

    I'm looking forward to hearing from you.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2015 at 07:52 AM

    For a selection-screen report don't use solutions provided for ALV but read online documentation on

    • SSCRFIELDS
    • SELECTION-SCREEN FUNCTION KEY or FM RS_SET_SELSCREEN_STATUS

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Elina Chingotuane

      Hi,

      You are not working with an ALV but the step you are following ( "copy status and add button" ) is forĀ  ALV.

      To add button to selection screen of report you will have to use SSCRFIELDS as told by Raymond.

      Search on SCN on how to use sscrfields to add button.

      After the button is added. You can catch the button click in event AT SELECTION-SCREEN.

      event START-OF-SELECTION only gets executed after Execution button(F8) is pressed on the selection screen.

      Thanks & regards,

      Ashish