Hi Guys I just want to share my experience here, few days back I was searching for a way to access data browser without using SE16. I have landed at Function Modules  “RS_TOOL_ACCESS” ; “RS_TABLE_LIST_CREATE” and later I have realized that SAP uses a program “/1BCDWB/DBTABLE”  ( where TABLE is replaced with any name of any Table e.g,  “/1BCDWB/DBKNA1” ; “/1BCDWB/DBLFA1”  ).

                              Later I have realized that all the above ways need authorization to t-code SE16. But my requirement was I need to build SE16 kind of thing without having authorization to SE16.

                            I have used SE16 kind of layout via dynamic programing to acheive my requirement. I would like to share my experience here.

I have create a program “Y_VENDOR_TBLS” which uses SE16 kind of layout program “YSE16_LAYOUT” to generate required dynamic program.

              I have create a FM “Y_DYM_FIELD_SELECTION” to achieve dynamic input fields for selection.[ Copy GUI STATUS ‘SELECTIO’ from Program ‘SAPLSETB’ to main program of Function group; Create a screen 100 with model dailog box and reduce the screen to a box size ]

Testing with code –

Push button of a table.jpg

Press on LFA1 -> It should display data browser of LFA1

OPens data browser.jpg

For dynamic input fields -> Settings ->Fields for Selection

For Dynamic input fields.jpg

It displays below pop up as in SE16

Displays input options.jpg

Select few more input fields and select enter

Select few input fields.jpg

->Displays new input screen

New INput screen.jpg

-> One can try with code provided , you can feel SE16 kind of thing. Though my code deosn’t support Settings->User paramters; Settings->Format list

Program – YSE16_LAYOUT

*&———————————————————————*
*& This Report is a layout to access SE16 by report Y_VENDOR_TBLS     *&
*& Please do not modify this, instead make of copy of it and use it   *&
*&———————————————————————*

REPORT  YSE16_LAYOUT.

TABLES: sscrfields.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE t1.

SELECTION-SCREEN SKIP 1.
PARAMETERS list_bre  TYPE rseumod-tblistbr DEFAULT ‘250’.
PARAMETERS max_sel   TYPE rseumod-tbmaxsel DEFAULT ‘500’.
SELECTION-SCREEN: END OF BLOCK b1.

PARAMETERS: p_table  TYPE dd02l-tabname DEFAULT ‘XXXX’ NO-DISPLAY.

DATA: i_selc_texts   TYPE STANDARD TABLE OF rsseltexts,
      prog           TYPE sy-repid VALUE sy-repid,
      list           TYPE STANDARD TABLE OF string,
      where          TYPE STANDARD TABLE OF string,
      it_fieldcat    TYPE lvc_t_fcat,
      tref           TYPE REF TO data,
      struct_type    TYPE REF TO cl_abap_structdescr,
      table_type     TYPE REF TO cl_abap_tabledescr,
      comp_tab1      TYPE cl_abap_structdescr=>component_table.

FIELD-SYMBOLS:
      <i_selc_texts> LIKE LINE OF i_selc_texts,
      <table>        TYPE STANDARD TABLE.

INITIALIZATION.

  APPEND INITIAL LINE TO i_selc_texts ASSIGNING <i_selc_texts>.
  <i_selc_texts>-name = ‘LIST_BRE’.
  <i_selc_texts>-kind = ‘P’.
  <i_selc_texts>-text = ‘Width of Output List'(001).

  APPEND INITIAL LINE TO i_selc_texts ASSIGNING <i_selc_texts>.
  <i_selc_texts>-name = ‘MAX_SEL’.
  <i_selc_texts>-kind = ‘P’.
  <i_selc_texts>-text = ‘Maximum No. of Hits'(002).

**–Set the Title
  PERFORM set_title_selection(saplsetb) USING p_table.

**–Set the PF Status same as SE16
  CALL FUNCTION ‘RS_EXTERNAL_SELSCREEN_STATUS’
    EXPORTING
      p_fb = ‘RS_DATABROWSE_STATUS_SET’.

**–Create texts for Select options and Paramerters at run time.
  CALL FUNCTION ‘SELECTION_TEXTS_MODIFY’
    EXPORTING
      program  = prog
    TABLES
      seltexts = i_selc_texts.

