2

事务 AL11 返回“目录参数”到应用服务器 AFAIK 上文件路径的映射。事务 AL11 的问题在于它的程序只调用 c 模块,几乎没有任何 select 语句或函数调用的踪迹来分析那里。

我希望能够在我的代码中动态地执行此操作,例如将“DATA_DIR”作为输入和“E:\usr\sap\IDS\DVEBMGS00\data”作为输出的功能模块。

这个线程是关于一个类似的主题,但它没有帮助。

其他人也有同样的问题,他在这里解释得很好。

4

2 回答 2

4

我强烈怀疑获得这些值的唯一方法是直接通过内核。其中一些可能因应用程序服务器而异,因此您可能无法在数据库中找到它们。你可以试试这个:

TYPE-POOLS abap.

TYPES: BEGIN OF t_directory,
         log_name TYPE dirprofilenames,
         phys_path TYPE dirname_al11,
       END OF t_directory.

DATA: lt_int_list    TYPE TABLE OF abaplist,
      lt_string_list TYPE list_string_table,
      lt_directories TYPE TABLE OF t_directory,
      ls_directory   TYPE t_directory.

FIELD-SYMBOLS: <l_line> TYPE string.

START-OF-SELECTION-OR-FORM-OR-METHOD-OR-WHATEVER.
* get the output of the program as string table
  SUBMIT rswatch0 EXPORTING LIST TO MEMORY AND RETURN.
  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = lt_int_list.
  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      with_line_break   = abap_true
    IMPORTING
      list_string_ascii = lt_string_list
    TABLES
      listobject        = lt_int_list.

* remove the separators and the two header lines
  DELETE lt_string_list WHERE table_line CO '-'.
  DELETE lt_string_list INDEX 1.
  DELETE lt_string_list INDEX 1.

* parse the individual lines
  LOOP AT lt_string_list ASSIGNING <l_line>.
*   If you're on a newer system, you can do this in a more elegant way using regular expressions
    CONDENSE <l_line>.
    SHIFT <l_line> LEFT DELETING LEADING '|'.
    SHIFT <l_line> RIGHT DELETING TRAILING '|'.
    SPLIT <l_line>+1 AT '|' INTO ls_directory-log_name ls_directory-phys_path.
    APPEND ls_directory TO lt_directories.
  ENDLOOP.
于 2012-08-17T14:27:22.757 回答
1

尝试以下

data : dirname type  DIRNAME_AL11.
CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DATA'
                   ID 'VALUE' FIELD dirname.

或者,如果您想使用自己的参数(AL11->configure),则从表 user_dir 中读取这些参数。

于 2013-02-20T12:57:40.377 回答