Application Development and Automation 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: 
Read only

Create DB view to hold all header sales document data

Former Member
0 Likes
515

hi dear

i want Create DB view to hold all header sales document data on the following tables:

VBAK, VBKD, VBUK, KNA1 as follow:

FROM VBAK:

Sales Document

Created on

Time

Created by

Doc. Currency

Division

Sales Group

Sales Office

FROM VBKD:

Price group

Customer group

Sales district

Price List

Incoterms

Payt Terms

FROM VBUK:

Overall status

Totals status

Pricing

Document cat.

Document object

FROM KNA1:

Name

Name 2

City

Postal Code

Govern.Code

Search term

Street

Telephone 1

Fax Number

One-time acct

Address

2. i want also Select and display all data from that view from program code, sales order will be the only parameter.

Any pointers in this regard are very much helpful.

Regards

Waseem Hesham

hi dear

i want Create DB view to hold all header sales document data on the following tables:

VBAK, VBKD, VBUK, KNA1 as follow:

FROM VBAK:

Sales Document

Created on

Time

Created by

Doc. Currency

Division

Sales Group

Sales Office

FROM VBKD:

Price group

Customer group

Sales district

Price List

Incoterms

Payt Terms

FROM VBUK:

Overall status

Totals status

Pricing

Document cat.

Document object

FROM KNA1:

Name

Name 2

City

Postal Code

Govern.Code

Search term

Street

Telephone 1

Fax Number

One-time acct

Address

2. i want also Select and display all data from that view from program code, sales order will be the only parameter.

Any pointers in this regard are very much helpful.

Regards

Waseem Hesham

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
486

Don't create a view, rather write an program that uses SELECT and INNER JOINS.

matt

Read only

Former Member
0 Likes
486

Hello

SE11 -> View -> Create -> Database view

In column TABLES:

VBAK

VBKD

VBUK

KNA1

Join conditions:

VBUK-MANDT = VBAK-MANDT

VBUK-VBELN = VBAK-VBELN

VBAK-MANDT = VBKD-MANDT

VBAK-VBELN = VBKD-VBELN

KNA1-MANDT = VBAK-MANDT

KNA1-KUNNR = VBAK-KUNNR

View fields:

MANDT VBAK MANDT

VBELN VBAK VBELN

ERDAT VBAK ERDAT

ERZET VBAK ERZET

ERNAM VBAK ERNAM

... ENUMERATE HERE ALL FIELDS YOU NEED

Save and activate.

Then in programm:

tables: z_your_view.

data: itable like z_your_view occurs 0.

parameters: p_vbeln like vbak-vbeln.

select * from z_your_view into table itable where vbeln eq p_vbeln.

anything do with data .....