05-18-2011 12:26 PM
Hi,
I hav a requirement in QM module where in,I need to compare the upper limit value and lower limit value from qamv table with the original value in qamr table.
Actually the original value should be with in the upper limit and lower limit value.
i took upper and lower limit value in one internal table and iam selecting original value from qamr table into internal table for all entries of the characteristic values in first internal table.but now i need to check if this original value is in between the upper and lower limit.this iam unable to incorporate in forall entries as it doesnot allow 'between'.
Kindly,guide me how can i check this validation in the code.
Thanks in advance.
Jiyaaaa
05-18-2011 12:34 PM
Hi,
If you are referring to a select option (upper and lower limit value) then you can directly write in the where condition
instead of taking into an internal table ..
Say for Ex: select * from QAMR into table i_QAMR
where PRUEFLOS in s_PRUEFLOS.
Regards,
Srini.
05-18-2011 12:40 PM
Hi Srinivas,
Iam not using a select-options.
the upper and lower limit are coming from other table.
05-18-2011 12:42 PM
Hi Jiyaa,
better do this in Loop...Endloop after selection from QAMV and QAMR.
Loop at QAMV.
Read table QAMR with key (your condition)
value ge QAMV-lower
value le QAMV-upper.
if sy-subrc ne 0.
delete QAMR index sy-tabix.
endif.
Endloop.
Regards,
Goutam
Edited by: Goutam Sahoo on May 18, 2011 1:43 PM
05-18-2011 1:22 PM
Hi gowtham,
Iam unable to use logical operators in read table.
kindly,provide me with other way to do this validation.
05-18-2011 1:29 PM
Hi Jiyaa,
better you can sort the qamv internal table based on the field we will get the lower value of the field and do the same thing
to ascending order we will get the upper limit value. then do the coding.
s_op-sign = 'I'.
s_op-option = 'BT'.
s_op-low = "passthe lower limit
s_op-high = "pass the uper limit
and do the select query.
select * from QAMR into table i_QAMR
where PRUEFLOS in s_op.
Regards,
DHina..
05-19-2011 12:37 PM
Hi Jiyaa,
I think u've taken care some commen field in this 2 table like prueflos, vorglfnr, marknr.
Loop at QAMV.
Read table QAMR with key (your condition like prueflos, vorglfnr, marknr).
if qamr-value ge QAMV-lower
and qamr-value le QAMV-upper.
continue.
else.
delete QAMR index sy-tabix.
endif.
Endloop.
Regards,
Goutam
05-24-2011 7:05 AM
05-18-2011 1:43 PM
Hi Jiyaa,
Plz go through that if getting right
Loop at first_internal_table Into wa_internal_table.
Select middle_amt From QAMR into wa_internal_table-middle_amt
Where middle_amt IN Between wa_internal_table-lower_amt AND wa_internal_table-upper_amt.
if sy-subrc eq 0.
modify first_internal_table from wa_internal_table.
endif.
clear: wa_internal_table.
endloop.
So using only one internal table, u get all three amt in each line item.
regards
Dhiraj Dangore