Skip to Content
avatar image
Former Member

SUBQUERY with INNER JOIN in ABAP

Hi Expert

How Can I write SUBQUERY with INNER JOIN in ABAP.

thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 30, 2009 at 10:23 AM

    Hi,

    check this code..

    SELECT a~pernr a~begda a~endda a~branc b~nachn b~vorna
     FROM pa0023 as a
       INNER JOIN pa0002 as b  
       ON a_pernr = b~pernr
    INTO TABLE ifinal
    WHERE a~pernr IN ( select pernr from pa0023
    where aedtm = p_aedtm and
    uname ne 'KA51151' )

    .

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks Sidhharth for your Respose

      Actually I need data from VBAP, VBAK, VBUP, VBUK and VBKD with all functional validation satisfied for a sales order item data. The requirement is to report all item data with other information from table VBAK, VBUP, VBUK and VBKD in a corresponding record with ALL data in VBAP.

      Your help is appriciated.

      see the below query for reference

      select alias_vbap~vbeln from vbap as

      alias_vbap inner join vbak as alias_vbak

      on alias_vbapvbeln eq alias_vbakvbeln

      "and alias_vbak~bukrs_vf eq '2400'

      inner join vbuk as alias_vbuk

      on alias_vbukvbeln = alias_vbapvbeln

      inner join vbup as alias_vbup

      on alias_vbupvbeln = alias_vbapvbeln

      and alias_vbupposnr = alias_vbapposnr

      left OUTER join veda as alias_veda

      on alias_vedavbeln = alias_vbapvbeln

      and alias_vedavposn = alias_vbapposnr

      left outer join vbkd as alias_vbkd

      on alias_vbkdvbeln = alias_vbapvbeln

      and alias_vbkdposnr = alias_vbapposnr

  • avatar image
    Former Member
    Apr 30, 2009 at 10:33 AM

    http://help.sap.com/saphelp_nw04/helpdata/en/dc/dc7614099b11d295320000e8353423/content.htm

    SELECT * FROM ( ( MSEG AS A INNER JOIN MKPF AS B ON BMBLNR = AMBLNR )

    INTO TABLE ITAB WHERE A~WERKS IN PLANTS

    AND A~MATNR IN ( SELECT MATNR FROM MARA AS F WHERE MATKL IN MATGRP )

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2009 at 10:32 AM

    ya

    Add comment
    10|10000 characters needed characters exceeded