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: 

SELECT WITHOUT JOIN

Former Member
0 Kudos
88

Sorry people..

How can i do this without join????

SELECT cbldat cbukrs clifnr pname1 crmwwr cbelnr c~gjahr

*c~cpudt

  • creindat cxblnr

  • FROM rbkp AS c

  • INNER JOIN lfa1 AS p

  • ON cmandt = pmandt AND

  • clifnr = plifnr

  • INTO TABLE it_output

  • WHERE c~blart IN p_blartm AND "Tipo de cod

  • c~bukrs IN p_bukrs AND "Sociedad

  • c~lifnr IN p_lifnr AND "Codi Acreedor

  • c~cpudt IN p_cpudt AND "Fecha CPU

  • c~gjahr IN p_gjahr. "Ejercicio

1 ACCEPTED SOLUTION

Former Member
0 Kudos
56
SELECT bldat bukrs lifnr  rmwwr belnr gjahr
cpudt
reindat xblnr
FROM rbkp  INTO  CORRESPONDING FIELDS OF TABLE it_output
 WHERE blart IN p_blartm 
bukrs IN p_bukrs AND 
lifnr IN p_lifnr AND 
cpudt IN p_cpudt AND
gjahr IN p_gjahr.

IF NOT IT_OUTPUT[] IS INITIAL.
  LOOP AT IT_OUTPUT.
     SELECT SINGLE NAME1 FROM LFA1 INTO IT_OUTPUT-NAME1 WHERE LIFNR = IT_OUTPUT-LIFNR .
   MOFIDY IT_OUTPUT TRANSPORTING NAME1 INDEX SY-TABIX.
  ENDLOOP.
ENDIF.
3 REPLIES 3

Former Member
0 Kudos
57
SELECT bldat bukrs lifnr  rmwwr belnr gjahr
cpudt
reindat xblnr
FROM rbkp  INTO  CORRESPONDING FIELDS OF TABLE it_output
 WHERE blart IN p_blartm 
bukrs IN p_bukrs AND 
lifnr IN p_lifnr AND 
cpudt IN p_cpudt AND
gjahr IN p_gjahr.

IF NOT IT_OUTPUT[] IS INITIAL.
  LOOP AT IT_OUTPUT.
     SELECT SINGLE NAME1 FROM LFA1 INTO IT_OUTPUT-NAME1 WHERE LIFNR = IT_OUTPUT-LIFNR .
   MOFIDY IT_OUTPUT TRANSPORTING NAME1 INDEX SY-TABIX.
  ENDLOOP.
ENDIF.

0 Kudos
56

Use For all entries instead of join.

Former Member
0 Kudos
56

Why are you getting rid of the JOIN? Is it for performance?

Rob