AT SELECTION-SCREEN.

**–Copy GUI STATUS ‘SELECTIO’ from Program ‘SAPLSETB’.

  CASE sscrfields-ucomm.
    WHEN ‘ONLI’.
**–Select query on select options
      PERFORM select_query.
    WHEN ‘AEIN’.
**–Lists of no.of Entries
      PERFORM select_no_entries.
    WHEN ‘SEOP’.
**–Select Fields of repective table for select options
      PERFORM select_input_fields.
    WHEN OTHERS.
  ENDCASE.

END-OF-SELECTION.

  IF <table> IS ASSIGNED.

**–Fetch the field catlouge by passing table as structure
    CALL FUNCTION ‘LVC_FIELDCATALOG_MERGE’
      EXPORTING
        i_structure_name = p_table
      CHANGING
        ct_fieldcat      = it_fieldcat.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

**–Display the table as in GRID display
    CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY_LVC’
      EXPORTING
        it_fieldcat_lvc = it_fieldcat
      TABLES
        t_outtab        = <table>.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

  ENDIF.  “IF <table> IS ASSIGNED.

*&———————————————————————*
*&      Form  SELECT_QUERY
*&———————————————————————*
* Select query on selected table with slected select options
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*
FORM select_query .

  FIELD-SYMBOLS: <fs> LIKE LINE OF comp_tab1.

  struct_type ?=
     cl_abap_typedescr=>describe_by_name( p_table ).
  comp_tab1 = struct_type->get_components( ).

  struct_type = cl_abap_structdescr=>create( comp_tab1 ).
  table_type = cl_abap_tabledescr=>create( struct_type ).
  CREATE DATA tref TYPE HANDLE table_type.
  ASSIGN tref->* TO <table>.

  LOOP AT comp_tab1 ASSIGNING <fs>.
    APPEND <fs>-name TO list.
  ENDLOOP.  ” LOOP AT comp_tab1 ASSIGNING <fs>.

**–Import where conditions from Program – ZFI_VENDOR_TBLS to Dyanmic program
  IMPORT where TO where FROM MEMORY ID ‘DYNMIC_PROG1’.

  IF max_sel IS INITIAL.

**–Dynamic Select query
    SELECT (list) FROM (p_table) INTO TABLE <table>
                  WHERE (where).

  ELSE.

**–Dynamic Select query
    SELECT (list) FROM (p_table) INTO TABLE <table>
                  UP TO max_sel ROWS
                  WHERE (where).

  ENDIF.

ENDFORM.                    ” SELECT_QUERY
*&———————————————————————*
*&      Form  SELECT_NO_ENTRIES
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*
FORM select_no_entries .

  DATA: isscr     TYPE STANDARD TABLE OF  rsscr,
        v_string  TYPE string.

  FIELD-SYMBOLS:
        <isscr> LIKE LINE OF isscr.

  REFRESH : where.
  LOAD REPORT prog PART ‘SSCR’ INTO isscr.

  DELETE isscr WHERE kind NE ‘S’.

  IF NOT isscr[] IS INITIAL.

    LOOP AT isscr ASSIGNING <isscr> .
      IF sy-tabix = 1.

        CLEAR:v_string.
        CONCATENATE  <isscr>-name  ‘in’   <isscr>-name  INTO v_string SEPARATED BY space.
        APPEND v_string TO where.

      ELSE.

        CLEAR:v_string.
        CONCATENATE ‘AND’  <isscr>-name  ‘in’   <isscr>-name  INTO v_string SEPARATED BY space.
        APPEND v_string TO where.

      ENDIF.

    ENDLOOP.  “LOOP AT isscr ASSIGNING <isscr>.

  ENDIF. “IF not isccr IS INITIAL.

**–Check the no.of entries
  SELECT COUNT(*) FROM (p_table) WHERE (where).
  IF sy-subrc = 0.
    MESSAGE i398(00) WITH ‘Number of entries which meet’ ‘the selection criteria:’ sy-dbcnt.
  else.
     MESSAGE i398(00) WITH ‘Number of entries which meet’ ‘the selection criteria:’ sy-dbcnt.
  ENDIF.

