2007 Dec 25 4:55 AM
can anyone tell me the code "how to create a report to display material number and sales order using two tables MARA and VBAP?"
points will be rewarded for correct answer.
2007 Dec 25 5:03 AM
To display material number and sales order using two tables MARA and VBAP
u can get like this.
DATA:matnr like mara-matnr.
select aMATNR INTO matnr from mara AS a INNER JOIN vbap as b on amatnr = b~matnr
endselect.
Reward Points if useful.
2007 Dec 25 5:05 AM
2007 Dec 25 5:18 AM
>data: begin of itab occurs 0,
> vbeln type vbak-vbeln,
> posnr type vbap-posnr,
> matnr type vbap-matnr,
> end of itab.
>
>select-options: so_vbeln for vbap-vbeln.
>
>select vbeln posnr matnr from vbap
> into table Itab
> where vbeln eq so_vbeln.
OR
> selct avbeln aposnr bmatnr bwerks
> from vbap as a
> join mara as b
> on amatnr = bmatnr
> into table itab ( create a stru related to it)
> where vbeln in so_vbeln.
Award points if helpful
Edited by: jackandjay on Dec 25, 2007 12:19 AM
2007 Dec 25 6:58 AM
can u tell me the code in detail.i am new to sap abap.
points will be rewarded for correct answer.
2007 Dec 25 5:27 AM
Hi Ashwini,
Just a suggestion, since you are new to ABAP, i feel you can obtain the results using SQVI. Here you can insert the tables you want, join the fields & in the layout mode, select the fields you want to be displayed & also select the respective input fields.
For your report, i feel a Join between MARC-VBAP would be better, as you will be able to get the report for a specific plant. The reason for suggestion is, MARA table contains all materials & not specific to a plant & if you run the report, it will take a very long time.
Hope i was able to provide you with some inputs.
Regards,
Vivek
2007 Dec 25 7:17 AM
Hi,
Assume that you have 2 tables Mara and Makt
First fire select query on Mara Table.
i.e select matnr from mara into table it_mara
Now fire query on Makt table
Select matnr maktx from Makt into table it_makt
for all entries in it_mara
where matnr = it_mara-matnr.
here we have joined tables using the For All Entries....
Regards,
DS