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

After Getting Error on Screen Changing the same screen data

SrihariNerella
Participant
0 Likes
758

Hi,

I am populating error message in module pool program . I want to edit the fields in the same screen currently it is nor allowing .

I use the CHAIN and ENDCHAIN also .

In my module pool screen i selecting some records if records contains different data the it is populating the error after that in the same screen i want to change the data .

Regrads

Nandan.N

1 ACCEPTED SOLUTION
Read only

sridhar_meesala
Active Contributor
0 Likes
620

Hi,

You can do it using CHAIN...ENDCHAIN.

In the main screen flow logic,

PROCESS BEFORE OUTPUT.
 MODULE STATUS_1000.

PROCESS AFTER INPUT.
 CHAIN.
  FIELD : field1 MODULE check-field1,
              field2 MODULE check-field2,
              field3 MODULE check-field3.
 ENDCHAIN.

Now write the code for these modules in F01 include.

MODULE check-field1 INPUT.

  SELECT SINGLE field1
    FROM ztable
    INTO lv_field1
    WHERE field1 = ztable-field1.

  IF sy-subrc = 0.
    MESSAGE 'field1 already exists' TYPE 'E'.
  ENDIF.

ENDMODULE.                 " check-field1 INPUT

Hope it helps you.

Thanks,

Sri.

4 REPLIES 4
Read only

Former Member
0 Likes
620

Are you using chain. endchain. with the field you want to have the end user fill in:

For example:

Chain.

field: field1, field2, field3.

module error_check.

endchain.

Read only

sridhar_meesala
Active Contributor
0 Likes
621

Hi,

You can do it using CHAIN...ENDCHAIN.

In the main screen flow logic,

PROCESS BEFORE OUTPUT.
 MODULE STATUS_1000.

PROCESS AFTER INPUT.
 CHAIN.
  FIELD : field1 MODULE check-field1,
              field2 MODULE check-field2,
              field3 MODULE check-field3.
 ENDCHAIN.

Now write the code for these modules in F01 include.

MODULE check-field1 INPUT.

  SELECT SINGLE field1
    FROM ztable
    INTO lv_field1
    WHERE field1 = ztable-field1.

  IF sy-subrc = 0.
    MESSAGE 'field1 already exists' TYPE 'E'.
  ENDIF.

ENDMODULE.                 " check-field1 INPUT

Hope it helps you.

Thanks,

Sri.

Read only

0 Likes
620

Hi,

I am getting the data into internal table. Then i am populating the data in PBO event in Display mode . I am selecting some data on that screen. Then i given validation in the screen . After getting error message they do not want go back in the same screen they want to change .

I used the

Chain .

Filed w_final-mark.

Endchain .

But it is not allowing to change the fields .

Regards

Nandan.N

Read only

0 Likes
620

Hi Srihari,

In this case follow the following code,

PROCESS AFTER INPUT.

CHAIN.

FIELD: FIELD_01 MODULE CHECK_FIELD_01,

FIELD_02 MODULE CHECK_FIELD_02,

FIELD_03 MODULE CHECK_FIELD_03,

FIELD_04 MODULE CHECK_FIELD_04.

ENDCHAIN.

Write your validations for the screen FIELD_01 in the MODULE CHECK_FIELD_01

so when you enter data in this field it enters this Module and checks the validations, if value passes the validation then the cursor moves to the next field (i.e. Field_02) otherwise if it fails the validation & you have specified the message type as 'E' then it waits on the same field of the screen till a correct value is entered.

Hope it helps you,

Regards,

Abhijit G. Borkar