Another example in SAP - ABAP.

..
I have this View created in DDIC:

And the join conditions are as follows:

Requirements and some description:
* Output a few fields from the SAP Billing Document Header table: VBRK for a 
* specified Company Code.
 
* The Company Code field in the table VBRK is 'BUKRS'.
 
* Input a Company Code through PARAMETERS statement.
 
* In this list, incorporate the Customer Name and the Customer City from the
* Customer primary table: 'KNA1'.
 
* Output the amount field (NETWR) from the table VBRK. The amount in the 
* billing document header can be in different currencies. Convert the currency
* to Company Codes operating currency. This is done by multiplying the amount
* field with the exchange rate field in the VBRK table: KURRF.
 
* In the List Heading (Nonstandard Page Header), output the Company Code, name
* of the Company Code and Currency of the Company Code. The name and the 
* currency of the Company Codes are available in the table: T001. 
* (Fields: BUTXT and CUKY)
 
* You can retrieve the fields BUTXT and WAERS for a Company Code with the
* 'SELECT SINGLE.. ' statement.
 
* View I created: Z_KNA1_VBRK 

So now the table T001:

And the code I have is as follows:
REPORT ZTMP_TEST_INNBOUND2 LINE-SIZE 120 LINE-COUNT 20 NO STANDARD PAGE HEADING.
 
TABLES:
  T001,        "Table of Company Codes.
  Z_KNA1_VBRK. "View I created..
 
DATA:
  CCNAME TYPE T001-BUTXT,   "Company Code Name
  CCCURR TYPE T001-WAERS,   "Company Code Currency
  KNAVBK TYPE Z_KNA1_VBRK,
  AMNICC TYPE Z_KNA1_VBRK-NETWR.
 
PARAMETERS:
  COMPCODE TYPE BUKRS.
 
TOP-OF-PAGE.
  WRITE:
    'Company Code: ', CCNAME, /'Company Currency: ', CCCURR.
 
  SKIP.
 
  WRITE:
    /1(11)  TEXT-001,
    13(8)   TEXT-002,
    22(11)  TEXT-003,
    34(20)  TEXT-004,
    55(10)  TEXT-005,
    66(3)   ' ',
    70(10)  TEXT-007,
    81(10)  TEXT-008.
 
  SKIP.
 
END-OF-PAGE.
  SKIP.
 
START-OF-SELECTION.
 
  " Select Company Code Name and Company Code Currency from Table: T001 (Table of Company Codes).
  SELECT SINGLE BUTXT WAERS FROM T001 INTO (CCNAME, CCCURR) WHERE BUKRS = COMPCODE.
 
  " Select rows from the View we created into the structure: KNAVBK where Company Code in the view is the selected Company Code by the user.
  SELECT * FROM Z_KNA1_VBRK INTO KNAVBK WHERE BUKRS = COMPCODE.
 
  AMNICC = KNAVBK-NETWR * 2.
 
  WRITE:
    /1(11)   KNAVBK-MANDT,   " Client Code
    13(8)    KNAVBK-KUNNR,   " Customer Number
    22(11)   KNAVBK-VBELN,   " Billing Document
    34(20)   KNAVBK-NAME1,   " Customer Name
    55(10)   KNAVBK-NETWR,   " Net Value in Doc Curr.
    66(3)    KNAVBK-WAERK,   " Document Curr.
    70(10)   KNAVBK-KURRF,   " Exchange Rate
    81(10)   AMNICC.
  ENDSELECT.

These are the Text Symbols of the Program:

And when you start the program, you will need to select a Company Code. Then the output will be: