Showing posts with label BAPI. Show all posts
Showing posts with label BAPI. Show all posts

Wednesday, April 24, 2013

0 SAP ABAP Introducation


SAP ABAP Introducation 
ABAP: (Advanced Business Application Programming)
          ABAP 4 is a programming language developed by SAP for the interactive development of application programming.
           ABAP 4 is a fourth generation language.
           ABAP 4 is tightly integrated across all the modules viz like SD, MM, HR etc..
           All application programs, along with parts of the R/3 Basis system, are written in the ABAP Workbench using ABAP, SAP’s programming language. The individual components of application programs are stored in a special section of the database called the R/3 Repository. The R/3 Repository serves as a central store for all of the development objects in the R/3 System
          It contains the Cross application concept to exchange the data from one system to another system
          EX: SAP to VB
                 JAVA to SAP
Characteristics of ABAP/4:
          ABAP/4 supports business-related data types and operations. You can execute calculations using special date and time fields. The system automatically executes all necessary type conversions.
          ABAP/4 provides a number of functions for processing character strings.
          ABAP/4 allows you to define and call subroutines. You can even call subroutines of other programs. There are different ways of how to pass parameters to and from the subroutines.
          ABAP/4 contains a special type of subroutine, called function module. Function modules are stored and maintained in a central library. They have clearly defined data interfaces to the calling program. You can test function modules in a stand-alone mode independent of the calling program.
          ABAP/4 contains an SQL subset called OPEN SQL. OPEN SQL allows you to read and change database tables independent of the underlying database system.
          ABAP/4 allows you to define and process internal tables that exist only for the execution period of the program. Internal tables most efficiently support the usage of database tables and allow you to implement complex data structures in a program.
          ABAP/4 allows you to store data not only in databases but also as sequential files on application and presentation servers.

   ABAP we have
Reports: Based on the given input we will fetch the data from database and display it in predefined format
They are 2 types of reports
1.Normal reports
2.ALV reports(ABAP List Viewer )
Transaction code SE38.
Data Dictionary: Used for Database Table handling.. etc.
Transaction code SE11
Dialog Programming :
In dialog programming you use the Screen Painter to create screens and program the sequence in which they appear. You write an ABAP/4 program (ABAP/4 module pool) for your screens. This is a collection of dialog modules which are called by the flow logic of your screens. You use dialog programs for both reading and changing database tables.
SAP Scripts :
SAP script is the tightly integrated text management system of the SAP R/3 System.
 It will therefore be used for many different text-processing tasks all over the SAP System.
Example:
 SAP script  is  used for incorporating the   company logo forms sets.                                                                                                                                                                                                                               
SAP Script can be used for printing the Sales order or the purchase order in the company given preprinted format.
Smartforms: Used to develop the business forms
Conversions: conversion programs are used to migrate the data from the legacy system to SAP system
They are 2 types of conversion programs
1.BDC
2.LSMW
Batch Data Communication (BDC)
Batch Data Communication (BDC) offers  transferring of  data into the SAP System from other SAP Systems and non-SAP Systems (legacy systems).
For example, the  data collection in some areas of your company is still performed by a non-SAP system like VB-SQL or Java-Oracle etc. You can still consolidate all of your data in the SAP System by exporting the data from the other system and reading it into the SAP System with batch input.
Enhancements :
1.SAP offers a broad range of functionality with its business application suite.
2.If standard applications do not offer  some of the  functionality  you need, You don’t have to Panic!!
3. R/3 provides the flexibility to Add-on/Bolt-on  any application to its standard functionality This facility is called “Enhancement” and called as “User     Exits”, “Menu Exits”, “Screen Exits” and “Function Exits”.
4. Enhancement offers better alternative to the   problem-ridden modification approach 
  Enhancements are 1.User Exit  
                                  2.Customer Exit
                                  3.BADI’S
                                  4.Enchancement frame work
Work Flows:  
Work flow is used to automate the existing business process                                                                                                                                             
Interface: used to connect the SAP to SAP as well as SAP to non-SAP
This are used to exchange the data from one system to another system
Interfaces are 1.ALE/IDOC
                        2.BADI

Monday, April 8, 2013

0 Uploading Data Using BAPI ( BAPI_BANK_CREATE )


*&---------------------------------------------------------------------*
*& Report  ZBAPI1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report  zbapi1 no standard page heading.

data:begin 
of wa_data,
     bctry 
like bapi1011_key-bank_ctry,
     bkey  
like bapi1011_key-bank_key.
        
include structure bapi1011_address.
data end of wa_data.


data lt_data like table of wa_data.

data : wa_add like bapi1011_address.

data: wa_return 
like bapiret2.

*CALL FUNCTION 'UPLOAD'
*  EXPORTING
*    filetype = 'DAT '
*  TABLES
*    data_tab = lt_data.

*//Local Varible delaration
  data:con_path 
type string.

*// Selection screen design
  
parameters : p_path type rlgrap-filename.

at selection-screen on value-request for p_path.
  
call function 'F4_FILENAME'
    
exporting
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
    
importing
      file_name     = p_path.

start-of-selection.
  con_path = p_path.
*//Uploading Data from Prsenetation Server
  
call function 'GUI_UPLOAD'
    
exporting
      filename = con_path
      filetype = 
'ASC'
    
tables
      data_tab = lt_data.

loop at lt_data into wa_data.
move-corresponding wa_data to wa_add.
call function 'BAPI_BANK_CREATE'
  
exporting
    bank_ctry    = wa_data-bctry
    bank_key     = wa_data-bkey
    bank_address = wa_add
  
importing
    
return       = wa_return.


call function 'BAPI_TRANSACTION_COMMIT'.

if not wa_return is initial.
  write:/ wa_return-message.
endif.
endloop.

 
if sy-subrc eq 0.
    write: 
'SUCCESS'.
  endif.

0 Uploading Data Into SAP DB for FI01 Tcode Using BAPI ( BAPI_BANK_CREATE )

Uploading Data Into SAP DB Using BAPI: ( BAPI_BANK_CREATE )


*&---------------------------------------------------------------------*
*& Report  ZBAPI
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report  zbapi no standard page heading.

data : wa_add like bapi1011_address.
wa_add-bank_name = 
'City bank'.
wa_add-region    = 
'01'.
wa_add-street    = 
'SRNAGER'.
wa_add-city      = 
'HYDERABAD'.

data: wa_return 
like bapiret2.

call function 'BAPI_BANK_CREATE'
  
exporting
    bank_ctry    = 
'IN'
    bank_key     = 
'555544444'
    bank_address = wa_add
  
importing
    
return       = wa_return.


call function 'BAPI_TRANSACTION_COMMIT'.

if not wa_return is initial.
  write:/ wa_return-message.
endif.
 

SAP-ABAP Copyright © 2011 - |- Template created by Vishnu - |- Powered by Blogger Templates