Application Development 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: 

How to center my ALV report (SALV) ?

Former Member
0 Kudos

Hello All,

I am displaying ALV report with just 6 columns using SALV, Now the functional wants it to be displayed it to little right side, (not right justified data or something), just all the columns should be moved to little right, for look and feel, can you please suggest me how to do this?

Thanks in advance,

Regards,

CA.

11 REPLIES 11

former_member195431
Participant
0 Kudos

Hello Chitranjali,

As per my knowledge, you can achieve this in two ways. Either increase the width at field catalog level to make the columns move towards right or by creating and saving a Global Layout for that ALV display.

Thanks

Rajit

deepan_v_s
Active Participant
0 Kudos

Hi Chitra,

Please create a custom container in the screen, bring it to right a bit. (As per your need) adn use OO ALV to display data.

OO ALV : class CL_GUI_ALV_GRID

Regards,

Deepan Swaminathan.

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Can the consultant show a standard sap screen as a sample ?

Can you post a screen shot of the current screen and also the desire result ?

Regards

Former Member
0 Kudos

Hi guys,

I know I can use oops ALV and container concept , but just want to know whether I can simply solve it with SALV, as I am currently using it.

Please see the screenshot for your reference, now I want that total ALV report to  centered(not data in cells), means first coloumn should be started from the 4th coloumn onwards, Hope you got the point.

Consider SALV while replying please.

0 Kudos

Hi Chitranjali,

Maybe you can add a dummy column then freeze the column.

Thanks,

Norman

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Is this design is good for you ?

Regards.

0 Kudos

Perfect Eitan,This is how I need, Can you please share how to achieve this using SALV?

0 Kudos

This seems like a demo program, can you share that name Eitan?

0 Kudos

Hi,

No it is not.....

Regards.

0 Kudos

Hi,

Some code:

REPORT  y_r_eitan_test_08_27.

*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK block04 WITH FRAME .

PARAMETERS: p_debug TYPE debug_flg .

SELECTION-SCREEN END OF BLOCK block04 .
*----------------------------------------------------------------------*

START-OF-SELECTION .
   PERFORM at_start_of_selection .

*----------------------------------------------------------------------*
FORM at_start_of_selection .
   CALL SCREEN 100 .
ENDFORM.                    "at_start_of_selection
*----------------------------------------------------------------------*
MODULE at_pbo OUTPUT.
   PERFORM at_pbo .
ENDMODULE.                    "at_pbo OUTPUT
*----------------------------------------------------------------------*
FORM at_pbo .

   DATA: ob_gui_splitter_container TYPE REF TO cl_gui_splitter_container .
   DATA: ob_gui_container TYPE REF TO cl_gui_container.

   CREATE OBJECT ob_gui_splitter_container
     EXPORTING
       parent  = cl_gui_container=>screen0
       rows    = 1
       columns = 3.

   CALL METHOD ob_gui_splitter_container->get_container
     EXPORTING
       row       = 1
       column    = 2
     RECEIVING
       container = ob_gui_container.

   CALL METHOD ob_gui_splitter_container->set_column_width
     EXPORTING
       id    = 2
       width = 50.

   DATA: it_sflight TYPE TABLE OF sflight .

   SELECT * INTO TABLE it_sflight
   FROM sflight
   UP TO 20 ROWS .

   DATA: ob_salv_table TYPE REF TO cl_salv_table .

   cl_salv_table=>factory(
     EXPORTING r_container  = ob_gui_container
     IMPORTING r_salv_table = ob_salv_table
     CHANGING  t_table = it_sflight ) .

   ob_salv_table->display( ) .

ENDFORM.                    "at_pbo
*----------------------------------------------------------------------*
MODULE at_pai_process INPUT.
   LEAVE TO SCREEN 0 .
ENDMODULE.                 " AT_PAI_PROCESS  INPUT

rosenberg_eitan
Active Contributor
0 Kudos

And Screen:

****************************************************************  
*   THIS FILE IS GENERATED BY THE SCREEN PAINTER.          *  
*   NEVER CHANGE IT MANUALLY, PLEASE !                     *  
****************************************************************  
%_DYNPRO  
Y_R_EITAN_TEST_08_27  
0100  
701  
         40  
%_HEADER  
Y_R_EITAN_TEST_08_27                0100 0100  0  0192 37  0  0 27120  0G E                          20150817114032  
%_DESCRIPTION  
Main  
%_FIELDS  
OK_CODE   CHAR     20    80    10    00    00    00    255      1    O      0      0      0      0      0      0   ____________________  
%_FLOWLOGIC  
PROCESS BEFORE OUTPUT.  
  MODULE at_pbo .  
*  
PROCESS AFTER INPUT.  
  MODULE at_pai_process .  
%_PARAMS