Retrieving Object names and Transfer requests for an entire package programmatically

我的未来我决定 提交于 2019-12-11 08:29:49

问题


I have two separate system (development and testing) and I need to check that for all my objects (programs and all includes) the version in development matches that in dev. I can do this manually by going to SE80 -> Utilities -> Version Management for each object but for hundreds/thousands of objects this is extremely time consuming.

Is there a way to retrieve the object name and TR programatically so that they could be output to a table or spreadsheet?

EDIT. (Vwgert it seems to me like this works - if it doesn't could you explain a bit more why it won't? Thanks)

So using the following JOIN I believe I am able to retrieve all the objects, types and latest TR in the system.

SELECT a~obj_name b~korrnum c~object b~datum b~zeit
  FROM tadir AS a
  INNER JOIN vrsd AS b
  ON a~obj_name = b~objname
  INNER JOIN e071 AS c
  ON a~obj_name = c~obj_name
  AND a~pgmid = c~pgmid
  AND a~object = c~object
  INTO TABLE gt_obj_tr
  WHERE a~devclass IN s_pkg.

SORT gt_obj_tr BY object ASCENDING obj_name ASCENDING korrnum DESCENDING datum DESCENDING zeit DESCENDING.
DELETE ADJACENT DUPLICATES FROM gt_obj_tr COMPARING object obj_name.

回答1:


You can find most of the object headers in the table TADIR. The request and task headers are stored in E070, the entries in E071 - just take a look at the contents, it's fairly self-explanatory if you know what a transport looks like. Be aware that some object types can be transported partially (R3TR CLAS is the entire class, LIMU METH is only a single method) - this makes direct joins impossible.




回答2:


Probably the easiest (although not pretty) is to use table REPOSRC and link that to VSRD. REPOSRC is the table containing all the source code (methods, programs, functions) in the system so you can be sure you don't miss anything. You'll probably do something like (rough pseudo code):

SELECT name FROM reposrc
       WHERE name LIKE 'Z%'
          OR name LIKE 'SAPLZ%'  
          OR name LIKE 'SAPMZ%'

SELECT objtype objname FROM vrsd
       WHERE objname = reposrc-name
         AND objtype IN ('CINC', 'REPS')  "Class include & reports

This of course is just source code but it sounds like thats all you need. If you need to get from the report name to the real abap object (method, class, function module) use function module SEO_CLASS_GET_NAME_BY_INCLUDE and for functions look it up on table TFDIR.



来源:https://stackoverflow.com/questions/19655765/retrieving-object-names-and-transfer-requests-for-an-entire-package-programmatic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!