SAP ABAP代码中打开浏览器跳转访问URL示例(支持超长URL)

实现URL调整的方法

  • 方法一:

    DATA: LV_OPENURL TYPE C LENGTH 300,
          LV_TEMPURL TYPE char50.
    
    " Url可由多个字符串组合
      LV_TEMPURL = 'https://'.
      CONCATENATE LV_OPENURL LV_TEMPURL INTO LV_OPENURL.
    
      LV_TEMPURL = |baike.baidu.com/item/SAP/40878|.
      CONCATENATE LV_OPENURL LV_TEMPURL INTO LV_OPENURL.
    
    call function 'CALL_BROWSER'
     EXPORTING
       URL                          = LV_OPENURL
    *   WINDOW_NAME                  = ' '
    *   NEW_WINDOW                   = ' '
    *   BROWSER_TYPE                 =
    *   CONTEXTSTRING                =
     EXCEPTIONS
       FRONTEND_NOT_SUPPORTED       = 1
       FRONTEND_ERROR               = 2
       PROG_NOT_FOUND               = 3
       NO_BATCH                     = 4
       UNSPECIFIED_ERROR            = 5
       OTHERS                       = 6.
    if sy-subrc <> 0.
    * Implement suitable error handling here
    endif.
    
  • 方法二:

    DATA LV_URL TYPE SO_TEXT255.
    
    LV_URL = |https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=baidu&wd=abap%20URL&oq=abap&rsv_pq=adf68d5800002aed&rsv_t=|.
    LV_URL = |{
          LV_URL }4e1bO0c9%2BnfMgoPLUuuurh%2FlZD%2FLCj8YFX7d04cHn0hivUNpA%2BKIZKTQhzk&rqlang=|.
    LV_URL = |{
          LV_URL }cn&rsv_dl=tb&rsv_enter=1&rsv_sug3=5&rsv_sug1=5&rsv_sug7=100<

你可能感兴趣的:(ABAP开发,ABAP,实用程序记录,SAP,ABAP,Url)