‎2005 Sep 15 6:51 PM
hi,
Here SP$00011 & SP$00008 are selection screen fields.
l1_dat & l2_dat are Radio buttons.I have to check entered plants with zplants table.
Here two cases,if sy-subrc = 0.
1.if l1_dat = 'X'.I have to add zplants-vplant field to r_plant field.
2.if l2_dat = 'X'.I have to add zplants-vplant field to SP$00011 field.
my problem is when i select l1_dat. r_plant field containing only one
value,i.e zplants-vplant value.Actually r_plant field should be with
two values after appending.how can i write the statement?
Ranges: r_plant for zplants-werks.
FORM CHECK_KUNAG.
loop at SP$00008.
check SP$00008-low+0(1) = 'P'.
r_plant = SP$00008-low+1. "(removes the first P).
endloop.
select * from zplants
where werks = r_plant and
reswk in SP$00011.
if sy-subrc = 0.
if l2_dat = 'X'.
SP$00011-sign = 'I'.
SP$00011-option = 'EQ'.
SP$00011-low = zplants-vplant.
append SP$00011.
<b> elseif l1_dat = 'X'.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
r_plant-low = zplants-vplant.
append zplants-vplant to r_plant.</b>
endif.
endif.
endselect.
Do I need the following statements......what is this means????????
if SP$00008[] is initial.
clear SP$00008.
SP$00008-sign = 'I'.
SP$00008-option = 'EQ'.
SP$00008-low = zplants-vplant.
append SP$00008 to r_plant
endif.
endform.
Thanks in advance,
fractal.
‎2005 Sep 15 7:20 PM
loop at SP$00008.
check SP$00008-low+0(1) = 'P'.
r_plant-sign = 'I'.
r_plant-option = 'EQ'
r_plant-low = SP$00008-low+1. "(removes the first P).
APPEND r_PLANT
endloop.
‎2005 Sep 15 7:03 PM
Replace the following
elseif l1_dat = 'X'.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
r_plant-low = zplants-vplant.
append zplants-vplant to r_plant.
to
elseif l1_dat = 'X'.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
r_plant-low = zplants-vplant.
append r_plant.
Cheers
‎2005 Sep 15 7:14 PM
Ranges: r_plant for zplants-werks.
FORM CHECK_KUNAG.
loop at SP$00008.
check SP$00008-low+0(1) = 'P'.
<b>r_plant</b> = SP$00008-low+1. "(removes the first P).
endloop.
Problem now is r_plant has only P235,P476...like that...
Actually I want r_plant field values should be IEQP235, IEQP476.where should i write the following statements.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
thanks.
‎2005 Sep 15 7:05 PM
Also define a new varaibale w_plant to replace R_Plant
in following statements -
loop at SP$00008.
check SP$00008-low+0(1) = 'P'.
<b>r_plant</b> = SP$00008-low+1. "(removes the first P).
endloop.
select * from zplants
where werks = <b>r_plant</b> and
reswk in SP$00011.
‎2005 Sep 15 7:20 PM
loop at SP$00008.
check SP$00008-low+0(1) = 'P'.
r_plant-sign = 'I'.
r_plant-option = 'EQ'
r_plant-low = SP$00008-low+1. "(removes the first P).
APPEND r_PLANT
endloop.