cancel
Showing results for 
Search instead for 
Did you mean: 

Logic for a report with check boxes

naren112
Explorer
0 Kudos
96

Hi All ,

I m writting a report , I need to put FOUR check box in this report ,

For example you can say Check1 ( material1)

Check2 ( material2)

Check3 ( material3)

Others

In selection critriea I defined one select option ( eg materail )

Now I have to diplay data accordingly checkboxes

If Check box '<b>check1'</b> is selected -list must contains only material1

If Check box '<b>check2'</b> is selected -list must contains only material2

If Check box '<b>check3</b>' is selected -list must contains only material3

If Check box '<b>check1</b>' or any other one is selected -list must contains material1 and other materail as per other selected check box .

If Check box<b> others</b> is selected then all other fields ( except the selected check box ) are the out put of this report .

IF you need more explaination of my query , plz let me know .

Regards ,

Narender

View Entire Topic
Former Member
0 Kudos

REPORT ZTEST3 line-size 400.

data : v_matnr1 like mara-matnr.

data : v_matnr2 like mara-matnr.

data : v_matnr3 like mara-matnr.

data : v_matnr4 like mara-matnr.

parameters : p_check1 as checkbox.

parameters : p_check2 as checkbox.

parameters : p_check3 as checkbox.

parameters : p_check4 as checkbox.

start-of-selection.

v_matnr1 = 'First Material'.

v_matnr2 = 'second Material'.

v_matnr3 = 'third Material'.

v_matnr4 = 'fourth Material'.

if p_check1 = 'X'.

write:/ v_matnr1.

endif.

if p_check2 = 'X'.

write:/ v_matnr2.

endif.

if p_check3 = 'X'.

write:/ v_matnr3.

endif.

if p_check4 = 'X'.

write:/ v_matnr4.

endif.

naren112
Explorer
0 Kudos

Dear Seshu ,

Thank you for your quick response . I would like to tell you that I have to select the data from database tables ( MARA ,MARC, MCHA, MKOL ).

If anyone of the conditions (mentioned in 1st sec of this thread ) is satisfied , data should be populated in the list according the Check Boxes.

In your reply , you defined some static data , but I want to implement this logic using tables as per my requirement (report).

Former Member
0 Kudos

REPORT ZTEST3 line-size 400.

tables : mara.

data i_mara like mara occurs 0 with header line.

data i_marc like marc occurs 0 with header line.

data i_mcha like mcha occurs 0 with header line.

data i_mkol like mkol occurs 0 with header line.

select-options: s_matnr for mara-matnr.

parameters : p_check1 as checkbox.

parameters : p_check2 as checkbox.

parameters : p_check3 as checkbox.

parameters : p_check4 as checkbox.

start-of-selection.

if p_check1 = 'X'.

select * from mara into table i_mara where matnr in s_matnr.

loop at i_mara.

endloop.

endif.

if p_check2 = 'X'.

select * from marc into table i_marc where matnr in s_matnr.

loop at i_marc.

endloop.

endif.

if p_check3 = 'X'.

select * from mcha into table i_mcha where matnr in s_matnr.

loop at i_mcha.

endloop.

endif.

if p_check4 = 'X'.

select * from mkol into table i_mkol where matnr in s_matnr.

loop at i_mkol.

endloop.

endif.

Former Member
0 Kudos

Hi Narendar,

Tables : mara.

PARAMETERS: S_fi AS CHECKBOX.

PARAMETERS: S_se AS CHECKBOX.

PARAMETERS: S_th AS CHECKBOX.

PARAMETERS: S_fo AS CHECKBOX.

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.

get all the data INTO ITAB.

then

if s_fi ne 'X'.

DELETE ITAB WHERE MATNR = FIRST MATERIAL.

ELSEIF s_se ne 'X'.

DELETE ITAB WHERE MATNR = second MATERIAL.

ELSE if s_th ne 'X'.

DELETE ITAB WHERE MATNR = third MATERIAL.

ELSE if s_fo ne 'X'.

DELETE ITAB WHERE MATNR = fourth MATERIAL.

endif.

now your itab has records only with material based on the check box selected

reward points if helpful

thanks

venki