What are Views, how they were useful. Types of Views

Answers were Sorted based on User's Feedback



What are Views, how they were useful. Types of Views..

Answer / uma mb

Views are basically a join of two or more underlying
database tables. Certain tables are logically related and
make sense and more meaning when viewed linked together.
Instead os making these joins at runtime and increasing
overheads, views when existing can provide information
readily such as in Search Helps in data entry screens.

Another example is when there is a table with many fields
and it does not make a lot of sense to see all of them
together everytime, it is better we project only certain
columns that we want to see.

There are four types of views:
a) Database View (Generally used a a read only view)
b) Maintenance View (Used as a means to maintain the
underlying tables participating in the view)
c) Projection View (Single table view)
d) Help View (used in 'search helps' got by pressing F4)

Is This Answer Correct ?    12 Yes 2 No

What are Views, how they were useful. Types of Views..

Answer / pavan

*&----------------------------------------------------------
-----------*
*& Report ZPPINRP_BOM_CREATE
*&
*&----------------------------------------------------------
-----------*
*&
*&
*&----------------------------------------------------------
-----------*

REPORT ZPPINRP_BOM_CREATE.
*&----------------------------------------------------------
-----------*
*& Report ZPPINRP_BOM_CREATE
*&
*&----------------------------------------------------------
-----------*
********* Basic documentation of
ABAP***********************************
* Date: 14-06-
2010 *
* Programmer:
Pavan *
* Program Specification document n°: DDD
document *
* Change
request :
*
* Project : SAP Implementation at Ashok
Leyland *
*
*
* Transport
No.: *
*
*
* Description Creating BOM by uploading data from
File *
*
*
* Called
from:
*
* Call
to:
*
*
*
* Inputs if special
use *
*
Tables:
*
* External files: From Local
System *
*
*
* Outputs if special
use *
*
Reports:
*
*
Tables:
*
*
Databases:
*
*
Screens:
*
* External
files: *
* Other
objects:
*
*
*
* Subroutines if special
use: *
* Includes if special
use: *
* Functions if special
use: *
* Logical
database:
*
*
*
************************************************************
************

*REPORT zppinrp_bom_create NO STANDARD PAGE HEADING LINE-
SIZE 350
* LINE-COUNT 65
* MESSAGE-ID zpp.
*-----------------------------------------------------------
-----------*
*
Tables *
*-----------------------------------------------------------
-----------*
TABLES: mara, " General Material Data
stpo, "BOM item
stas, "BOMs - Item Selection
stko, " BOM Header
mast, " Material to BOM Link
rc29p, " EATAB BOM Items
t001w. " Plants/Branches
*-----------------------------------------------------------
-----------*
*
Declarations *
*-----------------------------------------------------------
-----------*
TYPES: BEGIN OF ty_file,
matnr TYPE mara-matnr, "Material
werks TYPE t001w-werks, " Plant
stlan TYPE rc29n-stlan, " Bom Usage
datuv TYPE rc29n-datuv, " Valid from Date
posnr TYPE rc29p-posnr, " BOm item number
postp TYPE rc29p-postp, " Item Category
idnrk TYPE rc29p-idnrk, " BOM component
menge TYPE rc29p-menge, " Componenet QTy
meins TYPE rc29p-meins, " Component UOM
field_index LIKE sy-tabix,
END OF ty_file.

TYPES: BEGIN OF ty_error,
matnr TYPE mara-matnr,
message TYPE bapiret2-message,
END OF ty_error.

*-----------------------------------------------------------
-----------*
*
Constants *
*-----------------------------------------------------------
-----------*

