Producing SAP Requests

The following requests and output are examples of the capabilities of the Adapter for SAP using standard ANSI SQL code. These examples require that CREATE SYNONYM has been performed on the relevant tables from the Web Console. You can use the Web Console to navigate the SAP application hierarchy by searching the relevant tables or by doing a simple search by name.


Top of page

Example: Retrieving All Records

The following syntax retrieves all records from T014:

SELECT * FROM T014;

WebFOCUS equivalent of this SQL statement is:

TABLE FILE T014
PRINT *
END

The output is:

Client

Credit Area

Currency

Update

FYI Variant

Risk Categ.

Cred. Limit

Rep. Group

All Codes

800

0001

EUR

000012

 

 

.00

 

 

800

1000

EUR

000012

K4

 

.00

 

 

800

3000

USD

000012

K4

 

.00

 

 

800

5000

JPY

000012

K4

 

.00

 

 

800

6000

MXN

000012

K4

 

.00

 

 

800

R100

EUR

000012

K4

 

.00

 

 

800

R300

USD

000012

K4

 

.00

 

 



Example: Retrieving Selected Fields

The following syntax retrieves selected fields from MARA:

SELECT MARA_MATNR, MARA_MTART, MARA_MATKL, MARA_WRKST, MARA_BISMT FROM 
MARA WHERE MARA_MATKL='999';

The WebFOCUS equivalent of this SQL statement is:

TABLE FILE MARA
PRINT MARA_MATNR MARA_MTART MARA_MATKL MARA_WRKST MARA_BISMT
WHERE MARA_MATKL EQ '999';
END

The output is:

Material

Matl_type

Matl_group

Basic_matl

Matl_no_

000000000000000038

HALB

999

 

 

AM3-GT

KMAT

999

 

 

BG100001

HALB

999

 

 

KR090654

HALB

999

 

 



Example: Joining Two Tables

The following syntax joins the MARA database with the MARC database:

SELECT MARA_MATNR, MARA_WRKST,MARC_WERKS FROM MARA,MARC WHERE 
MARA_MATNR=MARC_MATNR AND MARC_WERKS='5100';

The WebFOCUS equivalent of this SQL statement is:

JOIN CLEAR *
JOIN MARA_MATNR IN MARA TO ALL MARC_MATNR IN MARC AS J0
TABLE FILE MARA
PRINT MARA_MATNR MARA_WRKST MARC_WERKS
WHERE MARC_WERKS EQ '5100';
END

The output is:

Material

Basic_matl

Plant

NC-100-212

 

5100

NC-100-213

 

5100

NC-100-311

 

5100

NC-100-312

 

5100

NC-103-101

 

5100

NC-103-211

 

5100


iWay Software