Access data browser without authorization to SE16
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 –
Press on LFA1 -> It should display data browser of LFA1
For dynamic input fields -> Settings ->Fields for Selection
It displays below pop up as in SE16
Select few more input fields and select enter
->Displays new input screen
-> 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
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
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
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.
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
Agreed
constructive feedback has a different motivation to critical - although author may not feel that way
And what about people who then want to score the most negative points ? like -678 points 🙂
We should have some badges for that... 😉
they well be stopped with a "disabled" tag next to their user name before they get into a scoring mood.
I guess with a bit of Moderator's intervention this negative pointing system can be implemented.
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.
Once you have this "SE16 with no access control" program, how do you run it?
Execute program Y_VENDOR_TBLS; Which leads you to push buttons of Table names.Hope you have copies all the relevent programs.
My point is, either
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.
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.
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.
May be...!!
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.
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.
Reminds me of ABAP Geek 13 - Interactive Dynamic WHERE Clauses
I understand that piece of code but it doesn't cover plenty of things like, dynamic selection for input fields, text description for input fields,
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.
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.
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.
yes agree with steve
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?
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.
@ - 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.
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. 🙁
It is not me who is going to access SE16, its end user and its comapny's policies to restrict SE16 not mine. Hope you understand.
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.
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.
Have a look into OSS notes 1516880 - Authorization check for generic table access (S_TABU_NAM)
and 26909 - SE16 - Security
it is in general pretty simple to restrict SE16
Hi Jurgen, I know about authorization object kind of restriction. I understand this. But my requirement is without havnig access to SE16 t-code it self. 😕
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
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.
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
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:
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
Hi Siva,
I don't see the attachments for Function module. can you share the code for FM.
Thanks,
Kumar