ENDFORM.                    ” SELECT_NO_ENTRIES
*&———————————————————————*
*&      Form  SELECT_INPUT_FIELDS
*&———————————————————————*
* Dynamically select input fields for the given table
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*
FORM select_input_fields .

**–select input fields dynamically
  CALL FUNCTION ‘Y_DYM_FIELD_SELECTION’
    EXPORTING
      p_table = p_table.

  LEAVE PROGRAM.

ENDFORM.                    ” SELECT_INPUT_FIELDS

_____________________________________________________________________________________________

Program – Y_VENDOR_TBLS

*&———————————————————————*
*& Report  Y_VENDOR_TBLS
*&———————————————————————*
*& Display Vendor tables – LFA1,LFAS,LFB1
*&———————————————————————*

REPORT  Y_vendor_tbls.

*———————————————————————-*
* Tables                                                               *
*———————————————————————-*
TABLES:  sscrfields.

*———————————————————————-*
* Data Declarations                                                    *
*———————————————————————-*
DATA:    buttonis      TYPE dd02l-tabname,
         prog          TYPE c LENGTH 30 VALUE ‘YSE16_LAYOUT’,
         prog1         TYPE c LENGTH 30 VALUE ‘YDYM_SE16’,
         itab          TYPE TABLE OF string,
         where         TYPE TABLE OF string,
         v_line        TYPE i,
         v_string      TYPE string.

*———————————————————————-*
* Field – Symbols                                                      *
*———————————————————————-*
FIELD-SYMBOLS:
         <fs>          TYPE ANY,
        <itab>         LIKE LINE OF itab.

*———————————————————————-*
* Selection Screen                                                     *
*———————————————————————-*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-100.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (15) w_bt101 USER-COMMAND bt101.
SELECTION-SCREEN PUSHBUTTON (15) w_bt102 USER-COMMAND bt102.
SELECTION-SCREEN PUSHBUTTON (15) w_bt103 USER-COMMAND bt103.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

*———————————————————————-*
* Initialization                                                       *
*———————————————————————-*
INITIALIZATION.

**–Declare Tables as buttons
  w_bt101 = ‘LFA1’.
  w_bt102 = ‘LFAS’.
  w_bt103 = ‘LFB1’.

*———————————————————————-*
* At Selection Screen                                                  *
*———————————————————————-*

AT SELECTION-SCREEN.

*——- Fetch the Table which need to be display
  LOOP AT SCREEN.
    IF screen-name CS sscrfields-ucomm.
      buttonis = screen-name.
      EXIT.
    ENDIF.  ” IF screen-name CS sscrfields-ucomm.
  ENDLOOP.  “LOOP AT SCREEN.

  IF NOT buttonis IS INITIAL.

**–Fetch the table named assiociated with the button name
    ASSIGN (buttonis) TO <fs>.

**–Display the table selected via pushbutton
    PERFORM se16_program USING <fs>.

  ENDIF.   “IF NOT buttonis IS INITIAL.

*———————————————————————-*
* End -of -Selection                                                   *
*———————————————————————-*
END-OF-SELECTION.

*———————————————————————*
* Display the selected table in se16
*———————————————————————*
FORM se16_program USING table TYPE any.

  DATA: table1 TYPE dd02l-tabname.

  table1 = table.

*  CALL FUNCTION ‘RS_TOOL_ACCESS’
*    EXPORTING
*      operation          = ‘TAB_CONT’
*      object_name        = table1
*      object_type        = ‘VIEW’
*      monitor_activation = space
*    EXCEPTIONS
*      not_executed       = 0.

* submit /1BCDWB/DBLFA1 via selection-screen and return.

  PERFORM call_se16_table USING table1.

ENDFORM.                    ” FORM se16_program USING table1 TYPE any.
*&———————————————————————*
*&      Form  CALL_SE16_TABLE
*&———————————————————————*
*  Create a program dynamically with selected Select options
*———————————————————————-*
*   Input -> Table
*———————————————————————-*
FORM call_se16_table  USING   table TYPE dd02l-tabname.

