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

Screen programming and ALV

Former Member
0 Likes
912

Hi,

I have screen 9000 which consists of a few input fields. Once entered, in PAI, it will PERFORM print_report which will return an ALV report ( CL_SALV_TABLE ). When I click 'BACK' from the ALV, it will process the PBO of standard program SAPLSLVC_FULLSCREEN which will bring me back to the screen before 9000. How do I force it not to load to this standard program PBO but to take my own coded MODULE USER_STATUS_9000? What I need is, to go back to screen 9000.

8 REPLIES 8
Read only

Former Member
0 Likes
850

Hi,

Please set the PF status BACK button and write the logic in the PAI event.

case:

when 'BACK':

call your perform statment.

endcase.

I think the above method will help you.

Regards

Sunil

Read only

0 Likes
850

Do you mean I only show my ALV report upon clicking BACK? That's not what I want. I need to show the ALV right after user enter info on screen 9000.

Read only

0 Likes
850

no u can call your alv on the click of F8 or execute on screen 9000 but u have to set the back button on the screen on which alv is displaying. In case of more clarification paste your code .

Thanks,

Ruchi

Read only

0 Likes
850

Hi,

Create a PF status including a back button.

As you are using the class CL_SALV_TABLE, by using the method SET_SCREEN_STATUS of this class you can set the PF status for your alv display.

create an object for handling the events.

Implement the class for handling user commands.

See the below code snippet. i may help you.

it_table->set_screen_status(
          pfstatus      =  'PF_STATUS'
          report        =  sy-repid
          set_functions = it_table->c_functions_all ).

*     Events for navigation through hotspot
        DATA: o_event TYPE REF TO cl_salv_events_table.

o_event = it_table->get_event( ).

        CREATE OBJECT o_events.

*     Register to the event USER_COMMAND
        SET HANDLER o_events->on_user_command FOR o_event.


*---------------------------------------------------------------------*
* CLASS cl_handle_events DEFINITION
*---------------------------------------------------------------------*
* Define a local class for handling events of cl_salv_table
*---------------------------------------------------------------------*
CLASS cl_handle_events DEFINITION.
  PUBLIC SECTION.

    METHODS:

      "Method for performing user defined function.
      on_user_command FOR EVENT added_function OF cl_salv_events
                                       IMPORTING e_salv_function,

ENDCLASS.                    "lcl_handle_events DEFINITION


*---------------------------------------------------------------------*
*       CLASS lcl_handle_events IMPLEMENTATION
*---------------------------------------------------------------------*
* Implement the events for handling the events of cl_salv_table
*---------------------------------------------------------------------*
CLASS cl_handle_events IMPLEMENTATION.
  METHOD on_user_command.
*   Subroutine for fetching rental data of selected rows.
    PERFORM handle_user_command USING e_salv_function.

  ENDMETHOD.                    "on_user_command


*&---------------------------------------------------------------------*
*&      Form  HANDLE_USER_COMMAND
*&---------------------------------------------------------------------*
*       Subroutine to handle user command
*----------------------------------------------------------------------*
FORM handle_user_command  USING  i_ucomm TYPE salv_de_function.

* Check for SY-UCOMM (User Command)
  CASE i_ucomm.
   
    WHEN c_back OR c_exit OR c_canc.
      SET SCREEN 0.
      LEAVE SCREEN.
  ENDCASE.

ENDFORM.                    " HANDLE_USER_COMMAND

In case of any further clarifications, please don't hesitate to ask.

Thanks

Tulasi.

Edited by: Tulasi Deepthi on Aug 5, 2009 11:45 AM

Read only

0 Likes
850

HI,

Please copy and paste the code and will help me to solve your problem.

Regards,

Sunil

Read only

Former Member
0 Likes
850

Hi, following the the Form.


FORM PRINT_REPORT .

  types: BEGIN of ty_content,
         total TYPE i,
         END OF ty_content.

  data: it_display type ref to cl_salv_table,
        it_content type STANDARD TABLE OF ty_content,
        wa_content LIKE LINE OF it_content,
        gr_columns type ref to cl_salv_columns_table,
        gr_column type ref to cl_salv_column_table.

 CLEAR: wa_content, it_content.

        wa_content-total = ct_flag.
        APPEND wa_content TO it_content.

  cl_salv_table=>factory( importing r_salv_table = it_display changing t_table = it_content ).

gr_columns = it_display->get_columns( ).
gr_columns->set_optimize( 'X' ).
gr_column ?= gr_columns->get_column( 'TOTAL' ).
gr_column->set_long_text( 'Total number of contacts created:' ).


  it_display->display( ).

ENDFORM.                    " PRINT_REPORT

Read only

0 Likes
850

Hi,

Please do copy the code what you have written in your pbo and pai.

Regards

Sunil

Read only

Former Member
0 Likes
850

Hi, I have made changes to the design of my program and no longer needs 2 screens.