2018년 10월 24일 수요일

SAP 화면에 웹화면 DISPLAY

전표조회시 함수내에서 화면구성함

Z_RFC_EVIDENCE_COMMON

FUNCTION Z_RFC_EVIDENCE_COMMON.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(BUKRS) TYPE  BUKRS
*"     VALUE(GJAHR) TYPE  GJAHR
*"     VALUE(BELNR) TYPE  BELNR_D
*"----------------------------------------------------------------------

  CLEAR gs_doc.
  move bukrs to gs_doc-bukrs.
  move gjahr to gs_doc-gjahr.
  move belnr to gs_doc-belnr.

  CALL SCREEN 0100 STARTING AT 010 005
                   ENDING   AT 060 015.

ENDFUNCTION.

100번 화면

PROCESS BEFORE OUTPUT.
  MODULE status_0100.
  MODULE create_and_init_controls_0100.
*
PROCESS AFTER INPUT.
  MODULE user_command_0100.


*----------------------------------------------------------------------*
***INCLUDE LZT1803_FG1O01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.

  SET PF-STATUS '0100'.
  SET TITLEBAR  '0100'.

ENDMODULE.
*&---------------------------------------------------------------------*
*& Module CREATE_AND_INIT_CONTROLS_0100 OUTPUT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
MODULE create_and_init_controls_0100 OUTPUT.

*-Container for html viewer
  DATA: cl_html_container TYPE REF TO cl_gui_custom_container,
*-HTML viewer
        cl_htmlviewer     TYPE REF TO cl_gui_html_viewer.

  DATA lv_url     TYPE c LENGTH 255.
  DATA lv_use_url TYPE c LENGTH 255.
  DATA lv_evd_no  TYPE c LENGTH 40.

  DATA : lv_budat TYPE datum.

  CONSTANTS : lc_url_dev(255) TYPE c VALUE
  'http://165.186.170.16:9900/poaacct/sso/byPassLogin.jsp?PK_NO='.
  CONSTANTS : lc_url_prd(255) TYPE c VALUE
  'http://165.186.170.209:9900/poaacct/sso/byPassLogin.jsp?PK_NO='.

  CONSTANTS : lc_ip_dev(30) TYPE c VALUE 'http://165.186.170.16'.
  CONSTANTS : lc_ip_prd(30) TYPE c VALUE 'http://ev.lsnikko.com'.

  CONSTANTS : lc_hello(100) TYPE c VALUE
  '/hello/eacc/common/popWelsApprViewer.do?GJAHR='.

  CONSTANTS : lc_belnr(10) TYPE c VALUE '&BELNR='.


  CLEAR lv_use_url.
  IF sy-sysid EQ 'LSD' OR sy-sysid EQ 'LSQ'.
    MOVE lc_url_dev TO lv_use_url.
  ELSEIF sy-sysid EQ 'LSP'.
    MOVE lc_url_prd TO lv_use_url.
  ENDIF.


  CLEAR lv_budat.
  SELECT SINGLE budat
    INTO lv_budat
    FROM bkpf
   WHERE bukrs EQ gs_doc-bukrs
**     AND gjahr EQ gs_doc-gjahr
     AND belnr EQ gs_doc-belnr.

* 무증빙
  IF lv_budat < '20181001'.
    CLEAR lv_evd_no.
    SELECT SINGLE evd_no
      INTO lv_evd_no
      FROM ztev0002
     WHERE belnr EQ gs_doc-belnr.
    IF lv_evd_no EQ space.
      lv_url = lv_use_url && gs_doc-belnr.
    ELSE.
      lv_url = lv_use_url && lv_evd_no.
    ENDIF.

* E-VOUCHER
  ELSE.
    IF sy-sysid EQ 'LSD' OR sy-sysid EQ 'LSQ'.
      lv_url = lc_ip_dev && lc_hello && lv_budat+0(4) && lc_belnr && gs_doc-belnr.
    ELSEIF sy-sysid EQ 'LSP'.
      lv_url = lc_ip_prd && lc_hello && lv_budat+0(4) && lc_belnr && gs_doc-belnr.
    ENDIF.
  ENDIF.

  CREATE OBJECT cl_html_container
       EXPORTING
         container_name = 'CONT'.

  CREATE OBJECT cl_htmlviewer
    EXPORTING
      parent = cl_html_container.

  CALL METHOD cl_htmlviewer->show_url
    EXPORTING
      url = lv_url.

ENDMODULE.

*----------------------------------------------------------------------*
***INCLUDE LZT1803_FG1I01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  CASE GV_OK_CODE.

    WHEN 'BACK' OR 'CANC' OR 'EXIT'.
*      PERFORM CLEAR_CONTAINER_PROC USING
*                          GO_ALV1 GO_DOCKING_CONT1 GO_SPLITTER1
*                          GO_CONTAINER_TOP1 GO_CONTAINER_ALV1
*                          GO_HTML_VIEW1
*                          GO_EVENT_RECEIVER1.
      IF GV_OK_CODE = 'EXIT'.
        LEAVE PROGRAM.
      ELSE.
        LEAVE TO SCREEN 0.
      ENDIF.

    WHEN 'REFR'.
*      PERFORM refresh.

    WHEN OTHERS.

  ENDCASE.
ENDMODULE.



댓글 없음:

댓글 쓰기