**–Define structure for Field selection table
  TYPES: BEGIN OF st_final,
             tabname      TYPE tabname,
             fieldname    TYPE fieldname,
             datatype     TYPE datatype,
             scrtext_m    TYPE scrtext_m,
             flag         TYPE c LENGTH 1,
           END OF st_final.

  DATA:      i_tab        TYPE STANDARD TABLE OF st_final,
             v_string     TYPE string,
             x030l        TYPE x030l,
             l_dfies      TYPE STANDARD TABLE OF dfies.

  FIELD-SYMBOLS:
             <i_tab>      LIKE LINE OF i_tab,
             <l_dfies>    LIKE LINE OF l_dfies.

**–refresh all internal tables used
  REFRESH: itab,i_tab,l_dfies,where.

**– Read the layout code of program designed for SE16 approach
  READ REPORT prog INTO itab .
  IF sy-subrc = 0.

**–Insert Tables line w.rt. table selected on selection screen into dynamic program
    LOOP AT itab ASSIGNING <itab> WHERE table_line CS ‘REPORT  Yse16_layout’.
      v_line = sy-tabix.
      v_line = v_line + 1.

      CLEAR:v_string.
      CONCATENATE ‘TABLES:’  table  ‘.’ INTO v_string SEPARATED BY space.
      INSERT v_string INTO itab INDEX v_line.
      EXIT.
    ENDLOOP. ” LOOP AT itab ASSIGNING <itab> WHERE table_line CS ‘REPORT  Yse16_layout’.

**–Insert Selection Options into dynamic program
    LOOP AT itab ASSIGNING <itab> WHERE table_line CS ‘SELECTION-SCREEN SKIP 1’.
      v_line = sy-tabix.
      v_line = v_line – 1.

**–Import Field selection list from Function group – YFI_DYNAMIC – Main program – LYFI_DYNAMICO01
      IMPORT i_tab TO i_tab FROM MEMORY ID  ‘SAPLYFI_DYNAMIC’.
      IF NOT i_tab IS INITIAL.

**–Delete entries where fieldname is MANDT
        DELETE i_tab  WHERE fieldname = ‘MANDT’.

**–Insert Select options for only selected entries
        LOOP AT i_tab ASSIGNING <i_tab> WHERE flag = ‘X’.

          CLEAR:v_string.
          CONCATENATE ‘SELECT-OPTIONS: ‘  <i_tab>-fieldname  ‘for ‘  INTO v_string SEPARATED BY space.
          CONCATENATE v_string            <i_tab>-tabname            INTO v_string SEPARATED BY space.
          CONCATENATE v_string  ‘-‘       <i_tab>-fieldname  ‘.’     INTO v_string.
          INSERT v_string INTO itab INDEX v_line.

          v_line = v_line + 1.
        ENDLOOP.  “LOOP AT i_tab ASSIGNING <i_tab> WHERE flag = ‘X’.

        CLEAR: v_string.
        INSERT v_string INTO itab INDEX v_line.

**–Delete the field list from Memory Function group – YFI_DYNAMIC – Main program – LYFI_DYNAMICO01
        DELETE FROM MEMORY ID ‘SAPLYFI_DYNAMIC’.

      ELSE.
**—Get initial settings of field selection from Key fields of Table

**–Fetch all fields of table
        CALL FUNCTION ‘DDIF_FIELDINFO_GET’
          EXPORTING
            tabname   = table
          IMPORTING
            x030l_wa  = x030l
          TABLES
            dfies_tab = l_dfies
          EXCEPTIONS
            OTHERS    = 0.

**–Delete entry with field name MANDT
        DELETE l_dfies WHERE fieldname = ‘MANDT’.

**–Insert Select options for Key fields – Initially
        LOOP AT l_dfies ASSIGNING <l_dfies> WHERE keyflag = ‘X’.

          CLEAR:v_string.
          CONCATENATE ‘SELECT-OPTIONS:’ <l_dfies>-fieldname  ‘for’ INTO v_string SEPARATED BY space.
          CONCATENATE v_string          <l_dfies>-tabname          INTO v_string SEPARATED BY space.
          CONCATENATE v_string  ‘-‘     <l_dfies>-fieldname ‘.’    INTO v_string.
          INSERT v_string INTO itab INDEX v_line.

          v_line = v_line + 1.

        ENDLOOP.   ” LOOP AT L_DFIES ASSIGNING <L_DFIES> WHERE KEYFLAG = ‘X’.

        CLEAR: v_string.
        INSERT v_string INTO itab INDEX v_line.

      ENDIF.  “IF NOT i_tab IS INITIAL.

      EXIT.
    ENDLOOP. “LOOP AT itab ASSIGNING <itab> WHERE table_line CS ‘SELECTION-SCREEN SKIP 1’.