*-----------------------------------------------------------
-----------*
* Workarea
Declarations *
*-----------------------------------------------------------
-----------*
DATA: is_mmst TYPE bapibommst,
is_stz TYPE bapibomstz,
is_stk TYPE bapibomstk,
is_stpo TYPE bapibomstp,
is_stas TYPE bapibomsta,
is_error TYPE ty_error,
w_cnt(4) TYPE c,
w_ecnt(4) TYPE c.
DATA: l_matnr TYPE mara-matnr,
l_werks TYPE t001w-werks,
l_stlan TYPE mast-stlan.
*-----------------------------------------------------------
-----------*
* Internal
Tables *
*-----------------------------------------------------------
-----------*
DATA : it_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER
LINE,
it_file TYPE ty_file OCCURS 0 WITH HEADER LINE,
it_error TYPE ty_error OCCURS 0 WITH HEADER LINE,
l_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
l_return1 LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
it_stpo TYPE bapibomstp OCCURS 0 WITH HEADER LINE,
it_sta TYPE bapibomsta OCCURS 0 WITH HEADER LINE,
it_stk TYPE bapibomstk OCCURS 0 WITH HEADER LINE.
*-----------------------------------------------------------
-----------*
* Global
varaibles *
*-----------------------------------------------------------
-----------*
DATA: gw_nlines TYPE i.
*-----------------------------------------------------------
-----------*
* Selection
Sceen *
*-----------------------------------------------------------
-----------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-
001.
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
*-----------------------------------------------------------
-----------*
*
Initialization *
*-----------------------------------------------------------
-----------*
INITIALIZATION.
p_file = text-t04.
*-----------------------------------------------------------
-----------*
* At Selection
Screen *
*-----------------------------------------------------------
-----------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM lookup_local_file USING p_file.
AT SELECTION-SCREEN.
* Read data from file
PERFORM pick_up_excelfile.
*-----------------------------------------------------------
-----------*
* Start-Of-
Selection *
*-----------------------------------------------------------
-----------*
START-OF-SELECTION.
* Transpose the internal table
PERFORM transpose_rows_and_columns.
*Fill the bapi structures
PERFORM fill_structures.

*display the result
PERFORM display_result.

*&----------------------------------------------------------
-----------*
*& Form LOOKUP_LOCAL_FILE
*&----------------------------------------------------------
-----------*
* text
*-----------------------------------------------------------
-----------*
* -->P_P_FILE text
*-----------------------------------------------------------
-----------*
FORM lookup_local_file USING pc_file LIKE rlgrap-
filename.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
* DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
file_name = pc_file.
ENDFORM. " LOOKUP_LOCAL_FILE
*&----------------------------------------------------------
-----------*
*& Form PICK_UP_EXCELFILE
*&----------------------------------------------------------
-----------*
* text
*-----------------------------------------------------------
-----------*
* --> p1 text
* <-- p2 text
*-----------------------------------------------------------
-----------*
FORM pick_up_excelfile .
* Pick up the excel file
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '10'
i_end_row = '50000'
TABLES
intern = it_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF it_excel[] IS INITIAL.
MESSAGE e000(zmm) WITH p_file 'File uploaded is empty.'.
ENDIF.
ENDFORM. " PICK_UP_EXCELFILE
*&----------------------------------------------------------
-----------*
*& Form TRANSPOSE_ROWS_AND_COLUMNS
*&----------------------------------------------------------
-----------*
* text
*-----------------------------------------------------------
-----------*
* --> p1 text
* <-- p2 text
*-----------------------------------------------------------
-----------*
FORM transpose_rows_and_columns .
FIELD-SYMBOLS <fs>.
DATA : lw_value(50) TYPE c.
DELETE it_excel WHERE col GT '0010'.
* Convert the upload data into the row format.
LOOP AT it_excel.

lw_value = it_excel-value.

AT NEW col.
ASSIGN COMPONENT it_excel-col OF STRUCTURE it_file TO
<fs>.
<fs> = lw_value.
ENDAT.

AT END OF row.
it_file-field_index = it_excel-row.
APPEND it_file.
CLEAR it_file.
ENDAT.

ENDLOOP.
DESCRIBE TABLE it_file LINES gw_nlines.
ENDFORM. " TRANSPOSE_ROWS_AND_COLUMNS
*&----------------------------------------------------------
-----------*
*& Form FILL_STRUCTURES
*&----------------------------------------------------------
-----------*
* text
*-----------------------------------------------------------
-----------*
* --> p1 text
* <-- p2 text
*-----------------------------------------------------------
-----------*
FORM fill_structures .


