08-20-2007 3:16 PM
Hi
Can anyone tell how to insert checkboxes in to ALV and based on the checkboxes selected i want to display the data.
I have tried like this, but it is giving a dump as Field Symbol is not yet been assigned.
Data: c1(1).
wa_layout-box_fieldname = 'C1'.
wa_layout-box_tabname = 'INTTAB'.
Regards
Haritha.
08-20-2007 3:25 PM
Hi Sudheer,
I am not using OOALV. Do u have any ex program on how to insert checkboxes with out using OOPS concept.
Regards
Haritha.
08-20-2007 3:19 PM
hi
u declare the chk box in an internal table as first field
and then give that internal table name in
wa_layout-box_tabname = '<itab name>'
when ever u select the chk boxes on list the internal table containing the chkbox gets automatically populated.
so u can directly check the internal table and acess the data
like
if itab-chk = 'X'.
<logic of urs>
endif.
Message was edited by:
Premalatha G
08-20-2007 3:20 PM
Hi,
We have a good example provided by SAP, please have a look at BCALV_EDIT_05
Regards
Sudheer
08-20-2007 3:21 PM
Hi
I have done that, but forgot to mention in the question. I have declared it like this.
Data: Begin of inttab occurs 0,
c1(1),
End of inttab.
Regards
Haritha.
08-20-2007 3:25 PM
Hi Sudheer,
I am not using OOALV. Do u have any ex program on how to insert checkboxes with out using OOPS concept.
Regards
Haritha.
08-20-2007 3:27 PM
report zpl_om_assignment3.
type-pools : slis.
&----
Table Declarations
&----
tables : kona,
ebox,
kote008,
kote007,
kote006,
ekbo,
ekbe.
&----
DATA DECLARATIONS ---- INTERNAL TABLES
&----
data : begin of it_ebox occurs 0,
knumh like ebox-knumh,
vbeln like ebox-vbeln,
end of it_ebox.
data : begin of it_kona occurs 0,
knuma like kona-knuma,
boart like kona-boart,
bonem like kona-bonem,
bolif like kona-bolif,
datab like kona-datab,
datbi like kona-datbi,
kobog like kona-kobog,
botext like kona-botext,
bukrs like kona-bukrs,
ekorg like kona-ekorg,
ekgrp like kona-ekgrp,
end of it_kona.
data : begin of it_kote occurs 0,
kappl like kote008-kappl,
kschl like kote008-kschl,
ekorg like kote008-ekorg,
lifnr like kote008-lifnr,
datbi like kote008-datbi,
knuma like kote008-knuma,
datab like kote008-datab,
knumh like kote008-knumh,
end of it_kote.
data : begin of it_final occurs 0,
box type c,
knuma like kona-knuma, "Arrangement
boart like kona-boart, "Arrangement type
datab like kona-datab, "Validity data from
datbi like kona-datbi, "date to
knumh like kote008-knumh, "Condition Record
kobog like kona-kobog, "Condition type
botext like kona-botext, "Agreement desc
bonem like kona-bonem, "Rebate recipient
lifnr like kote008-lifnr, "Vendor number
name1 like lfa1-lifnr, "Vendor Name
ekorg like kote008-ekorg, "purchase organization
ebeln like ekbe-ebeln, "PO number
aedat like ekko-aedat, "PO Date
ebelp like ekbe-ebelp, "PO line item
matnr like ekbe-matnr, "MaterialNumber
werks like ekbe-werks, "Site Number
maktx like makt-maktx, "Material desc
matkl like mara-matkl, "Merchandise Category
menge like ekpo-menge, "Quantity
meins like ekpo-meins, "Unit of measure
gjahr like ekbe-gjahr, "Invoice Doc. Year
bldat like rbkp-bldat, "Invoice date
cpudt like ekbe-cpudt, "Inv. Update Date
belnr like ekbe-belnr, "Invoice Number
xblnr like rbkp-xblnr, "Reference
buzei like ekbe-buzei, "Invoice Line Item
dmbtr like ekbe-dmbtr, "Dollar Amount
shkzg like ekbe-shkzg, "Debit/Credit ind
bukrs like kona-bukrs, "Company code
end of it_final.
data : begin of it_ekbo occurs 0,
ebeln like ekbo-ebeln,
ebelp like ekbe-ebelp,
knumh like ekbo-knumh,
kopos like ekbo-kopos,
budat like ekbo-budat,
belnr like ekbo-belnr,
buzei like ekbo-buzei,
lifnr like ekbo-lifnr,
matnr like ekbo-matnr,
bltypn like ekbo-bltypn,
bltypf like ekbo-bltypf,
etenr like ekbo-etenr,
zekkn like ekbo-zekkn,
vgabe like ekbo-vgabe,
gjahr like ekbo-gjahr,
end of it_ekbo.
data : begin of it_ekbe occurs 0,
ebeln like ekbe-ebeln,
ebelp like ekbe-ebelp,
EBELP LIKE IT_EKBO-EBELP,
gjahr like ekbe-gjahr,
belnr like ekbe-belnr,
buzei like ekbe-buzei,
dmbtr like ekbe-dmbtr,
shkzg like ekbe-shkzg,
cpudt like ekbe-cpudt,
matnr like ekbe-matnr,
werks like ekbe-werks,
end of it_ekbe.
data : begin of it_lfa1 occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
end of it_lfa1.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
matkl like mara-matkl,
end of it_mara.
data : begin of it_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of it_makt.
data : begin of it_ekko occurs 0,
ebeln like ekko-ebeln,
aedat like ekko-aedat,
end of it_ekko.
data : begin of it_ekpo occurs 0,
ebeln like ekpo-ebeln,
menge like ekpo-menge,
meins like ekpo-meins,
end of it_ekpo.
data : begin of it_rbkp occurs 0,
belnr like rbkp-belnr,
bldat like rbkp-bldat,
xblnr like rbkp-xblnr,
end of it_rbkp.
data : begin of t_ekpo occurs 0,
mandt type mandt,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
aedat type ekpo-aedat,
menge type ekpo-menge,
meins type ekpo-meins,
end of t_ekpo.
data : it_fieldcat type slis_t_fieldcat_alv,
it_fieldcat_ekpo type slis_t_fieldcat_alv with header line,
it_events type slis_t_event,
wa_events like line of it_events,
v_ucomm like sy-ucomm,
v_selfield type slis_selfield,
v_value type slis_entry,
it_layout type slis_layout_alv,
it_layout_ekpo type slis_layout_alv,
it_sort type slis_t_sortinfo_alv ,
wa_sort type slis_sortinfo_alv,
it_extab type slis_t_extab.
data : begin of it_ebeln occurs 1,
ebeln type ekpo-ebeln,
end of it_ebeln.
&----
SELECTION-SCREEN ELEMENTS
&----
Block for rebate Arrangements
&----
selection-screen begin of block b1 with frame title text-001.
select-options : s_knuma for kona-knuma default '42',
s_boart for kona-boart,
s_bolif for kona-bolif.
selection-screen begin of line.
selection-screen comment (5) v_1 for field p_datab .
selection-screen position 33.
parameters : p_datab like kona-datab.
selection-screen position 52.
selection-screen comment (3) v_2 for field p_datbi .
selection-screen position 58.
parameters : p_datbi like kona-datbi.
selection-screen end of line.
selection-screen end of block b1.
&----
Block for Condition Records
&----
selection-screen begin of block b2 with frame title text-002.
selection-screen begin of line.
selection-screen comment (5) v_3 for field p_vfrom .
selection-screen position 33.
parameters : p_vfrom like kona-datab.
selection-screen position 52.
selection-screen comment (3) v_4 for field p_vto .
selection-screen position 58.
parameters : p_vto like kona-datbi.
selection-screen end of line.
selection-screen end of block b2.
&----
Block for Organizational data
&----
selection-screen begin of block b3 with frame title text-003.
select-options : s_ekorg for kona-ekorg,
s_ekgrp for kona-ekgrp.
selection-screen end of block b3.
parameters : p_dmemo as checkbox user-command chk,
p_vbeln like ebox-vbeln.
&----
INITIALIZATION
&----
initialization.
v_1 = v_3 = 'Validity Period' .
v_2 = v_4 = 'to' .
&----
AT SELECTION-SCREEN OUTPUT
&----
at selection-screen output.
loop at screen.
if p_dmemo = 'X'.
if screen-name = 'P_VBELN' and screen-group1 = 'CHK'.
screen-input = 'X'.
modify screen.
endif.
else.
if screen-name = 'P_VBELN'.
screen-input = ' '.
modify screen.
endif.
endif.
endloop.
&----
START-OF-SELECTION
&----
start-of-selection.
perform it_kona.
if p_dmemo = 'X'.
perform fetch_ebox.
endif.
perform it_kote.
perform it_ekbo.
perform it_ekbe.
perform it_lfa1.
perform it_mara.
perform it_makt.
perform it_ekko.
perform it_ekpo.
perform it_rbkp.
perform populate_final.
perform it_layout.
perform display.
perform get_events.
&----
*& Form FETCH_EBOX
&----
form fetch_ebox.
select knumh
lifnr
from ebox
INTO TABLE it_ebox
appending corresponding fields of
table it_kote
where vbeln eq p_vbeln.
endform. " FETCH_EBOX
&----
*& Form it_kona
&----
form it_kona .
if not p_datab is initial and not p_datbi is initial.
select knuma
boart
bonem
bolif
datab
datbi
kobog
botext
bukrs
ekorg
ekgrp
from kona into
table it_kona
where knuma in s_knuma and
boart in s_boart and
datab le p_datab and
datbi ge p_datbi and
bolif in s_bolif and
ekorg in s_ekorg and
ekgrp in s_ekgrp.
else.
select knuma
boart
bonem
bolif
datab
datbi
kobog
botext
bukrs
ekorg
ekgrp
from kona into
table it_kona
where knuma in s_knuma and
boart in s_boart and
bolif in s_bolif and
ekorg in s_ekorg and
ekgrp in s_ekgrp.
endif.
endform. " it_kona
&----
*& Form IT_KOTE
&----
form it_kote .
if not it_kona[] is initial.
if not p_vfrom is initial and p_vto is initial.
select kappl
kschl
ekorg
lifnr
datbi
knuma
datab
knumh
from kote008
into table it_kote
for all entries in it_kona
where knuma eq it_kona-knuma and
datab le p_vfrom and
datbi ge p_vto.
select kappl
kschl
ekorg
lifnr
datbi
knuma
datab
knumh
from kote007
appending table it_kote
for all entries in it_kona
where knuma eq it_kona-knuma and
datab le p_vfrom and
datbi ge p_vto.
select kappl
kschl
ekorg
lifnr
datbi
knuma
datab
knumh
from kote006
appending table it_kote
for all entries in it_kona
where knuma eq it_kona-knuma and
datab le p_vfrom and
datbi ge p_vto.
else.
select kappl
kschl
ekorg
lifnr
datbi
knuma
datab
knumh
from kote008
into table it_kote
for all entries in it_kona
where knuma eq it_kona-knuma.
select kappl
kschl
ekorg
lifnr
datbi
knuma
datab
knumh
from kote007
appending table it_kote
for all entries in it_kona
where knuma eq it_kona-knuma .
select kappl
kschl
ekorg
lifnr
datbi
knuma
datab
knumh
from kote006
appending table it_kote
for all entries in it_kona
where knuma eq it_kona-knuma.
endif.
endif.
endform. " IT_KOTE
&----
*& Form IT_EKBO
&----
form it_ekbo .
if not it_kote[] is initial.
select ebeln
ebelp
knumh
kopos
budat
belnr
buzei
lifnr
matnr
bltypn
bltypf
etenr
zekkn
vgabe
gjahr
from ekbo
into table it_ekbo
for all entries in it_kote
where knumh eq it_kote-knumh.
endif.
sort it_ekbo by ebeln ebelp.
delete adjacent duplicates from it_ekbo comparing ebeln ebelp.
endform. " IT_EKBO
&----
*& Form IT_EKBE
&----
form it_ekbe .
if not it_ekbo[] is initial.
select ebeln
ebelp
gjahr
belnr
buzei
dmbtr
shkzg
cpudt
matnr
werks
from ekbe into
table it_ekbe
for all entries in it_ekbo
where ebeln eq it_ekbo-ebeln
and ebelp eq it_ekbo-ebelp and
vgabe = '2'.
endif.
endform. " IT_EKBE
&----
*& Form it_lfa1
&----
form it_lfa1 .
if not it_kote[] is initial.
select lifnr
name1
from lfa1
into table it_lfa1
for all entries in it_kote
where lifnr eq it_kote-lifnr.
endif.
endform. " it_lfa1
&----
*& Form it_mara
&----
form it_mara .
if not it_ekbo[] is initial.
select matnr
matkl
from mara
into table it_mara
for all entries in it_ekbo
where matnr eq it_ekbo-matnr.
endif.
endform. " it_mara
&----
*& Form it_makt
&----
form it_makt .
if not it_mara[] is initial.
select matnr
maktx
from makt
into table it_makt
for all entries in it_mara
where matnr eq it_mara-matnr and
spras eq sy-langu.
endif.
endform. " it_makt
&----
*& Form it_ekko
&----
form it_ekko .
if not it_ekbo[] is initial.
select ebeln
aedat
from ekko
into table it_ekko
for all entries in it_ekbo
where ebeln eq it_ekbo-ebeln.
endif.
endform. " it_ekko
&----
*& Form it_ekpo
&----
form it_ekpo .
if not it_ekko[] is initial.
select ebeln
menge
meins
from ekpo
into table it_ekpo
for all entries in it_ekko
where ebeln eq it_ekko-ebeln.
endif.
endform. " it_ekpo
&----
*& Form populate_final
&----
form populate_final .
loop at it_kote.
it_final-knumh = it_kote-knumh.
it_final-lifnr = it_kote-lifnr.
it_final-ekorg = it_kote-ekorg.
read table it_kona with key knuma = it_kote-knuma.
it_final-knuma = it_kona-knuma.
it_final-boart = it_kona-boart.
it_final-datab = it_kona-datab.
it_final-datbi = it_kona-datbi.
it_final-kobog = it_kona-kobog.
it_final-botext = it_kona-botext.
it_final-bonem = it_kona-bonem.
it_final-bukrs = it_kona-bukrs.
read table it_ekbo with key knumh = it_kote-knumh.
it_final-ebeln = it_ekbo-ebeln.
it_final-ebelp = it_ekbo-ebelp.
read table it_ekbe with key ebeln = it_ekbo-ebeln
ebelp = it_ekbo-ebelp.
it_final-matnr = it_ekbe-matnr.
it_final-werks = it_ekbe-werks.
it_final-gjahr = it_ekbe-gjahr.
it_final-belnr = it_ekbe-belnr.
it_final-buzei = it_ekbe-buzei.
it_final-dmbtr = it_ekbe-dmbtr.
it_final-shkzg = it_ekbe-shkzg.
it_final-cpudt = it_ekbe-cpudt.
read table it_lfa1 with key lifnr = it_kote-lifnr.
it_final-lifnr = it_lfa1-lifnr.
read table it_mara with key matnr = it_ekbo-matnr.
it_final-matkl = it_mara-matkl.
read table it_makt with key matnr = it_mara-matnr.
it_final-maktx = it_makt-maktx.
read table it_ekko with key ebeln = it_ekbo-ebeln.
it_final-aedat = it_ekko-aedat.
read table it_ekpo with key ebeln = it_ekko-ebeln.
it_final-menge = it_ekpo-menge.
it_final-meins = it_ekpo-meins.
read table it_rbkp with key belnr = it_ekbo-belnr.
it_final-bldat = it_rbkp-bldat.
it_final-xblnr = it_rbkp-xblnr.
append it_final.
endloop.
endform. " populate_final
&----
*& Form it_rbkp
&----
form it_rbkp .
if not it_ekbo[] is initial.
select belnr
bldat
xblnr
from rbkp
into table it_rbkp
for all entries in it_ekbo
where belnr = it_ekbo-belnr.
endif.
endform. " it_rbkp
&----
*& Form DISPLAY
&----
form display .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-cprog
i_internal_tabname = 'IT_FINAL'
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = sy-cprog
I_BYPASSING_BUFFER = I_BYPASSING_BUFFER
I_BUFFER_ACTIVE = I_BUFFER_ACTIVE
changing
ct_fieldcat = it_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3
.
if sy-subrc <> 0.
message i000(bctrain) with 'Not Merged'.
else.
*message i000(bctrain) with ' Merged'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = 'X'
I_BYPASSING_BUFFER = I_BYPASSING_BUFFER
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
I_STRUCTURE_NAME = I_STRUCTURE_NAME
is_layout = it_layout
it_fieldcat = it_fieldcat[]
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
IT_SORT = IT_SORT
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
it_events = it_events
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER = IR_SALV_LIST_ADAPTER
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
t_outtab = it_final
exceptions
program_error = 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.
endform. " DISPLAY
&----
*& Form get_events
&----
form get_events .
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = it_events
exceptions
list_type_wrong = 1
others = 2.
if sy-subrc <> 0.
endif.
**USER_COMMAND EVENT
*
READ TABLE IT_EVENTS INTO WA_EVENTS WITH KEY
NAME = 'USER_COMMAND'.
IF SY-SUBRC = 0.
WA_EVENTS-FORM = 'USER_COMMAND'.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDIF.
**PF_STATUS_SET EVENT
READ TABLE IT_EVENTS INTO WA_EVENTS WITH KEY
NAME = 'PF_STATUS_SET'.
IF SY-SUBRC = 0.
WA_EVENTS-FORM = 'PF_STATUS'.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDIF.
TOP_OF_LIST EVENT.
read table it_events into wa_events with key
name = 'TOP_OF_LIST'.
NAME = 'TOP_OF_PAGE'.
if sy-subrc = 0.
wa_events-form = 'TOP-OF-LIST'.
modify it_events from wa_events index sy-tabix.
endif.
endform. " get_events
&----
*& Form USER_COMMAND
&----
form user_command using v_ucomm type sy-ucomm
v_selfield type slis_selfield .
refresh it_fieldcat_ekpo.
case v_ucomm.
when 'DISP_DET'.
refresh t_ekpo.
refresh it_ebeln.
loop at it_final.
if it_final-box = 'X'.
it_ebeln-ebeln = it_final-ebeln.
append it_ebeln.
endif.
endloop.
perform poitem_det.
endcase.
IF V_SELFIELD-FIELDNAME = 'EBELN'.
V_VALUE = V_SELFIELD-VALUE.
ELSE.
MESSAGE I000(BCTRAIN) WITH 'SELECT PURCHASE ORDER FOR ITEM DETAILS'
SY-LSIND.
EXIT.
ENDIF.
SELECT EBELN
EBELP
AEDAT
MENGE
MEINS
FROM EKPO
INTO TABLE T_EKPO
WHERE EBELN EQ V_VALUE.
IF SY-SUBRC <> 0.
MESSAGE I000(BCTRAIN) WITH 'NO ITEM DETAILS FOUND FOR PO :' V_VALUE.
EXIT.
ENDIF.
**perform fldcat_merge.
PERFORM IT_FIELDCAT_EKPO.
PERFORM IT_LAYOUT_EKPO.
PERFORM GET_EVENTS.
PERFORM DISP_ITEMDET.
REFRESH IT_FIELDCAT_EKPO.
**ENDIF.
endform. " USER_COMMAND
&----
*& Form DISP_ITEMDET
&----
form disp_itemdet.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = 'X'
I_BYPASSING_BUFFER = I_BYPASSING_BUFFER
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'TOP_OF_LIST'
I_STRUCTURE_NAME = I_STRUCTURE_NAME
is_layout = it_layout_ekpo
it_fieldcat = it_fieldcat_ekpo[]
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
it_sort = it_sort[]
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER = IR_SALV_LIST_ADAPTER
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
t_outtab = t_ekpo
exceptions
program_error = 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.
endform. " DISP_ITEMDET
&----
*& Form IT_FIELDCAT_EKPO
&----
form it_fieldcat_ekpo .
it_fieldcat_ekpo-fieldname = 'MANDT'.
it_fieldcat_ekpo-seltext_l = 'CLIENT'.
append it_fieldcat_ekpo.
it_fieldcat_ekpo-fieldname = 'EBELN'.
it_fieldcat_ekpo-seltext_l = 'PO NUMBER'.
append it_fieldcat_ekpo.
it_fieldcat_ekpo-fieldname = 'EBELP'.
it_fieldcat_ekpo-seltext_l = 'PO ITEM'.
append it_fieldcat_ekpo.
it_fieldcat_ekpo-fieldname = 'AEDAT'.
it_fieldcat_ekpo-seltext_l = 'PO DATE'.
append it_fieldcat_ekpo.
it_fieldcat_ekpo-fieldname = 'MENGE'.
it_fieldcat_ekpo-seltext_l = 'QUANTITY'.
it_fieldcat_ekpo-do_sum = 'X'.
append it_fieldcat_ekpo.
it_fieldcat_ekpo-fieldname = 'MEINS'.
it_fieldcat_ekpo-seltext_l = 'UNIT OF MEASURE'.
append it_fieldcat_ekpo.
endform. " IT_FIELDCAT_EKPO
&----
*& Form TOP-OF-LIST
&----
form top-of-list.
format color col_positive.
write : 'ITEM DETAILS OF PURCHASE ORDERS : ' .
endform. "TOP-OF-LIST
&----
*& Form PF_STATUS_SET
&----
form pf_status using it_extab type slis_t_extab.
set pf-status 'DISP_DET' excluding it_extab.
endform. "PF_STATUS_SET
&----
*& Form IT_LAYOUT
&----
form it_layout .
it_layout-box_fieldname = 'BOX'.
it_layout-box_tabname = 'IT_FINAL'.
IT_LAYOUT-TOTALS_TEXT = 'TOTALS'.
endform. " IT_LAYOUT
&----
*& Form IT_LAYOUT_EKPO
&----
form it_layout_ekpo .
it_layout_ekpo-subtotals_text = 'SUBTOTALS'.
it_layout_ekpo-totals_text = 'TOTALS'.
*CLEAR IT_LAYOUT_EKPO-SUBTOTALS_TEXT.
IT_LAYOUT_EKPO-NO_subtotals = ' '.
endform. " IT_LAYOUT_EKPO
&----
*& Form fldcat_merge
&----
form fldcat_merge .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-cprog
i_internal_tabname = 'T_EKPO'
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = sy-cprog
I_BYPASSING_BUFFER = I_BYPASSING_BUFFER
I_BUFFER_ACTIVE = I_BUFFER_ACTIVE
changing
ct_fieldcat = it_fieldcat_ekpo
exceptions
inconsistent_interface = 1
program_error = 2
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.
endform. " fldcat_merge
&----
*& Form it_fieldcat
&----
form it_fieldcat .
*
*it_fieldcat-fieldname = 'KNUMA'.
*IT_FIELDCAT-SELTEXT_L = 'AGGREMENT'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'BOART'.
*IT_FIELDCAT-SELTEXT_L = 'AGGREMENTTYPE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'DATAB'.
*IT_FIELDCAT-SELTEXT_L = 'AGGREMENT FROM DATE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'DATBI'.
*IT_FIELDCAT-SELTEXT_L = 'AGGREMENT TO DATE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'KNUMH'.
*IT_FIELDCAT-SELTEXT_L = 'CONDRECORD'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'KOBOG'.
*IT_FIELDCAT-SELTEXT_L = 'CT GRP'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'BOTEXT'.
*IT_FIELDCAT-SELTEXT_L = 'CTGrpText'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'BONEM'.
*IT_FIELDCAT-SELTEXT_L = 'REB_RECEIPT'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'LIFNR'.
*IT_FIELDCAT-SELTEXT_L = 'VENDORNUM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'NAME1'.
*IT_FIELDCAT-SELTEXT_L = 'VEN NAME'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'EKORG'.
*IT_FIELDCAT-SELTEXT_L = 'PUR_ORG'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'EBELN'.
*IT_FIELDCAT-SELTEXT_L = 'PO NUM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'AEDAT'.
*IT_FIELDCAT-SELTEXT_L = 'PO DATE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'EBELP'.
*IT_FIELDCAT-SELTEXT_L = 'PO ITEM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'MATNR'.
*IT_FIELDCAT-SELTEXT_L = 'MATERIALNUM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'WERKS'.
*IT_FIELDCAT-SELTEXT_L = 'SITE NUM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'MAKTX'.
*IT_FIELDCAT-SELTEXT_L = 'MAT_DESC'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'MATKL'.
*IT_FIELDCAT-SELTEXT_L = 'MAT GRP'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'MENGE'.
*IT_FIELDCAT-SELTEXT_L = 'QUANTITY'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'MEINS'.
*IT_FIELDCAT-SELTEXT_L = 'UNITOF MEAS'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'GJAHR'.
*IT_FIELDCAT-SELTEXT_L = 'DOC YR'.
*APPEND IT_FIELDCAT.
*
*it_fieldcat-fieldname = 'BLDAT'.
*IT_FIELDCAT-SELTEXT_L = 'INV DATE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'CPUDT'.
*IT_FIELDCAT-SELTEXT_L = 'INV_UPDATE_DATE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'BELNR'.
*IT_FIELDCAT-SELTEXT_L = 'INV NUM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'XBLNR'.
*IT_FIELDCAT-SELTEXT_L = 'REFERENCE'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'BUZEI'.
*IT_FIELDCAT-SELTEXT_L = 'INV_LNITEM'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'DMBTR'.
*IT_FIELDCAT-SELTEXT_L = 'DOLLAR AMT'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'SHKZG'.
*IT_FIELDCAT-SELTEXT_L = 'DEB/CRD IND'.
*APPEND IT_FIELDCAT.
*it_fieldcat-fieldname = 'BUKRS'.
*IT_FIELDCAT-SELTEXT_L = 'COMPANYCODE'.
*APPEND IT_FIELDCAT.
endform. " it_fieldcat
&----
*& Form poitem_det
&----
form poitem_det .
if not it_ebeln[] is initial.
select mandt
ebeln
ebelp
aedat
menge
meins
from ekpo
into table t_ekpo
for all entries in it_ebeln
where ebeln = it_ebeln-ebeln.
endif.
perform it_fieldcat_ekpo.
perform it_sort.
perform it_layout_ekpo.
perform get_events.
perform disp_itemdet.
refresh it_fieldcat_ekpo.
clear it_layout_ekpo.
refresh it_sort.
endform. " poitem_det
&----
*& Form it_sort
&----
form it_sort .
wa_sort-fieldname = 'EBELN'.
it_sort-spos = 1.
IT_SORT-TABNAME = 'T_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
wa_sort-group = 'UL'.
append wa_sort to it_sort.
endform. " it_sort
08-20-2007 4:02 PM
08-20-2007 3:54 PM
Refer Good examples for alv check boxes.
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Thanks
Mahesh