Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Skipping Mandatory fields in module pool programming

Former Member
0 Kudos

I developed module pool program with three output fields and one input mandatory field along with these i have some others push buttons to process the data.Now my requirement is if i press clear push button i have to initialize the output field values.

5 REPLIES 5

Former Member
0 Kudos

Hi Sandhaya,

  Basic things needs to do:

1.) Define global variables with same name output screen field names.

2.) In PAI of your screen capture the sy-ucom  of  of your clear button and clear all the global variables once the user will click on clear button.

Let me know if u need more details.

Thanks,

Prakash

karun_prabhu
Active Contributor
0 Kudos

Hello Sandhya Pujari.

     Two key topics of a module pool program: PBO (Process Before Output) and PAI (Process After Input).

     First system to understand what button you have pressed:

     1) Assign function code to the button

     2) Assign function code capturing variable (Eg: OK1001 TYPE SY-UCOMM).

     What the system should do?

     * In PAI module MODULE USER_COMMAND_SCREEN_NUMBER, write the business logic to clear the variable. After PAI, ABAP application server executes PBO which will clear the variable(s) in the screen.     

      

Regards.

Former Member
0 Kudos

Automatic field checks can be avoided by AT EXIT-COMMAND, Which works exactly the same way as cancel works on application tols bar.

code

Process After Inpt.

Module exit AT EXIT-COMMAND.

In module pool program.

Module exit.

Case Okcode.

     When 'Exit'.

     leave to screen 0.

0 Kudos

Hi Sandhya,

Please visit this link, it may help you.

Problem in Module Pool-fill required entry | SCN

Regards,

Vikram

raymond_giuseppi
Active Contributor
0 Kudos
  1. Define the function code associated to pushbutton CLEAR as an exit command.
  2. Add a MODULE AT EXIT-COMMAND at start of PAI logic, there when the button was pressed, set a global defined clear flag to 'X' and leave to current screen.
  3. In the PBO if the clear flag was set, use a LOOP AT SCREEN, and for each field where SCREEN-INPUT is '1', initialize its value : ASSIGN(SCREEN-NAME) TO <fs>. IF sy-subrc EQ 0. CLEAR <fs>. ENDIF. (dynamic) and clear the clear flag

Regards,

Raymond