SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Displaying the hidden ABAP from the transport data files



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP Dictionary
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 18, 2007 8:30 pm    Post subject: Displaying the hidden ABAP from the transport data files Reply with quote

Method of displaying the hidden ABAPs of SAP - from the transport data files

Code:
REPORT ZREADATR NO STANDARD PAGE HEADING LINE-SIZE 132.
************************************************************************
* The program reads a transport data file, and using some simple filters
* displays the contents. To see an abap source, first create a transport
* using se01 with an entry like: LIMU REPS SAPMSYST, then analyze it.
* This program does not handle data files bigger than 65535 bytes.
* I tested a slightly different version of this program as well, that
* changed some data in the data file, and imported it back - and it
* worked. But be careful with that, it can screw your system big time!
************************************************************************
* Get the filename
PARAMETERS: FILE(40) LOWER CASE OBLIGATORY
            DEFAULT '/usr/sap/trans/data/R901111.ZZZ'.

* Find out the size of the transport file
DATA: L(132), F(50) VALUE '/tmp/azaz'.
DATA: FILT(56) VALUE 'ls -l'.
DATA: A, B(10) TYPE N.
FILT+6 = FILE.
OPEN DATASET F FOR OUTPUT IN TEXT MODE FILTER FILT.
CLOSE DATASET F.
OPEN DATASET F FOR INPUT IN TEXT MODE.
READ DATASET F INTO L.
IF SY-SUBRC <> 0. WRITE: / 'File does not exist'.EXIT. ENDIF.
DELETE DATASET F.
CONDENSE L.
SPLIT L AT ' ' INTO A A A A B A A A A.
IF B IS INITIAL OR B CN '0123456789 '.
  WRITE: / 'File does not exist'.
ENDIF.
IF B > 65535.
  WRITE: / 'File size is too big for this program'. EXIT.
ENDIF.
B = B - 11.

* Read an process the transport file
DATA: LL(65535) TYPE C.
DATA: I TYPE I, J TYPE I, K TYPE I.
DATA: X(11), Q(83), Y(3).
DATA: BEGIN OF STRUCC,
      1(5), 2(1) TYPE X, 3(2), 4(3), 5(72),
END OF STRUCC.

OPEN DATASET FILE IN BINARY MODE FOR INPUT.
READ DATASET FILE INTO LL.

DO B TIMES.
  I = SY-INDEX - 1.
  X = LL+I.
  IF X CP '+ ++++  +++'.
    Y = X+2.
    IF Y NA
' abcdefghijklmnopqrstxwz1234567890ABCDEFGHIJKLMNOPQRSTXWZ+=-/?*><'.
      K = I - J.
      Q = LL+J(K).
      STRUCC = Q.
      WRITE: / STRUCC-1, STRUCC-2, STRUCC-3, STRUCC-5.
      J = I.
    ENDIF.
  ENDIF.
ENDDO.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP Dictionary All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.