Application Development and Automation 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: 
Read only

How to keep fields on module pool screen ENABLED

Former Member
0 Likes
2,102

Hi all,

I am designing one module pool program , which contains 2 screens

screen1 :- Selection data,

screen2 :- Details data in Tab Con.

Now from screen1 data , I populate int table and display that in screen2.

Now my requirement is to block user to go to screen2 if int table is empty.

So I have given message in one module in PAI of screen1 , with message type 'E'.

But as soon as this condition is fulfilled i.e .int table is empty ,

message appears , and user cant go further BUT all INPUT fields turn in DISABLED (display only) Mode

and I want all inputs to be ENABLED even if MESSAGE occurs....

My code in flow logic is

 PROCESS AFTER INPUT.

          MODULE GET_DATA_TABCON.

          MODULE VALIDATE_DATA.

          MODULE USER_COMMAND_8000.  

In Module GET_DATA_TABCON , I get int table data and I check the same in

MODULE VALIDATE_DATA as below ..


MODULE validate_data INPUT.

IF IT_FORECAST[] IS INITIAL.
    MESSAGE 'No data found for this selection'  TYPE  'E'.
    LEAVE TO SCREEN '8000'.
  ENDIF.

ENDMODULE.                 " validate_data  INPUT

Could anybody suggest me the solution................

Thanks.................

7 REPLIES 7
Read only

Former Member
0 Likes
1,160

Hi,

1. Check by changing the error mesg type to 'W'

2. Add the error message in between CHAIN ENDCHAIN of those fields.

Once you hit enter after the error message, normally sap makes the fields editable.

Best regards,

Prashant

Read only

0 Likes
1,160

Dear Prashant,

thanks for replying,

I tried your way , but it does not work......one new problem has arisen bcoz of that.....

it does not takes the values of fields on the first screen..even if I make entries in those...i.e. the values of ZSTR_MONTH-ZMONTH,CE1GNPL-GJAHR, KNVV-KUNNR,KNVV-VWERK are initilised.........

My new Flow Logic is


PROCESS AFTER INPUT.
  MODULE GET_DATA_TABCON.
  CHAIN.
    FIELD :  ZSTR_MONTH-ZMONTH,
             CE1GNPL-GJAHR,
             KNVV-KUNNR,
             KNVV-VWERK.
    MODULE VALIDATE_DATA.
  ENDCHAIN.

  MODULE USER_COMMAND_8000.

and MODULE VALIDATE_DATA is as below.........


IF IT_FORECAST[] IS INITIAL.
    MESSAGE 'No data found for this selection' TYPE 'W'.
    EXIT.
  ENDIF.

Could you suggest me a solution........

Thanksssssssssss.

Read only

0 Likes
1,160

Hi,

Try doing the following way.

Dont put chain - endchain.

In your previous code, keep the message type as 'I'.

Now if the itab is empty

Show message [type 'I' ].

else.

go to screen 2.

Hope this helps.

Read only

0 Likes
1,160

Try:

CHAIN.
    FIELD :  ZSTR_MONTH-ZMONTH,
             CE1GNPL-GJAHR,
             KNVV-KUNNR,
             KNVV-VWERK.
    MODULE VALIDATE_DATA ON CHAIN-REQUEST.
  ENDCHAIN.

Read only

0 Likes
1,160

"Add the error message in between CHAIN ENDCHAIN of those fields ' This also works with message type 'E'.

Thanks prashant

Read only

Former Member
0 Likes
1,160

hi,

u should not put error message as it stops the processing.Try doin like this

1.In the PAI after checking the validation u dispay the error message and exit

2.In the second method u can call the second screen explicitl only if the internal table has values, then give a success message and dont call the screen.

Read only

Former Member
0 Likes
1,160

issue resolved ...thanks for ur reply......