Jump from alv report to cor2 screen

Hi experts,
I develop one alv report ..i want to jump from alv report to COR2 screen when click on order number(field name is AUFNR).
i wrote code in this way.
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD
  CASE SELFIELD-FIELDNAME.
    WHEN 'AUFNR'.
      READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
      SET PARAMETER ID  'AUF' FIELD T_FINAL-AUFNR.
      CALL TRANSACTION 'COR2'   AND SKIP FIRST SCREEN.
  ENDCASE.
ENDFORM.
but it is not working properly,when u click on any order number it is going only the same order number(in cor2 screen).
what is the problem? set par id (AUF) EXIST IN TPARA table compulsalory or it is created automatically?
pls help me in this . If possible pls send the code.

Hi,
I have already mentioned both ways, but ok, once again.
A. how I found parameter ID ANR:
1.) run transaction COR2
2.) set cursor to field "Process order"
3.) press F1 button
4.) performance assistant displays
5.) press "Technical Information"
6.) technical information displays
7.) in field "Parameter ID" you can see parameter ID assigned to a screen field
B. how I found parameter ID BR1:
1.) switch on debugger
2.) run transaction COR2
3.) put a breakpoint on "GET PARAMETER" statement
4.) debugger stops on every GET PARAMETER statement in PBO of COR2
5.) there you can see that BR1 is used for field AUFNR
Basically first mentioned way is sufficient, because system gets parameter value from parameter ID assigned to a screen element automatically. But in this case a value is overwritten by coding in PBO of COR2.
Hope it helps.
Regrds,
Adrian

