内表数据
物料 库位 期末庫存金額
F0D7004DSA 1PYF 701410.944
F0D7004DSA 1SNT 191642.256
F0D7004DSA 1SYF 191642.256
显示ALV
金额显示为:
70,141,094
19,164,226
19,164,226
看的出来是乘了100, 然后一顿猛操作
FIELDCAT 写的有问题 :
初始是这么写的:
DATA : ls_fieldcat TYPE lvc_s_fcat.
DEFINE alv_field.
ls_fieldcat-fieldname = &1.
ls_fieldcat-tabname = &2.
ls_fieldcat-key = &3.
ls_fieldcat-edit = &4.
ls_fieldcat-scrtext_l = &5.
ls_fieldcat-cfieldname = &6.
ls_fieldcat-qfieldname = &7.
ls_fieldcat-do_sum = &8.
ls_fieldcat-outputlen = &9.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
END-OF-DEFINITION.
alv_field 'LIGHTS' 'GT_DATA3' '' '' '訊息圖示' '' '' '' ''. alv_field 'WERKS' 'GT_DATA3' 'X' '' '工廠' '' '' '' '38'. alv_field 'NAME1' 'GT_DATA3' 'X' '' '工廠名稱' '' '' '' '48'. alv_field 'MATNR' 'GT_DATA3' 'X' '' '物料號碼' '' '' '' '48'. alv_field 'MAKTX' 'GT_DATA3' 'X' '' '物料說明' '' '' '' '48'. alv_field 'LGORT' 'GT_DATA3' 'X' '' '储位' '' '' '' '48'. alv_field 'LGOBE' 'GT_DATA3' 'X' '' '儲位名稱' '' '' '' '48'. alv_field 'MTART' 'GT_DATA3' '' '' '物料類型' '' '' '' '48'. alv_field 'MTBEZ' 'GT_DATA3' '' '' '物料類型說明' '' '' '' '48'. alv_field 'MATKL' 'GT_DATA3' '' '' '物料群組' '' '' '' '48'. alv_field 'WGBEZ' 'GT_DATA3' '' '' '物料群組說明' '' '' '' '48'. alv_field 'BKLAS' 'GT_DATA3' '' '' '評價類別' '' '' '' '48'. alv_field 'BKBEZ' 'GT_DATA3' '' '' '評價類別說明' '' '' '' '48'. alv_field 'ATWRT' 'GT_DATA3' '' '' '機種' '' '' '' '48'. alv_field 'ATWRT_T' 'GT_DATA3' '' '' '機種說明' '' '' '' '48'. ls_fieldcat-convexit = 'CUNIT'. alv_field 'MEINS' 'GT_DATA3' '' '' '單位' '' '' '' '48'. alv_field 'WAERS' 'GT_DATA3' '' '' '幣別碼' '' '' '' '48'. alv_field 'VERPR_QC' 'GT_DATA' '' '' '期初價格' '' '' '' '48'. alv_field 'PEINH' 'GT_DATA' '' '' '價格單位' '' '' '' '48'. alv_field 'SPRIC' 'GT_DATA' '' '' '期初單價' '' '' '' '48'. alv_field 'VERPR_QM' 'GT_DATA' '' '' '期末價格' '' '' '' '48'. alv_field 'EPRIC' 'GT_DATA' '' '' '期末單價' '' '' '' '48'. alv_field 'MENGE' 'GT_DATA3' '' '' '期初庫存數量' '' 'MEINS' '' '48'. alv_field 'DMBTR' 'GT_DATA3' '' '' '期初庫存金額' 'WAERS' '' '' '48'. alv_field 'EMENGE' 'GT_DATA3' '' '' '期末庫存數量' '' 'MEINS' '' '48'. alv_field 'EDMBTR' 'GT_DATA3' '' '' '期末庫存金額' 'WAERS' '' '' '48'. alv_field 'EMENGE2' 'GT_DATA3' '' '' '部門領用(修繕)_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR2' 'GT_DATA3' '' '' '部門領用(修繕)_金额' 'WAERS' '' '' '48'. alv_field 'EMENGE4' 'GT_DATA3' '' '' '部門領用(研究)_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR4' 'GT_DATA3' '' '' '部門領用(研究)_金额' 'WAERS' '' '' '48'. alv_field 'EMENGE7' 'GT_DATA3' '' '' '部門領用(消耗品)_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR7' 'GT_DATA3' '' '' '部門領用(消耗品)_金額' 'WAERS' '' '' '48'. alv_field 'EMENGE8' 'GT_DATA3' '' '' '部門領用(其他)_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR8' 'GT_DATA3' '' '' '部門領用(其他)_金額' 'WAERS' '' '' '48'. alv_field 'MMENGE1' 'GT_DATA3' '' '' '生產入庫_数量' '' 'MEINS' '' '48'. alv_field 'MDMBTR1' 'GT_DATA3' '' '' '生產入庫_金額' 'WAERS' '' '' '48'. alv_field 'SUBMENGE2' 'GT_DATA3' '' '' '耗用—其他_数量' '' 'MEINS' '' '48'. alv_field 'SUBDMBTR2' 'GT_DATA3' '' '' '耗用—其他_金額' 'WAERS' '' '' '48'. alv_field 'PMENGE' 'GT_DATA3' '' '' '採購入庫_数量' '' 'MEINS' '' '48'. alv_field 'PDMBTR' 'GT_DATA3' '' '' '採購入庫_金額' 'WAERS' '' '' '48'. alv_field 'RMENGE' 'GT_DATA3' '' '' '採購退回_数量' '' 'MEINS' '' '48'. alv_field 'RDMBTR' 'GT_DATA3' '' '' '採購退回_金額' 'WAERS' '' '' '48'. alv_field 'EMENGE_P20' 'GT_DATA3' '' '' '委外加工_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR_P20' 'GT_DATA3' '' '' '委外加工_金額' 'WAERS' '' '' '48'. alv_field 'WMENGE4' 'GT_DATA3' '' '' '委外領用-數量' '' 'MEINS' '' '48'. alv_field 'WDMBTR4' 'GT_DATA3' '' '' '委外領用-金額' 'WAERS' '' '' '48'. alv_field 'EMENGE_S10' 'GT_DATA3' '' '' '銷貨出貨_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR_S10' 'GT_DATA3' '' '' '銷貨出貨_金額' 'WAERS' '' '' '48'. alv_field 'SMENGE2' 'GT_DATA3' '' '' '銷貨退回_数量' '' 'MEINS' '' '48'. alv_field 'SDMBTR2' 'GT_DATA3' '' '' '銷貨退回_金額' 'WAERS' '' '' '48'. alv_field 'EMENGE_S12' 'GT_DATA3' '' '' '銷貨耗用_数量' '' 'MEINS' '' '48'. alv_field 'EDMBTR_S12' 'GT_DATA3' '' '' '銷貨耗用_金額' 'WAERS' '' '' '48'. alv_field 'WMENGE1' 'GT_DATA3' '' '' '盤點盈虧_数量' '' 'MEINS' '' '48'. alv_field 'WDMBTR1' 'GT_DATA3' '' '' '盤點盈虧_金額' 'WAERS' '' '' '48'. alv_field 'WMENGE2' 'GT_DATA3' '' '' '報廢_数量' '' 'MEINS' '' '48'. alv_field 'WDMBTR2' 'GT_DATA3' '' '' '報廢_金額' 'WAERS' '' '' '48'. alv_field 'WMENGE3' 'GT_DATA3' '' '' '轉倉_数量' '' 'MEINS' '' '48'. alv_field 'WDMBTR3' 'GT_DATA3' '' '' '轉倉_金額' 'WAERS' '' '' '48'. **建立日期 alv_field 'ERSDA' 'GT_DATA1' '' '' '建立日期' '' '' '' '48'. alv_field 'ERTIM' 'GT_DATA1' '' '' '建立物件的時間' '' '' '' '48'. alv_field 'ERNAM' 'GT_DATA1' '' '' '物件建立者的姓名' '' '' '' '48'. alv_field 'ERTER' 'GT_DATA1' '' '' '終端機' '' '' '' '48'. alv_field 'LAEDA' 'GT_DATA1' '' '' '最後更改日期' '' '' '' '48'. alv_field 'AETIM' 'GT_DATA1' '' '' '最後更改時間' '' '' '' '48'. alv_field 'AENAM' 'GT_DATA1' '' '' '物件更改者的名字' '' '' '' '48'. alv_field 'AETER' 'GT_DATA1' '' '' '終端機' '' '' '' '48'.
后面加了对FIELDCAT 的处理:
PERFORM frm_edit_fieldcat.
LOOP AT gt_fieldcat ASSIGNING FIELD-SYMBOL(<lf_fieldcat>). CASE <lf_fieldcat>-fieldname. WHEN 'DMBTR' OR 'EDMBTR' OR 'EDMBTR2' OR 'EDMBTR4' OR 'EDMBTR7' OR 'EDMBTR8' OR 'MDMBTR1' OR 'SUBDMBTR2' OR 'PDMBTR' OR 'RDMBTR' OR 'EDMBTR_P20' OR 'WDMBTR4' OR 'EDMBTR_S10' OR 'SDMBTR2' OR 'EDMBTR_S12' OR 'WDMBTR1' OR 'WDMBTR2' OR 'WDMBTR3'. <lf_fieldcat>-ref_field = 'RHCUR'. <lf_fieldcat>-ref_table = 'ACDOCA'. CLEAR: <lf_fieldcat>-cfieldname. ** <lf_fieldcat>-currency = g_waers. ** <lf_fieldcat>-cfieldname = 'CURRENCY'. WHEN OTHERS. ENDCASE.
然后可以了显示
期末库存金额
2010 東莞(外銷)工廠 F0D7004DSA DesktopICAIO330-20IGMJ4005/5004G460x47x3 701410.94
2010 東莞(外銷)工廠 F0D7004DSA DesktopICAIO330-20IGMJ4005/5004G460x47x3 191642.26
2010 東莞(外銷)工廠 F0D7004DSA DesktopICAIO330-20IGMJ4005/5004G460x47x3 191642.26