10-17-2008 12:36 PM
Hi Gurus,
Can anyone help me how can i create an ABAP query to fetch the delivery number of a sales order. What are the tables to be joined.
Through tables I got the solution. From VBAP table I fetched the sales order numbers. I copied the sales order numbers and opened VBFA table. In the preceding documents field I had pasted those sales orders numbers. Then I've selected subsequent document category 'J' to get the deliveries.
But now how to write an ABAP query for this.
regards
rama krishna
10-17-2008 1:22 PM
Hi,
Try to use join query like:
Select vbfa~VBTYP_N INTO CORRESPONDING FIELDS OF TABLE itab from VBFA inner join VBAP
where vbapvbeln = VBFAVBELN.
Regards
Mudit
10-17-2008 1:26 PM
Hi Mudit,
Can you please explain in detail as I am new to ABAP query.
regards
rama krishna
10-17-2008 4:32 PM
read sap help on how to do. use SQVI and put your tables, it will build the join conditions for you
10-20-2008 7:40 AM
Hi,
Select VBELN POSNR from VBAP into T_VBAP where VBELN in S_VBELN.
Select VBELN POSNN from vbfa into t_vbfa for all entries in T_VBAP WHERE VBELV = t_vbap-vbeln and POSNV = t_vbap-posnr
In t_vbfa you will delivery number