Dependency Check

227 views
Skip to first unread message

mpang

unread,
Aug 29, 2008, 9:30:31 AM8/29/08
to SAPlink
Has anyone thought of adding a "dependency check" to SAPLINKS?
A code scan of some sort, so for example you are downloading a program
or class, that it grabs all the Z* structures, tables and any other
dependencies etc.

I am tempted to start something like this...
I want to see if anyone knows if there's something similar along the
way already?


Cheers

Michael.

Nicola Fankhauser

unread,
Aug 29, 2008, 9:35:29 AM8/29/08
to sap...@googlegroups.com
hi mike

mpang schrieb:

that is certainly an interesting idea I've been thinking about too. in
essence it should be enough to resolve all dependencies recursively via
the db-table WBCROSSGT. let us know when you've come up with some
working code...

--
regards
nicola

mpang

unread,
Aug 29, 2008, 10:06:21 AM8/29/08
to SAPlink
Thanks Nicola, that is very valuable table to know.
I was planning to go even further than this, so that the nugget you
have in the end will install into other systems without any problems.
Currently you can export your code, but there is no guarantee that it
will activate in another system.


On Aug 29, 2:35 pm, Nicola Fankhauser <nicola.fankhau...@variant.ch>
wrote:

Eddie Herrmann

unread,
Aug 29, 2008, 10:18:01 AM8/29/08
to sap...@googlegroups.com

On Fri, Aug 29, 2008 at 9:30 AM, mpang <joy...@gmail.com> wrote:

Has anyone thought of adding a "dependency check" to SAPLINKS?
A code scan of some sort, so for example you are downloading a program
or class, that it grabs all the Z* structures, tables and any other
dependencies etc.


We have discussed this option, but that's a very slippery slope.  It's very hard to traverse all dependencies and know when to stop.  You are also not guaranteed to catch everything if something is used dynamically such as when using runtime type services.

As a rule of thumb, we try to only stick with functionality that is available in the existing transport system, but if you want to try to tackle this issue, thats the beauty of open source.

Cheers,
Eddie

mpang

unread,
Aug 29, 2008, 10:50:16 AM8/29/08
to SAPlink
Hi Eddie,

Thanks for your reply. I agree that it is a very slippery slope.
I picture it won't cater for dynamic calls, as it will not prevent
'activation' of code (yes, it won't run, but at least you have the
code).
It will only care about custom built objects, and ignore all SAP
standard objects.
Perhaps it can be an option for the user to select the depth, or pick
the 'objects of interest'. Any ideas?

Interestingly it can reuse all the plugins available currently.
Once I have the list of 'dependent objects', it will go off and call
other plugins to add to the nugget.
The import of the nugget is handled automatically.


Cheers

Michael.



On Aug 29, 3:18 pm, "Eddie Herrmann" <ewherrm...@gmail.com> wrote:

Eddie Herrmann

unread,
Aug 29, 2008, 11:03:45 AM8/29/08
to sap...@googlegroups.com
After discussing the potential confusion and complexity of it, we decided to implement the features for adding all objects from a package or a transport.  Since these additions, I haven't heard of any requests for dependencies, but again, that's the beauty of being a developer for an open source project; we have the power to scratch our own itch.  :)

Sandra Rossi

unread,
Aug 30, 2008, 5:10:15 AM8/30/08
to sap...@googlegroups.com
Hi Michael,
 
