*
* Inner Join to retrieve the Material Valuation Class pointing to
* which General Ledger.
*
* Based on transaction OBYC - Inventory Posting - BSX
*
* If you use inner join to read data from several logically
* connected tables instead of nested Select statements.
* It will reduce your network load.
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
*
*
REPORT ZVALGL.
TABLES: MARA, "General Material Data
MAKT, "Material Descriptions
MBEW, "Material Valuation
SKAT, "G/L Account Master Record
T025T, "Valuation Class Descriptions
T030. "Standard Accounts Table
DATA: BEGIN OF WA,
BKLAS TYPE MBEW-BKLAS,
BKBEZ TYPE T025T-BKBEZ,
MTART TYPE MARA-MTART,
MATNR TYPE MARA-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF WA,
ITAB LIKE SORTED TABLE OF WA
WITH NON-UNIQUE KEY BKLAS MATNR.
SELECT-OPTIONS: PLANT FOR MBEW-BWKEY MEMORY ID PLT,
MATLTYPE FOR MARA-MTART MEMORY ID TYP,
MATERIAL FOR MBEW-MATNR MEMORY ID MAT,
CHARTACC FOR T030-KTOPL MEMORY ID KTO.
SELECT P~BKLAS
F~MATNR F~MTART
G~MAKTX
T~BKBEZ
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM ( ( ( ( MBEW AS P
INNER JOIN MARA AS F ON P~MATNR = F~MATNR )
INNER JOIN MAKT AS G ON P~MATNR = G~MATNR )
INNER JOIN T025T AS T ON P~BKLAS = T~BKLAS ) )
WHERE P~BWKEY IN PLANT
AND F~MTART IN MATLTYPE
AND P~MATNR IN MATERIAL
AND G~SPRAS = 'E'.
LOOP AT ITAB INTO WA.
CLEAR: T030, SKAT.
SELECT SINGLE * FROM T030 WHERE BKLAS = WA-BKLAS
AND KTOSL = 'BSX'.
SELECT SINGLE * FROM SKAT WHERE SAKNR = T030-KONTS
AND SPRAS = 'E'.
WRITE: / WA, T030-KONTS, SKAT-TXT20.
ENDLOOP.
Friday, April 18, 2008
Inner Join to retrieve the Material Valuation Class SAP ABAP INTERVIEW Questions
Posted by Anonymous at 7:14 AM
Labels: ABAP Interview Questions
Subscribe to:
Post Comments (Atom)
Content
-
►
2009
(2)
- ► 09/06 - 09/13 (1)
- ► 03/01 - 03/08 (1)
-
▼
2008
(207)
- ► 11/23 - 11/30 (1)
- ► 04/20 - 04/27 (70)
-
▼
04/13 - 04/20
(51)
- Difference Between Select-Options & Ranges SAP ABA...
- Inner Join to retrieve the Material Valuation Clas...
- How to used 3 tables for inner joins? SAP ABAP INT...
- Protect Selection/Parameters SAP ABAP INTERVIEW Qu...
- Difference Between Select Single and Select UpTo O...
- Select statement with inner join is taking forever...
- How can we give dynamic table name in select state...
- Performance tuning for Data Selection Statement SA...
- What's the purpose of using PACKAGE SIZE in select...
- Usage of 'for all entries' in Select Statement SAP...
- ABAP Self Test Q & A SAP ABAP INTERVIEW Questions
- What is the difference between SMOD and CMOD? SAP ...
- Split String into two parts at delimiter SAP ABAP ...
- String Handling in ABAP - Removing Unwanted Char S...
- System Fields for Details Lists SAP ABAP INTERVIEW...
- System Landscape: SAP ABAP INTERVIEW Questions
- System Landscape1 SAP ABAP INTERVIEW Questions
- Table Maintenance Generator SAP ABAP INTERVIEW Que...
- TABStrips in ABAP SAP ABAP INTERVIEW Questions
- ABAP Tips and Tricks SAP ABAP INTERVIEW Questions
- Tree type report in ABAP SAP ABAP INTERVIEW Questions
- Explain Unicode-enabled ABAP program SAP ABAP INTE...
- Source Code Listing SAP ABAP INTERVIEW Questions
- What is User Exits and Customer Exits? SAP ABAP IN...
- A Short Tutorial on User Exits SAP ABAP INTERVIEW ...
- Program to Test Line Selection & Scrolling within ...
- Creating new program via ABAP SAP ABAP INTERVIEW Q...
- Program to Hide ABAP's Source Code and Protects it...
- Protect part of ABAP code from modifying SAP ABAP ...
- How to delete an editor lock? SAP ABAP INTERVIEW Q...
- Check Length and Alpha Numeric Variable SAP ABAP I...
- Run or Display ABAP Report over the web SAP ABAP I...
- Working on Polymorphism SAP ABAP INTERVIEW Questions
- How to Write Web Reports in SAP SAP ABAP INTERVIEW...
- Steps to Creating domains, Data Elements, Tables S...
- Function to Display All the Columns of any Table W...
- Difference between Work Area and Header Line SAP A...
- The Different Types of SAP Tables
- Difference between a check table and a value table...
- Quick Note on Design of secondary database indexes...
- How to get the field descriptions of a table? SAP ...
- What is use of using HASHED TABLE?
- How to create a Dynamic Internal Table or Array? S...
- Which table is the developer key stored in? SAP AB...
- What is use of using HASHED TABLE? SAP ABAP INTERV...
- Trace when a variant of a report was created SAP A...
- Difference between extract and collect statements ...
- What Are Different Types Of Internal Tables and Th...
- What is the Different Types and Usage of Views SAP...
- How Loop Works in Internal Tables
- Easy Way To Remember Table In SAP
- ► 03/16 - 03/23 (44)
- ► 02/24 - 03/02 (9)
- ► 02/17 - 02/24 (32)
No comments:
Post a Comment