Go through the program structure below.
You need to follow this structure when you start your coding.
Suppose you have to validate three field in the selection block. You have to write like this...
AT SELECTION SCREEN.
perform validate_field1.
perform validate_field1.
perform validate_field1.
then.....
Double clock on the first perform statement and write the validation code for that field in between the FORM ----- ENDFORM .
Similarly, when you collect the data into an output internal table or display the output table write the code in the respective perform statements only like..
PERFORM GET_OUTPUT.
PERFORM DISPLAY_OUTPUT.
For any action you perform, make sure you write the respective code inside the perform statements ONLY.
************************************************************************
* Program Name :
* Title :
* Requestor :
* Req Recd Date :
* Creation Date :
* SAP Version :
* Author/ Id :
* Based on : (optional)
* Project No. :
*----------------------------------------------------------------------*
* Description :
* :
************************************************************************
* Change History
*----------------------------------------------------------------------*
* Req Date Recd :
* Requestor :
* Change desc :
* :
* SAP Version :
* Done by/ Id :
* Ref in code :
************************************************************************
REPORT <Prog. name> NO STANDARD PAGE HEADING
MESSAGE-ID XX.
********************************************************************
* TABLES
********************************************************************
TABLES:
********************************************************************
* TYPE-POOLS
********************************************************************
********************************************************************
* TYPE DECLARATION
********************************************************************
********************************************************************
* CONSTANTS
********************************************************************
********************************************************************
* DATA DECLARATION
********************************************************************
*WORK FIELDS.
*STRUCTURES DEFINITION.
*INTERNAL TABLES.
*GLOBAL VARIABLES.
********************************************************************
* RANGES
********************************************************************
RANGES:
********************************************************************
* SELECTION-SCREEN.
********************************************************************
*SELECTION VALUES.
* * * * * * * * * * LOGIC SECTION * * * * * * * * *
********************************************************************
* INITIALIZATION .
********************************************************************
INITIALIZATION .
********************************************************************
* AT SELECTION-SCREEN.
********************************************************************
AT SELECTION-SCREEN .
********************************************************************
* START-OF-SELECTION
********************************************************************
START-OF-SELECTION .
********************************************************************
* END-OF-SELECTION.
********************************************************************
END-OF-SELECTION .
********************************************************************
* TOP-OF-PAGE.
********************************************************************
TOP-OF-PAGE .
********************************************************************
* END-OF-PAGE.
********************************************************************
END-OF-PAGE .
********************************************************************
* AT LINE SELECTION.
********************************************************************
********************************************************************
* AT USER COMMAND.
********************************************************************
********************************************************************
* SUBROUTINES.
********************************************************************
*eject
*&---------------------------------------------------------------------*
*& Form validate_scr_input
*&---------------------------------------------------------------------*
* Subroutine to validate screen input values
*----------------------------------------------------------------------*
FORM validate_scr_input.
ENDFORM. “validate_scr_input






