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: 

Problem with Issuing error Message in TC

ricky_shaw
Contributor
0 Kudos
158

Dear Experts,
I am having a table control and in that i have a column as drop down list box for events. If user selects a wrong event from the drop down,

i issue a pop up "Wrong Event Selected" and then enable the user to correct. But here all the fields are still enabled. User can skip correction.


What i need is the user should be able to proceed further AFTER correction only(in drop down),

I am doing in the following ways:

1) If i issue an info type message to display like E(or Vice-Versa), a pop up raises and if i press ok it disappears and still enables the user to go ahead without correcting the entry. All the fields are still enabled.

2) If i throw an error message it blanks out the whole screen. At this point, i need to re start the whole program which i dont want to do.

I want the user need to correct the same row and then only proceed forward.

How can i do this?

Thanks

Ricky

1 ACCEPTED SOLUTION

Former Member
0 Kudos
124

Hello Ricky,

Lets say, 

     Work Area : gs_data

     Internal Table : gt_data

     Table Control : tc_data

IF gs_data-field EQ 'XYZ'       "Selected Wrong value from dropdown

     CLEAR : gs_data-field.

     MODIFY gt_data FROM gs_data INDEX tc_data-current_line TRANSPORTING field.
     MESSAGE 'Wrong Value Selected' TYPE 'W' DISPLAY LIKE 'E'.
     LEAVE TO SCREEN 8008. OR LEAVE TO SCREEN sy-dynnr

ENDIF.

Proper error message will be thrown to user and the selected value will be cleared so that the user has to select some other value again.

Hopefully it helps.

Rgrds,

Sravan

2 REPLIES 2

Former Member
0 Kudos
125

Hello Ricky,

Lets say, 

     Work Area : gs_data

     Internal Table : gt_data

     Table Control : tc_data

IF gs_data-field EQ 'XYZ'       "Selected Wrong value from dropdown

     CLEAR : gs_data-field.

     MODIFY gt_data FROM gs_data INDEX tc_data-current_line TRANSPORTING field.
     MESSAGE 'Wrong Value Selected' TYPE 'W' DISPLAY LIKE 'E'.
     LEAVE TO SCREEN 8008. OR LEAVE TO SCREEN sy-dynnr

ENDIF.

Proper error message will be thrown to user and the selected value will be cleared so that the user has to select some other value again.

Hopefully it helps.

Rgrds,

Sravan

former_member491621
Contributor
0 Kudos
124

Hi Ricky,

In the PAI module of the Screen Flow Logic, write your validation within the loop on the internal table and use an error message to force the user to enter correct value. Only the line with wrong value must be editable.

Else you can try using the below code in the PAI of the screen.

LOOP AT <your ITAB> INTO <wa>.

CHAIN.

    FIELD <field 1>

    FIELD <dropdown field> MODULE <validate>.

    ...

ENDCHAIN.

Put your code for validation in this module for the field with error type message. It should work fine.

Hope this helps