Problem in ALV Filter option
Hi Experts,
In the ALV output we are having fields like year,period and plant.If i click on Year or period or plant and then click on filter option in ALV it is giving a select option and then click on the F4 Help in the selection option,it is giving the list of option once i select any one of the value it is displaying(for eg:Year) as '2004####'.Then if we click ok it is showing error instead of '2004####' it should be '2004' after selection.
Is there any way to rectify this?????Please reply ASAP.
Thanks
Raj.
Hi
If it is YEAR (type is GJAHR) .... and passing the value as '2008'.
Hi Guys,
Did anyone come across this situation??
Thanks
Raj.
Similar Messages
-
Problem with ALV Filter Option
Hi
In 4.6C version when i click on a column for Filter option, i am able to key only 20 Chars( Visible length is 16 ). Whereas in 4.7 version, i am able to key in 40 Chars in the Input field of the filter option. Is this a problem with 4.6C version. Please Help...Hi
Can you check report BCALV_TEST_FULLSCREEN_FILTER in 46C. When you put a filter on C60 ( 60 Char field ) the screen display of select-option is small but when you select the multiple options, you can key in upto 60 chars and the filter works well. Check if thsi rpogram helps you.
Cheers. -
Problem with ALV filter functionality when filtered for multiple values
Hi,
I am facing a problem with ALV filter functionality.
I have displayed an ALV with some columns col_A, col_B and col_C
col_A---- col_B -
col_C
1----
a -
abc
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
5----
f -
stu
From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
i.e. after applying the filter the ALV table looks as below:
col_A---- col_B -
col_C
3----
c -
lmn
But ideally it should be:
col_A---- col_B -
col_C
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
I could not find any OSS note related to this issue.
Please help me resolve this issue.
Thanks,
FerozHi,
I am facing a problem with ALV filter functionality.
I have displayed an ALV with some columns col_A, col_B and col_C
col_A---- col_B -
col_C
1----
a -
abc
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
5----
f -
stu
From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
i.e. after applying the filter the ALV table looks as below:
col_A---- col_B -
col_C
3----
c -
lmn
But ideally it should be:
col_A---- col_B -
col_C
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
I could not find any OSS note related to this issue.
Please help me resolve this issue.
Thanks,
Feroz -
Hi all,
I have a problem when i filter ALV column, which has data type BELNR (FI doc No). I input in filter FI doc: 40000007 (8 char long, w/o zero ahead), then i get the empty result. The really one i want to get is a ALV line with FI doc = '40000007'.
Could u pls help me?
Thanks and regards,
Hung.Check the field catalog for field BELNR, it should have conversion exit ALPHA. (check your report or execute [The Consistency Check|http://help.sap.com/saphelp_sm32/helpdata/EN/d6/23253963143e6ae10000000a11402f/frameset.htm])
Regards,
Raymond -
Dear All
I written a program using ALV in which i can get only 10 characters but i want all characters in the field what settings i should do in ALV or in anything else.
Thanks and Regards
Sureshhi Vasu
thanks for ur ealist reply
my coding following
wht i can change
REPORT z_gldetail_withoutpo LINE-SIZE 175 LINE-COUNT 30.
TABLES: ekko,
ekpo,
rbkp,
lfa1,
rseg,
skat,
bkpf,
bseg.
TYPE-POOLS slis.
DATA: BEGIN OF it_lfa OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
ORT01 like lfa1-ORT01,
STRAS like lfa1-STRAS,
END OF it_lfa.
data: begin of it_cin occurs 0,
lifnr LIKE J_1IMOVEND-lifnr,
J_1ICSTNO like J_1IMOVEND-J_1ICSTNO,
J_1ILSTNO LIKE J_1IMOVEND-J_1ILSTNO,
end of it_cin.
for update all data - ALV use
data: begin of FinnalTbl,
belnr like bkpf-belnr,
bldat like bkpf-bldat,
bldat(10) type c ,
xblnr like bkpf-xblnr,
wrbtr like bseg-wrbtr,
dmbtr like bseg-dmbtr,
lifnr like bseg-lifnr,
MENGE like bseg-MENGE, qty
l_MEINS like bseg-MEINS, uom
land1 like LFA1-LAND1,
regio like LFA1-REGIO,
stceg like LFA1-stceg,
NAME1 like lfa1-NAME1,
count(5),
perval type p decimals 2,
vatamt type p decimals 2,
ttlval type p decimals 2,
linevalue type p decimals 2,
tgjAHR like bseg-gjAHR,
STRAS like LFA1-STRAS,
ORT01 like LFA1-ORT01,
BKTXT LIKE BKPF-BKTXT,
BilValue type p decimals 2,
VatPer type p decimals 2,
ZUONR like bseg-ZUONR, "Qty
holdtax type p decimals 2,
docdate like bkpf-bldat,
end of FinnalTbl.
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
ct_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
for new ALV
*TYPE-POOLS slis.
*DATA: afield TYPE slis_fieldcat_alv.
*DATA: fieldcat TYPE slis_t_fieldcat_alv.
*DATA: gd_layout TYPE slis_layout_alv.
DATA : BEGIN OF wa_ven_inv,
l_belnr like bkpf-belnr,
lifnr LIKE rbkp-lifnr,
name1 LIKE lfa1-name1,
ORT01 like lfa1-ORT01,
STRAS like lfa1-STRAS,
J_1ICSTNO like J_1IMOVEND-J_1ICSTNO,
J_1ILSTNO LIKE J_1IMOVEND-J_1ILSTNO,
kalsb like tmkkt-kalsb,
l_budat like bkpf-budat,
l_bldat like bkpf-bldat,
l_xblnr like bkpf-xblnr,
l_menge LIKE bseg-menge,
l_lifnr like bseg-lifnr,
l_hkont like bseg-hkont,
l_sgtxt like bseg-sgtxt,
l_wrbtr like bseg-wrbtr,
l_dmbtr like bseg-dmbtr,
l_matnr like bseg-matnr,
l_pswsl like bseg-pswsl,
l_vbel2 like bseg-vbel2,
l_MEINS like bseg-MEINS,
gldsc like skat-txt50,
ll_dmbtr like bseg-dmbtr,
ll_per type p decimals 2,
TotalV like bseg-dmbtr,
l_tmpcountryc like LFA1-LAND1,
l_tmpregc like LFA1-REGIO,
l_STCEG like LFA1-STCEG,
l_tmpcountry like T005T-LANDX50,
l_tmpreg like T005U-BEZEI,
l_tmpunitmea like rseg-BSTME,
l_BKTXT like bkpf-BKTXT,
l_GSBER like bseg-GSBER,
qsskz like bseg-qsskz, "With Holding Tax
END OF wa_ven_inv.
data: begin of wa_bkpf,
l_belnr like bkpf-belnr,
l_budat like bkpf-budat,
l_bldat like bkpf-bldat,
l_xblnr like bkpf-xblnr,
l_hkont like bseg-hkont,
l_sgtxt like bseg-sgtxt,
l_wrbtr like bseg-wrbtr,
l_dmbtr like bseg-dmbtr,
l_lifnr like bseg-lifnr,
l_matnr like bseg-matnr,
l_MENGE like bseg-MENGE,
l_pswsl like bseg-pswsl,
l_shkzg like bseg-shkzg,
l_bschl like bseg-bschl,
l_buzid like bseg-buzid,
l_vbel2 like bseg-vbel2,
l_MEINS like bseg-MEINS,
l_tmpcountryc like LFA1-LAND1,
l_tmpregc like LFA1-REGIO,
l_tmpcountry like T005T-LANDX50,
l_tmpreg like T005U-BEZEI,
l_tmpunitmea like rseg-BSTME,
l_BKTXT like bkpf-BKTXT,
l_GSBER like bseg-GSBER,
qsskz like bseg-qsskz, "With Holding Tax
tmpsisn like bseg-SHKZG,
tmpsisn1 like bseg-SHKZG,
postkey like bseg-bschl,
docdate(10) type c,
end of wa_bkpf.
data : gd_awkey type awkey,
gltxt type skat-txt50,
vetxt type lfa1-name1,
t_kalsk like lfm1-kalsk,
t_KALSB like tmkkt-kalsb,
podat(10),
glpdt(10),
glddt(10),
accno(15),
accyr(4),
tmpGlNum(15),
docvl type p decimals 2,
venam like bseg-lifnr,
gltot(15) type p decimals 2,
tebeln like bseg-ebeln,
tebelp like bseg-ebelp,
tgjahr like bseg-gjahr,
tbelnr like bkpf-belnr,
invnum like rbkp-belnr,
CSTNO like J_1IMOVEND-J_1ICSTNO,
LSTNO LIKE J_1IMOVEND-J_1ILSTNO,
HDMBTR like bseg-DMBTR,
balDMBTR like bseg-dmbtr,
peramt type p decimals 2,
Pamt type p decimals 2,
MENGE type bseg-MENGE,
MEINS type bseg-MEINS,
TMENGE type bseg-MENGE,
count(5),
VatPer type p decimals 2,
tempPer type p decimals 2,
perval type p decimals 2,
vatamt type p decimals 2,
ttlval type p decimals 2,
tmpsisn like bseg-SHKZG,
tmpsisn1 like bseg-SHKZG,
linevalue type p decimals 2.
DATA: it_sortcat TYPE slis_sortinfo_alv OCCURS 1,
wa_sort LIKE LINE OF it_sortcat.
data: it_bkpf like bkpf occurs 0 with header line,
it_bseg like bseg occurs 0 with header line,
it_rbkp like rbkp occurs 0 with header line.
DATA: in_bkpf like wa_bkpf occurs 0 with header line,
it_ven_inv LIKE wa_ven_inv OCCURS 0 WITH HEADER LINE,
finaltbl LIKE FinnalTbl OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN : BEGIN OF BLOCK B WITH FRAME TITLE text-002.
parameters : ekorg like LFM1-ekorg obligatory,
GJAHR like BKPF-GJAHR obligatory.
select-options : Dtype for RBKP-BLART.
SELECTION-SCREEN : END OF BLOCK B.
selection-screen : begin of block D with frame title text-004.
parameters : glnum like skat-saknr obligatory.
select-options : gldat for BKPF-budat,
dodat for BKPF-BLDAT.
selection-screen : end of block D.
tmpGlNum = glnum.
START-OF-SELECTION.
tmpglnum = tmpglnum+4(6).
count = 0.
Main Loop (Header Table) - ForGet Account Doc No
select belnr budat bldat xblnr BKTXT from bkpf
into (in_bkpf-l_belnr, in_bkpf-l_budat, in_bkpf-l_bldat,
in_bkpf-l_xblnr,in_bkpf-l_BKTXT)
where blart in dtype and bukrs eq 'NCCP'
and budat in gldat and BLDAT in dodat and
gjahr eq GJAHR order by belnr.
clear: vatamt, linevalue, in_bkpf-l_dmbtr, Finaltbl-BilValue,
finaltbl-holdtax, in_bkpf-l_lifnr.
Sub Loop - for get Values in Item Table
bschl is posting key
31 - for get bill value - RE & KR Regular entry
21 - for get bill value - RE Reverse entry
22 - for get bill value - KA (this KA is reversed entry key for KR.)
select GJAHR hkont menge dmbtr BUZID shkzg qsskz from bseg
into (tgjAHR, in_bkpf-l_hkont, in_bkpf-l_menge,
in_bkpf-l_dmbtr, in_bkpf-l_BUZID,
in_bkpf-l_shkzg, in_bkpf-qsskz)
where belnr = in_bkpf-l_belnr and
bukrs eq 'NCCP' and gjahr eq gjahr and
qsskz eq space and
( bschl ne '31' and bschl ne '21' and bschl ne '22' ).
for give negative symbol
if in_bkpf-l_shkzg = 'S'.
it_ven_inv-l_dmbtr = in_bkpf-l_dmbtr.
endif.
if in_bkpf-l_shkzg = 'H'.
it_ven_inv-l_dmbtr = - in_bkpf-l_dmbtr.
endif.
*for convert GL Account number in 6 charcter
in_bkpf-l_hkont = in_bkpf-l_hkont+4(6).
for get VAT & Line Value
if in_bkpf-l_hkont = tmpglnum.
vatamt = vatamt + it_ven_inv-l_dmbtr.
elseif in_bkpf-l_hkont ne tmpglnum.
linevalue = linevalue + it_ven_inv-l_dmbtr.
endif.
*for get withholding tax amount
*Sub Loop1A - For get Bill total value + withholding tax value
select dmbtr SHKZG from bseg into
(finaltbl-holdtax, in_bkpf-tmpsisn)
where belnr = in_bkpf-l_belnr and
bukrs eq 'NCCP' and gjahr eq gjahr and
qsskz ne space and
( bschl ne '31' or bschl ne '21' or bschl ne '22' ).
for give negative symbol to withholding tax Value
for display bill value in positive value here sigh changed
if in_bkpf-tmpsisn = 'S'.
Finaltbl-holdtax = - Finaltbl-holdtax .
endif.
if in_bkpf-tmpsisn = 'H'.
Finaltbl-holdtax = Finaltbl-holdtax .
endif.
endselect.
*sub Loop1A Ended
endselect.
*Sub Loop Ended
Sub Loop1 - For get Vendor Code
clear in_bkpf-postkey .
clear in_bkpf-l_lifnr.
select bschl from bseg into in_bkpf-postkey
where belnr = in_bkpf-l_belnr and bukrs eq 'NCCP'
and gjahr eq gjahr .
if in_bkpf-postkey = '31'.
select lifnr into in_bkpf-l_lifnr from bseg where
bschl = '31' and belnr = in_bkpf-l_belnr .
endselect.
endif.
if in_bkpf-postkey = '21'.
select lifnr into in_bkpf-l_lifnr from bseg where
bschl = '21' and belnr = in_bkpf-l_belnr .
endselect.
endif.
if in_bkpf-postkey = '22'.
select lifnr into in_bkpf-l_lifnr from bseg where
bschl = '22' and belnr = in_bkpf-l_belnr .
endselect.
endif.
endselect.
select lifnr into in_bkpf-l_lifnr from bseg where
( bschl = '31' or bschl = '21' or bschl = '22' )
and belnr = in_bkpf-l_belnr .
*Sub Loop2 - for select vendor details
if in_bkpf-l_lifnr ne space.
select regio stceg land1 NAME1 ORT01 STRAS into
(FinalTbl-regio, FinalTbl-stceg, FinalTbl-land1,
FinalTbl-name1, FinalTbl-ORT01, FinalTbl-STRAS)
from lfa1 where lifnr = in_bkpf-l_lifnr.
for get VAT percentage, VAT and Line Value Total
if vatamt ne 0 and linevalue ne 0 .
perval = vatamt / linevalue * 100.
ttlval = vatamt + linevalue.
endif .
*assign VAT Percentage 4 & 12.5 to check 100% value for VAT.
if perval >= 2 and perval <= 6.
tempPer = 4.
endif .
if perval >= 10 and perval <= 14 .
tempPer = 125 / 10.
endif .
if vatamt ne 0 and tempPer ne 0.
vatper = vatamt * ( 100 / tempPer ).
endif.
endselect.
endif.
Sub Loop2 Ended
endselect.
*Sub Loop1 Ended
*Sub Loop3 - For get Bill Value -
select dmbtr ZUONR SHKZG from bseg into
(Finaltbl-BilValue, Finaltbl-ZUONR, in_bkpf-tmpsisn1)
where belnr = in_bkpf-l_belnr and bukrs eq 'NCCP'
and gjahr eq gjahr and
( bschl = '31' or bschl = '21' or bschl = '22' ).
for assign negative symbol to Bill Value
for display bill value in positive value here sigh changed
if in_bkpf-tmpsisn1 = 'S'.
Finaltbl-BilValue = - Finaltbl-BilValue .
endif.
if in_bkpf-tmpsisn1 = 'H'.
Finaltbl-BilValue = Finaltbl-BilValue .
endif.
endselect.
*sub Loop3 Ended
Finaltbl-BilValue = Finaltbl-BilValue + Finaltbl-holdtax.
concatenate in_bkpf-l_bldat+6(2) '/'
in_bkpf-l_bldat+4(2) '/'
in_bkpf-l_bldat(4) into wa_bkpf-docdate.
*Move To Temp Table
if vatamt ne 0. " for avoid 0 values
count = count + 1.
FinalTbl-count = count.
FinalTbl-belnr = in_bkpf-l_belnr.
FinalTbl-bldat = in_bkpf-l_bldat.
FinalTbl-bldat = wa_bkpf-docdate.
FinalTbl-vatamt = vatamt.
FinalTbl-linevalue = linevalue.
FinalTbl-perval = perval.
FinalTbl-ttlval = ttlval.
FinalTbl-lifnr = in_bkpf-l_lifnr.
FinalTbl-regio = FinalTbl-regio.
FinalTbl-stceg = FinalTbl-stceg.
FinalTbl-land1 = FinalTbl-land1.
FinalTbl-name1 = FinalTbl-name1.
finaltbl-tgjAHR = tgjAHR.
FinalTbl-ORT01 = FinalTbl-ORT01.
FinalTbl-STRAS = FinalTbl-STRAS.
FinalTbl-xblnr = in_bkpf-l_xblnr.
FinalTbl-BKTXT = in_bkpf-l_BKTXT.
Finaltbl-BilValue = Finaltbl-BilValue.
Finaltbl-vatper = vatper.
Finaltbl-ZUONR = Finaltbl-ZUONR.
append finalTbl.
endif.
clear in_bkpf-l_lifnr.
clear FinalTbl-name1.
clear FinalTbl-STRAS.
clear: Finaltbl-BilValue.
endselect.
*Main Loop Ended
*coding for ALV
PERFORM build_sortcat.
PERFORM build_catalog.
PERFORM build_layout.
PERFORM disply.
*& Form TOP_OF_PAGE
LOGO
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = SLIS_EV_TOP_OF_PAGE.
ENDFORM.
*& Form Display_Header
text
FORM disply.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = gd_repid
CHANGING
ct_fieldcat = ct_catalog[]
EXCEPTIONS
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = it_sortcat[]
i_save = 'X'
TABLES
t_outtab = FinalTbl
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "disply
*& Form build_layout
text
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
ENDFORM. "build_layout
*& Form Build_catalog
text
FORM build_catalog.
fieldcatalog-col_pos = 1.
fieldcatalog-fieldname = 'COUNT'.
fieldcatalog-seltext_m = 'S.No'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'LIFNR'.
fieldcatalog-seltext_m = 'Vendor Code'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NAME1'.
fieldcatalog-seltext_m = 'Vendor Name'.
fieldcatalog-seltext_m = 'Vendor'.
lfa1
fieldcatalog-ref_fieldname = 'LFA1~NAME1'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STRAS'.
fieldcatalog-seltext_m = 'Address'.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ORT01'.
fieldcatalog-seltext_m = 'Place'.
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'REGIO'.
fieldcatalog-seltext_m = 'State'.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STCEG'.
fieldcatalog-seltext_m = 'Tin No'.
fieldcatalog-col_pos = 7.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'LAND1'.
fieldcatalog-seltext_m = 'Country'.
fieldcatalog-col_pos = 8.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BELNR'.
fieldcatalog-seltext_m = 'Doc Acc No'.
fieldcatalog-col_pos = 9.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BLDAT'.
fieldcatalog-seltext_m = 'Doc Date'.
fieldcatalog-col_pos = 10.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'XBLNR'.
fieldcatalog-seltext_m = 'Doc Ref No'.
fieldcatalog-col_pos = 11.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BKTXT'.
fieldcatalog-seltext_m = 'Material'.
fieldcatalog-col_pos = 12.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ZUONR'.
fieldcatalog-seltext_m = 'Quantity/Uom'.
fieldcatalog-col_pos = 13.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VATAMT'.
fieldcatalog-seltext_m = 'VAT'.
fieldcatalog-col_pos = 14.
fieldcatalog-do_sum = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'LINEVALUE'.
fieldcatalog-seltext_m = 'Value'.
fieldcatalog-col_pos = 15.
fieldcatalog-do_sum = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PERVAL'.
fieldcatalog-seltext_m = '%'.
fieldcatalog-col_pos = 16.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'TTLVAL'.
fieldcatalog-seltext_m = 'Total Value'.
fieldcatalog-col_pos = 17.
fieldcatalog-do_sum = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BILVALUE'.
fieldcatalog-seltext_m = 'Bill Value'.
fieldcatalog-col_pos = 18.
fieldcatalog-do_sum = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VATPER'.
fieldcatalog-seltext_m = '100% Value'.
fieldcatalog-col_pos = 19.
fieldcatalog-do_sum = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. "Build_catalog
*& Form build_sortcat
text
FORM build_sortcat .
ENDFORM. " build_sortcat
*& Form USER_COMMAND
text
-->GUCOMM text
-->G_SELFIELD text
FORM user_command USING
gucomm TYPE sy-ucomm g_selfield TYPE slis_selfield.
READ TABLE FinalTbl INTO FinalTbl INDEX
g_selfield-tabindex.
case g_selfield-fieldname.
when 'BELNR'.
SET PARAMETER ID 'BLN' FIELD FinalTbl-belnr.
SET PARAMETER ID 'BUK' FIELD 'NCCP'.
SET PARAMETER ID 'GJR' FIELD FinalTbl-tGJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. "USER_COMMAND -
Problem in ALV set filter option
Hi to all
I have an issue regarding ALV report :
I have developed an ALV report and it is showing report output correctly as required.
when I further filter it on a particular field using SET FILTER OPTION , the length of the field is shorter than displayed.
Why this happens so.
BUT for the same field in a standard ALV report , it shows the same length as displayed in report.
Please advice. As this is the standard ALV functionality.
Thanks & Regards
Anubhav guptaHi Gupta,
<li>Define layout structure
data: wa_layout TYPE slis_layout_alv.
<li>Pass value like below
wa_layout-colwidth_optimize = 'X'.
<li>Pass this structure through fm
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = program
it_fieldcat = it_fieldcat
is_layout = wa_layout
it_events = it_events
TABLES
t_outtab = i_mard.
Thanks
Venkat.O -
ALV Filter : Not working for a text field - Strange problem
Dear All,
I have a Z-program where the ALV filter is not working on a particular text field.
The output on that text field is as below :
ABCD
JKLM
YYZZ
ABCD
JKLM
ABCD
JKLM
YYZZ
YYZZ
When we try to filter on YYZZ, it gives blank list. But for other options given abobe it works fine.
I know it is because of the negative sign , but how can we over come this problem ?
Thanks in advance,
Sandip.Hi Sandip,
Use 'LOWERCASE' in the fieldcatalog.
For the particular text field when you are appending the Fieldcatalog structure to the Fieldcatalog Table
( Suppose LS_FIELDCAT)
Then check the LOWERCASE field.
(LS_FIELDCAT-LOWERCASE = 'X' )
This will serve the purpose.
Regards,
Sourav -
Filter option is not working in Reuse alv grid
Hi all,
Filter option is not working in alv grid properly.
if i choose one particular field for filter option .it is working .but another field it is not working though it contains different values.please give the answer.whether i have to pass filter option throuogh reuse_alv _grid or not.thanks in advance
rajHi raja,
1. The search/filter is
CASE SENSITIVE
2. U can give *
to search for pattern.
(IN THAT CASE, it is NOT Case Sensitive)
regards,
amit m. -
How to hide Print and Filter option from dynamic ALV
Hi,
I have created the dynamic ALV. now User don't wan't Filter , export,print Option on the ALV dispaly.
Could you please tell me How to hide Print and Filter option from dynamic ALV.
Thanks and regards
Amita.Hi,
Please go through the following link to get an better idea on ALV.
[https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9&overridelayout=true]
This is the code which you have to write in WDDOINIT
DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV_TEST( ).
IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LO_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV_TEST( ).
DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_EXPORT_ALLOWED( abap_false ).
lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_PDF_ALLOWED( abap_false ).
lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( abap_false ). -
Filtering is not working at standared Alv layout as filter option . Is there is any coding for this issue.
This is actually standared button but not working .please answer to this issue.Hello Vasudeva,
I don't think there's any special coding to make the filter appear. In fact, you have write code if you <b>don't</b> want it to appear.
Please check your code to see if you have excluded it by mistake.
Regards,
Anand Mandalika. -
Hi Friends,
I have the following 2 problems in ALV report
1) Logo is not getting displayed in the report.
2) When i click on the Purchase order number in the report the interactive report is not working,i am not able to see report of First interactive level.
can you help it out friends.
Thanks and regards
Dinesh
REPORT YSDBALV1
tables: ekko , ekpo .
type-pools: slis .
Table for Display Header
data:i_header type slis_t_listheader with header line.
*Fieldcat Declaration
data:fieldcatalog type slis_T_fieldcat_alv WITH HEADER LINE.
*Table of Events
data:i_event type slis_t_event with header line .
For Layout
data:i_layout type slis_layout_alv .
data: text(30) .
*Internal Table Declaration
data: begin of it_final occurs 0 ,
ebeln like ekko-ebeln , "Purchasing Document No.
bedat like ekko-bedat , "Purchasing Document Date
matnr like ekpo-matnr , "Material No.
netwr like ekpo-netwr , "Net Order Value in PO Currancy
meins like ekpo-meins , "UOM
chk(1) ,
light(1) ,
change like ekpo-menge ,
end of it_final .
**select option Declaration
selection-screen begin of block block.
select-options: s_ebeln for ekko-ebeln .
selection-screen end of block block .
selection-screen begin of block block1 .
parameters:grid radiobutton group r .
parameters:list radiobutton group r .
selection-screen end of block block1 .
at selection screen
at selection-screen .
select single * from ekko where ebeln in s_ebeln .
if sy-subrc <> 0 .
message e000(8I) WITH 'No Data Exists' .
endif .
start-of-selection .
if grid = 'X' .
perform get_data .
perform event using i_event[] .
perform field using fieldcatalog[] .
perform layout using i_layout .
perform grid_display .
endif .
*& Form get_data
text
--> p1 text
<-- p2 text
form get_data .
*DATA Retrieval from tables
SELECT EKKO~EBELN
EKKO~BEDAT
EKPO~EBELP
EKPO~MATNR
EKPO~NETWR
EKPO~MEINS
EKPO~MENGE
EKPO~BPRME
INTO CORRESPONDING FIELDS OF table IT_FINAL
FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
WHERE EKKO~EBELN IN S_EBELN.
APPEND IT_FINAL.
endform. " get_data
*Getting the Event for Top of Page display.
*& Form event
text
-->P_I_event[] text
form event using p_i_event type slis_t_event.
clear p_i_event .
refresh p_i_event .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = p_i_event
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
read table p_i_event with key name = slis_ev_top_of_page into i_event.
if sy-subrc = 0.
move 'TOP_OF_PAGE_PO' to i_event-form.
modify p_i_event from i_event index sy-tabix transporting form.
endif.
clear i_event.
endform. " event
*Display Top-of Page Details and Logo
form top_of_page_po .
clear i_header .
refresh i_header .
write sy-datum to text.
i_header-typ = 'H'.
i_header-info = 'PURCHASE OREDER DETAILS'.
append i_header.
*Logo Display
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_header[]
I_LOGO = 'ENJOYSAPLOGO'.
endform .
*Field Catalog Append
*& Form field
text
-->P_fieldCATALOG[] text
form field using p_fieldcatalog type slis_t_fieldcat_alv.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order No'.
fieldcatalog-col_pos = 1.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'BEDAT'.
fieldcatalog-seltext_m = 'PO Date'.
fieldcatalog-col_pos = 2.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material No'.
fieldcatalog-col_pos = 4.
fieldcatalog-outputlen = 20.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'NETWR'.
fieldcatalog-seltext_m = 'Net Value '.
fieldcatalog-col_pos = 5.
fieldcatalog-outputlen = 20.
fieldcatalog-do_sum = 'X'.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Units'.
fieldcatalog-col_pos = 6.
fieldcatalog-outputlen = 4.
append fieldcatalog .
clear fieldcatalog.
endform. " field
*& Form layout
text
form layout using p_i_layout TYPE SLIS_LAYOUT_ALV .
i_layout-zebra = 'X'.
i_layout-lights_fieldname = 'LIGHT'.
i_layout-lights_tabname = 'IT_FINAL'.
i_layout-box_fieldname = 'CHK'.
i_layout-box_tabname = 'IT_FINAL'.
i_layout-edit = ' '.
endform.
*To display Buttons in the MENU BAR if needed
FORM SET_PO_PF_STATUS USING P_I_EXTAB TYPE
SLIS_T_EXTAB.
SET PF-STATUS 'MENUPO'.
ENDFORM.
*Event for Interactive display of ALV report
form USER_COMMAND using r_ucomm like sy-ucomm
rs_selfield type slis_selfield .
if r_ucomm = '&IC1'.
READ TABLE IT_FINAL index rs_selfield-tabindex.
write:/ IT_FINAL-ebeln.
endif.
endform .
*Parameters of FM REUSE_ALV_GRID_DISPLAY
*& Form grid_display
text
--> p1 text
<-- p2 text
form grid_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PO_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
IT_EVENTS = I_EVENT[]
TABLES
t_outtab = IT_FINAL.
endform. " grid_display*& Report YSDBALV1
REPORT YSDBALV1.
tables: ekko , ekpo .
type-pools: slis .
Table for Display Header
data:i_header type slis_t_listheader with header line.
*Fieldcat Declaration
data:fieldcatalog type slis_T_fieldcat_alv WITH HEADER LINE.
*Table of Events
data:i_event type slis_t_event with header line ,
wa_event type line of slis_t_event.
For Layout
data:i_layout type slis_layout_alv .
data: text(30) .
*Internal Table Declaration
data: begin of it_final occurs 0 ,
ebeln like ekko-ebeln , "Purchasing Document No.
bedat like ekko-bedat , "Purchasing Document Date
matnr like ekpo-matnr , "Material No.
netwr like ekpo-netwr , "Net Order Value in PO Currancy
meins like ekpo-meins , "UOM
chk(1) ,
light(1) ,
change like ekpo-menge ,
end of it_final .
**select option Declaration
selection-screen begin of block block.
select-options: s_ebeln for ekko-ebeln .
selection-screen end of block block .
selection-screen begin of block block1 .
parameters:grid radiobutton group r .
parameters:list radiobutton group r .
selection-screen end of block block1 .
at selection screen
at selection-screen .
select single * from ekko where ebeln in s_ebeln .
if sy-subrc <> 0 .
message e000(8I) WITH 'No Data Exists' .
endif .
start-of-selection .
if grid = 'X' .
perform get_data .
perform event using i_event[] .
perform field using fieldcatalog[] .
perform layout using i_layout .
perform grid_display .
endif .
*& Form get_data
text
--> p1 text
<-- p2 text
form get_data .
*DATA Retrieval from tables
SELECT EKKO~EBELN
EKKO~BEDAT
EKPO~EBELP
EKPO~MATNR
EKPO~NETWR
EKPO~MEINS
EKPO~MENGE
EKPO~BPRME
INTO CORRESPONDING FIELDS OF table IT_FINAL
FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
WHERE EKKO~EBELN IN S_EBELN.
APPEND IT_FINAL.
endform. " get_data
*Getting the Event for Top of Page display.
*& Form event
text
-->P_I_event[] text
form event using p_i_event type slis_t_event.
clear p_i_event .
refresh p_i_event .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = p_i_event.
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
read table p_i_event with key name = slis_ev_top_of_page into wa_event.
if sy-subrc = 0.
move 'TOP_OF_PAGE_PO' to i_event-form.
modify p_i_event from i_event index sy-tabix transporting form.
endif.
clear i_event.
endform. " event
*Display Top-of Page Details and Logo
form top_of_page_po .
clear i_header .
refresh i_header .
write sy-datum to text.
i_header-typ = 'H'.
i_header-info = 'PURCHASE OREDER DETAILS'.
append i_header.
*Logo Display
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_header[]
I_LOGO = 'ENJOYSAP_LOGO'.
endform .
*Field Catalog Append
*& Form field
text
-->P_fieldCATALOG[] text
form field using p_fieldcatalog type slis_t_fieldcat_alv.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order No'.
fieldcatalog-col_pos = 1.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'BEDAT'.
fieldcatalog-seltext_m = 'PO Date'.
fieldcatalog-col_pos = 2.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material No'.
fieldcatalog-col_pos = 4.
fieldcatalog-outputlen = 20.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'NETWR'.
fieldcatalog-seltext_m = 'Net Value '.
fieldcatalog-col_pos = 5.
fieldcatalog-outputlen = 20.
fieldcatalog-do_sum = 'X'.
append fieldcatalog .
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Units'.
fieldcatalog-col_pos = 6.
fieldcatalog-outputlen = 4.
append fieldcatalog .
clear fieldcatalog.
endform. " field
*& Form layout
text
form layout using p_i_layout TYPE SLIS_LAYOUT_ALV .
i_layout-zebra = 'X'.
i_layout-lights_fieldname = 'LIGHT'.
i_layout-lights_tabname = 'IT_FINAL'.
i_layout-box_fieldname = 'CHK'.
i_layout-box_tabname = 'IT_FINAL'.
i_layout-edit = ' '.
endform.
*To display Buttons in the MENU BAR if needed
FORM SET_PO_PF_STATUS USING P_I_EXTAB TYPE
SLIS_T_EXTAB.
SET PF-STATUS 'MENUPO'.
ENDFORM.
*Event for Interactive display of ALV report
form USER_COMMAND using r_ucomm like sy-ucomm
rs_selfield type slis_selfield .
if r_ucomm = '&IC1'.
READ TABLE IT_FINAL index rs_selfield-tabindex.
set parameter id 'VL1' field it_final-ebeln.
call transaction 'ME23N'.
endif.
endform .
*Parameters of FM REUSE_ALV_GRID_DISPLAY
*& Form grid_display
text
--> p1 text
<-- p2 text
form grid_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PO_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
IT_EVENTS = I_EVENT[]
TABLES
t_outtab = IT_FINAL.
endform. " grid_display
Regards,
Rusidar S. -
Filter Option in Table Control
Hi Folks ,
I am working on a table control , i need to add Filter functionality same as of ALV filter
i tried with suggestion given on SCN
Following is the code that i tried, but its not working, no popup with FM LVC_FILTER_DIALOG
please help me with sum more suggestion or sample code
DATA : cp_vbak LIKE it_vbak OCCURS 0.
DATA : it_fieldcat1 TYPE lvc_t_fcat,
wa_fieldcat LIKE line of it_fieldcat1,
it_group1 like lvc_s_sgrp occurs 0,
ls_group LIKE lvc_s_sgrp,
filter_ranges TYPE lvc_t_filt.
DATA: counter TYPE i.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'VKORG'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'VTWEG'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'SPART'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
ls_group-SP_GROUP = '0001'.
ls_group-TEXT = 'VBELN'.
append ls_group to it_group1.
clear ls_group.
ls_group-SP_GROUP = '0002'.
ls_group-TEXT = 'VKORG'.
append ls_group to it_group1.
cp_vbak[] = it_vbak[].
CALL FUNCTION 'LVC_FILTER_DIALOG'
EXPORTING
it_fieldcat = it_fieldcat1
it_groups = it_group1
* IS_FILT_LAYOUT =
* I_NO_DIALOG =
* IT_EXCEPT_QINFO =
tables
it_data = it_vbak
CHANGING
ct_filter_lvc = filter_ranges
* EXCEPTIONS
* NO_CHANGE = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Need to code more for Filter the internal tableHi Pihu,
I am also trying to implement the filter functionality in a Table Conntriol.
I have used following two function modules to handle the filter option.
1. CEP_DOUBLE_ALV: You will get the pop up to select you filtering fields.
2. LVC_FILTER_DIALOG: Second pop up to select the filtering data for the fields selected.
But the second FM is giving an error 'filter internal error : 15'
If u have already implemented this functionality, can u give me the sample code.
Thanks in advance,
Sai -
Filter Option missing on the input screen
Hi Experts,
one of the user of the report is missing a filter option in the input screen, but when i try to execute the same query with other users it comes up with the missing filter parameter.what could be the problem??
Thanks in advace.Hi Shetty,
Do you mean that the user is missing a variable for entry. This could be due to the fact that he has personalized that variable. Run the report and then goto Change > Variable values (from the change button, do not use the Refresh button). Here you can delete the personalization and he can then get the variable for input.
Hope this helps... -
Problems about query filter (BEx).
Hello there,
I have some problems about query filter (BEx).
I have master data and I want to use attribute in this master data to dynamic filter in query(BEx).
But this attribute is key figure. I can't done it now. TT
Is this possible? If yes, could anyone advise how this is to be done?
Thanks in advance.Hi
In BEx there is option as 'Exceptions' & 'Conditions'. If you go in condition, you can specify range for key figure output. This is either predefined or by user selection. You create the condition as per your requirement & it will show you filtered data.
How to create conditions you will find easily on this site.
You can create as many conditions as no of filters you want. You can create these at query level also at report output level. -
Hi All,
In web dynpro ALV we have one column called Article . I am trying to find the article 661-2689 by using Standard SAP filter option but the Article is getting converted to 000000000000000661-000000000000002689 . This zero appending happens when I choose the Filter/ Press enter key . It does not find the article by using Filter option .
Our system version is SAP_BASIS 700 . Please let me know if there is any solution to this ALV Filter issue .
Thanks in advance,
Kiran.Hi Kiran,
It depends on the attribute's data element. If it's NUMC this property is automatically displayed in the context in the bottom panel labeled "Formatting".
But if you are trying to do it whit Article i think the data element is MATNR of type CHAR, so this property will not be displayed.
May be, you need to convert the value assigned to your filter field before to trigger the filter. I think you have created an action for the event "onFilter" in your table, so in this action before to do "wd_this->table_filter->apply_filter( )" maybe you need to use the FM CONVERSION_EXIT_ALPHA_OUTPUT in order to quit the leading zeros.
Maybe you are looking for
-
My itunes account won't let me download any apps because it says my account hasn't been set up with itunes. When I sign in and go through the payment set up it still won't let me download any apps and puts me through the same process all over again.
-
My ipad 2 no longer recognizes my apple sd card reader
Can anyone tell me why my apple SD card reader stopped working?
-
TC Extremely slow when copying files from an external HDD
I have a new TC, everything works well. Now I am trying to copy my iTunes library from an external HDD that is hooked on the USB of the TC. The directory is well over 300GB, the estimated time of completion is 70+ hours, that can be?! Last week I cop
-
I trashed my system folder accidentally, when I took some loose folders that end up in my hardrive to the trash. When I attempted to rescue the "system" folder out of the trash, the folder started to copy to the desktop but never finalize. I realize
-
Adobe Photoshop Elements 7 auf Windows 8.1, geht das?
Wie kann das Programm vom alten auf den neuen PC übertragen werden?