Events associated with classical report: 1 initialization 2.at selection-screen-output 3.at selection-screen 4.

at selection-screen on value request for field <fld> 5.start-of-selections 6.top-of-page 7.end-of-page 8.end-of-selection usage : 1.to declare frequently used or default values(PBO). 2.to change the look and feel of screen attributes 3.to validate a particular field i.e fld 4.to validate all the fields present in the screen 5.default event ,which triggers after pressing F8 6.to display the page heading in basic list 7.to disp the footer 8.to display the output. When you link a logical database with an executable program, the GET statements determine the depth to which the logical database is read. When you call the function module LDB_PROCESS, you determine the depth by specifying a node name in the CALLBACK parameter. For each node for which you request data, a callback routine can be executed at two points. These correspond to the GET and GET LATE events in executable programs. In the table parameter CALLBACK, you specify the name of the callback routine and the required execution point for each node. A callback routine is a subroutine in the calling program or another program that is to be executed at the required point. For the GET event, the callback routine is executed directly after the data has been read for the node, and before the subordinate nodes are processed. For the GET_LATE event, the callback routine is processed after the subordinate nodes have been processed. The line type of the table parameter CALLBACK is the flat structure LDBCB from the ABAP Dictionary. It has the following components: LDBNODE Name of the node of the logical database to be read. GET A flag (contents X or SPACE), to call the corresponding callback routine at the GET event. GET_LATE A flag (contents X or SPACE), to call the corresponding callback routine at the GET LATE event. Example

TABLES SPFLI. SELECT-OPTIONS S_CARR FOR SPFLI-CARRID. TYPE-POOLS: RSDS, RSFS. DATA: CALLBACK TYPE TABLE OF LDBCB, CALLBACK_WA LIKE LINE OF CALLBACK. DATA: SELTAB TYPE TABLE OF RSPARAMS,

CALLBACK_WA-GET = 'X'. IF SY-SUBRC 0. CALLBACK_WA-CB_PROG = SY-REPID. CALLBACK_WA-GET_LATE = 'X'. MOVE-CORRESPONDING S_CARR TO SELTAB_WA. APPEND CALLBACK_WA TO CALLBACK. CALLBACK_WA-CB_FORM = 'CALLBACK_SFLIGHT'. CALLBACK_WA-GET = 'X'. CALLBACK_WA-CB_FORM = 'CALLBACK_SPFLI'. ENDLOOP. SELTAB_WA-SELNAME = 'CARRID'. DATA: TEXPR TYPE RSDS_TEXPR. FORM CALLBACK_SPFLI USING NAME TYPE LDBN-LDBNODE . CLEAR CALLBACK_WA. CALL FUNCTION 'LDB_PROCESS' EXPORTING LDBNAME = 'F1S' VARIANT = ' ' EXPRESSIONS = TEXPR FIELD_SELECTION = FSEL TABLES CALLBACK = CALLBACK SELECTIONS = SELTAB EXCEPTIONS LDB_NOT_REENTRANT = 1 LDB_INCORRECT = 2 LDB_ALREADY_RUNNING = 3 LDB_ERROR = 4 LDB_SELECTIONS_ERROR = 5 LDB_SELECTIONS_NOT_ACCEPTED = 6 VARIANT_NOT_EXISTENT = 7 VARIANT_OBSOLETE = 8 VARIANT_ERROR = 9 FREE_SELECTIONS_ERROR = 10 CALLBACK_NO_EVENT = 11 CALLBACK_NODE_DUPLICATE = 12 OTHERS = 13. APPEND SELTAB_WA TO SELTAB. SY-SUBRC. CALLBACK_WA-CB_PROG = SY-REPID. SELTAB_WA-KIND = 'S'.SELTAB_WA LIKE LINE OF SELTAB. CALLBACK_WA-LDBNODE = 'SPFLI'. LOOP AT S_CARR. CALLBACK_WA-LDBNODE = 'SFLIGHT'. FSEL TYPE RSFS_FIELDS. APPEND CALLBACK_WA TO CALLBACK. WRITE: 'Exception with SY-SUBRC'. ENDIF.

