Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

check box in basic list

Former Member
0 Kudos
87

Hi frieds,

I wants to display a list of record in basic list and also one chek box for every record.

Then based on selected check box i want to cancel that record in database means i want to set it's flag. also in application toolbar of basic list display cancel button.

can any one gives me code for this.

Thank you.

Regards,

Virat

1 ACCEPTED SOLUTION

Former Member
0 Kudos
67

Hi,

My idea is...

Have one field as FLAG type C in the internal table and keep this as first column of the report.

Write FLAG s Checkbox..Then it will display the checkbox...and have one button in the tool bar.

If the user selects the checkbox and clicking the button...

1. it should update the FLAG as X for the corresponding record..

it should capture the reords and process further.

3 REPLIES 3

Former Member
0 Kudos
67

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.

Reward points for useful Answers

Regards

Anji

Former Member
0 Kudos
67

Former Member
0 Kudos
68

Hi,

My idea is...

Have one field as FLAG type C in the internal table and keep this as first column of the report.

Write FLAG s Checkbox..Then it will display the checkbox...and have one button in the tool bar.

If the user selects the checkbox and clicking the button...

1. it should update the FLAG as X for the corresponding record..

it should capture the reords and process further.