今天看到一個ABAP SearchHelp設計的一個作法

起因事有一個 Search help下拉時會看到這個物料的價格

抓的是KONP-KBETR的欄位屬性CURR

顯示的金額如果是TWD應該要在換算成台幣*100才對

這個一般ABAP都是CALL FUNCTION可是在Search help怎做呢

後來想到寫一個Search help 的程式設定一個function

參考

http://blog.csdn.net/CompassButton/archive/2007/01/24/1492229.aspx

 

 

 FUNCTION ZVMVAC_SHLP_EXIT.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  TABLES
*"      SHLP_TAB TYPE  SHLP_DESCT
*"      RECORD_TAB STRUCTURE  SEAHLPRES
*"  CHANGING
*"     VALUE(SHLP) TYPE  SHLP_DESCR
*"     VALUE(CALLCONTROL) TYPE  DDSHF4CTRL
*"----------------------------------------------------------------------

data: ZSDV06DB LIKE ZSDVCH0006 OCCURS 0 WITH HEADER LINE.

if callcontrol-step = 'DISP'.

 

call function 'F4UT_PARAMETER_VALUE_GET'

exporting

parameter = 'KBETR'

" Reference to search help parameter

fieldname = 'KBETR'

" Reference to field of Seatinfo

tables

shlp_tab = shlp_tab

record_tab = record_tab

results_tab = ZSDV06DB

changing

shlp = shlp

callcontrol = callcontrol.

 

 

LOOP AT ZSDV06DB.

ZSDV06DB-KBETR = ZSDV06DB-KBETR * 100.

modify ZSDV06DB transporting KBETR.

endloop.

 

 

call function 'F4UT_PARAMETER_RESULTS_PUT'

exporting

parameter = 'KBETR'

" Reference to search help parameter

fieldname = 'KBETR'

" Reference to field of Seatinfo

tables

shlp_tab = shlp_tab

record_tab = record_tab

source_tab = ZSDV06DB

changing

shlp = shlp

callcontrol = callcontrol.

 

ENDFUNCTION.

arrow
arrow
    全站熱搜

    ROACH 發表在 痞客邦 留言(1) 人氣()