‎2008 Apr 22 11:48 AM
in one of the programs i saw(see the below code) both the selects are written one after other as shown below
if s_paledg-low = '02'.
clear w_waers.
select * from t001
where bukrs = s_bukrs-low.
w_waers = t001-waers.
endselect.
elseif s_paledg-low = '01'.
w_waers = 'USD'.
endif.
select * from t001 client specified
where bukrs = s_bukrs-low.
endselect.
both the selects are on t001, they used first select to get the value of WAERS
but for the second select they are not using the values of t001 any where in the complete code
can any one clarify why they have written like this with out using this
Edited by: Alvaro Tejada Galindo on Apr 22, 2008 3:00 PM
‎2008 Apr 22 12:47 PM
Hi,
Yes, the selects do not make any sense since that value is no longer used in the program. It probably was at an earlier point, then someone removed the usage and forgot to remove the selects.
Furthermore the CLIENT SPECIFIED in the second select does not make any sense either because no MANDT is specified meaning it will read the data from the current client only anyway.
Regards,
Michael
‎2008 Apr 22 11:53 AM
hi,
If the values of t001 which are taken in the work area i,e, t001 are not being used any where in the program you can avoid the select statement as it has no significance of its usage.
Regards,
Santosh
‎2008 Apr 22 12:47 PM
Hi,
Yes, the selects do not make any sense since that value is no longer used in the program. It probably was at an earlier point, then someone removed the usage and forgot to remove the selects.
Furthermore the CLIENT SPECIFIED in the second select does not make any sense either because no MANDT is specified meaning it will read the data from the current client only anyway.
Regards,
Michael
‎2008 Apr 22 2:22 PM
Hi Ram,
I think that select statement is compulsary one. They might have been using the other fields of table T001 in the rest of the program.(I mean other than the field WAERS).
They should have written select statement before the if condition as shown below.
select * from t001 client specified
where bukrs = s_bukrs-low.
clear w_waers.
if s_paledg-low = '02'.
w_waers = t001-waers.
elseif s_paledg-low = '01'.
w_waers = 'USD'.
endif.
‎2008 Apr 22 2:23 PM
Hi Ram,
I think that select statement is compulsary one. They might have been using the other fields of table T001 in the rest of the program.(I mean other than the field WAERS).
They should have written select statement before the if condition as shown below.
select * from t001 client specified
where bukrs = s_bukrs-low.
clear w_waers.
if s_paledg-low = '02'.
w_waers = t001-waers.
elseif s_paledg-low = '01'.
w_waers = 'USD'.
endif.
‎2008 Apr 23 11:01 AM