I had done some research about that, and worked with CROSS table instead of WBCROSSGT. I don't know if it's the same or not, or complementary. What I know is that we can't reuse SAP standard code to get the cross-references because it's old-fashioned programming : results are directly written to list (no means to get them back through routine or function module parameters).
  • For a given program source (report, include, function group, function module, method, etc.), cross-referenced objects ("where-used list") can be found via :
    • CROSS table : it contains most of cross references; meaning of table fields depend on main field "TYPE":
      • A : source <CROSS-INCLUDE> contains AUTHORITY-CHECK OBJECT <CROSS-NAME>. Valid at least in sap 7.0
      • B : deprecated since SAP 7.0. Source <CROSS-INCLUDE> contains CALL SCREEN <CROSS-PROG>. What does contain NAME field ?
      • D : source <CROSS-INCLUDE> contains CALL DIALOG <CROSS-NAME>. Still works in SAP 7.0
      • F : source <CROSS-INCLUDE> contains CALL FUNCTION <CROSS-NAME>. Valid at least in sap 7.0
      • G : source <CROSS-INCLUDE> contains TYPE-POOLS <CROSS-NAME>. Valid at least in sap 7.0
      • H : source <CROSS-INCLUDE> contains ASSERT ID <CROSS-NAME> (checkpoint group, object type ACID, cf transaction SAAB)
      • K : source <CROSS-INCLUDE> uses external macro <CROSS-NAME> (external macro = defined in table TRMAC). Valid at least in sap 7.0
      • M : dynpro <CROSS-PROG> of program <CROSS-INCLUDE> contains a field which references search-help (or matchcode?) <CROSS-NAME>
      • N :
        • if <CROSS-NAME+20(3)> = space, source <CROSS-INCLUDE> contains at least one MESSAGE ID <CROSS-NAME(20)> NUMBER <any value>
        • otherwise, source <CROSS-INCLUDE> contains MESSAGE ID <CROSS-NAME(20)> NUMBER <CROSS-NAME+20(3)>
      • O : source <CROSS-INCLUDE> contains DATA BEGIN OF COMMON PART <CROSS-NAME>, etc. Valid at least in sap 7.0
      • P : source <CROSS-INCLUDE> contains GET (ou SET) PARAMETER ID '<CROSS-NAME>'. Valid at least in sap 7.0
      • Q : dynpro <CROSS-PROG> of program <CROSS-INCLUDE> contains a field which has a SGA/PGA '<CROSS-NAME>'. Valid at least in sap 7.0
      • R : source <CROSS-INCLUDE> contains SUBMIT <CROSS-NAME>. Valid at least in sap 7.0
      • S : Deprecated in 7.0. Source <CROSS-INCLUDE> uses ddic structure (or table?) <CROSS-NAME> (this may be in a DATA ... TYPE of a structure component or of the structure itself. Note: now we use function module RS_GET_TABLE_REFERENCES to get cross-references
      • T : source <CROSS-INCLUDE> contains CALL TRANSACTION <CROSS-NAME>. Valid at least in sap 7.0
      • U : source <CROSS-INCLUDE> contains PERFORM <CROSS-NAME> IN PROGRAM <CROSS-PROG>. Valid at least in sap 7.0
      • V : search help? deprecated?
      • X : dynpro <CROSS-PROG> of program <CROSS-INCLUDE> contains a "transaction" button which calls transaction <CROSS-NAME>. Valid at least in sap 7.0
      • Y : Deprecated. Main program <CROSS-INCLUDE> contains CALL TRANSACTION <CROSS-NAME> (may not be the same as T because for Y, field CROSS-INCLUDE is the main program, and for T, it's the include name). SAP 7.0 (at least) does not fill it anymore.
      • Note: for dynamic references, field CROSS-NAME contains "?"
      • Note: lock object cross-references are determined via cross-references of function modules (CROSS-TYPE = "F"): function modules named 'ENQUEUE_E*' and 'DEQUEUE_E*' correspond to the use of a lock object
    • Function module RS_GET_TABLE_REFERENCES : references to structures, view, tables, etc. You can only get it from the main program name (not from includes)
    • Function module RS_GET_ALL_INCLUDES : included sources (statement INCLUDE)
  • Known missing functions in where-used lists:
    • CALL SUBSCREEN with screen given as a litteral
    • AUTHORITY-CHECK in ABAP OO methods
GOOD LUCK!
By the way, if you can make the code reusable (where-used list returned via method parameter), that would be great (I think of things like creating a program which checks completeness of transport requests, a recurrent problem as old as SAP!, that would be rather easy to develop if you succeed in creating your program)
 
sandra
Reply all
Reply to author
Forward
0 new messages