Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP query to find delivery number of a sales document

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

4 REPLIES 4

Former Member

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

0 Kudos

Hi Mudit,

Can you please explain in detail as I am new to ABAP query.

regards

rama krishna

0 Kudos

read sap help on how to do. use SQVI and put your tables, it will build the join conditions for you

Former Member

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