Thursday, February 14, 2019

How to download classical report in SAP ABAP ?

Before the start, you need to know what is the classical report, function module, At User command,
set PF Status and SY-UCOMM.
Firstly we clear all concepts and then start the actual code of download classical report's.
Classical Reports:
  • Classical Reports are reports which contain both selection-screen and output screen.
  • SAP ABAP is an event-driven programming language, ABAP programs executed based on events, not line-by-line.  
Function Modules:
  • Function Modules are sub-programs which contains a set of re-usable statements with importing, exporting parameters, exceptions. Unlike include programs Function Modules can be executed independently.
  • You can find the function builder with transaction code SE37.

set pf-status:

  • This event will trigger whenever a user clicks on any custom buttons of the GUI.
  • Syntax: set pf-status. "Triggers user command
 At User Command:
  • This event will trigger whenever a user clicks on any function buttons.
  • Syntax: AT USER-COMMAND. "Triggers user command.
SY-UCOMM:
  • SY-UCOMM is a system variable. It contains the latest user action triggered. It is used for doing the functions what the user wishes to do at that particular event. You can use it in menus and other places. This is mainly used for <pfstatus>.
Create a classical report and download that report in the local machine.
*&---------------------------------------------------------------------*
*& Report  ZCLASSICALDOWN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZCLASSICALDOWN.

TABLES: MARA.  “ Table Name

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: S_MTART TYPE MARA-MTART. “take the input from User material type(FERT)
SELECTION-SCREEN END OF BLOCK B1.
TYPES: BEGIN OF TY_MARA,
        MATNR TYPE MARA-MATNR,  “ Material Number.
        MTART TYPE MARA-MTART,    “ Material Type.
        MATKL TYPE MARA-MATKL,     “ Material Group.
  END OF TY_MARA.
DATA: IT_MARA TYPE TABLE OF TY_MARA. “ Internal table of MARA Table.
DATA: WA_MARA TYPE TY_MARA. “ work-area of MARA Table.

START-OF-SELECTION.
  SET PF-STATUS 'MENU'. “ when you double click on the menu, It will trigger in se51 i.e menu painter and create Download button on GUI.

  SELECT MATNR MTART MATKL FROM MARA INTO TABLE IT_MARA WHERE MTART = S_MTART.  “ fetch data from MARA table into Internal table.

 “ Movie data from Internal table to Work-area.

  LOOP AT IT_MARA INTO WA_MARA.
    WRITE: / WA_MARA-MATNR,WA_MARA-MTART, WA_MARA-MATKL. “ print data
  ENDLOOP.

AT USER-COMMAND.
           IF SY-UCOMM = 'DOWN'.
           CALL FUNCTION 'GUI_DOWNLOAD'   “ call function for downloading the report or we can data.
           EXPORTING
**        BIN_FILESIZE                    =
           FILENAME                        = 'E:\MARA TAB\MARA10.TXT'   “ path of file where data will be stored.
           FILETYPE                        = 'ASC'
**        APPEND                          = ' '
**        WRITE_FIELD_SEPARATOR           = ' '
**        HEADER                          = '00'
**        TRUNC_TRAILING_BLANKS           = ' '
**        WRITE_LF                        = 'X'
**        COL_SELECT                      = ' '
**        COL_SELECT_MASK                 = ' '
**        DAT_MODE                        = ' '
**        CONFIRM_OVERWRITE               = ' '
**        NO_AUTH_CHECK                   = ' '
**        CODEPAGE                        = ' '
**        IGNORE_CERR                     = ABAP_TRUE
**        REPLACEMENT                     = '#'
**        WRITE_BOM                       = ' '
**        TRUNC_TRAILING_BLANKS_EOL       = 'X'
**        WK1_N_FORMAT                    = ' '
**        WK1_N_SIZE                      = ' '
**        WK1_T_FORMAT                    = ' '
**        WK1_T_SIZE                      = ' '
**      IMPORTING
**        FILELENGTH                      =
      TABLES
            DATA_TAB                        = IT_MARA  " Internal Table
**        FIELDNAMES                      =
**      EXCEPTIONS
**        FILE_WRITE_ERROR                = 1
**        NO_BATCH                        = 2
**        GUI_REFUSE_FILETRANSFER         = 3
**        INVALID_TYPE                    = 4
**        NO_AUTHORITY                    = 5
**        UNKNOWN_ERROR                   = 6
**        HEADER_NOT_ALLOWED              = 7
**        SEPARATOR_NOT_ALLOWED           = 8
**        FILESIZE_NOT_ALLOWED            = 9
**        HEADER_TOO_LONG                 = 10
**        DP_ERROR_CREATE                 = 11
**        DP_ERROR_SEND                   = 12
**        DP_ERROR_WRITE                  = 13
**        UNKNOWN_DP_ERROR                = 14
**        ACCESS_DENIED                   = 15
**        DP_OUT_OF_MEMORY                = 16
**        DISK_FULL                       = 17
**        DP_TIMEOUT                      = 18
**        FILE_NOT_FOUND                  = 19
**        DATAPROVIDER_EXCEPTION          = 20
**        CONTROL_FLUSH_ERROR             = 21
**        OTHERS                          = 22
**              .
            IF SY-SUBRC = 0.
                        MESSAGE: 'DATA SUCCESSFULLY DOWNLOADED' TYPE 'S'. “Pass the message so you will gate notification when file gate downloaded.
            ENDIF.