**–Insert texts for Selection Options.
    LOOP AT itab ASSIGNING <itab> WHERE table_line CS ‘INITIALIZATION’.
      v_line = sy-tabix.
      v_line = v_line + 2.

      IF NOT i_tab[] IS INITIAL.

        LOOP AT i_tab ASSIGNING <i_tab> WHERE flag = ‘X’.

          INSERT ‘ APPEND INITIAL LINE TO I_SELC_TEXTS ASSIGNING <I_SELC_TEXTS>.’ INTO itab INDEX v_line.
          v_line = v_line + 1.

          CLEAR:v_string.
          CONCATENATE ‘<I_SELC_TEXTS>-NAME = ‘   ””       INTO v_string SEPARATED BY space.
          CONCATENATE v_string  <i_tab>-fieldname ””  ‘.’ INTO v_string.
          INSERT v_string INTO itab INDEX v_line.
          v_line = v_line + 1.

          INSERT ‘<I_SELC_TEXTS>-KIND = ”S”.’             INTO itab INDEX v_line.
          v_line = v_line + 1.

          CLEAR:v_string.
          CONCATENATE ‘<I_SELC_TEXTS>-TEXT = ‘   ””       INTO v_string SEPARATED BY space.
          CONCATENATE v_string <i_tab>-scrtext_m ””  ‘.’  INTO v_string.
          INSERT v_string INTO itab INDEX v_line.
          v_line = v_line + 1.

          CLEAR:v_string.
          INSERT v_string INTO itab INDEX v_line.
          v_line = v_line + 1.

        ENDLOOP.  “LOOP AT I_TAB ASSIGNING <I_TAB> WHERE FLAG = ‘X’.

      ELSEIF NOT l_dfies[] IS INITIAL.

        LOOP AT l_dfies ASSIGNING <l_dfies> WHERE keyflag = ‘X’.

          INSERT ‘ APPEND INITIAL LINE TO I_SELC_TEXTS ASSIGNING <I_SELC_TEXTS>.’ INTO itab INDEX v_line.
          v_line = v_line + 1.

          CLEAR:v_string.
          CONCATENATE ‘<I_SELC_TEXTS>-NAME = ‘  ””         INTO v_string SEPARATED BY space.
          CONCATENATE v_string <l_dfies>-fieldname ””  ‘.’ INTO v_string.
          INSERT v_string INTO itab INDEX v_line.
          v_line = v_line + 1.

          INSERT ‘<I_SELC_TEXTS>-KIND = ”S”.’              INTO itab INDEX v_line.
          v_line = v_line + 1.

          CLEAR:v_string.
          CONCATENATE ‘<I_SELC_TEXTS>-TEXT = ‘  ””         INTO v_string SEPARATED BY space.
          CONCATENATE v_string <l_dfies>-scrtext_l ””  ‘.’ INTO v_string.
          INSERT v_string INTO itab INDEX v_line.
          v_line = v_line + 1.

          CLEAR:v_string.
          INSERT v_string INTO itab INDEX v_line.
          v_line = v_line + 1.

        ENDLOOP.  “LOOP AT L_DFIES ASSIGNING <L_DFIES> WHERE FLAG = ‘X’.

      ENDIF.  “IF NOT i_tab[] IS INITIAL. ; ELSEIF NOT l_dfies[] IS INITIAL.

      EXIT.
    ENDLOOP.  ” LOOP AT ITAB ASSIGNING <ITAB> WHERE TABLE_LINE CS ‘INITIALIZATION’.

**–Replace XXXX with table name
    LOOP AT itab ASSIGNING <itab> WHERE table_line CS ‘PARAMETERS: P_TABLE’.
      REPLACE ‘XXXX’ IN <itab> WITH table.
    ENDLOOP.

**–Delete existing program PROG1
    DELETE REPORT prog1.