Similar Messages

  • Jump from alv report to qa03 screen based on PRUEFLOS field

    Hi experts,
    I developed one alv report ,in that one field name is PRUEFLOS (inspection lot number).I want to jump from alv report
    to QA03 screen based on PRUEFLOS field.I wrote in this way but i didn't get.
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
      CASE SELFIELD-FIELDNAME.
        WHEN 'PRUEFLOS'.
          READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
          SET PARAMETER ID  'QLS' FIELD T_FINAL-PRUEFLOS.
          CALL TRANSACTION 'QA03'   AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.
    what is the problem ?pls help me in this.

    Hi Ram,
    Recheck:
    1) You have passed 'FORM USER_COMMAND' in 'I_CALLBACK_USER_COMMAND' while calling f.m. for ALV displa, and
    2) You have checked the value of user command, i.e.
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
    CASE SY-UCOMM.
    WHEN '&IC1'.
    CASE SELFIELD-FIELDNAME.
    WHEN 'PRUEFLOS'.
    READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
    SET PARAMETER ID 'QLS' FIELD T_FINAL-PRUEFLOS.
    CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
    ENDCASE.
    ENDCASE.
    ENDFORM.
    Regards,
    Birendra

  • Jump from alv report to FB03 screen when u click BELNR field

    Hi experts,
    I developed one alv report in that one field is there (BELNR .When u click on BELNR field it will directly go to FB03  screen.
    I wrote in this way.
      FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD
      CASE SELFIELD-FIELDNAME.
        WHEN 'BELNR'.
          READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
          SET PARAMETER ID  'BLN' FIELD T_FINAL-BELNR.
          CALL TRANSACTION 'FB03'   AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.
    But it is going to initial screen then u enter year it is going to next screen but i don't want this.
    I want to go to directly fb03 screen without entering year in the initial screen.Is it possible? pls help me in this.

       IF  RS_SELFIELD-FIELDNAME = 'BELNR'.
                    READ TABLE GT_FINAL INTO GS_FINAL INDEX RS_SELFIELD-TABINDEX.
                   SET PARAMETER ID 'MBN' FIELD GS_FINAL-BELNR.
                    CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
               ENDIF.
    i m not getting the value of belnr in migo here is my code

  • Can we call screen from ALV report

    Hi All,
    I am in the process of creating a stand alone application. However I have stuck up here.
    Problem: Can we call any screen from ALV report? If yes then how??? Can anyone give some code snippet??
    All your help appreciated.
    Thanks,
    Jignesh

    Hello Jignesh,
    Here is an example, when you double click on a line, it pops with with another screen that holds details for the flight information.
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click FOR EVENT double_click
                            OF cl_gui_alv_grid
                            IMPORTING e_row
                                      e_column.
       ENDCLASS.                    "lcl_event_handler
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_double_click.
        READ TABLE it_flight INTO wa_flight INDEX e_row-index.
        IF sy-subrc EQ 0.
          SELECT * FROM sbook
                   INTO TABLE it_book
                   WHERE carrid EQ wa_flight-carrid AND
                         connid EQ wa_flight-connid.
          CALL SCREEN 101 STARTING AT 10 10.
        ENDIF.
      ENDMETHOD.                 "HANDLE_DOUBLE_CLICK
    ENDCLASS.                    "LCL_EVENT_HANDLER
    MODULE status_0101 OUTPUT.
    Variant to save the layout
      gv_repid = sy-repid.
      IF g_custom_container2 IS INITIAL.
    Create an instance for Custom Container 'ALV_GRID'
        CREATE OBJECT g_custom_container2
               EXPORTING container_name = gs_container2.
    Create an instance for ALV Grid
        CREATE OBJECT g_grid2
               EXPORTING i_parent = g_custom_container2.
    Variant to save the layout
        gs_layout-grid_title = 'Flight Bookings'.
        CALL METHOD g_grid2->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SBOOK'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = it_book[].
      ELSE.
        CALL METHOD g_grid2->refresh_table_display.
      ENDIF.                               "IF grid2 IS INITIAL.
    Setting focus for created grid control
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = g_grid2.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                 " status_0101  OUTPUT
    Refer to BC_ALV_GRID04 for ALV data declarations used in the above piece of code.

  • Excel fiel from ALV report

    Hi Gurus,
        is der any way to download data from ALV report to excel sheet depending on  layout set dyanmically.
      I mean to say that if I choose a layout then data has to transfer to excel sheet according to layout fields automaticaly.

    I think this can be done by oops ALV , are u using reusealv F.M to call output in ALV ?
    Try the below kind of ALV
    IN PBO -
    >
    SET PF-STATUS 'PROJREP'.
    SET TITLEBAR text-046.
    DATA: g_container TYPE scrfname VALUE 'ALV',
          g_grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.  (Name of the container )
    CREATE OBJECT g_grid1
               EXPORTING i_parent = g_custom_container.
    PERFORM create_field_catalog_ce
    CALL METHOD g_grid1->set_frontend_fieldcatalog
          EXPORTING
            it_fieldcatalog = t_fcat_ce.
    ALL METHOD g_grid1->set_table_for_first_display
          EXPORTING
            i_structure_name = 'ST_DISPLAY'
          CHANGING
            it_outtab        = t_display_io
            it_fieldcatalog  = t_fcat_ce.
    ->Create Object to receive events and link them to handler methods.
    When the ALV Control raises the event for the specified instance
    the corresponding method is automatically called.
        CREATE OBJECT g_event_receiver.
        SET HANDLER g_event_receiver->handle_double_click FOR g_grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = g_grid1.
    IN PAI -->
    CALL METHOD cl_gui_cfw=>dispatch.

  • Exporting data from ALV Report...

    Dear All,
    While I am exporting data from ALV report to any other Format (Excel, Txt, HTML) it only export the data of last column, but the heading is comming properly and also the column heading is displaying properly.
    So how to rectify it. (the report is Object Oriented).
    Regards,
    Dahrmesh

    Hi Davabap,
    Refer this sample program "BCALV_GRID_VERIFY" . I hope it is problem with structure mismatching.
    Otherwise can you paste your code ?
    Regards,
    Vicky
    PS: Award points if helpful

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • Return from ALV  Grid to Selection screen

    hi,
    I want to go back from ALV grid to selection screen.
    I am using the following code:
    WHEN 'BACK'.
    CALL METHOD grid1->refresh_table_display.
    CALL METHOD grid1->free.
    CALL METHOD custom_container1->free.
    CALL SELECTION-SCREEN 1000.
    it is working,but when i press BACK button from selection screen to program it is showing ERROR IN FLUSH 4 Error.
    Also I tried with method FLUSH
    WHEN 'BACK'.
    CALL METHOD grid1->refresh_table_display.
    CALL METHOD grid1->free.
    CALL METHOD custom_container1->free.
    CALL METHOD cl_gui_cfw=>flush.
    it's still showing same Error.
    Please help on this.
    Regards,
    Sankar

    Hi,
    My grid name is grid1.
    I tried with :
    DATA grid1 TYPE REF TO cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = grid1.
    CALL METHOD grid1->check_changed_data.
    CALL METHOD grid1->refresh_table_display.
    LEAVE TO SCREEN 0.
    Even, I tried with declaring another grid : grid2
    DATA grid1 TYPE REF TO cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = grid1.
    CALL METHOD grid1->check_changed_data.
    CALL METHOD grid1->refresh_table_display.
    LEAVE TO SCREEN 0.
    In both cases, I am getting the following Error : OBJECTS_OBJREF_NOT_ASSIGNED

  • Run alv report without selection screen in background

    Hello Every body,
    i programmed a ALV Report without selection screen, and i want to create a job for this alv report.
    Any help?
    Thank u.
    Ouail.

    Hi Steve,
    Can you tell me where i have to put your code?
    this is my abap code:
    START-OF-SELECTION.
       p_filref = '\\SAPSERVER\f\SAFT\ivat\FI_Extract_1000_20140709_102346_910.XML'.
       PERFORM copy_from_xml_to_itab TABLES it_ref_file
                                     ref_xml_data
                                     USING p_filref.
    **Begin Extraction File
       SUBMIT ZZ_FI_IVAT_EXTRACTOR
       WITH p_bukrs EQ '1000'
       WITH p_gjahr EQ '1998'
       WITH filepath EQ '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
       WITH cldata eq space
       AND RETURN.
       DATA: FILE_TABLE  TYPE TABLE OF SDOKPATH,
       DIR_TABLE  TYPE TABLE OF SDOKPATH.
       CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
         EXPORTING
           DIRECTORY  = '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
           FILTER     = '*.*'
         TABLES
           FILE_TABLE = FILE_TABLE
           DIR_TABLE  = DIR_TABLE
         EXCEPTIONS
           CNTL_ERROR = 1
           OTHERS     = 2.
       IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
       "get file name
       LOOP AT FILE_TABLE INTO p_filref.
       ENDLOOP.
       CONCATENATE '\\SAPSERVER\f\SAFT\iVAT_Extractie\' p_filref INTO path.
       PERFORM copy_from_xml_to_itab TABLES t_ext_file
                                     ext_xml_data
                                     USING path.
       PERFORM fill_xml_tab_in .
       perform build_fieldcatalog.
       PERFORM compare_data_ref_ext.
       PERFORM send_email.
       perform display_alv_report.
       PERFORM delete_extraction_file.
    in the perform copy_from_xml_to_itab TABLES it_ref_file......, i use this code:
       CREATE OBJECT gcl_xml.
    *Upload XML File
       CALL METHOD gcl_xml->import_from_file
         EXPORTING
           filename = p_filref
         RECEIVING
           retcode  = gv_subrc.
       IF gv_subrc = 0.
         CALL METHOD gcl_xml->render_2_xstring
           IMPORTING
             retcode = gv_subrc
             stream  = gv_xml_string
             size    = gv_size.
         IF gv_subrc = 0.
           REFRESH gt_xml_data[].
    * Convert XML to internal table
           CALL FUNCTION 'SMUM_XML_PARSE'
             EXPORTING
               xml_input = gv_xml_string
             TABLES
               xml_table = gt_xml_data
               return    = gt_return.
         ENDIF.
       ENDIF.

  • How to keep the filter when jump from one report to another report?

    Hi experts,
    How to use the "Link" or "Button Group" Web Item in BEx Web Application Designer to jump from one report A to another report B, both the filter of report A and report B could be kept and not missing.
    When I use jump from report A to report B, the filter of Report B disappears.
    But I need the filter of Report B to stay there and could be used.
    Thanks
    Alex

    Hi..
    I tried Your approached but I got an error as the field are connected to Entity Object and they are mandatory.
    I achieved it using another way. Using " setForwardURL " method only.
    As I am calling this method to delegate back to first page. This method takes 8 input parameters.
    The 6 no parameter is about to retain AM or not. It a boolean type. Initially it was TRUE as soon as I changed it to False it worked as I needed. :)
    Thanks and Regards,
    Ajay

  • Query regarding calling T-code MIGO from ALV report output

    Dear friends,
    I have to call MIGO transaction  from my ALV report output. Now problem is that I have to set the value 'display' In the first header field, 'Material Document' in 2nd header field when MIGO is called from the report output. Morever there is no parameter ID for these two fields. So how to set the values w/o using parameter ids.
    Regards,
    Rishi

    Hi,
    Try this coding,
    FORM DISPLAY.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
       IS_LAYOUT                      = AK_LAYOUT
       IT_FIELDCAT                    = AK_FIELDCAT
      TABLES
       T_OUTTAB                       = ITAB.
    ENDFORM.                    " DISPLAY
    *&      Form  EVENT
    FORM EVENT USING P_AK_EVENT TYPE SLIS_T_EVENT.
      DATA : AK_EVENT1 TYPE SLIS_ALV_EVENT.
      AK_EVENT1-NAME = 'USER_COMMAND'.
      AK_EVENT1-FORM = 'USER_COMMAND'.
      APPEND AK_EVENT1 TO P_AK_EVENT.
    ENDFORM.                    " EVENT
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      IF R_UCOMM = '&IC1'.
      " AND SY-LSIND = '1'.
        READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
        SET PARAMETER ID 'AUN' FIELD ITAB-BUDAT.
        CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDFORM.                    " USER_COMMAND
    Regards,
    Nikhil.

  • Calling standard printer driver program RVADOR01 from ALV report

    I have ALV report (Sales order documents) and one of columns in report is icon type with print preview link (hotspot). When user press icon, I would like to call standard print program RVADOR01 (actually we have custom Z_RVADOR01 and custom smartform which are working fine when using Document -> Output in VA03) to display print preview. I don't know how to call (trigger) print driver routine and pass needed parameters to it (ex. SO number).
    Marko

    Actually I did that. But then you are at least three clicks away from print preview screen. For testing purpose I've created custom smartform and run it from my report. It is working like I want. Now, instead of my procedure I want to run standard printer driver program with needed parameters. I believe that all it needs is document number (vbeln) and all the rest is already there, program, smatform... I just don't know how to use it (ex. pass parameters).
    I know I maybe complicating too much but I am ABAP beginner and want to learn as much as possible. Thank you anyway!

  • Top of page data is repeated while going back from alv report

    Hi,
       In my alv report , I call ed TOP_OF_PAGE.   Data regatding top_of_page is stored in internal table.
       After executing the report,while going back from report,  a screen containing top_of_page data is appeaing.
       Even though I cleared that table,still that data appeared.
      Please resolve this.

    Hi all,
       I cleared that table previously .
       Still that screen appears.
    This is my following code.
    PERFORM top_of_page.            " Subroutine for Top-of-page
    *Display Report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            I_INTERFACE_CHECK                 = ' '
            I_BYPASSING_BUFFER                = ' '
            I_BUFFER_ACTIVE                   = ' '
              i_callback_program                = lv_repid
            I_CALLBACK_PF_STATUS_SET          = ' '
            I_CALLBACK_USER_COMMAND           = ' '
              i_callback_top_of_page            = 'TOP_OF_PAGE'
            I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
            I_CALLBACK_HTML_END_OF_LIST       = ' '
            I_STRUCTURE_NAME                  =
            I_BACKGROUND_ID                   = ' '
            I_GRID_TITLE                      =
            I_GRID_SETTINGS                   =
            IS_LAYOUT                         =
              it_fieldcat                       = lt_fieldcat[]
            IT_EXCLUDING                      =
            IT_SPECIAL_GROUPS                 =
            IT_SORT                           =
            IT_FILTER                         =
            IS_SEL_HIDE                       =
            I_DEFAULT                         = 'X'
            I_SAVE                            = ' '
            IS_VARIANT                        =
            IT_EVENTS                         = it_events
            IT_EVENT_EXIT                     =
            IS_PRINT                          =
            IS_REPREP_ID                      =
            I_SCREEN_START_COLUMN             = 0
            I_SCREEN_START_LINE               = 0
            I_SCREEN_END_COLUMN               = 0
            I_SCREEN_END_LINE                 = 0
            I_HTML_HEIGHT_TOP                 = 0
            I_HTML_HEIGHT_END                 = 0
            IT_ALV_GRAPHICS                   =
            IT_HYPERLINK                      =
            IT_ADD_FIELDCAT                   =
            IT_EXCEPT_QINFO                   =
            IR_SALV_FULLSCREEN_ADAPTER        =
          IMPORTING
            E_EXIT_CAUSED_BY_CALLER           =
            ES_EXIT_CAUSED_BY_USER            =
       TABLES
              t_outtab                          = lt_meter
       EXCEPTIONS
              program_error                     = 1
              OTHERS                            = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    perform clear_data.
    endif.
    FORM top_of_page .
    Declaration of local variables, structures and internal tables
      Data : lv_count      TYPE i,
             lv_count_c(9) TYPE c,
             lt_header     TYPE slis_t_listheader,
             wa_header     TYPE slis_listheader,
             lt_line       LIKE wa_header-info.
    Title
      clear lt_header[].
      wa_header-typ  = 'H'.
      wa_header-info = 'Meter Readings Report'.
      APPEND wa_header TO lt_header.
      CLEAR wa_header.
    Total No. of Records Selected
      DESCRIBE TABLE lt_meter LINES lv_count.
      lv_count_c      = lv_count.
      CONCATENATE 'Total Number of meters readed for given cycle: ' lv_count_c
         INTO lt_line SEPARATED BY space.
      wa_header-typ    =    'A'.
      wa_header-info   =    lt_line.
      APPEND wa_header TO lt_header.
      CLEAR: wa_header, lt_line.
    *Display Top-of-page
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = lt_header.
    ENDFORM.                    " TOP_OF_PAGE
    *&      Form  CLEAR_DATA
          text
    -->  p1        text
    <--  p2        text
    form CLEAR_DATA .
    data : lt_header     TYPE slis_t_listheader.
    clear lt_header[].
    endform.

  • Hiding some fields from ALV report

    Hi All,
    I want to know if there is way to hide certain fields in ALV for some users only and not for others?
    If I use the option NO_OUT = 'X'  it will not be displayed in the list but the user can see the in the Layout option fields but if use NO_OUT = 'X' and TECH = 'X' the field will not be in the list and in the layout also but other users will miss that field.
    If I create user specific variant, but once the user is in the report he can change the layout so certain fields cannot be hidden.
    So, is there any way to hide some fields for certain users and not for others without hard coding user ids in program and restricting the fields from display??
    Thanks in Advance.
    Sonali.

    Thank You Vijay for the reply.
    I knew that Authorization object was the final solution but before using it I wanted to find out if there was a way in the ALV report to restrict certain fields.
    Sonali.

  • Data missing when Exporting or print preview from ALV report

    Hi
    I have a alv report which is showing fine but when i try to export it to say excel sheet or do print preview some of the data is missing. Can anyone tell me how to fix this. or at least point to some document that discuss this problem.
    Here is my ALV CODE
    *  CALL_ALV
    form call_alv.
    *  v_repid = sy-repid.
      perform build_field_catalog using field_tab[].
      perform build_eventtab      using events[].
      perform comment_build       using header_alv[].
      perform build_sorttab       using gt_sort[].
    *  perform build_layout.
    *  v_variant-variant = '/TEST3'.
    * Call ABAP List Viewer
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program      = v_repid
          i_callback_user_command = ''
          i_structure_name        = 'REC'
          it_fieldcat             = field_tab[]
          it_special_groups       = gt_sp_group[]
          it_sort                 = gt_sort[]
          i_save                  = v_save
          is_variant              = v_variant
          it_events               = events[]
    *      is_layout               = gd_layout
        tables
          t_outtab                 = REC
        exceptions
          program_error            = 1
          others                   = 2.
    endform.
    From my Catalog this data is missing
    * BUILD_FIELD_CATALOG
    form build_field_catalog USING pt_fieldcat type
                                   slis_t_fieldcat_alv.
      data:  ls_fieldcat type slis_fieldcat_alv.
      clear: fieldcat, pt_fieldcat[].
      ls_fieldcat-tabname        =                'REC'.
      ls_fieldcat-edit           =                ' '.
        ls_fieldcat-fieldname      =                'PERNR'.
        ls_fieldcat-seltext_s      =                'Employee #     '.
        ls_fieldcat-seltext_m      =                'Employee #           '.
        ls_fieldcat-seltext_l      =                'Employee #           '.
        ls_fieldcat-datatype       =                'C'.
        append ls_fieldcat to pt_fieldcat.
    There r coupole that's missing
    But there couple that show's up like this one
        ls_fieldcat-fieldname      =                'STIME'.
        ls_fieldcat-seltext_s      =                'ST   '.
        ls_fieldcat-seltext_m      =                'St Tm     '.
        ls_fieldcat-seltext_l      =                'Start Time          '.
        ls_fieldcat-datatype       =                'C'.
        append ls_fieldcat to pt_fieldcat.
        ls_fieldcat-fieldname      =                'ETIME'.
        ls_fieldcat-seltext_s      =                'ET      '.
        ls_fieldcat-seltext_m      =                'Et Tm           '.
        ls_fieldcat-seltext_l      =                'End Time             '.
        append ls_fieldcat to pt_fieldcat.
    I always reward points.
    Thanks

    hi Anwarul,
    Try the following code:
    *  CALL_ALV
    form call_alv.
    *  v_repid = sy-repid.
      perform build_field_catalog using field_tab[].
      perform build_eventtab      using events[].
      perform comment_build       using header_alv[].
      perform build_sorttab       using gt_sort[].
    *  perform build_layout.
    *  v_variant-variant = '/TEST3'.
    * Call ABAP List Viewer
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program      = v_repid
          i_callback_user_command = ''
          i_structure_name        = 'REC'
          it_fieldcat             = field_tab[]
          it_special_groups       = gt_sp_group[]
          it_sort                 = gt_sort[]
          i_save                  = v_save
          is_variant              = v_variant
          it_events               = events[]
    *      is_layout               = gd_layout
        tables
          t_outtab                 = REC
        exceptions
          program_error            = 1
          others                   = 2.
    endform.
    form build_field_catalog USING pt_fieldcat type
                                   slis_t_fieldcat_alv.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
    I_PROGRAM_NAME  = sy-repid
    I_STRUCTURE_NAME = 'REC'
    changing
    CT_FIELDCAT          = pt_fieldcat.
    When you export to excel, the character fields and numeric columns gets re-arranged, but all the fields will be displayed in this case.
    hope this helps.

Maybe you are looking for

  • How can I make a file a more manageable size?

    I'm looking to downsize a very hefty file.  It currently has a lot of information and is clumsy to deal with when attaching to email, opening it up, printing, etc.  Is there a straightforward way to save a version of this document with ONLY the infor

  • Web URLS & Documents

    I'm having 2 problems. 1. I want to create a hyperlink so visitors to my iWeb created website can download a .pdf document. But I can't figure out how to create,or even find, a URL at .mac (MobileMe) to direct it and automatically download or even op

  • Trouble replacing Hard Drive

    Hi all, I'm struggling to replace my hard drive on my 2.0 GHz MacBook. Want to upgrade from 60Gb to 160Gb. Ordered the below hard drive from OWC: http://eshop.macsales.com/item/Hitachi/0A28844/ The swap out of drives was easy (after having to run to

  • Ipad cannot get mail

    I've recently lost email capability. The error message says that my gmail account username or password are incorrect, but I know that they are both ok because I can log into my gmail account using these settings directly from safari. I've tried delet

  • Why does cloud logo not appear next to some songs in my iTunes library?  Does it not save them for some reason?

    Why does cloud logo not appear next to some songs in my iTunes library?  Does it not save them for some reason?