Showing posts with label Module Pool. Show all posts
Showing posts with label Module Pool. Show all posts

Friday, April 22, 2022

EVENTS IN MODULE POOL PROGRAM IN SAP ABAP.

EVENTS IN MODULE POOL PROGRAM IN SAP ABAP. 


Process before output (PBO)

Process after input (PAI)

Process on value-request (POV)

Process on help-request (POH)


PROCESS BEFORE OUTPUT:-  This event is triggered before the screen is displayed. This event is used to assign some default values to screen fields. With those values the field will be displayed.


PROCESS AFTER INPUT:-  This event is triggered after giving input to the screen fields. This is used to handle user action actions on the screen.


PROCESS ON VALUE-REQUEST:- This is used to give F4 help to screen fields.


PROCESS ON HELP-REQUEST:- This is used to give F1 help to screen fields.


The in the module pool program should be written between module and endmodule.


AT EXIT-COMMAND:- It is used to go to the leave the screen or process some logic even though some of the mandatory fields of a screen not filled.


SY-UCOMM:- It is a system variable used to catch the  function code that is triggered for user actions on the screen.


OK_CODE:- It is used as substitute for sy-ucomm.


Wednesday, September 30, 2020

Module screen flow statements in SAP ABAP.

Module screen flow statements in SAP ABAP.

Module screen flow statements?

Ans: This statement is used in flow logic to call the define process module pool programs.

Syntax: [FIELD<screen-field>]MODULE<module-name>.

Additions:

      I.        ….AT EXIT-COMMAND: This command is used to trigger the dialogue module in case of push button or menu item with the function type ‘E’ exit is pressed.

    II.        …AT CURSOR-SELECTION: This addition is used to trigger the corresponding module when the cursor is placed on the input field of a screen. It can also be used to trigger corresponding module in case of a push button or menu item with f-type ‘S’ (system) or CS (cursor selection) is pressed.

   III.        CHAIN…ENDCHAIN: This statement is used in flow logic to define the process chains. It can be used to make all the screen input fields enables to enter input data.

Useful additions to CHAIN…ENDCHAIN statement:

      I.        MODULE ON CHAIN-REQUEST: The module with ON CHAIN-REQUEST is used to trigger the corresponding module on the specified screen fields (in the sequence).

    II.        MODULE ON CHAIN INPUT: The module ON CHAIN INPUT is used to check the individual conditions of the screen fields in the sequence.

Q) what is the use of at exit command in mpp?

Ans: At exit Command is mainly used to quit the program.

This command is used to trigger the dialogue module in case of push button or menu item with the function type ‘E’ exit is pressed.

Scenario:

I have five input fields in my screen, all the five fields are mandatory

 i have to go back to the program (LEAVE PROGRAM).

Normally if there is any one mandatory fields in screen if am triggering any event,

that time the system automatically throws an error like  “Please fill in the mandatory fields”.

In that case the AT EXIT COMMAND will be used.

Tuesday, April 21, 2020

Search help in module pool programming in SAP ABAP.


Search help in module pool programming SAP ABAP.

Below Example with programming .

 PROCESS ON VALUE-REQUEST.
  FIELD vbak-ZZPORTLD MODULE f4_ZZORTLD.


MODULE f4_zzortld INPUT.

  
TYPESBEGIN OF ty_value,
       ZCODE   
TYPE  ZCODE,
       ZSDPORT 
TYPE  ZSDPORT1,
         
END OF ty_value.
  
DATA: lt_value TYPE STANDARD TABLE OF ty_value,
        lw_value 
TYPE ty_value.
  
SELECT ZCODE ZSDPORT INTO TABLE lt_value FROM ZSDPORT.
*    WHERE ebeln = rm08m-ebeln.
  
SORT lt_value BY ZCODE ZSDPORT.
  
DELETE ADJACENT DUPLICATES FROM lt_value COMPARING ZCODE ZSDPORT.
  
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    
EXPORTING
      retfield        = 
'ZCODE'
      dynpprog        = sy
-repid
      dynpnr          = sy
-dynnr
      dynprofield     = 
'VBAK-ZZPORTLD'
      value_org       = 
'S'
    
TABLES
      value_tab       = lt_value
    
EXCEPTIONS
      parameter_error = 
1
      no_values_found = 
2
      
OTHERS          3.
  
IF sy-subrc <> 0.
* Implement suitable error handling here
  
ENDIF.
ENDMODULE.