**–Insert code from ITAB into Program PROG1
    INSERT REPORT prog1 FROM itab.

**–Generate the created report PROG1
    GENERATE REPORT prog1.

**–Export the where condition.

    IF NOT i_tab[] IS INITIAL.

      LOOP AT i_tab ASSIGNING <i_tab> WHERE flag = ‘X’.

        IF sy-tabix = 1.

          CLEAR:v_string.
          CONCATENATE <i_tab>-fieldname  ‘in’  <i_tab>-fieldname INTO v_string SEPARATED BY space.
          APPEND v_string TO where.

        ELSE.

          CLEAR:v_string.
          CONCATENATE ‘AND’  <i_tab>-fieldname  ‘in’  <i_tab>-fieldname INTO v_string SEPARATED BY space.
          APPEND v_string TO where.

        ENDIF.

      ENDLOOP.  “LOOP AT I_TAB ASSIGNING <I_TAB> WHERE FLAG = ‘X’.

    ELSEIF NOT l_dfies[] IS INITIAL.

      LOOP AT l_dfies ASSIGNING <l_dfies> WHERE keyflag = ‘X’.

        IF sy-tabix = 1.

          CLEAR:v_string.
          CONCATENATE  <l_dfies>-fieldname  ‘in’   <l_dfies>-fieldname  INTO v_string SEPARATED BY space.
          APPEND v_string TO where.

        ELSE.

          CLEAR:v_string.
          CONCATENATE ‘AND’  <l_dfies>-fieldname   ‘in’  <l_dfies>-fieldname INTO v_string SEPARATED BY space.
          APPEND v_string TO where.

        ENDIF.

      ENDLOOP.  “LOOP AT L_DFIES ASSIGNING <L_DFIES> WHERE KEYFLAG = ‘X’.

    ENDIF. “IF NOT i_tab[] IS INITIAL. ; ELSEIF NOT l_dfies[] IS INITIAL.

**–Export where conditions to the dynamic program.
    DELETE FROM MEMORY ID  ‘DYNMIC_PROG1’.
    EXPORT where FROM where TO MEMORY ID ‘DYNMIC_PROG1’.

**–Submit the program to display
    SUBMIT (prog1) VIA SELECTION-SCREEN AND RETURN.

**–Delete existing program PROG1
    DELETE REPORT prog1.

  ENDIF.  ”  READ REPORT PROG INTO ITAB .

ENDFORM.                    ” CALL_SE16_TABLE

______________________________________________________________________________

Attached are the files to create Function module  – Y_DYM_FIELD_SELECTION ; its top include; Include program

To report this post you need to login first.

38 Comments

