Skip to main content

YCLASSICAL_JOINING

*&---------------------------------------------------------------------* *& Report  YCLASSICAL_JOINING *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT   yclassical_joining  NO   STANDARD   PAGE  HEADING                               LINE - SIZE   110                               LINE - COUNT   255                               MESSAGE - ID  z...

YCLASSICAL_JOINING

*&---------------------------------------------------------------------*
*& Report  YCLASSICAL_JOINING
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  yclassical_joining NO STANDARD PAGE HEADING
                             
LINE-SIZE 110
                             
LINE-COUNT 255
                             
MESSAGE-ID zsan.

** T Y P E    D E C L A R A T I O N **
TYPES : BEGIN OF ty_mara,
         matnr 
TYPE matnr,
         ernam 
TYPE ernam,
         pstat 
TYPE pstat_d,
        
END OF ty_mara,

        
BEGIN OF ty_makt,
         matnr 
TYPE matnr,
         spras 
TYPE spras,
         maktx 
TYPE maktx,
        
END OF ty_makt,

        
BEGIN OF ty_final,
         matnr 
TYPE matnr,
         ernam 
TYPE ernam,
         pstat 
TYPE pstat_d,
         maktx 
TYPE maktx,
        
END OF ty_final.

** D A T A     D E C L A R A T I O N **
DATA : it_mara  TYPE STANDARD TABLE OF ty_mara,
       it_makt  
TYPE STANDARD TABLE OF ty_makt,
       it_final 
TYPE STANDARD TABLE OF ty_final,
       wa_mara  
TYPE ty_mara,
       wa_makt  
TYPE ty_makt,
       wa_final 
TYPE ty_final,
       gv_matnr 
TYPE mara-matnr.

** C O N S T A N T     D E C L A R A T I O N **
CONSTANTS : c_23  TYPE matnr VALUE '23',
            c_100 
TYPE matnr VALUE '100',
            c_eng 
TYPE spras VALUE 'E'.

** S E L E C T I O N    S C R E E N **
SELECTION-
SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.
SELECT-OPTIONS   : s_matnr FOR gv_matnr.
SELECTION-
SCREEN : END OF BLOCK b1.

INITIALIZATION.
  s_matnr-low  = c_23.                                      
"'23'.
  s_matnr-high = c_100.                                     
"'100'.
  
APPEND s_matnr.

START-
OF-SELECTION.
  
SELECT matnr   " Material Number
         ernam   
" Name of Person who Created the Object
         pstat   
" Maintenance status
  
FROM mara INTO TABLE it_mara
  
WHERE matnr IN s_matnr.
  
IF sy-subrc EQ 0.
    
SORT it_mara BY matnr.
    
SELECT matnr
           spras
           maktx
    
FROM makt INTO TABLE it_makt
    
FOR ALL ENTRIES IN it_mara
    
WHERE matnr = it_mara-matnr
    
AND   spras = c_eng.
    
IF sy-subrc NE 0.
      
MESSAGE s001(zsan). " No values found
      
LEAVE LIST-PROCESSING.
    
ENDIF.
  
ELSE.
    
MESSAGE s001(zsan). " No values found
    
LEAVE LIST-PROCESSING.
  
ENDIF.

END-OF-SELECTION.

* Now proceed for output.
  
LOOP AT it_mara INTO wa_mara.

    wa_final-matnr = wa_mara-matnr.
    wa_final-ernam = wa_mara-ernam.
    wa_final-pstat = wa_mara-pstat.

    
READ TABLE it_makt INTO wa_makt WITH KEY matnr = wa_mara-matnr.
    
IF sy-subrc EQ 0.
      wa_final-maktx = wa_makt-maktx.
    
ENDIF.

    
APPEND wa_final TO it_final.
    
CLEAR : wa_final, wa_mara, wa_makt.
  
ENDLOOP.

* Now proceed for output.
  
LOOP AT it_final INTO wa_final.
    
AT FIRST.
      
ULINE.
      
WRITE:/1'|',  'Material Number'(001)     COLOR 1,  19'|',
                    
'Created By'(002)         COLOR 1,  32'|',
                    
'Maintenance status'(003COLOR 1,  60'|',
                    
'Material descp'(004)  COLOR 1,  110'|'.
      
ULINE.
    
ENDAT.

    
WRITE:/1'|', wa_final-matnr,  19'|',
                 wa_final-ernam,  32
'|',
                 wa_final-pstat,  60
'|',
                 wa_final-maktx,  110
'|'.
    
ULINE.

    
AT LAST.
      
WRITE: 1'|''This is the end of report'(004), 110'|'.
      
ULINE.
    
ENDAT.

  
ENDLOOP.







Comments

Popular posts from this blog

Some Basics of SAP ABAP

Some Basics of SAP ABAP.:- 1.What is an ABAP? ABAP (Advanced Business Application Programming) is a high level programming language created by the German software company SAP. It is currently positioned as the language for programming SAP's Web Application Server, part of its NetWeaver platform for building business applications. Its syntax is somewhat similar to COBOL. **************** 2.What is an ABAP data dictionary? ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views. *************** 3.What are domains and data element? Domains:Domain is the central object for describing the technical characteristics of an attribute of an business objects. It describes the value range of the field. Data Element: It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be dis...

Top 35 SAP ABAP Interview Questions

Top 35 SAP ABAP Interview Questions 1) What is SAP ABAP? SAP is a type of software known as ERP (Enterprise Resource Planning) that large company use to manage their day to day affairs. ABAP (Advanced Business Application Programming) is the coding language for SAP to develop RICEFW objects. (Reports, Interfaces, Extensions, Forms and Workflows). 2) What do you mean by an ABAP data dictionary? To describe the logical structures of the objects that are used in application development ABAP 4 data dictionary is used. It is also used to show the underlying relational database in tables. 3) Explain the difference between pool tables and transparent tables? Transparent tables: It has one to one relation with the table in the database. Its structure corresponds to single database field. Pooled tables: It has many to one relation with the table in the database. Pooled tables are stored at the database level. a) Basic List: For simple reports b) Statistics: For Percentage, ...

How to Create SAP ABAP Query Using SQ01 Step by Step Guide

How to Create SAP ABAP Query Using SQ01 Step by Step. You can create ABAP query objects ,if they are not exist in the SAP system. You can create SAP query without  ABAP programming knowledge. ABAP Query provides users with a variety of ways to define and create different types of  reports , such as  Basic Lists ,  Stats , and  Sorted Lists . ABAP query consists of four elements: Queries InfoSets Groups Translation query Queries The query component is used by end users for Queries. You can create queries, change and queries executed. Transaction  SQ01. Trnslation component / QUERY Many texts to define queries, InfoSets and user groups are generated. These texts are displayed in the language we choose to access the SAP system. We can compare the text or languages ​​that use this component. InfoSets InfoSets are the views of the Special Data Sources. An InfoSet Describes the fields of a data source that can be reported in the q...