Using BAPI upload excel file for t-code AS02 in SAP

Using BAPI " BAPI_FIXEDASSET_CHANGE " create a zprogram to upload excel file for mass change fixed asset in SAP. REPORT  ZAS02_ASSET_CHANGE_UPLOAD . TYPE-POOLS :  truxs . " Structure for Excel data TYPES :  BEGIN  OF  ty_excel ,          anln1  TYPE  anln1 ,          bukrs  TYPE  bukrs ,          kostl  TYPE  kostl ,          werks  TYPE  werks ,          prctr  TYPE  prctr ,         END  OF  ty_excel . DATA :  lt_excel     TYPE  TABLE  OF  ty_excel ,       ls_excel     TYPE  ty_excel ,     ...

Modularization in SAP ABAP

In SAP ABAP environment, modularization involves the organization of programs into modular units, also known as logical blocks. It reduce redundancy and increases program readability even as you are creating it and subsequently during the maintenance cycle.Modularization also enables reusability of the same code again.ABAP has made it necessary for developers to modularize, organizing the programs relatively more than in the OOPS based language that have relatively more built in modular feature.

Modularization techniques:

  • Subroutines
  • function module
  • Include
  • Field-symbol.
Subroutine: It is a mini program and can be called within program and from outside of the program.
Using Subroutines we can perform calculations, write statement, call function Module etc.

Types of Subroutine :
  • Internal subroutine. 
  • External subroutine.
Passing parameters in Subroutine:
  • Pass by Value
  • Pass by reference
Pass by Value:

DATA X TYPE C VALUE 'APPLE'.
PERFORM SUB USING X.

WRITE:/  X.

FORM SUB USING VALUE(P).

P = 'BAT'.

WRITE:/ P.

ENDFORM.
 
 Pass by reference
 
DATA X  TYPE C   VALUE 'A'.

PERFORM SUB CHANGING X.

WRITE:/  X.

FORM SUB CHANGING P.

P = 'B'.

WRITE:/ P.

ENDFORM.
 
 
 

Comments

Popular posts from this blog

New commodity code create in SAP S/4 Hana

BAPI to Change STO PO/ PO Delivery date in SAP

Alpha IN/OUT to Handle Leading Zeros in SAP ABAP