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

Fields disabled when error message (MESSAGE EXXX) encountered

Former Member
0 Likes
1,234

Hi All,

I have a screen with 2 tabs (TAB1, TAB2) created using the tabstrip wizard (with Scrolling in the Application Server radio button selected).

On TAB1, I have 2 fields FIELD1_1 and FIELD1_2.

I want to perform validation on FIELD1_1 so that when errors are encountered, an error message (e.g. E001) will be displayed.

However, when an error message is encountered, all the fields on TAB1 will be disabled. How do I change my codes below so that:

(1) TAB1 will still be in focus, and

(2) the fields in TAB1 will still be enabled?

Thanks.

===========================================

My codes:

MAIN SCREEN (9000) Flow Logic

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC

...

MODULE PBO_9000.

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC

...

MODULE VALIDATE_FIELDS.

MODULE USER_COMMAND_9000.

Main Program Codes

MODULE VALIDATE_FIELDS INPUT.

PERFORM VALIDATE_LOAD_ID.

ENDMODULE.

FORM VALIDATE_LOAD_ID.

DATA: CHECK_LOAD_ID TYPE I. "0 = DON'T EXIST, 1 = EXIST

SELECT COUNT(*) INTO CHECK_LOAD_ID FROM ...

IF CHECK_LOAD_ID > 0.

MESSAGE E103(ZSCSDM_DMT) WITH 'LOAD ID'.

PERFORM ENABLE_SCREEN.

"I tried to call this subroutine to enable the fields, but this subroutine is never called once the previous MESSAGE statement is hit.

SET CURSOR FIELD 'ZKKA301-LOAD_ID'.

ENDIF.

ENDFORM.

Edited by: Kian Keong on Mar 13, 2008 11:30 PM

Hi All,

I have a screen with 2 tabs (TAB1, TAB2) created using the tabstrip wizard (with Scrolling in the Application Server radio button selected).

On TAB1, I have 2 fields FIELD1_1 and FIELD1_2.

I want to perform validation on FIELD1_1 so that when errors are encountered, an error message (e.g. E001) will be displayed.

However, when an error message is encountered, all the fields on TAB1 will be disabled. How do I change my codes below so that:

(1) TAB1 will still be in focus, and

(2) the fields in TAB1 will still be enabled?

Thanks.

===========================================

My codes:

MAIN SCREEN (9000) Flow Logic

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC

...

MODULE PBO_9000.

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC

...

MODULE VALIDATE_FIELDS.

MODULE USER_COMMAND_9000.

Main Program Codes

MODULE VALIDATE_FIELDS INPUT.

PERFORM VALIDATE_LOAD_ID.

ENDMODULE.

FORM VALIDATE_LOAD_ID.

DATA: CHECK_LOAD_ID TYPE I. "0 = DON'T EXIST, 1 = EXIST

SELECT COUNT(*) INTO CHECK_LOAD_ID FROM ...

IF CHECK_LOAD_ID > 0.

MESSAGE E103(ZSCSDM_DMT) WITH 'LOAD ID'.

PERFORM ENABLE_SCREEN.

"I tried to call this subroutine to enable the fields, but this subroutine is never called once the previous MESSAGE statement is hit.

SET CURSOR FIELD 'ZKKA301-LOAD_ID'.

ENDIF.

ENDFORM.

Edited by: Kian Keong on Mar 13, 2008 11:30 PM

3 REPLIES 3
Read only

Former Member
0 Likes
790

Use the FIELD command in the flow logic if you want to perform validation on a single field. If you have many fields look up the CHAIN, ENDCHAIN.


PROCESS AFTER INPUT.
 field: field1_1 module validate_fields.

Read only

Former Member
0 Likes
790

try to put these fields in chain .. endchain ...

Also .. put error message after enable_screen ...

IF CHECK_LOAD_ID > 0.

PERFORM ENABLE_SCREEN.

SET CURSOR FIELD 'ZKKA301-LOAD_ID'.

MESSAGE E103(ZSCSDM_DMT) WITH 'LOAD ID'.

ENDIF.

ENDFORM.

Read only

Former Member
0 Likes
790

You have to use

CHAIN

......

END CHAIN

statements.

Thanks.