Questions tagged [opensql]

Open SQL is used for SAP database access in the ABAP programming language.

Presentation

ABAP SQL (named Open SQL before version 7.53), is a set of ABAP statements that performs operations like reads, modifies or deletes data in the SAP database. ABAP SQL is independent of the database system, so the syntax of the ABAP SQL is uniform for all the databases supported by SAP.

All ABAP SQL statements are passed to the database interface. The DB interface converts the ABAP SQL into native SQL and passes it on to the database.

ABAP SQL Description

  • SELECT : Reads data from database
  • INSERT : Inserts lines to database
  • UPDATE : Changes the contents of lines in database
  • MODIFY : Inserts lines into database or changes the contents of existing lines
  • DELETE : Deletes lines from database

Links

ABAP SQL (ABAP documentation)

A complete guide to OpenSQL statements (SAP Community Blog Post)

Related Tags

288 questions
0
votes
1 answer

How to group joins in OpenSQL

I'd like to do the equivalent of SELECT * FROM A LEFT OUTER JOIN (B INNER JOIN C) using OpenSQL. Is this possible and what is the syntax?
user462982
  • 1,635
  • 1
  • 16
  • 26
0
votes
0 answers

ptreq_attabsdata - ptreq_header - ptreq_items join is not getting data

I'm trying to join three tables and call the report with personal number or begin/end date. However gt_outtab is filling with nothing. Can someone help me to make the join work ? I'm sharing whole code below. Thanks. REPORT …
Eldanar
  • 31
  • 1
  • 10
0
votes
3 answers

How to sort rows in "SELECT ... FOR ALL ENTRIES ...", ORDER BY is not accepted

I am selecting a table that has multiple of the same records (same REQUEST_ID) with different VERSION_NO. So I want to sort it descending so I can take the highest number (latest record). This is what I have... IF it_temp2[] IS NOT INITIAL. …
ᴛʜᴇᴘᴀᴛᴇʟ
  • 4,466
  • 5
  • 39
  • 73
0
votes
2 answers

Dynamic Order by [variable] instead of column names?

Is it possible to create a dynamic Order by? something like Select * from ztable_name Order by variable_name Or maybe are there any other way to do similar with this if it is not possible? Thanks, Appreciate any help in advance.
J A
  • 3
  • 3
0
votes
3 answers

How to get results from one's output? (loop within loop)

I am trying to find out the no. of bookings from a table where customer from City = Liverpool; but it seems to give me wrong results. What could have gone wrong? Tables : scustom, sbook. Data : ABCtable type scustom, BKcnt(4) type…
Nironto
  • 3
  • 2
0
votes
1 answer

ABAP retrieving data from database to a screen table control

I need help if possible because i am stuck on a place where there is no syntax errors . I am using abap to retrieve data from my database table to the table control i have in screen 0300 . And whenever i press direct processing in screen 0300 i have…
A.Wad
  • 29
  • 3
  • 9
0
votes
2 answers

Commit for one table

Is it possible to execute a commit only for a selected table? The problem I have is that I do not know if there are more tables updated by the process, so that I want to prevent to update them with my commit! It is mass processing and just at the…
0
votes
2 answers

Show table data on screen

I have a database table named zrswheel .I entered 3 datas and want to show them on screen.Here s my code REPORT ZRS_WHEEL. TYPES: BEGIN OF ty_zrswheel, lv_brand TYPE c, lv_dimension TYPE i, lv_pressure…
user1953051
  • 321
  • 2
  • 7
  • 21
0
votes
1 answer

Join COVP and GLPCA Tables

this topic is rather cryptic for me cause I am no SAP/ABAP developer (SAP tables are for me just a datasource) I have 2 tables COVP and GLPCA. I try to join them but I do not know on which key I can do that. Any idea ? Thanks
laloune
  • 548
  • 1
  • 9
  • 26
0
votes
2 answers

How to make a search in SAP with multiple values

My question is how can I make a search in SAP like the search in MySQL. For example: select * from [table] where id in (1,2,3,4)
user2969234
  • 11
  • 1
  • 2
0
votes
1 answer

search dynamically from any table

I want to make a function module that make the same query, for example: Select column_id from table_name where column_name = name_value. I want to pass the table_name, column name and name_value, so, no matter what table is, I can get the id of the…
Sterling Diaz
  • 3,789
  • 2
  • 31
  • 35
0
votes
1 answer

Not getting data with right conditions?

In select statement i gave right conditions but not getting data back. When i try from se16n with these conditions it turns me one row but when i try in a program with select statement it turns me empty internal table. Here is the sample…
EkremG
  • 131
  • 1
  • 13
0
votes
3 answers

Negate FOR ALL ENTRIES in SELECT query?

I want to fetch those records from transparent table that do not exist in the FOR ALL ENTRIES itab. Whereas default logic is to include those entries which exist in the internal table, I want to exclude them. I want some type of FOR ALL ENTRIES NOT…
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
-1
votes
3 answers

What means the statement "Select ... for all Entries ..."

I was trying to do select for all entries in select statement - abap. I'm not getting the clear idea what select for entries does. Does any one know ? Kindly have a look at the statements below: 1. select bukrs belnr xblnr budat from bkpf …
Siva
  • 3,458
  • 8
  • 25
  • 26
-1
votes
1 answer

ABAP Open SQL - What is the function to return current date?

I'm looking for the equivalent of GETDATE() in SQL Server, but for ABAP Open SQL. I have tried CURRENT_DATE, sy-date but with no success. I've also tried CURDATE() and NOW(), but receive an error on specifically the open parenthesis for each.