CLEAR: l_matnr,
l_werks,
l_stlan,
is_mmst,
is_stz,
is_stpo.
REFRESH : it_stpo,
it_stk,
it_sta,
l_return.

*fill the header details for all the records
LOOP AT it_file.
IF NOT it_file-matnr IS INITIAL.
l_matnr = it_file-matnr.
l_werks = it_file-werks.
l_stlan = it_file-stlan.
ELSE.
it_file-matnr = l_matnr.
it_file-werks = l_werks.
it_file-stlan = l_stlan.
MODIFY it_file.
ENDIF.
ENDLOOP.

CLEAR : l_werks, l_stlan.
LOOP AT it_file.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = it_file-matnr
IMPORTING
output = it_file-matnr.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = it_file-idnrk
IMPORTING
output = it_file-idnrk.

translate it_file-matnr to upper case.
translate it_file-idnrk to upper case.

is_stpo-component = it_file-idnrk.
is_stpo-bom_itm_no = it_file-posnr.
is_stpo-item_cat = it_file-postp.
is_stpo-uncomp = it_file-meins.
is_stpo-compon_qty = it_file-menge.
is_stpo-valid_from = it_file-datuv.
APPEND is_stpo TO it_stpo.

l_werks = it_file-werks.
l_stlan = it_file-stlan.

AT END OF matnr.
is_mmst-material = it_file-matnr.
is_mmst-plant = l_werks."it_file-werks.
is_mmst-bom_usage = l_stlan."it_file-stlan.
is_mmst-lot_sz_min = '0.00'.
is_mmst-lot_sz_max = '99999999'.

is_stz-bom_usage = l_stlan.

is_stk-dsn_office = 'PLM'.
append is_stk to it_stk.
* call bapi
PERFORM bapi_bom_create.

CLEAR: is_mmst, is_stz, is_stpo, is_stk.
REFRESH : it_stpo, it_stk, it_sta.
ENDAT.
ENDLOOP.

ENDFORM. " FILL_STRUCTURES
*&----------------------------------------------------------
-----------*
*& Form BAPI_BOM_CREATE
*&----------------------------------------------------------
-----------*
* text
*-----------------------------------------------------------
-----------*
* --> p1 text
* <-- p2 text
*-----------------------------------------------------------
-----------*
FORM bapi_bom_create .

CALL FUNCTION 'BAPI_BOM_UPLOAD_SAVE'
EXPORTING
is_mast = is_mmst
is_stzu = is_stz
IMPORTING
es_return = l_return
TABLES
it_stko = it_stk
it_stpo = it_stpo
it_stas = it_sta
.

IF l_return-type EQ 'E'.

if l_return-message is initial.
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = l_return-id
msgnr = l_return-number
msgv1 = l_return-MESSAGE_V1
msgv2 = l_return-MESSAGE_V2
msgv3 = l_return-MESSAGE_V3
msgv4 = l_return-MESSAGE_V4
IMPORTING
message_text_output = l_return-message.
endif.

MOVE is_mmst-material TO is_error-matnr.
MOVE l_return-message TO is_error-message.
APPEND is_error TO it_error.
CLEAR is_error.
w_ecnt = w_ecnt + 1.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = l_return1.

FORMAT COLOR 5 INTENSIFIED ON INVERSE OFF.
WRITE:/ is_mmst-material.
w_cnt = w_cnt + 1.
CONDENSE w_cnt.
IF w_cnt EQ '1'.
WRITE:/ 'Successful Records'(t01).
SKIP 1.
ENDIF.
ENDIF.
ENDFORM. " BAPI_BOM_CREATE
*&----------------------------------------------------------
-----------*
*& Form DISPLAY_RESULT
*&----------------------------------------------------------
-----------*
* text
*-----------------------------------------------------------
-----------*
* --> p1 text
* <-- p2 text
*-----------------------------------------------------------
-----------*
FORM display_result .

