What are Views, how they were useful. Types of Views
Answers were Sorted based on User's Feedback
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 |
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 |
What are some control break events in abap?
What is the advantage of structures?
I want to give a input/output field on list , where can I define it?
How many sessions will be opened using bdc_open_group?
1.How can u set more than one selection screen for one report? 2.Where u can provide initial values other than in INITIALIZATION event?
In SAP Query with out know user that query can we execute?
sort statement can sort?
What is a data class? : abap data dictionary
Table ztest has a secondary index on the following fields: tnum, tcode. Select * from ztest where tnum ne '123' and tcode = '456'. Why is the index not used in the above case? Choices: a) Indexes are not allowed on Z tables b) Variables must be used, NOT literals c) Select individual fields, not select * d) Client is not in the where clause e) NE invalidates the use of an index Info: Can someone explain in detail why this happened? It will be really helpful to handle to case in Secondary index:
what are Table-Controls?
explain any one in briefly what are the books we have to buy to study dont say see the help or abap 21 days if u have any other materials to study please suggest me i am unable to understand
What are the mandatory fields to be filled in Transaction Code "VA21" for sales order quotation creation.
SAP Basis (1262)
SAP ABAP (3939)
SAPScript (236)
SAP SD (Sales & Distribution) (2717)
SAP MM (Material Management) (912)
SAP QM (Quality Management) (99)
SAP PP (Production Planning) (523)
SAP PM (Plant Maintenance) (252)
SAP PS (Project Systems) (138)
SAP FI-CO (Financial Accounting & Controlling) (2766)
SAP HR (Human Resource Management) (1180)
SAP CRM (Customer Relationship Management) (432)
SAP SRM (Supplier Relationship Management) (132)
SAP APO (Advanced Planner Optimizer) (92)
SAP BW (Business Warehouse) (896)
SAP Business Workflow (72)
SAP Security (597)
SAP Interfaces (74)
SAP Netweaver (282)
SAP ALE IDocs (163)
SAP Business One (110)
SAP BO BOBJ (Business Objects) (388)
SAP CPS (Central Process Scheduling) (14)
SAP GTS (Global Trade Services) (21)
SAP Hybris (132)
SAP HANA (700)
SAP PI (Process Integration) (113)
SAP PO (Process Orchestration) (25)
SAP BI (Business Intelligence) (174)
SAP BPC (Business Planning and Consolidation) (38)
SAP BODS (Business Objects Data Services) (49)
SAP BODI (Business Objects Data Integrator) (26)
SAP Ariba (9)
SAP Fiori (45)
SAP EWM (Extended Warehouse Management) (58)
Sap R/3 (150)
SAP FSCM Financial Supply Chain Management (101)
SAP WM (Warehouse Management) (31)
SAP GRC (Governance Risk and Compliance) (64)
SAP MDM (Master Data Management) (0)
SAP MRS (Multi Resource Scheduling) (0)
SAP ESS MSS (Employee Manager Self Service) (13)
SAP CS (Customer Service) (0)
SAP TRM (Treasury and Risk Management) (0)
SAP Web Dynpro ABAP (198)
SAP IBP (Integrated Business Planning) (0)
SAP OO-ABAP (Object Oriented ABAP) (70)
SAP S/4 HANA Finance (Simple Finance) (143)
SAP FS-CD (Collections and Disbursements) (0)
SAP PLM (Product Lifecycle Management) (0)
SAP SuccessFactors (33)
SAP Vistex (0)
SAP ISR (IS Retail) (28)
SAP IdM (Identity Management) (0)
SAP IM (Investment Management) (0)
SAP UI5 (59)
SAP SCM (Supply Chain Management) (51)
SAP XI (Exchange Infrastructure) (49)
SAP Cloud Platform (34)
SAP Testing (89)
SAP SolMan (Solution Manager) (63)
SAP MaxDB (116)
SAP GUI (15)
SAP AllOther (329)