on 2006 Jan 20 2:55 PM
Hi experts,
I have two tables QALS & QAVE with PRUEFLOS as common field.In my selection screen I have one parameter for QALS-ART & one select-option for QAVE-VDATUM.
What is the better way to write select statement.Do i need to write join?User can select any one the options...
PARAMETERS:P_ART LIKE QMEL-ART.
SELECT-OPTIONS:S_VDATUM FOR QAVE-VDATUM.
Reward guaranteed
cheers
kaki
Hi Kaki,
You cannot use the View because it doesn't have the field VDATUM.
Better to use the inner join option.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
My suggestion is write a join on two tables
like but be careful when user doesn't enter
values in parameter P_ART .
For example
Better to build ranges for this parameter option
p_art.
Regards
Amole
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It doesn't appear that VDATUM is part of the view. So you will not be able to use it. If it was there in the view, you could do something like this.
report zrich_0003.
tables: qave.
data: iQALSVE_V1 type table of QALSVE_V1 with header line.
PARAMETERS: P_ART LIKE Qals-ART.
SELECT-OPTIONS:S_VDATUM FOR qave-VDATUM.
select * into corresponding fields of table iQALSVE_V1
from QALSVE_V1
where art = p_art
and vdatum in s_vdatum.
I would suggest doing a INNER JOIN.
REgards,
Rich Heilman
Hi KAki,
I am not sure what is your question Inspection lot no : PRUEFLOS in in bothe tabbles QALS and QAVE.
Inspection type QAVE-ART in generally mainteined in table TQ30 and in table QAVE there is a check table is maintained.
your selctions will work.
If possible use Function module : 'READ_NOTIFICATION'
This will fetch you comple data for inspection lots.
CALL FUNCTION 'READ_NOTIFICATION'
EXPORTING
QMNUM = WA_VIQMEL-QMNUM
I_VIQMEL = WA_VIQMEL
IV_AKTYP = 'A'
TABLES
IVIQMFE = IWQMFE
IVIQMMA = IWQMMA
IVIQMSM = IWQMSM
IVIQMUR = IWQMUR
TRIWO020TAB = G_RIWO020TAB
EXCEPTIONS
INVALID_NUMBER = 1
OTHERS = 2.
Lanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the fields that you need are present, I would suggest using the view QALSVE_V1. If not then a inner join will do just fine.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kaki,
1. User can select any one the options...
One option is that
we can use IF to check what is entered
and accordingly write TWO Different SQls.
2. But my personal opinion is ,
it is better to write Sql using JOIN
for the two tables,
so that in future,
if the requirement is that
the use CAN ENTER IN BOTH Fields,
then we don't have to worry about it !
regards,
amit m.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kaki,
You can write a join.
select <fields>
from QALS JOIN QAVE
ON QALSPRUEFLOS = QAVEPRUEFLOS
INTO TABLE ITAB
WHERE QALS~ART = P_ART AND
QAVE~VDATUM IN S_VDATUM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.