IF NOT w_cnt IS INITIAL.
WRITE:/ 'Total Successful Records:'(t02), w_cnt.
ENDIF.

SKIP 2.
IF NOT it_error[] IS INITIAL.
WRITE:/ 'Error Records'(t03).
SKIP 1.
FORMAT COLOR 4 INTENSIFIED ON INVERSE OFF.
LOOP AT it_error.
WRITE:/ it_error-matnr, it_error-message.
ENDLOOP.
SKIP 1.
WRITE:/ 'Total No of Error Records'(t05), w_ecnt.
ENDIF.

ENDFORM. " DISPLAY_RESULT

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SAP ABAP Interview Questions

Can you show multiple alvs on a single screen?

0 Answers  


Can Top-of-page trigger with VLINE.?

4 Answers   Satyam,


How do you send files to the legacy systems from SAP and vice versa?

3 Answers   CTS,


I have one BADI Definition , which i have use it in multiple Implementation .Now i am calling the BADI , In which Sequence the BADI will be called ? Can i control the sequence of calling ?

2 Answers   Nissan, Renault Nissan,


Explain what is an rdbms?

0 Answers  






What's the use of AT PF event?

1 Answers   HP,


WHAT IS THE DIFFERENCE BETWEEN FILE PORT AND TRFC PORT ?

2 Answers  


What are logical databases? : abap hr

0 Answers  


What is the effect on Customer Exits and User Exits maintained in a system on Up-gradation .

1 Answers  


Which of the following assigns work to the application server? Options ::Dispatcher, work process, roll area

4 Answers   Accenture,


What are the events in ABAP/4 language?

3 Answers  


How BAPI is Different from call Transaction/Session

2 Answers   Accenture,


