Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7819325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:54:11+00:00 2026-06-02T06:54:11+00:00

I manage to do the selection with more selects and a loop. 4 tables

  • 0

I manage to do the selection with more selects and a loop. 4 tables ( the last one was just for collecting all the data )

But now i’m thinking of a way to select all the fields i need with just one select statement. Here is the huge select 🙂

  SELECT vbak~vbeln vbak~audat
         tvakt~bezei
         vbap~posnr vbap~matnr vbap~kwmeng vbap~vrkme
         lips~vbeln lips~posnr lips~werks lips~lfimg
         vbfa~vbtyp_n
    FROM vbak JOIN vbap ON vbak~vbeln = vbap~vbeln
              JOIN tvakt ON vbak~auart = tvakt~auart
              LEFT JOIN vbfa ON vbfa~vbelv = vbak~vbeln AND vbfa~posnv = vbap~posnr
              JOIN lips ON vbfa~vbeln = lips~vbeln AND vbfa~posnn = lips~posnr
    INTO TABLE gt_salord
    WHERE tvakt~spras = 'EN' AND
          vbak~vbeln IN s_vbeln AND
          vbak~audat IN s_audat.

The problem is this doesn’t work. When i try to activate it throws this error: " Unable to compare with "VBAP~POSNR". A table can be joined with a maximum of one other table using LEFT OUTER JOIN "
If i don’t use LEFT JOIN and only JOIN it works but i don’t get all what i want. I need to get all the SALES ORDERS even if they don’t have a DELIVERY ORDER assigned. Is there a way to do that, or do i really have to split my select?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:54:13+00:00Added an answer on June 2, 2026 at 6:54 am

    I have noticed in SAP that it’s more efficient to simplify select statements and proceed with LOOP and SELECT SINGLE for table that do not participate in data selection.

    In your case data from table VBFA could be fetch after data selection (it is not restricting the amount of data fetched from the DB).

    Of course it depends on indexes, application server buffering… but, even though it might be counter-intuitive for SQL experts, keeping select statements not too complex in SAP is best.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For more than two days now, I'm trying to grab a list of all
How can I manage the user selection on the more view of a UITabBar?
I manage a CakePHP 1.1 CMS website, and our hosts just upgraded PHP to
See the code below. If I initialize more than one entity context, then I
I manage a group of programmers. I do value my employees opinion but lately
I have used a number of grouped tables tied to core data managed objects,
I manage to identify duplicate records from two different databases: select * from taskperformance
I manage project for JNI for both compilers: MSVC++ 8.0 and 9.0, my cpp
I manage a rather large application (50k+ lines of code) by myself, and it
I manage a website for an organization that has a network where several hundred

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.