ENDIF.




Previous Topic                                                                                                                                          Next Topic

Tuesday, February 5, 2019

What is SAP ?

What is SAP?
SAP stands for System application & product, Is the name of the company as well as the software itself.
SAP is the ERP (Enterprise Resource Planning) system that aims to integrate all the different modules in the company.As well as we can say it's a 'Centralized system'.
SAP is well-known for its Enterprise Resource Management (ERM) and data management programs.
Before SAP comes in the picture we use Decentralized system.
Let's look at Decentralized system first.















Let's look at the same business process for Centralized System.
In this Case, all departments update a Central Information System.



















Key benefits of the centralized system are:

  • It Eliminates the duplication, discontinuity, and redundancy in data.
  • Provides information across departments in real time.
  • Increases productivity, better inventory management, promotes quality, reduced material cost, effective human resources management, reduced overheads boosts profits.
  • Better customer interaction and increased throughput. It also improves customer service.
  • SAP Software is a centralized enterprise management system also known as Enterprise Resource Planning.
SAP Modules:
SAP Financial Accounting (FI)
SAP FI module as the term suggests deals in managing financial transactions within enterprises. This financial accounting module helps employees to manage data involved in any financial and business transactions in a unified system.
SAP Controlling (CO)
SAP CO module is another important SAP modules offered to enterprises. The controlling module supports in the process works of planning, reporting and monitoring operations of businesses. It involves methods to view and organize costs that are required for financial reporting. The controlling module enables one to plan, track, perform and report about costs.
SAP Sales and Distribution (SD)
SAP SD modules deal in managing all transactions ranging from inquiries, proposals, quotations, pricing and more. The sales and distribution module helps greatly in inventory control and management. SAP SD module consists of master data, system configuration, and transactions.
SAP Production Planning (PP)
SAP PP module is another important module that includes software designed specifically for production planning and management. This module also consists of master data, system configuration and transactions in order to accomplish plan procedure for production. SAP PP module collaborate with master data, sales, and operations planning, distribution resource planning, material requirements planning, Kanban, product cost planning and so on while working towards production management in enterprises.
SAP Materials Management (MM)
SAP MM module as the term suggests manages materials required, processed and produced in enterprises. Different types of procurement processes are managed with this system. Some of the popular sub-components in SAP MM module are vendor master data, consumption-based planning, purchasing, inventory management, invoice verification and so on.
SAP Quality Management (QM)
SAP QM module helps in the management of quality in productions across processes in an organization. This quality management module helps an organization to accelerate their business by adopting a structured and functional way of managing quality in different processes. SAP QM module collaborates in procurement and sales, production, planning, inspection, notification, control, audit management and so on.
SAP Human Capital Management (HCM)
SAP HCM module enhances the work process and data management within the HR department of enterprises. Right from hiring a person to evaluating one’s performance, managing promotions, compensations, handling payroll and other related activities of an HR is processed using this module. The task of managing the details and task flow of the most important resource i.e. human resource is managed using this SAP ERP HCM module.
SAP Advanced Business Application Programming (ABAP)
ABAP is one of the many application-specific fourth-generation languages (4GLs) first developed in the 1980s. It was originally the report language for SAP R/2, a platform that enabled large corporations to build mainframe business applications for materials management and financial and management accounting.ABAP establish integration between independent software.
SAP Basis
SAP Basis is the technical foundation that enables SAP applications to function. It consists of middleware programs and tools that support the interoperability and portability of SAP applications across systems and databases.
SAP Basis is essentially the system administration platform for SAP environments from SAP R/3 through SAP S/4HANA. Its purpose is to make sure that all SAP systems in the environment run smoothly and consistently.
SAP Warehouse Management (WM)
Definition and mapping of the physical warehousing structure in the system.
Processing goods movements like – receipts, issues, and stock transfers.
Maintain up to date stock inventories in the Warehousing complex at storage bin level
                                                                                                                                             Next Topic

Monday, February 4, 2019

What is the ERP ?

What is the ERP definition?

ERP is nothing but 'Enterprise Resource Planning'.Think about all the core processes needed or department's to run a company: finance, HR, manufacturing, supply chain, services, procurement, and others. At its most basic level, ERP 'Integrates' these processes into a single system.
Benefits of ERP:
  • Higher productivity.
  • better insights.
  • Accelerated reporting.
  • Lower risk.
  • Simpler IT.
  • Improved Agility.
How do ERP systems work?
An ERP system also called an ERP suite, is made up of different enterprise resource planning applications that talk to each other and share a database.
Each application (aka ERP module) typically focuses on one business area. You can combine different modules to meet your needs. Finance & Accounting, human resources, sales, marketing, Inventory, Purchase, Customer Relationship Management(CRM), Engineering/ Production, Supply Chain Management (SCM) and logistics are popular starting points. There are also modules specific to industries – from manufacturing to retail.
Types of ERP:
  • Cloud ERP.
  • On-Premise ERP.
  • Hybrid ERP.

ERP Modules:













                                                       




Previous Topic                                                                                  Next  Topic