Skip to end of metadata
Go to start of metadata

Author: Marc Bernard, SAP Techology RIG
Submitted: 2007-06-15

Related Links:

Description:
This program creates and activates the missing HTTP service for the BI-IP file upload. Implement and run once.

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
************************************************************************
* ZRSPLF_FILE_UPLOAD_ICF
* BI-IP File Upload HTTP Service
*
* (c) SAP AG 2007                                    MFB, SAP Labs, LLC
* last update: 2007-06-15
************************************************************************

REPORT zrsplf_file_upload_icf.

TYPE-POOLS: abap.

DATA:
  ls_icfservloc  TYPE icfservloc,
  l_nodeguid     TYPE icfnodguid,
  l_answer       TYPE c,
  lb_node_active TYPE boolean.

CONSTANTS:
  c_root_node   TYPE icfparguid VALUE 'BPXI9KP2BASOTAFYZA1IQQI7C', " /default_host/sap/bc/webdynpro/sap
  c_devclass    TYPE devclass   VALUE 'ZRSPLF',
  c_icfname     TYPE icfname    VALUE 'BIR00310',
  c_icfdocu     TYPE icf_docu   VALUE 'BI-IP File Upload',
  c_icfaltname  TYPE icfaltnme  VALUE 'ZRSPLF_FILE_UPLOAD',
  c_icfaltname2 TYPE icfaltnme  VALUE 'zrsplf_file_upload'.

lb_node_active = space.

CALL FUNCTION 'HTTP_GET_NODEGUID'
  EXPORTING
    parguid        = c_root_node
    nodename       = c_icfname
  IMPORTING
    nodeguid       = l_nodeguid
  EXCEPTIONS
    node_not_found = 1
    OTHERS         = 2.

IF sy-subrc = 0.
  lb_node_active = '-'.
  SELECT * FROM icfservloc INTO ls_icfservloc WHERE icf_name = c_icfname.
    IF ls_icfservloc-icfactive = 'X'.
      lb_node_active = 'X'.
    ENDIF.
  ENDSELECT.
ENDIF.

CASE lb_node_active.
* service DOESN'T EXIST => create ------------------------------
  WHEN space.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
        titlebar              = 'HTTP-Service'
        text_question         = 'Do you want to create an entry for Web Dynpro zrsplf_file_upload'
        display_cancel_button = space
      IMPORTING
        answer                = l_answer.

    IF l_answer = '1'. " yes

      CALL FUNCTION 'HTTPTREE_INSERT_NODE'
        EXPORTING
          p_icf_name                = c_icfname
          p_icfparguid              = c_root_node
          p_icfdocu                 = c_icfdocu
          p_doculang                = sy-langu
          p_icfactive               = 'X'
          p_package                 = c_devclass
        EXCEPTIONS
          no_new_virtual_host       = 1
          special_service_error     = 2
          parent_not_existing       = 3
          enqueue_error             = 4
          node_already_existing     = 5
          empty_docu                = 6
          doculang_not_installed    = 7
          security_info_error       = 8
          user_password_error       = 9
          password_encryption_error = 10
          invalid_url               = 11
          invalid_otr_concept       = 12
          formflg401_error          = 13
          handler_error             = 14
          transport_error           = 15
          tadir_error               = 16
          package_not_found         = 17
          OTHERS                    = 18.

      IF sy-subrc = 0.
        UPDATE icfservice
          SET   icf_cclnt      = sy-mandt
                icf_mclnt      = sy-mandt
                icfaltnme      = c_icfaltname
                icfaltnme_orig = c_icfaltname2
          WHERE icf_name       = c_icfname
            AND icfparguid     = c_root_node.

        MESSAGE i171(so2_tool) WITH c_icfdocu.
      ELSE.
        message e001(rsplf) with sy-subrc.
        MESSAGE e174(so2_tool) WITH c_icfdocu.
      ENDIF.

    ENDIF.

* service INACTIVE => activate ------------------------------
  WHEN '-'.

    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
        titlebar              = 'HTTP-Service'
        text_question         = 'Do you want to activate the service for Web Dynpro zrsplf_file_upload'
        display_cancel_button = space
      IMPORTING
        answer                = l_answer.

    IF l_answer = '1'.

      CALL FUNCTION 'HTTP_ACTIVATE_NODE'
        EXPORTING
          nodeguid          = l_nodeguid
        EXCEPTIONS
          node_not_existing = 1
          enqueue_error     = 2
          OTHERS            = 3.

      IF sy-subrc = 0.
        UPDATE icfservice
          SET   icf_cclnt      = sy-mandt
                icf_mclnt      = sy-mandt
                icfaltnme      = c_icfaltname
                icfaltnme_orig = c_icfaltname2
          WHERE icf_name       = c_icfname
            AND icfparguid     = c_root_node.

        MESSAGE i001(rsplf) WITH 'Service for Web Dynpro zrsplf_file_upload' 'successfully activated'.
      ELSE.
        MESSAGE e001(rsplf) WITH 'Service for Web Dynpro zrsplf_file_upload' 'could not be activated'.
      ENDIF.

    ENDIF.

* service ACTIVE => ok message ------------------------------
  WHEN OTHERS.

    MESSAGE i001(rsplf) WITH 'Service for Web Dynpro zrsplf_file_upload' 'already exists and is active'.

ENDCASE.