Check whether directory exist on both PC and AS

http://scn.sap.com/thread/280091

You can use the DIRECTORY_EXIST method for both, PC frontend and application server,  you will need to know the fully qualified name of the appilication server on your network in order for it to work.

For example,  we run on an AS400 and this path gets me to the application server and this works in the following program.

\<ip_address>qfilesvr400<host_Name>usrsapTST

report zrich_0001.

type-pools: abap.

data: rc type abap_bool.
data: dir type string.

parameters: p_file type localfile default 'C:'.


start-of-selection.

dir = p_file.

  call method cl_gui_frontend_services=>directory_exist
    exporting
      directory            = dir
    receiving
      result               = rc
    exceptions
      cntl_error           = 1
      error_no_gui         = 2
      wrong_parameter      = 3
      not_supported_by_gui = 4
      others               = 5.

  if rc = 'X'.

    write:/ 'The directory does exist'.

  else.

    write:/ 'The directory does not exist'.

  endif.

回答: 这个错误是由于在build.gradle文件中缺少相应的属性导致的。根据引用\[1\]和引用\[2\]的建议,你需要在extra properties extension中添加buildToolsVersion和compileSdkVersion属性。具体的解决方法是在build.gradle文件中添加以下代码: ``` android { // 添加buildToolsVersion属性 buildToolsVersion "版本号" // 添加compileSdkVersion属性 compileSdkVersion 版本号 } ``` 此外,根据引用\[3\]的建议,你还需要在dependencies块中添加相应的依赖项。具体的解决方法是在build.gradle文件中的dependencies块中添加以下代码: ``` dependencies { implementation fileTree(dir: 'libs', include: \['*.jar'\]) implementation rootProject.ext.dependencies.appcompat implementation rootProject.ext.dependencies.constraintlayout testImplementation rootProject.ext.testDependencies.junit androidTestImplementation rootProject.ext.testDependencies.runner androidTestImplementation rootProject.ext.testDependencies.espresso_core } ``` 通过以上的修改,你应该能够解决这个错误。 #### 引用[.reference_title] - *1* *2* [Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist问题解决](https://blog.csdn.net/u013768203/article/details/53140449)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [ERROR: Cannot get property 'dependencies' on extra properties extension as it does not exist](https://blog.csdn.net/weixin_40420578/article/details/102934754)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值