data: begin
of it_date occurs
0,lv_date like vbak-vdatu,
endof it_date.
data: begin
of it_month occurs
0,month(8) type
c,end
of it_month.
獲取每個so的所有交貨日期(yyyymm)
select j_3arqda
into
table it_date
from vbap
forall entries in it_so
where vbeln = it_so-vbeln.
sort it_date by lv_date.
delete
adjacent
duplicates
from it_date.
describe
table it_date lines lv_line.
if lv_line <> 0.
read
table it_date index lv_line.
lv_max = it_date-lv_date.
read
table it_date index
lines
of it_date to it_month.
loop
at it_month.
it_month-month = it_month-month+0(6).
modify it_month index sy-tabix.
endloop.
sort it_month by month.
delete
adjacent
duplicates
from it_month.
delete it_month where month = '000000'.
獲取每個日期(yyyymm)下訂單總數量
data wa_field(14) type
c.data wa_tabix type
i.data
no(2) type
c.data tmp(15) type p decimals
2.field-symbols: .
field-symbols: .
loop
at it_month.
no = sy-tabix.
if wa_tabix < 10.
concatenate
'it_tab-field'
'0'no
into wa_field.
else.
concatenate
'it_tab-field'
nointo wa_field.
endif.
perform get_rdate using it_month-month.
select
sum( kwmeng ) into tmp from vbap
where vbeln = it_tab-vbeln
and abgru = space
and j_3arqda in r_date.
assign (wa_field) to
.= tmp.
it_tab-ttl_qty = it_tab-ttl_qty + tmp.
clear: tmp, wa_field.
endloop.
form get_rdate using p_date.
data p_from like vbak-vdatu.
data p_to like vbak-vdatu.
concatenate p_date+0(6) '01'
into p_from.
call
function
'last_day_of_months'
exporting
day_in = p_from
importing
控制alv表頭中日期部分動態輸出:
data: t_atwrt(15) type
cvalue
'it_tab'.
data: t_atwrt2(15) type
cvalue
'it_tab'.
data: t_atwrt3(25) type
cvalue
'it_tab'.
field-symbols: .
field-symbols: .
t_atwrt+0(12) = 'it_tab-field'.
t_atwrt3+0(20) = 'it_qty_month-field'.
clear lv_tabix.
data
no(2) type
c.loop
at it_month.
lv_tabix = sy-tabix.
if lv_tabix < 10.
no = lv_tabix.
concatenate
'0'no
into
no.t_atwrt3+19(2) = no.
t_atwrt+12(2) = no.
else.
t_atwrt3+19(2) = no.
t_atwrt+12(2) = no.
endif.
assign t_atwrt to
.assign t_atwrt3 to.if
neno.
endloop.
ABAP實現多表頭ALV
實現 雙層設定 這句話是關鍵,擴充套件節點 第一層表頭 cns vbap type slis tabname value ty wflist 第二層專案 表頭 l h tbl fieldcat tabname cns vbak.l h tbl fieldcat fieldname instid l ...
ABAP的alv控制輸入輸出到單元格
正如我們所知道的,通常乙個alv的輸入輸出控制只會精確到列,比如說讓這一列入庫地點可輸入而另一列入庫單號不可輸入。可當我們想要乙個alv的某一列有的可以修改而有的不能修改時我們該怎麼辦呢?比如說當入庫單號為1開頭時入庫地點可修改,而入庫單號為2開頭時不可修改。我們該怎麼辦呢?這需要給所要輸出的表 這...
element ui實現複雜動態表頭
製作乙個不同省份不同業務的的統計報表。如下圖 動態表頭只需要在中v for迴圈即可,但是在多層迴圈中,prop屬性的賦值卻讓我試了半天,希望能幫到有需要的小夥伴,最終 如下 data datalist width 1200 show summary summary method getsummari...