Categories
  • SAP Basis Interview Questions SAP Basis (1262)
  • SAP ABAP Interview Questions SAP ABAP (3939)
  • SAPScript Interview Questions SAPScript (236)
  • SAP SD (Sales & Distribution) Interview Questions SAP SD (Sales & Distribution) (2716)
  • SAP MM (Material Management) Interview Questions SAP MM (Material Management) (911)
  • SAP QM (Quality Management) Interview Questions SAP QM (Quality Management) (99)
  • SAP PP (Production Planning) Interview Questions SAP PP (Production Planning) (523)
  • SAP PM (Plant Maintenance) Interview Questions SAP PM (Plant Maintenance) (252)
  • SAP PS (Project Systems) Interview Questions SAP PS (Project Systems) (138)
  • SAP FI-CO (Financial Accounting & Controlling) Interview Questions SAP FI-CO (Financial Accounting & Controlling) (2766)
  • SAP HR (Human Resource Management) Interview Questions SAP HR (Human Resource Management) (1180)
  • SAP CRM (Customer Relationship Management) Interview Questions SAP CRM (Customer Relationship Management) (432)
  • SAP SRM (Supplier Relationship Management) Interview Questions SAP SRM (Supplier Relationship Management) (132)
  • SAP APO (Advanced Planner Optimizer) Interview Questions SAP APO (Advanced Planner Optimizer) (92)
  • SAP BW (Business Warehouse) Interview Questions SAP BW (Business Warehouse) (896)
  • SAP Business Workflow Interview Questions SAP Business Workflow (72)
  • SAP Security Interview Questions SAP Security (597)
  • SAP Interfaces Interview Questions SAP Interfaces (74)
  • SAP Netweaver Interview Questions SAP Netweaver (282)
  • SAP ALE IDocs Interview Questions SAP ALE IDocs (163)
  • SAP Business One Interview Questions SAP Business One (110)
  • SAP BO BOBJ (Business Objects) Interview Questions SAP BO BOBJ (Business Objects) (388)
  • SAP CPS (Central Process Scheduling) Interview Questions SAP CPS (Central Process Scheduling) (14)
  • SAP GTS (Global Trade Services) Interview Questions SAP GTS (Global Trade Services) (21)
  • SAP Hybris Interview Questions SAP Hybris (132)
  • SAP HANA Interview Questions SAP HANA (700)
  • SAP PI (Process Integration) Interview Questions SAP PI (Process Integration) (113)
  • SAP PO (Process Orchestration) Interview Questions SAP PO (Process Orchestration) (25)
  • SAP BI (Business Intelligence) Interview Questions SAP BI (Business Intelligence) (174)
  • SAP BPC (Business Planning and Consolidation) Interview Questions SAP BPC (Business Planning and Consolidation) (38)
  • SAP BODS (Business Objects Data Services) Interview Questions SAP BODS (Business Objects Data Services) (49)
  • SAP BODI (Business Objects Data Integrator) Interview Questions SAP BODI (Business Objects Data Integrator) (26)
  • SAP Ariba Interview Questions SAP Ariba (9)
  • SAP Fiori Interview Questions SAP Fiori (45)
  • SAP EWM (Extended Warehouse Management) Interview Questions SAP EWM (Extended Warehouse Management) (58)
  • Sap R/3 Interview Questions Sap R/3 (150)
  • SAP FSCM Financial Supply Chain Management Interview Questions SAP FSCM Financial Supply Chain Management (101)
  • SAP WM (Warehouse Management) Interview Questions SAP WM (Warehouse Management) (31)
  • SAP GRC (Governance Risk and Compliance) Interview Questions SAP GRC (Governance Risk and Compliance) (64)
  • SAP MDM (Master Data Management) Interview Questions SAP MDM (Master Data Management) (0)
  • SAP MRS (Multi Resource Scheduling) Interview Questions SAP MRS (Multi Resource Scheduling) (0)
  • SAP ESS MSS (Employee Manager Self Service) Interview Questions SAP ESS MSS (Employee Manager Self Service) (13)
  • SAP CS (Customer Service) Interview Questions SAP CS (Customer Service) (0)
  • SAP TRM (Treasury and Risk Management) Interview Questions SAP TRM (Treasury and Risk Management) (0)
  • SAP Web Dynpro ABAP Interview Questions SAP Web Dynpro ABAP (198)
  • SAP IBP (Integrated Business Planning) Interview Questions SAP IBP (Integrated Business Planning) (0)
  • SAP OO-ABAP (Object Oriented ABAP) Interview Questions SAP OO-ABAP (Object Oriented ABAP) (70)
  • SAP S/4 HANA Finance (Simple Finance) Interview Questions SAP S/4 HANA Finance (Simple Finance) (143)
  • SAP FS-CD (Collections and Disbursements) Interview Questions SAP FS-CD (Collections and Disbursements) (0)
  • SAP PLM (Product Lifecycle Management) Interview Questions SAP PLM (Product Lifecycle Management) (0)
  • SAP SuccessFactors Interview Questions SAP SuccessFactors (33)
  • SAP Vistex Interview Questions SAP Vistex (0)
  • SAP ISR (IS Retail) Interview Questions SAP ISR (IS Retail) (28)
  • SAP IdM (Identity Management) Interview Questions SAP IdM (Identity Management) (0)
  • SAP IM (Investment Management) Interview Questions SAP IM (Investment Management) (0)
  • SAP UI5 Interview Questions SAP UI5 (59)
  • SAP SCM (Supply Chain Management) Interview Questions SAP SCM (Supply Chain Management) (51)
  • SAP XI (Exchange Infrastructure) Interview Questions SAP XI (Exchange Infrastructure) (49)
  • SAP Cloud Platform Interview Questions SAP Cloud Platform (34)
  • SAP Testing Interview Questions SAP Testing (89)
  • SAP SolMan (Solution Manager) Interview Questions SAP SolMan (Solution Manager) (63)
  • SAP MaxDB Interview Questions SAP MaxDB (116)
  • SAP GUI Interview Questions SAP GUI (15)
  • SAP AllOther Interview Questions SAP AllOther (329)