Table of Contents

Search

  1. Preface
  2. Part 1: Getting Started with PowerExchange for SAP NetWeaver
  3. Part 2: Data Integration Using PowerExchange for SAP Dynamic ABAP Table Extractor
  4. Part 3: Data Integration Using ABAP
  5. Part 4: IDoc Integration Using ALE
  6. Part 5: Data Integration Using BAPI/RFC Functions
  7. Part 6: Data Migration
  8. Part 7: Business Content Integration
  9. Part 8: SAP BW Data Extraction
  10. Part 9: Loading Data to SAP BI
  11. Appendix A: Data Type Reference
  12. Appendix B: Code Pages and Unicode Support
  13. Appendix C: Glossary

PowerExchange for SAP NetWeaver User Guide for PowerCenter

PowerExchange for SAP NetWeaver User Guide for PowerCenter

Joining Sources Using Open SQL

Joining Sources Using Open SQL

When the Designer generates the ABAP program using open SQL, the ABAP program can perform an inner join or an outer join.
When you use open SQL, the Designer issues multiple SELECT statements. The Designer generates the WHERE clause for the join condition within the nested loop. For example, after the Designer issues the second SELECT statement, it generates the WHERE clause to join the second table with the first table.
The following sample ABAP program is generated using open SQL to join two transparent tables with an inner join. The join order is KONH, KONP. After the Designer generates the SELECT statement for KONH, it generates the WHERE clause to join KONH with KONP:
select KNUMH MANDT [...] LICDT into (KONH-KNUMH,KONH-MANDT,[...] KONH-LICDT) from KONH where (KONH_clause) order by MANDT KNUMH ERNAM .   select MANDT KNUMH KOPOS [...] VBEWA   into (KONP-MANDT,KONP-KNUMH,KONP-KOPOS,[...] KONP-VBEWA)   from KONP   where   KNUMH = KONH-KNUMH and   (KONP_clause)   order by MANDT KNUMH KOPOS .   endselect. [...]
The following sample ABAP program is generated using open SQL to join KONH and KONP with an outer join:
select KNUMH MANDT [...] LICDT into (KONH-KNUMH,KONH-MANDT, [...], KONH-LICDT) from KONH where (KONH_clause) order by MANDT KNUMH ERNAM .   select MANDT KNUMH KOPOS [...] VBEWA   into (KONP-MANDT,KONP-KNUMH,KONP-KOPOS,[...] KONP-VBEWA)   from KONP   where   KNUMH = KONH-KNUMH and   (KONP_clause)   order by MANDT KNUMH KOPOS . [...]   endselect.   if sy-subrc <> 0.     perform move_columns_to_output changing output.     perform terminate_output changing output.   endif. endselect. [...]

0 COMMENTS

We’d like to hear from you!