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: 

How to display Checkboxs in Output screen in General reporting? (Not ALV )

Former Member
0 Kudos

How to display Checkboxs in Output screen in General reporting? (Not ALV )

In output screen checkboxes should be displyed for every record. So that, user can select the checkboxes from the Output screen for further detailed report in secondary list.

Plz explain it with sample code.......

Regards,

Krishna Chaitanya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

declare a field of length 1 in the internal table ..

loop at itab.

write 😕 itab-field1 as checkbox , <-- use this statement ...

.........

endloop.

6 REPLIES 6

Former Member
0 Kudos

declare a field of length 1 in the internal table ..

loop at itab.

write 😕 itab-field1 as checkbox , <-- use this statement ...

.........

endloop.

Former Member
0 Kudos

Hi this is the code.

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.

Thanks

Chandra

Former Member
0 Kudos

Hi,

Have a look on the fllowing code.It displays the selected

records in second level report.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARC-MATNR,

WERKS LIKE MARC-WERKS,

CH TYPE CHECKBOX,

END OF ITAB.

data : begin of itab1 occurs 0,

matnr like mard-matnr,

werks like mard-werks,

end of itab1.

DATA : V_LIN TYPE I,

V_SEL type SY-LISEL.

data: v_matnr type mara-matnr.

START-OF-SELECTION.

SET PF-STATUS 'CH9'.

select matnr

werks

from marc

up to 10 rows

into table itab.

loop at itab .

write : /2 sy-vline, 3 itab-matnr,22 sy-vline, 23 itab-werks, 28

sy-vline, 29 itab-ch as checkbox.

hide itab.

endloop.

top-of-page.

uline at /1(30).

write : /2 sy-vline, 3 'MAterial no' ,22 sy-vline, 23 'Palnt', 28

Sy-vline.

uline at /1(30).

at user-command.

case sy-ucomm.

WHEN 'DISP'.

LOOP AT ITAB.

refresh itab1.

V_LIN = SY-TABIX + 3.

READ LINE V_LIN LINE VALUE INTO V_SEL.

IF V_SEL+28(1) = 'X'.

ITAB1-MATNR = V_SEL+2(18).

ITAB1-WERKS = V_SEL+22(4).

APPEND ITAB1.

CLEAR ITAB1.

LOOP AT ITAB1.

WRITE 😕 ITAB1-MATNR,ITAB1-WERKS.

ENDLOOP.

ENDIF.

ENDLOOP.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

Reward,if useful.

Thanks,

Chandu

Former Member
0 Kudos

Hi Krishna,

you can use this:

write field as checkbox input on.

But I think it's better to use the write command with the option "hotspot on". In the next line you must use the hide command for remembering the relevant fields wich you need for the detail list. When the user select the line the event "at line-selection" will be process and you can display the detail list. This solution is only possible if the user can only select one line.

Kindly Regards

Lars

venkat_o
Active Contributor
0 Kudos

Hi Krishna,

Check this sample code.

Report ztest1.
Data:
       checkbox type c.
write: checkbox as checkbox input on

.

Regards,

Venkat.O

Former Member
0 Kudos

Hello Srinivas, Chandra, Chandu, Lars and

Venkat.

Thank you for your response.

It has really helped me to resolve my issue. Information you had provided was really Helpful.

Points are rewarded.

Have a great evening!

Regards,

Krishna Chaitanya