2015年10月3日 星期六

KE30 - Execute AC040 report does not display plant in navigation area

在連入 IDES AC040 練習-4  時,操作到 KE30 執行 AC040 時

Acconting / Controlling / Profitability Analysis / Information System / KE30 -Execute Report
執行下面參數
選擇 AC040
結果沒有 Plant 在 Navigation Area 裡

2015年9月17日 星期四

ABAP/4 : How to use DOI to export internal table to EXCEL and set cell to string

User 在使用報表時,通常都希望系統能直接將結果導出成 Excel,以方便後續報編的編制,通常會使用 GUI_Download 產生以 Tab 分隔的檔案,但問題是產生的只是純文字檔,會造成文字檔轉 Excel 很容易發生 00001 -> 1 的情況



這種情況則可透過 DOI (Desktop Office Integration) 產生 Excel,將 Internal Table 中的值匯出到 Excel,並且透過 i_oi_spreadsheet-> set_format_string  的功能把 cell format 成 String


CALL METHOD i_oi_spreadsheet-> set_format_string
  EXPORTING
    rangename = 'range name'
    formatstring = '@'
  IMPORTING
    error = iref_error.

2015年9月3日 星期四

ABAP/4 Use DYNP_VALUES_READ & DYNP_VALUES_UPDATE read/update current screen PARAMETER or SELECT-OPTIONS value

在 AT SELECTION-SCREEN ON VALUE-REQUEST FOR <Parameters or Select-Option> 要捉取畫面的變數時,會無法取得目前的值


使用 DYNP_VALUES_READ 即可取得目前畫面上的值

2015年6月16日 星期二

SQVI - How to change SQVI screen from basic view to graphical join screen (choose data source)

使用 SQVI,有時在 join 的 choose data source 畫面,進入到 basic mode 後,想要再增加 Table 但不想在 basic mode 裡進行時,則可透過以下方式回到 choose data source

2015年6月4日 星期四

ABAP4 - How to use alv to change the value of internal table

ABAP4 - How to use alv to change the value of internal table

透過 ALV 修改資料的好處是可以減少 Screen 的控制,直接讓 User 像是直接在 Excel 上編輯,程式只需要將畫面上新的值寫回 Internal Table 並且將 Internal Table 再顯示在 ALV 中。

2015年5月24日 星期日

HTML5 - HTML5 Simple template & Eclipse 開發環境

一、HTML5 Simple Template

<!doctype html>
<html>
  <head>
     <title>HTML5 TITLE</title>
     <!--存的檔案記得也要放 utf-8 不然非英文字元顯示會異常-->
     <mata charset="utf-8">
     <link href="user.css" rel="stylesheet"></link>
     <script src="user.js"></script>
  </head>
  <body>
    <h1>Hellow World, HTML5!</h1>
  </body>
</html>

2015年4月14日 星期二

MM - Difference amount when GR & GR return - stock value not enough

Mvt 122 發生退貨金額與 Mvt 101 不一致可能發生的原因很多,目前的 CASE 要說明的是當庫存 value 已不足時,系統產生金額差異的情況。

如下圖,GR 時 3000 PC,Local Amount 為 12000,但 GR Return 時 3000 PC,Local Amount 卻為 11286

2015年4月4日 星期六

ABAP - CL_GUI_DOCKING_CONTAINER & CL_GUI_SPLITTER_CONTAINER

透過 CL_GUI_DOCKING_CONTAINER 建立一個可以放入各種物件的容器,但如果需要分割數個區塊供不同功能使用 (e.g. 左邊樹狀結構,右邊顯示資料),則需要再搭配 CL_GUI_SPLITTER_CONTAINER


主要宣告的物件如下,主要是透過 CL_GUI_DOCKING_CONTAINER 建立一個全螢幕的 CONTAINER,再透過 SPLITTER_1 把 CONTAINER 切成四個區塊,再透過 CL_GUI_CONTAINER 填入四個區塊中

"CONTAINER
DATA: G_CONTAINER1 type ref to CL_GUI_DOCKING_CONTAINER,   "MAIN CONTAINER
      G_CONTAINER2 type ref to CL_GUI_CONTAINER,
      G_CONTAINER3 type ref to cl_gui_container,
      G_CONTAINER4 type ref to cl_gui_container,
      G_CONTAINER5 type ref to cl_gui_container.

DATA splitter_1 TYPE REF TO CL_GUI_SPLITTER_CONTAINER.

2015年4月1日 星期三

ABAP How to trigger double click for multiple table control in one screen

ABAP How to trigger double click for multiple table control in one screen

針對此需求大概分為兩個目標

A) 如何做到 Double Click

針對要觸發 Double Click 的元件,設定 Pesponds to double-click
再 GUI Status 的 Choose 加入 Code

B) 如何判斷目前 Table Control

DATA: G_LINE TYPE I.
DATA: G_DBL_AREA(20) TYPE C.

"透過 Get Cursor 捉取目前滑鼠點擊的行數以及哪個 Area (點在哪個 Table Control 上)
GET CURSOR LINE G_LINE AREA G_DBL_AREA.

ABAP How to get screen resolution (width & height)

How to get screen resolution (width & height)


透過以下 Class 進行

Class:CL_GUI_PROPS_CONSUMER

2015年3月26日 星期四

ABAP4: Add or subtract SAP Date Time

ABAP4: Add or subtract SAP Date Time By Timestamp

SAP 的日期與時間 SY-DATUM & SY-UZEIT 是分開,並不像 Oracle datetime 可以直接加減運算,因此可透過轉換成 Timestamp (UTC) 變成秒後,再針對要增加 or 減少的時間轉換成秒後進行運算,最後再把 Timestamp 轉為 Date Time

第一種方法:

透過 RKE_TIMESTAMP_CONVERT_INPUT 把時間轉換成 UTC Timestamp,再透過 RKE_TIMESTAMP_CONVERT_OUTPUT 轉回 DATE/TIME.

CALL FUNCTION 'RKE_TIMESTAMP_CONVERT_INPUT'


CALL FUNCTION 'RKE_TIMESTAMP_CONVERT_OUTPUT'

How to install & specified python version or distreibtuion package version in google colab

在買了 RTX 3080 要來 挖礦...  嗯~是跑機器學習後,結果發現了 GOOGLE COLAB,其實之前在「GAN 對抗式生成網路」一書就有看到,但資訊人就是什麼都想自己安裝,在本機用 Anaconda + pyCharm 弄了 GPU 環境,結果有天從新竹回家發現家裡沒...