The events GET and GET LATE are handled differently in CALLBACK_SPFLI. 1. the required variables are defined for the interface. for SFLIGHT. Occurs 10. WRITE: / WA-CARRID. The structure of F1S is: A program-specific selection screen is defined at the beginning of the program. User Exit http://www. ENDFORM. WA-CONNID. The program is written to read data using the logical database F1S. (It means it will create the 101 rows for the internal table) But where as in defauty the system is create the 8KB size of the memory space for the internal table. WA-CITYTO.sap-img. ULINE.htm http://www. WA-CITYFROM. ULINE. FORM CALLBACK_SFLIGHT USING NAME TYPE LDBN-LDBNODE WA TYPE SFLIGHT EVT TYPE C CHECK TYPE C. ENDFORM. ENDCASE. WRITE: / WA-FLDATE. The interface parameter WA is fully typed. only at the GET event. For SPFLI.com/abap/a-short-tutorial-on-user-exits.Occurs 100. The internal table SELTAB is filled with values for the node SPFLI from the selection table S_CARR from the program-specific selection screen.sap-img. This requires the TABLES statement. so you can address the individual components of the work areas. WHEN 'L'. The program then calls the function module LDB_PROCESS with these parameters. WA-SEATSMAX.com/abap/field-exits-smod-cmod-questions-and-answers.WA TYPE SPFLI EVT TYPE C CHECK TYPE C. WA-SEATSOCC. The internal table CALLBACK is filled so that various callback routines are called in the program for the two nodes SPFLI and SFLIGHT. occurs 0: (It means it will create the default rows for the internal table depend on the requirement) 2. The subroutines CALLBACK_SPFLI and CALLBACK_SFLIGHT serve as callback routines. Next.htm . (It means it will create the 11 rows for the internal table) 3. CASE EVT. WHEN 'G'. the routine is to be called for GET and GET_LATE.

That is when you write some programs which will read that data and load it into SAP. So when you first implement SAP.g. So during go live. In short. You are now replacing all that with SAP. Interfacing is connecting two or more different entities. To customize an existing SAP application we have been provided the user exits by SAP. To see the effect of your whole project you must activate each componnents of your enhancements http://help. You need to somehow pass data back and forth between SAP and these remaining systems. These are typically file based.SMOD is just to see all the enhancements in the sap system. conversions are written to load data into SAP onetime. file based. Now extending our previous example. Thereafter you do coding and other things like making your subscreens or adding fields to standard tables in respective exits. You will still need to do some data transformations/translations etc to make the data understandable to the receiving system. you are actually replacing some of your legacy systems. it is connecting one or more systems with SAP. You then want to load that data into your new SAP system.itcserver. SAP has limited no of enhancements for any transactions.htm A Conversion means data that is converted from one format to another format and from one system to another. enhancement MM06E005 is used for adding custom field in me21/me21n. You still need some of that data from the systems that are being replaced. Data may be going one way or the other way or both ways. XI etc are useful in this). real time(business connector. you want to transfer the POs from your legacy system to SAP. After selecting your enhancements you have to inherit them in your project in CMOD. Imagine you had a home grown purchasing system. you want to keep using your home grown purchasing system. http://www. and the list goes on. So you convert the data. you are replacing some legacy applications but there are some applications that you don't want to replace yet. Interfaces are written to exchange/update/send/receive data between SAP and other systems on an ongoing basis. So you pull the data out of your legacy systems and put them on some files. But until SAP goes live. These exits are packaged under enhancements. idoc based. xml. These can be in many forms.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/con tent. If you want to implement any enhancements then you will create a project and assign the enhancement and do the coding in exits. but you are not completely trashing the data. Now a PO in your legacy system may not have the same fields as a PO in SAP.com/blog/2006/06/29/interactive-reports-in-abap/ . CMOD is the customer projects where enhancements are implemented. You choose an enhancement according to your requirements e. you have to choose only from them to cater your requiement you cant create them. In our case. This will continue as long as you want to keep the systems running alongside SAP.

Sign up to vote on this title
UsefulNot useful