01-30-2007 10:42 AM
can u please write joins according to this condition, i will give pooints to us.
the detail data will need to be checked to see if there is any data records to be selected for the internal table. Select a count of records from the ZPNOTEDETL table for the PSPID passed from the calling program.
If the record count is zero then the internal table should be set to initial. A parameter called IS_NOTICES should be set to N.
If the record count is greater than zero then:
Set the parameter IS_NOTICES = Y.
Select the following data from the ZPNOTEDETL table where the PSPNR = the PSPID passed from the calling program. The PNOTE_NO, PNOTE_TYPE, AWD_TYPE_CODE, PSPNR, BID_NO, PROC_STEP_CODE, PNOTE_STAT, PUB_DATE, PUB_TIME, ORIG_PUB_DATE, ORIG_PUB_TIME, SUB_END_DATE, Concatenate (SUB_END_TIME_HR + : + SUB_END_TIME_MM) as SUB_END_TIME, CTR_DESC as PNOTE_DESC, PROC_METH_CODE, CHG_BY_NAME, CRE_BY_NAME, REPT_FROM_DATE, REPT_TO_DATE.
Join the PNOTE_NO for the selected data to the PNOTE_NO in the ZPNOTEHIST table where the PNOTE_HIST_NO = 1 and select the PNOTE_EDIT_DATE as the PNOTE_CRE_DATE.
Join the PNOTE_TYPE for the selected data to the PNOTE_TYPE in the ZPNOTETYPE table and select the PNOTE_TYPE_CODE value.
Join the PNOTE_TYPE_CODE from the ZPNOTETYPE table and the DISP_LANG value to the PNOTE_TYPE_CODE and SPRAS in the ZPNOTETYPEDESC table and select the PNOTE_TYPE_DESC value.
The data should be selected into the PNOTE_LIST internal table.
01-30-2007 12:21 PM
try this way...
select afield1 afield2 bfield3 cfield4 into corresponding fields of itab
from table1 as a inner join table 2 as b on afield1 = bfield3
inner join table 3 as c on afield1 = cfield4
where <conditions>.
01-30-2007 10:58 AM
instead of join...write first select statement for main table and then using for all entries write select for other tables....now using loop & read statements insert the data to final internal table.
01-30-2007 12:11 PM
01-30-2007 12:21 PM
try this way...
select afield1 afield2 bfield3 cfield4 into corresponding fields of itab
from table1 as a inner join table 2 as b on afield1 = bfield3
inner join table 3 as c on afield1 = cfield4
where <conditions>.