‎2007 Jul 18 8:01 AM
Hi,
I am working on a report where I have 4 secondary codes zzscom1,zzscom2,zzscom3,zzscom4 from lfa1 table.In the selection-screen i have displayed only 2 secondary codes zzscom3,zzscom4.if i enter a value in any of these 2 secondary codes.for example if i enter warehousing in zzscom3 but in lfa1 table warehousing is present only in zzscom4 field.Now in the output i should get all the 4 secondary codes with their values present in lfai table.
How can i write a select query for this?
Regards,
Hema
‎2007 Jul 18 8:20 AM
Hi hema,
Let p_zzscom3,p_zzscom4 are your selection parameters.
PARAMETER:p_zzscom3,
p_zzscom4.
SELECT-OPTIONS: s_sec FOR lfa1-zzscom1 NO-DISPLAY.
DATA:ls_secondary TYPE selopt.
START-OF-SELECTION.
IF p_zzscom3 IS NOT INITIAL.
ls_secondary-sign = 'I'.
ls_secondary-option = 'EQ'.
ls_secondary-low = p_zzscom3.
APPEND ls_secondary TO s_sec.
ENDIF.
IF p_zzscom4 IS NOT INITIAL.
CLEAR ls_secondary.
ls_secondary-sign = 'I'.
ls_secondary-option = 'EQ'.
ls_secondary-low = p_zzscom4.
APPEND ls_secondary TO s_sec.
ENDIF.
SELECT SINGLE lifnr zzscom1 zzscom2 zzscom3 zzscom4 FROM lfa1
INTO wa_lfa1
WHERE zzscom1 IN s_sec OR
zzscom2 IN s_sec OR
zzscom3 IN s_sec OR
zzscom4 IN s_sec.
Hope this will work for you!
Regards
Antony Thomas
Reward if find useful!
‎2007 Jul 18 8:20 AM
Hi hema,
Let p_zzscom3,p_zzscom4 are your selection parameters.
PARAMETER:p_zzscom3,
p_zzscom4.
SELECT-OPTIONS: s_sec FOR lfa1-zzscom1 NO-DISPLAY.
DATA:ls_secondary TYPE selopt.
START-OF-SELECTION.
IF p_zzscom3 IS NOT INITIAL.
ls_secondary-sign = 'I'.
ls_secondary-option = 'EQ'.
ls_secondary-low = p_zzscom3.
APPEND ls_secondary TO s_sec.
ENDIF.
IF p_zzscom4 IS NOT INITIAL.
CLEAR ls_secondary.
ls_secondary-sign = 'I'.
ls_secondary-option = 'EQ'.
ls_secondary-low = p_zzscom4.
APPEND ls_secondary TO s_sec.
ENDIF.
SELECT SINGLE lifnr zzscom1 zzscom2 zzscom3 zzscom4 FROM lfa1
INTO wa_lfa1
WHERE zzscom1 IN s_sec OR
zzscom2 IN s_sec OR
zzscom3 IN s_sec OR
zzscom4 IN s_sec.
Hope this will work for you!
Regards
Antony Thomas
Reward if find useful!
‎2007 Jul 18 9:29 AM
Hi,
Still I have a problem.Could you pls help me solve this problem.
In the selection-screen if i give 'warehousing' in zzscom3 field and execute it is giving 'no matches found'.but it should retrieve a record irrespective of the value given in the zzscom3 field i.e in the output it should display a record having 'warehousing' in zzscom4 field.Because in lfa1 table 'warehousing' is present in zzscom4 field.
Regards,
Hema
‎2007 Jul 18 9:49 AM
Hi Antony,
Thanku very much.My problem was solved.
Regards,
Hema.
‎2007 Jul 28 9:02 AM
hi,
I am working on a report about open STPO. I need pick up the PO data both in header and items level. Such as PO No., doc. date, item No.,schedule line#(item detail infomation), DN No., DN Qty etc.
if one item has one schedule line, there is no problem to get the DN data(even more than one DN), but if there're two or more schedule lines, I can't find the link between the schedule lines and DNs. I can't decide which DNs generate by schedule line1 and which DNs generate by schedule line2
how can i link them? is there any table with the relation of them? THS
‎2007 Jul 28 9:05 AM
hi,
I am working on a report about open STPO. I need pick up the PO data both in header and items level. Such as PO No., doc. date, item No.,schedule line#(item detail infomation), DN No., DN Qty etc.
if one item has one schedule line, there is no problem to get the DN data(even more than one DN), but if there're two or more schedule lines, I can't find the link between the schedule lines and DNs. I can't decide which DNs generate by schedule line1 and which DNs generate by schedule line2
how can i link them? is there any table with the relation of them? THS