2007 Jul 13 5:01 AM
hi,
how to include check box in the report list.
for each line there shld be a check box.
i must take the line and take it to the secondary list.
pls help.
thanks in adv.
will be rewarded.
2007 Jul 13 5:10 AM
Hi,
Declare the first field of internal tables as checkbox and display the records
see the sample report.
TABLES:MARA.
DATA:BEGIN OF GT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF GT_MARA,
GV_CB,
GV_CBV,
GV_LINES TYPE I,
INDEX TYPE I,
SY_INDEX TYPE I,
GV_LINES1 TYPE I,
MATNR LIKE MARA-MATNR.
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECT
MATNR FROM MARA
INTO TABLE GT_MARA
WHERE MATNR IN S_MATNR.
IF SY-SUBRC = 0.
DESCRIBE TABLE GT_MARA LINES GV_LINES.
ENDIF.
LOOP AT GT_MARA.
WRITE:/ GV_CB AS CHECKBOX,
GT_MARA-MATNR.
ENDLOOP.
CLEAR GT_MARA.
WRITE:'Total num of records is ',GV_LINES.
SET PF-STATUS 'DEL'.
AT USER-COMMAND.
IF SY-UCOMM = 'DEL' OR SY-UCOMM = 'PICK'.
DO 50 TIMES.
SY_INDEX = SY-INDEX.
READ LINE SY_INDEX FIELD VALUE GV_CB
GT_MARA-MATNR INTO MATNR.
IF GV_CB = 'X'." AND MATNR IS NOT INITIAL.
LOOP AT GT_MARA." WHERE MATNR = MATNR.
DELETE GT_MARA.
CLEAR GT_MARA.
ENDLOOP.
delete gt_mara index sy_index.
ENDIF.
ENDDO.
DESCRIBE TABLE GT_MARA LINES GV_LINES1.
WRITE:'Total num of records is ',GV_LINES1.
CLEAR:GV_LINES .
LOOP AT GT_MARA.
WRITE:/ GT_MARA-MATNR.
ENDLOOP.
ENDIF.
Regards,
Padmam.
2007 Jul 13 5:10 AM
Hi,
Declare the first field of internal tables as checkbox and display the records
see the sample report.
TABLES:MARA.
DATA:BEGIN OF GT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF GT_MARA,
GV_CB,
GV_CBV,
GV_LINES TYPE I,
INDEX TYPE I,
SY_INDEX TYPE I,
GV_LINES1 TYPE I,
MATNR LIKE MARA-MATNR.
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECT
MATNR FROM MARA
INTO TABLE GT_MARA
WHERE MATNR IN S_MATNR.
IF SY-SUBRC = 0.
DESCRIBE TABLE GT_MARA LINES GV_LINES.
ENDIF.
LOOP AT GT_MARA.
WRITE:/ GV_CB AS CHECKBOX,
GT_MARA-MATNR.
ENDLOOP.
CLEAR GT_MARA.
WRITE:'Total num of records is ',GV_LINES.
SET PF-STATUS 'DEL'.
AT USER-COMMAND.
IF SY-UCOMM = 'DEL' OR SY-UCOMM = 'PICK'.
DO 50 TIMES.
SY_INDEX = SY-INDEX.
READ LINE SY_INDEX FIELD VALUE GV_CB
GT_MARA-MATNR INTO MATNR.
IF GV_CB = 'X'." AND MATNR IS NOT INITIAL.
LOOP AT GT_MARA." WHERE MATNR = MATNR.
DELETE GT_MARA.
CLEAR GT_MARA.
ENDLOOP.
delete gt_mara index sy_index.
ENDIF.
ENDDO.
DESCRIBE TABLE GT_MARA LINES GV_LINES1.
WRITE:'Total num of records is ',GV_LINES1.
CLEAR:GV_LINES .
LOOP AT GT_MARA.
WRITE:/ GT_MARA-MATNR.
ENDLOOP.
ENDIF.
Regards,
Padmam.
2007 Jul 13 5:19 AM
Hi
See the sample example code
and do accordingly
TABLES:MARA.
DATA:BEGIN OF GT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF GT_MARA,
GV_CB,
GV_CBV,
GV_LINES TYPE I,
INDEX TYPE I,
SY_INDEX TYPE I,
GV_LINES1 TYPE I,
MATNR LIKE MARA-MATNR.
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECT
MATNR FROM MARA
INTO TABLE GT_MARA
WHERE MATNR IN S_MATNR.
IF SY-SUBRC = 0.
DESCRIBE TABLE GT_MARA LINES GV_LINES.
ENDIF.
LOOP AT GT_MARA.
WRITE:/ GV_CB AS CHECKBOX,
GT_MARA-MATNR.
ENDLOOP.
CLEAR GT_MARA.
WRITE:'Total num of records is ',GV_LINES.
SET PF-STATUS 'DEL'.
AT USER-COMMAND.
IF SY-UCOMM = 'DEL' OR SY-UCOMM = 'PICK'.
DO 50 TIMES.
SY_INDEX = SY-INDEX.
READ LINE SY_INDEX FIELD VALUE GV_CB
GT_MARA-MATNR INTO MATNR.
IF GV_CB = 'X'." AND MATNR IS NOT INITIAL.
LOOP AT GT_MARA." WHERE MATNR = MATNR.
DELETE GT_MARA.
CLEAR GT_MARA.
ENDLOOP.
delete gt_mara index sy_index.
ENDIF.
ENDDO.
DESCRIBE TABLE GT_MARA LINES GV_LINES1.
WRITE:'Total num of records is ',GV_LINES1.
CLEAR:GV_LINES .
LOOP AT GT_MARA.
WRITE:/ GT_MARA-MATNR.
ENDLOOP.
ENDIF.
CHECK THIS LINK,
https://forums.sdn.sap.com/click.jspa?searchID=3028689&messageID=1171856
<b>Reward points for useful Answers</b>
Regards
Ashu
2007 Jul 13 5:24 AM
Hi,
If u want to include chebox in the list along with some other fields. u can use like below.
Data : mark type c.
data : begin of itab occurs 0,
matnr type mara-matnr,
end of itab.
itab-matnr = '000001234'.
append itab.
write : Mark as checkbox , itab-matnr .
Regards,
2007 Jul 13 5:45 AM
hi
good
go through this link
http://www.informit.com/articles/article.asp?p=664660&seqNum=2&rl=1
thanks
mrutyun^