‎2008 Jun 24 9:53 AM
Hi,
My Requirment is to hide the sourcecode in ECC6,means that others not able to see the coding .is it possible and if possible pls give me a solution for this.
Thanks,
Deesanth
‎2008 Jun 24 9:58 AM
Hi,
u cn get sm info with these.
http://www.sap-basis-abap.com/sapab028.htm
i heard of it but dint try.
regards,
teja.
‎2008 Jun 24 9:55 AM
Hi.
Why do you want to hide the code? Is there really a business requirement for this?
I'm not aware of any way to achive this.
Best regards,
Jan Stallkamp
‎2008 Jun 24 10:11 AM
Hi.
One thing I would like to add. Security by obscurity is a bad idea at all. By trying to hide your source code you may make it a little bit harder for an attacker but you will not keep him outside. If your original security design is based on the idea that no one knows the implementation you most likely have an issue with your design.
/Jan
‎2008 Jun 24 9:58 AM
Hi,
u cn get sm info with these.
http://www.sap-basis-abap.com/sapab028.htm
i heard of it but dint try.
regards,
teja.
‎2008 Jun 24 9:59 AM
Hi,
U can avoid ur source code for editing from others by enabling EDITOR lock the attributes..
Or else create a transaction code for ur report program so dat others may not see ur source code.
But i dont think u can hide ur source code.
Regards.
‎2008 Jun 24 10:00 AM
\[removed by moderator as it was just a copy and paste answer of someone else's work without giving a source\]
Edited by: Jan Stallkamp on Jun 24, 2008 11:05 AM
‎2008 Jun 24 10:01 AM
Hi ,
I am not aware of such a feature .
You can prevent others from editing your program by setting the Edit Lock Check box in the attributes of the report.
Regards
Arun
‎2008 Jun 24 11:22 AM
Hi
Refer this code
This program hides any ABAP's source code and protects it with a password. One can still run the ABAP (the load version is intact) but it can not be displayed, edited, traced, transported or generated. If the ABAP is not hidden, the program hides it. If it is hidden, it unhides it. The password is hard-coded in a source code, so the first candidate to be hidden should be ZHIDE itself.
PROGRAM ZHIDE NO STANDARD PAGE HEADING.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(8) PWD.
SELECTION-SCREEN POSITION 35.
PARAMETERS: PASSWORD(8) MODIF ID AAA.
SELECTION-SCREEN END OF LINE.
PARAMETERS: PROGRAM(8).
SELECTION-SCREEN END OF BLOCK BLOCK.
*
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'AAA'.
SCREEN-INVISIBLE = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*
INITIALIZATION.
PWD = 'PASSWORD'.
*
START-OF-SELECTION.
TABLES: TRDIR.
* User name and passsword check
IF SY-UNAME <> 'IMRE' OR PASSWORD <> 'TITOK'.
WRITE: / 'Wrong password'.
EXIT.
ENDIF.
* SAP owned?
IF NOT PROGRAM CP 'Z*' AND NOT PROGRAM CP 'Y*'.
WRITE: / 'Do not hide original SAP programs!'.
EXIT.
ENDIF.
* Exists?
SELECT SINGLE * FROM TRDIR WHERE NAME = PROGRAM.
IF SY-SUBRC <> 0.
WRITE: / 'Program does not exists!'.
EXIT.
ENDIF.
* Does it have a current generated version?
DATA: F1 TYPE D, F3 TYPE D.
DATA: F2 TYPE T, F4 TYPE T.
EXEC SQL.
SELECT UDAT, UTIME, SDAT, STIME INTO :F1, :F2, :F3, :F4 FROM D010LINF
WHERE PROG = :PROGRAM
ENDEXEC.
IF F1 < F3 OR ( F1 = F3 AND F2 < F4 ).
WRITE: / 'The program has no recent generated version!'.
EXIT.
ENDIF.
* Compose a new program name
DATA: NEW_NAME(8), I TYPE I, J TYPE I.
NEW_NAME = PROGRAM.
DO 8 TIMES.
I = SY-INDEX - 1.
NEW_NAME+I(1) = '_'.
* Search for acceptable program name variations
J = 0.
SELECT * FROM TRDIR WHERE NAME LIKE NEW_NAME.
J = J + 1.
ENDSELECT.
IF J = 1.
EXIT.
ENDIF.
NEW_NAME = PROGRAM.
ENDDO.
* Can not generate appropriate program name
IF J > 1.
WRITE: / 'Can not generate appropriate program name'.
EXIT.
ENDIF.
* Check if it is already in d010s (already hidden)
DATA: F5(8).
EXEC SQL.
SELECT PROG INTO :F5 FROM D010S WHERE PROG = :NEW_NAME
ENDEXEC.
IF F5 IS INITIAL.
* There is no such hidden program, hide it
EXEC SQL.
UPDATE D010S SET PROG = :NEW_NAME WHERE PROG = :PROGRAM
ENDEXEC.
ELSE.
* There is already a hidden program there, unhide it
EXEC SQL.
UPDATE D010S SET PROG = :PROGRAM WHERE PROG = :NEW_NAME
ENDEXEC.
ENDIF.
‎2008 Jun 24 11:30 AM
U can use the exit EXIT_SAPLS38E_001 to hide ur code.
Within this write :
if PROGRAM = '<Your program name>'.
raise cancelled.
endif.
Now nobody can display or change the code.
Regards,
Joy.