‎2008 Jan 18 6:30 AM
Hi all,
I have 2 input box on the header line.say A and B
i have 12 boxes underneath the header line( 6 belongs to A and 6 belongs to B)
Now based on the value of A and B on the header .The boxes below that must be disabled and enabled.
for example if A = 2 ad B = 2.(Header input box)
For A -
2 out of 6 boxes of A must be enabled
For B -
2 out of 6 boxes of B must be enabled..
Picture
A= B=
A1 B1
A2 B2
A3 B3
A4 B4
A5 B5
A6 B6
Can anyone please provide the code for this...
P:S ...good answers will be rewarded with points
‎2008 Jan 18 6:59 AM
hI Vijay,
Try this one .
parameters : A type i,
B type i.
data: begin of itab occurs 0,
filed(2) type c,
field1(2) type c,
temp type i,
end of itab.
itab-filed = 'A1'.
append itab.
itab-filed = 'A2'.
append itab.
itab-filed = 'A3'.
append itab.
itab-filed = 'A4'.
append itab.
itab-filed = 'A5'.
append itab.
itab-filed = 'A6'.
append itab.
itab-filed1 = 'B1'.
append itab.
itab-filed1 = 'B2'.
append itab.
itab-filed1 = 'B3'.
append itab.
itab-filed1 = 'B4'.
append itab.
itab-filed1 = 'B5'.
append itab.
itab-filed1 = 'B6'.
append itab.
loop at itab where temp LT A.
loop at screen.
if screen-name = ITAB-FILED.
screen-input = 1.
endif.
if screen-name = ITAB-FILED1.
screen-input = 1.
endif.
modify screen.
endloop.
endloop.
Reward points if helpful
Kiran Kumar.G.A
‎2008 Jan 18 6:45 AM
Hi,
parameters:
p_a type i ,
p_a1 as check box,
p_a2 as check box,
p_a3 as checkbox,
p_a4 as checkbox,
p_a5 as checkbox,
p_a6 as checkbox,
p_b type i ,
p_b1 as check box ,
p_b2 as check box,
p_b3 as checkbox,
p_b4 as checkbox,
p_b5 as checkbox,
p_b6 as checkbox.
at selection-screen output.
loop at screen.
if w_count le p_a.
w_count = w_count + 1.
endif.
if screen-name eq 'a(w_count)'
screen-active = 1.
modify screen.
endif.
at selection-screen.
if a gt 6.
error message.
endif.
i did for a similary u can write for b .
Plzz reward points.
‎2008 Jan 18 6:51 AM
in PBO of dat screen
loop at screen.
case A.
when '1'.
if screen name = A1.
screen-input = 0.
endif.
when '2'.
...
.
.
endcase.
modify screen.
endloop.
simillarly for B
‎2008 Jan 18 6:56 AM
parameters:
p_a(3) type n ,
a1 as check box,
a2 as check box,
a3 as checkbox,
a4 as checkbox,
a5 as checkbox,
a6 as checkbox,
p_b(3) type n ,
b1 as check box ,
b2 as check box,
b3 as checkbox,
b4 as checkbox,
b5 as checkbox,
b6 as checkbox.
clear: count.
LOOP AT SCREEN.
count = count + 1.
case screen-name.
when 'a1'.
if count <= P_a.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'a2'.
if count <= P_a.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'a3'.
if count <= P_a.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'a4'.
if count <= P_a.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'a5'.
if count <= P_a.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'a6'.
if count <= P_a.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'b1'.
if count <= P_b.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'b2'.
if count <= P_b.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'b3'.
if count <= P_b.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'b4'.
if count <= P_b.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'b5'.
if count <= P_b.
screen-active = '1'.
else.
screen-active = '0'.
endif.
when 'b6'.
if count <= P_b.
screen-active = '1'.
else.
screen-active = '0'.
endif.
endcase.
MODIFY SCREEN.
ENDLOOP.
In the above logic,
Initially if p_a = 3 is selected, first 3 checkbox will be enabled, next time if p_a = 1, then only the first one will be enabled and rest ofthem will be disabled.
‎2008 Jan 18 6:59 AM
hI Vijay,
Try this one .
parameters : A type i,
B type i.
data: begin of itab occurs 0,
filed(2) type c,
field1(2) type c,
temp type i,
end of itab.
itab-filed = 'A1'.
append itab.
itab-filed = 'A2'.
append itab.
itab-filed = 'A3'.
append itab.
itab-filed = 'A4'.
append itab.
itab-filed = 'A5'.
append itab.
itab-filed = 'A6'.
append itab.
itab-filed1 = 'B1'.
append itab.
itab-filed1 = 'B2'.
append itab.
itab-filed1 = 'B3'.
append itab.
itab-filed1 = 'B4'.
append itab.
itab-filed1 = 'B5'.
append itab.
itab-filed1 = 'B6'.
append itab.
loop at itab where temp LT A.
loop at screen.
if screen-name = ITAB-FILED.
screen-input = 1.
endif.
if screen-name = ITAB-FILED1.
screen-input = 1.
endif.
modify screen.
endloop.
endloop.
Reward points if helpful
Kiran Kumar.G.A
‎2008 Jan 18 9:54 AM
Thanks guys for the answer..
i had given reward points for useful answers