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

All about Classes in ABAP Object Oriented Programming?

All about Classes in ABAP Object Oriented Programming? Class describes real world Object that may be car ,home and Animal .In ABAP Object Oriented (OO)Programming ,Class concept is first and Fore most Topic ,so through this post ,we will learn class in ABAP and Types of class and How to create classes and Methods in SAP ABAP. Class consists the Properties and Attributes. Properties are Methods or Functions or Procedures. Attributes are Variables . One class can have Any number of Objects that is Object is like a class but object can never be a Class. Example :Car is a class ,Here class contains some common Properties for its related Objects. Object may be different companies like Ford Maruthi etc. Objects are instances of a class ,so for one class ,we can create many objects Class Definition in SAP ABAP Class: we can build an Object properties using class. The attributes of objects are defined by the components of the class, which describe the state and behavior of O...

What is SAP HANA?

What is SAP HANA? The main features of SAP HANA are given below: SAP HANA is a combination of software and hardware innovation to process huge amount of real time data. Based on multi core architecture in distributed system environment. Based on row and column type of data-storage in database. Advantages of SAP HANA Used extensively in Memory Computing Engine to process and analyze massive amount of real time data. It reduces cost of ownership, increases application performance, enables new applications to run on real time environment that were not possible before. It is written in C , supports and runs on only one Operating System Suse Linux Enterprise Server 11 SP1/2. Today, most successful companies respond quickly to market changes and new opportunities. A key to this is the effective and efficient use of data and information by analyst and managers. HANA overcomes the limitations mentioned below: Due to increase in "Data Volume", it is a challenge f...

SAP had released a two versions for BPC 10.1; they are BPC 10.1 Classic and BPC 10.1 Embedded

SAP had released a two versions for BPC 10.1; they are BPC 10.1 Classic and BPC 10.1 Embedded. The Classic version can be considered an extension of previous versions in the BPC family, and can be used to implement both planning and consolidations solutions. The Embedded version utilizes Integrated Planning and BPC features, and is designed for planning only. Integrated Planning (IP) is a planning tool introduced by SAP before BPC came into effect. Let’s look some of the differences between the Classic and Embedded versions from a configuration perspective: 1. Master and transactional data objects Classic Embedded This version utilizes BPC objects i.e., Dimensions for master data and Models for transactional data. When data is saved in BPC, it will be stored in the SAP BW system under the namespace /CPMB. This method is similar to that used in earlier versions of BPC. This version uses the SAP Business Warehouse (BW) system and its objects directly. Characteri...