2008 Nov 17 11:02 AM
Hi,
I am have one interactive report. in the basic list , i am displying one checkbox and material number(MATNR). only two fields in the internal table. what ever the line , i am selecting using checkbox,
these lines should be deleted using any (user defined delete) button . i dont know , how to capture
these check box data in the basic list.
kathir.
2008 Nov 17 11:13 AM
Just check for sy-ucomm and read the line for which the check box is ticked. extract the contents of the line and then delete the record from the internal table.
Check the following code as a reference,
IF sy-lsind EQ 1.
* To display the freight variance amount based on vendor number
PERFORM display_var_amt_by_vend.
ENDIF. " IF SY-LSIND EQ 1
DO.
READ LINE sy-index FIELD VALUE w_cbox_ship.
IF sy-subrc NE 0.
EXIT.
ELSEIF w_cbox_ship EQ c_flag_x.
CLEAR: w_vsbed.
w_vsbed = sy-lisel+3(2).
CLEAR w_cbox_ship.
MODIFY LINE sy-index FIELD VALUE w_cbox_ship
FIELD FORMAT
fs_prod_ship_cond-vsbed COLOR col_positive INTENSIFIED.
DO.
READ LINE sy-index FIELD VALUE w_cbox_ship w_cbox_mat.
IF sy-subrc NE 0.
EXIT.
ELSEIF w_cbox_ship EQ c_flag_x.
CLEAR: w_vsbed.
w_vsbed = sy-lisel+3(2).
CLEAR w_cbox_ship.
MODIFY LINE sy-index FIELD VALUE w_cbox_ship
FIELD FORMAT
fs_prod_ship_cond-vsbed COLOR col_positive INTENSIFIED.
ELSEIF w_cbox_mat EQ c_flag_x.
CLEAR w_matnr.
w_matnr = sy-lisel+3(18).
CLEAR w_cbox_mat.
MODIFY LINE sy-index FIELD VALUE w_cbox_mat
FIELD FORMAT
fs_prod_ship_cond-matnr COLOR col_positive INTENSIFIED.
* To fetch description of the selected material from MAKT.
PERFORM fetch_mat_description.
* To display the Material no. and the header texts for the data
* grouped by Material and Shipping cond.
SKIP 1.
WRITE:/2 w_cbox_mat AS CHECKBOX,
text-mtn COLOR COL_HEADING
INTENSIFIED,
w_matnr COLOR COL_NORMAL
INTENSIFIED OFF,
w_mat_desc COLOR COL_NORMAL
INTENSIFIED OFF.
FORMAT COLOR COL_HEADING ON INTENSIFIED.
SKIP 1.
ULINE /1(51).
WRITE:/ sy-vline,
3 sy-vline,
4 text-ven,
14 sy-vline,
15 text-dlv,
25 sy-vline,
35 text-amt,
42 sy-vline,
43 text-cur,
51 sy-vline.
ULINE /1(51).
FORMAT COLOR COL_HEADING OFF INTENSIFIED.
LOOP AT t_prod_ship_cond INTO fs_prod_ship_cond
WHERE vsbed = w_vsbed
AND matnr = w_matnr.
w_total_delv = w_total_delv + 1.
w_total_amt = w_total_amt + fs_prod_ship_cond-dmbtr.
AT END OF lifnr.
* To display the Freight Variance Amount based on Vendor number.
FORMAT COLOR COL_NORMAL ON INTENSIFIED OFF.
WRITE:/1 sy-vline,
2 w_cbox_vend AS CHECKBOX,
3 sy-vline,
4 fs_prod_ship_cond-lifnr COLOR COL_KEY,
14 sy-vline,
15 w_total_delv,
25 sy-vline,
26 w_total_amt CURRENCY text-usd,
42 sy-vline,
43 text-usd,
51 sy-vline.
FORMAT COLOR COL_NORMAL OFF INTENSIFIED OFF.
CLEAR: w_total_delv,
w_total_amt.
ENDAT. " AT END OF LIFNR
ENDLOOP. " LOOP AT T_PROD_SHIP_COND
ULINE /1(51).
ENDIF. " IF SY-SUBRC NE 0
ENDDO.
ENDIF. " IF SY-SUBRC NE 0
ENDDO.
ENDFORM. " DISPLAY_VAR_AMT_BY_VEND
Here w_cbox_ship is a checkbox. Based on the selected checkbox, additional data is being written to the secondary list. Instead, you can delete the entries from your table.
2008 Nov 17 11:15 AM
hi this how to put check box to your list
WA_FIELDCAT-FIELDNAME = 'TAKEN'.
WA_FIELDCAT-SCRTEXT_M = 'Running Status'.
WA_FIELDCAT-COL_POS = 0.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-EDIT = 'X'.
WA_FIELDCAT-CHECKBOX = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
when you press delete button
you can find there value (check box) like 'X'
then you can proceed what you want
2008 Nov 17 11:33 AM
Hi,
at user-command.
case sy-ucomm.
when 'DELE'.
if p_check eq 'X'.
delete t_record with index eq w_lineno.
endif
endcase.
Hope it helps it.
Regards
Manjari