Skip to Content
author's profile photo Former Member
Former Member

Skipping Mandatory fields in module pool programming

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2013 at 09:31 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 31, 2013 at 09:56 AM

    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.


    a.jpg (42.4 kB)
    a.jpg (64.1 kB)
    a.jpg (40.0 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2013 at 10:21 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 31, 2013 at 11:02 AM

    Hi Sandhya,

    Please visit this link, it may help you.

    Problem in Module Pool-fill required entry | SCN

    Regards,

    Vikram

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 31, 2013 at 12:09 PM
    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.