You must be Logged on to comment or reply to a post.

  1. Suhas Saha

    Did you check if you had access to SE16n, SQVI?

    Would have saved you from re-inventing the whole wheel, or do you want to make the wheel elliptical? 😐

    – Suhas    

    (0) 
    1. Thomas Zloch

      That would be one bumpy ride…

      Q. You want to use transaction SE16, but you don’t have authorisation. What do you do?

      a) I follow proper procedures and apply for SE16 authorisation

      b) There is probably a good reason why, so I’ll leave it at that

      c) Leave me alone, I’ll just rewrite the darn thing as YSE16

      (0) 
      1. Sijin Chandran

        Thinking about that bumpy ride made me laugh 😆

        Recently a small up-gradation has been made in the pointing system ( no more points for  LIKE on replies ) , similarly one more thing can be considered. Points on Documents should be based on star count except for 1 star.

        For 1 star -5 points should be there.

        This thing will result to self cleansing of SCN documents.

        People itself will delete their docs worrying about draining of their points.

        (0) 
        1. Thomas Zloch

          This was discussed, but that might be too discouraging for new authors, also some people might get into a habit of leaving purely retaliative down-ratings.

          I guess critical comments are the way to go.

          Thomas

          (0) 
          1. Sijin Chandran

            I guess with a bit of Moderator’s intervention this negative pointing system can be implemented.

            This was discussed, but that might be too discouraging for new authors, also some people might get into a habit of leaving purely retaliative down-ratings

            If any such things happens it can be easily caught into the radar by just getting the Documents reviewed by Senior members like you all.

            And we can even alert moderators also if we come to know about such cases.

            (0) 
      1. Steve Rumsby

        My point is, either

        1. you have access to SE38/SA38 to run the program, in which case I can’t see why you wouldn’t be allowed SE16 – the system clearly isn’t that critical, or
        2. you’ve created a tcode for it and had to ask for access to that new tcode and I don’t see why anyone would approve a request for ZSE16 but not for SE16.
        (0) 
        1. Siva rama Krishna Pabbraju Post author

          Even SE38 or SA38 access is not given , I have created a Zt-code for the program and only access to that T-code will be given to End user. And restrictions on t-codes are not in my hand, that’s my client concern. My basis strictly rejected access of SE16 to any user in PROD. Please let me know if you know a way to acheve this requirement.

          (0) 
          1. Steve Rumsby

            Did you explain to basis that your custom tcode was SE16 in disguise, or did you not describe it that way?

            Why not create a tcode “ZSE16” (or “ZSAFE” to help with the disguise) as a total copy of the SE16 tcode (referencing the exact same ABAP, so no programming required) and use auth groups to restrict the accessible tables.

            Steve.

            (0) 
  2. Jürgen L

    there must be a big gap in your companies security if you could make use of this coding.

    In our company we could not even have started doing this coding, as anything has to start with a formal request in a Solman system,  which gets approved by a round table, which needs business blueprint and functional spec before a workbench transport is created that can be used.

    Any development has to be tested by someone else than the developer and needs to pass a code inspector before it gets transported to production.  (just an abbreviated scenario)

    So I understand it only as an ABAP exercise  with no real use.

    (0) 
    1. Jozef Vaclavek

      In our company we have somehow different situation – with more customers – meaning more clients to log in on a daily basis, with different politics given at each place, somewhere SE16N / N is ok, somewhere not.

      But it is true that sometimes SAP is too robust and too stuck in the mud when all you want is something simple (to be able to see the data). Those are the reasons why such a development can be of some need / added value, when even &SAP_EDIT does not need to be implemented. Looking at tables from ZSE16N is far easier than from se16 / se11 / sm30. But yes, it is true, that once you can jump over the security / basis with such requirement (they cancel SE16N and you create ZSE16N). The other day you may find that you broke a security policy and you can pay for it.

      (0) 
  3. Peter Jonker

    easier would be to select all entries (according to selection screen) and then call the ALV factory method. Done in just a few lines of code. Since you cannot change anything in SE16.

    With a little effort you can even make the table name dynamic, so then you can use it for any table. (Form blablala changing table type any table)

    DATA: gr_table TYPE REF TO cl_salv_table

    TRY.     

    CALL METHOD cl_salv_table=>factory        

    IMPORTING        

    r_salv_table   = gr_table      

    CHANGING        

    t_table        = lt_table.  

    CATCH cx_salv_msg .

    ENDTRY.

    (0) 
  4. Syed Ghulam Ali

    Good Attempt, You must have learnt alot exploring standard code 🙂 , good for learning but i would go with Restricting the Access.

    I am not sure if it already exists but your code can be modified to provide access to only the Authorized tables like prepare a z-Auth-Object–> assign role with access to particular tables–> validate this in your code.

    (1) 
    1. Siva rama Krishna Pabbraju Post author

      Yeah, I know with authirization group concept, we can acheive it. But we need SE16 authorization for that too. Please let me know if there is any possibilty to achieve data browser concept without having access to SE16,SE16N,SE11,SE12,SM30,SM31. Thanks for your reply.

      (0) 
      1. Steve Rumsby

        I think what most people here are saying is that there’s a reason why you don’t have access to SE16. If you are supposed to be able to browse data in random tables in the system then you should be given SE16. If you aren’t supposed to be able to browse such data, writing your own code to work around the restrictions isn’t the solution.

        Steve.

        (0) 
      2. Syed Ghulam Ali

        Siva,

        you have mentioned that you have copied some code to prepare output, does it still require the authorization to SE16. i mean aren’t you able to access the table data from your zprogram?

        (0) 
        1. Siva rama Krishna Pabbraju Post author

          Syed,

                 No authorization checks, the custom programs works similar to logic behind SE16. My problem is my client doesn’t agree to have any end user with access to SE16. Had they given access to SE16 there are ways as I mentioned in the begining of this document.

          (0) 
  5. Siva rama Krishna Pabbraju Post author

    @ – Thomas Zloch & Sijin Sij – I am still waiting for a reply from you guys – how to achieve my requirement ? I need to acess SE16 kinf of thing without having authorizations to SE16,SE16N,SQVI. Your eralier comments were really helpful.

    @ – Colleen Lee – Thanks a lot for support.

    (0) 
    1. Peter Jonker

      You are asking people to assist you in “illegal” activities. If you have no authorization for SE16 there must be a reason why the company don’t trust you with these authorizations.

      I am beginning to understand why. 🙁

      (0) 
        1. Peter Jonker

          Then the end user should ask for authorizatioln for the SE16 transaction. This authorization can be limited to  (set only for) certain tables, so I still don’t see a justified reason for this work around.

          I don’t think there is a justification for this. It doesn’t mean that you are to blame for this ! Maybe a good talk with the manager of the end user and/or the manager of the basis guy will give the end user the proper authorization. If after a discussion like that they still don’t want to give authorization and agree with the work around then, I am sorry to say, they are not fit for their job title.

          A bit harsh, but we do not have authorizations for nothing.

          (0) 
          1. Siva rama Krishna Pabbraju Post author

            Yup, we had plenty of discussion all aroud our basis,security and client.But client is reluctant to provide access to SE16 , hence I have choosen this approach. If any other possible way found please let me know.I would be helpful to me.

            (0) 
            1. Gretchen Lindquist

              Siva,

              You seem to not understand what people posting here are trying to tell you, so please allow me to put it another way. If my organization were the client and I discovered that you had enabled some end user here to circumvent our security rules by providing a program that is for all intents and purposes a clone of an SAP standard transaction that you knew was not allowed to end users such as SE16 or SE38, I would inform management and suggest that they tell the consultancy that you knowingly did not abide by our security policies and terminate the contract.

              Gretchen

              (0) 
              1. Siva rama Krishna Pabbraju Post author

                Gretchen,

                       

                                I believe I have understood all the points discussed here. Whta all  I have create is a custom t-code which can access only few tables related to his Core function, as he will not be given SE16 access. It’s pure my functional requirement. Please let me know I am wrong again ?.

                Siva.

                (0) 
                1. Suhas Saha

                  The requirement should not have been catered to, from whom-so-ever it comes from.

                  That’s what others have been trying to tell.

                  – Suhas

                  (0) 
  6. Colleen Hebbert

    Hi Siva

    In truth I don’t agree with the program you have delivered as your entire motivation here is to bypass security controls without understanding why the exist before you question their validity

    I am from security side that does not believe in granting SE16/SE16N/SM30 etc directly in production. I’m not stubborn enough to be black and white and will consider Fire-fighter or some exceptions for support users. But definitely not for end users. It’s a debate I have with quite a few Functional and Technical counterparts. Sometimes I’m successful on my point and other times not.

    I see two key risks in granting direct table access:

    1. More access than intended due to:
      1. S_TABU_DIS granted to table group. Although SAP now has S_TABU_NAME there has been risk user obtains addition table access than they should have
      2. Organisational restriction data. SAP now has the S_TABU_LIN object but that is a massive performance hit on large tables
      3. Sensitive Fields – you are granting the entire table and not limited the applicable fields
    2. System performance – granting users direct access to tables that contain million+ records is begging for potential negative system performance. How many of your users are going to value what a primary key is when entering selection criteria or who will try and pull the entire table in one go.

    The better solution is to understand the business requirement – why does the user need access to this data. From here you could look at building solutions such as custom program that can be scheduled; an interface; extraction to BW, etc that can be controlled (security access) and system performance tested

    Once all those options have been exhausted and it’s a few table only I would then consider a Custom Transaction for SE16 that skips the initial screen and loads the table. That way you have to have a transaction code per table. You may not control the organisational restriction of the data but it stops SE16 being granted and you know which tables they have access to.

    Where possible though, take it back to business requirements and get users away from 1990s style or reporting whereby they extract data, manipulate in Ms Excel and then said reports out. It that’s their intended usage, build the actual report directly in the system.

    Regards

    Colleen

    (0) 

Leave a Reply