‎2008 Dec 11 10:14 AM
Hi,
this is basic question but iam confusing.
in my selection contains two fields like matnr and werks.
if user give matnr only i will get all matnrs.
if user give matnr and werks i need matnr no's based on werks.
how can i write select statement based on mara and marc.
Regards,
Suresh.
‎2008 Dec 11 10:15 AM
search sdn with <select ... For all entries>
or even an F1 wud do.
Edited by: kartik tarla on Dec 11, 2008 3:45 PM
‎2008 Dec 11 10:15 AM
search sdn with <select ... For all entries>
or even an F1 wud do.
Edited by: kartik tarla on Dec 11, 2008 3:45 PM
‎2008 Dec 11 10:16 AM
select matnr werks from marc into table itab
where matnr in s_matnr and werks in s_werks.
‎2008 Dec 11 10:16 AM
hi,
Concatenate % sign at end of both matnr and werks.
write the selection statement as below.
select * from <tab-name> into table <itab>
where matnr like v_matnr
and werks like v_werks
Hope this helps,
Rajat
‎2008 Dec 11 10:20 AM
hi do like this ..
if p_matnr is not initial .
select matnr from marc into table itab where matnr = p_matnr .
elseif p_matnr is initial and p_werks is not initial.
select matnr
werks
from marc
into table itab1
where matnr = p_matnr
and werks = p_werks .
endif.
‎2008 Dec 11 10:20 AM
Hi,
For this when u enter only matnr details in select-options u get only matnrs.
so for select-option put if condition.
like this..
If s_matnr is not intitial .
select.....
endif.
if s_matnr is not intial and s_werks is not initial
select matnr werks......
endif.
for output printing also u use same if condition for both...
Try this....
‎2008 Dec 11 10:20 AM
‎2008 Dec 11 11:38 AM
Hi Suresh,
The following query may help you.
Here select option is used for both matnr and werks.
SELECT a~matnr
INTO TABLE int_tab
FROM mara AS a INNER JOIN marc AS b
ON a~matnr = b~matnr
WHERE a~matnr IN so_matnr AND
b~werks IN so_werks.Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Dec 11, 2008 12:41 PM
‎2008 Dec 11 3:03 PM
Hi,
Select matnr werks from table name
where matnr in s_matnr
and werks in s_werks.
Thanks,
Krishna...