Database view

 Database view

*  If you want to display the data from more than one table then we pick the data from        each table & merge its & display it.  Then it's better to create database view. 

*  Database view is always involved with more than one table.

Steps to create database view: -

        * Execute SE11. 

        * Select the radio button view. 

        * Provide the data base view name. 

        * Click on create. Enter. 

        * Provide short description. 

        * Provide the related tables in left table. Select all tables. Click on relationships.

        * Select the check box. Enter. 



        * Click on view fields tab. 

        * Click on table fields button. 

        * Select each table. Click on choose. 

        * Select the required fields. 



        * Enter. Save, check, activate.

Refer




code

REPORT ZRP_DATA_VIEW.

select zst_id,
        zst_name,
        zst_dept,
        zst_fee,
        zst_loc,
        zst_phone
        from ZDV_STUDENT
        into table @data(it_zstu).
LOOP AT it_zstu into data(wa_zstu).
  write / wa_zstu-zst_id under 'Student Id',
          wa_zstu-zst_name UNDER 'Student Name',
          wa_zstu-zst_dept UNDER 'Student Dept',
          wa_zstu-zst_fee UNDER 'Student fee',
          wa_zstu-zst_loc under 'Student LOC',
          wa_zstu-zst_phone UNDER 'Student Phone'.


ENDLOOP.

output



Comments

Popular posts from this blog

Pf status and user command in factory method - OOPS ALV in ABAP

fetch the data from table and send an email in ABAP

Enhancements in abap