IT

How to get Text of Domain Value in ABAP/4


CALL FUNCTION ’DOMAIN_VALUE_GET’
   EXPORTING
     I_DOMNAME       = lv_name "Domain Name
     I_DOMVALUE      = lv_value "Domain Value
   IMPORTING
     E_DDTEXT        = lv_text "Text of Domain Value
   EXCEPTIONS
     NOT_EXIST       = 1
     OTHERS          = 2
           .

Get Last Date of Month in ABAP/4


*&---------------------------------------------------------------------*
*&     Form get_last_date_of_month
*&---------------------------------------------------------------------*
*      get last date of month
*----------------------------------------------------------------------*
*     -->P_BEGDA is the date in month that you want to know last date
*     <--P_ENDDA last date of month that system will return to you
*----------------------------------------------------------------------*
form get_last_date_of_month using   p_begda
                           changing p_endda.
CALL FUNCTION ’LAST_DAY_OF_MONTHS’

How to Call Shell Script from ABAP/4


*---------------------------------------------------------------------*
*      FORM CALL_SHELL_SCRIPT                                       *
*---------------------------------------------------------------------*
*      ........                                                     *
*---------------------------------------------------------------------*
* --> PAR_FILENAME                                                 *
*---------------------------------------------------------------------*
FORM call_shell_script USING par_filename.

How to count page number of report in ABAP/4

In the first session we can define TOP-OF-PAGE event as normally and we will insert the special wording replace the page count.

In the second session we will place this code at the last of program. This session will replace back the no. of last page to special wording that you define in the first session. 

*** Note: If the special wording is not in the first line of report, you can change the sentence ’READ LINE 1 OF PAGE SY-INDEX.’ to ’READ LINE X OF PAGE SY-INDEX.’ by X is the no. of line that you want to modify.

How to get windows filename in ABAP/4

Method 1

CALL FUNCTION ’KD_GET_FILENAME_ON_F4’
EXPORTING
MASK = ’,*.txt,*.*’
STATIC = ’X’
CHANGING
FILE_NAME = LV_FILE.

Method 2 


CALL FUNCTION ’F4_FILENAME’
EXPORTING
         program_name = syst-cprog
         dynpro_number = syst-dynnr
         field_name  

Event of Report in ABAP/4

In ABAP/4, the event immidiately begins when the program is running. In general, these events is normally used in the report:

  • INITIALIZATION
    This is the first event when the report generated. We can modify default value of selection screen.
  • AT SELECTION-SCREEN
    If we want to verify input data before executing program, we will use this event. This event is triggered when user press Enter.
  • START-OF-SELECTION
    This event is activated at the main process when the program is executed.
  • END-OF-SELECTION
    This event is activated follow on START-OF-SELECTION event.