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: 

join query help

Former Member
0 Kudos

hi

i am encountering error like the values not getting populated in internal table though values are in dbtable...so if u can help me out in the join query it will be of gr8 help

SELECT a1~guid a1~posting_date a1~process_type
       b1~sales_org b1~division b1~dis_channel
       INTO CORRESPONDING FIELDS OF TABLE it_ordel
       FROM ( ( crmd_orderadm_h AS a1 INNER JOIN crmd_link AS c1 ON a1~guid  = c1~guid_hi )
                INNER JOIN crmd_orgman AS b1 ON c1~guid_hi = b1~guid )
       WHERE c1~objtype_hi = '05'
       AND   c1~objtype_set = '21'.
    AND   a1~process_type IN so_prst
       AND   a1~posting_date IN so_podt
       AND   b1~division     IN so_div.

thnx

1 ACCEPTED SOLUTION

Former Member
0 Kudos

For a start, you are best to stop using the a1....b1. Use the actual table name instead. It makes the SQL easier to read.

3 REPLIES 3

Former Member
0 Kudos

For a start, you are best to stop using the a1....b1. Use the actual table name instead. It makes the SQL easier to read.

Former Member
0 Kudos
SELECT a1~guid a1~posting_date a1~process_type
       b1~sales_org b1~division b1~dis_channel
       INTO CORRESPONDING FIELDS OF TABLE it_ordel
       FROM ( ( crmd_orderadm_h AS a1 INNER JOIN crmd_link AS c1 ON a1~guid  = c1~guid_hi )
                INNER JOIN crmd_orgman AS b1 ON c1~guid_hi = b1~guid )
       WHERE c1~objtype_hi = '05'
       AND   c1~objtype_set = '21'.
    AND   a1~process_type IN so_prst
       AND   a1~posting_date IN so_podt
       AND   b1~division     IN so_div.

SELECT a1~guid a1~posting_date a1~process_type
       b1~sales_org b1~division b1~dis_channel
       INTO CORRESPONDING FIELDS OF TABLE it_ordel
       FROM ( ( crmd_orderadm_h AS a1 INNER JOIN crmd_link AS c1 ON a1~guid  = c1~guid_hi )
                INNER JOIN crmd_orgman AS b1 ON c1~guid_hi = b1~guid )
       WHERE c1~objtype_hi = '05'
       AND   c1~objtype_set = '21'    ".              delete that period its wrong
    AND   a1~process_type IN so_prst
       AND   a1~posting_date IN so_podt
       AND   b1~division     IN so_div.

Former Member
0 Kudos

Hey why do you have . after first AND. is it not giving u sysntax error.

Regards,

Uma Dave

Edited by: UmaDave on Jul 2, 2010 11:23 AM