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: 

How to handle error message during PAI?

Former Member
0 Kudos

Hi Experts,

Need help here.

In my dialog screen, I have a field which is typed 'QUAN'.

In entering different format , e.g. with non numeric value or a negative value, an error message appear and it does not process the MODULES inside the chain or FIELD MODULE ON REQUEST.

Does anyone knows how to handle this kind of error. I need to display into a separate screen the errors I encountered coz I'm creating a new RF transaction.

Points will be rewarded.

Thanks in advance.

2 REPLIES 2

former_member194669
Active Contributor
0 Kudos

Hi

May be this way.


PROCESS BEFORE OUTPUT.
  MODULE INIT_SCREEN_0100.

PROCESS AFTER INPUT.
  MODULE CANCEL AT EXIT-COMMAND.
  MODULE BACK AT EXIT-COMMAND.
  MODULE EXECUTE.


MODULE EXECUTE INPUT.
  if your field is ne do something  "<<<< Your validation
" << collect all messages into i_tem internal table
   MESSAGE I888(BCTRAIN) WITH TEXT-004 OK_CODE INPUT1 INPUT2 into i_temp-message.
  ENDIF.
ENDMODULE.

aRs

former_member188685
Active Contributor
0 Kudos

Hai

in your case(RF case) it is other way...

yes you can use

field x_currency module check_currency.

in module check_currency.

you have to display errors in another screen say 200.

in that there will be 4 fields, all are display only fields.

X_MESSAGE-MSGV1 of type sy-msgv1

X_MESSAGE-MSGV2 of type sy-msgv2

X_MESSAGE-MSGV3 of type sy-msgv3

X_MESSAGE-MSGV4 of type sy-msgv4

you populate the messages with these fields and then display it in the screen.

method check_currency.

*--do all your checks here....

if error

clear x_message.

x_message-msgv1 = 'Enter Valid Employee Number'(004).

leave to screen 0200.

endif.

endif.

ENDMODULE. " VALIDATE_Currency

in screen 200 PBO you need to format the message

using the below logic.

----


  • Method for formatting the message

----


method message_format.

data : lt_text type table of tline, "text table

lx_text type tline. "work area

refresh lt_text.

clear lx_text.

concatenate x_message-msgv1 x_message-msgv2 into lx_text-tdline

separated by space.

append lx_text to lt_text.

clear lx_text.

concatenate x_message-msgv3 x_message-msgv4 into lx_text-tdline

separated by space.

append lx_text to lt_text.

*- formatting the message

call function 'FORMAT_TEXTLINES'

exporting

formatwidth = 20

tables

lines = lt_text

exceptions

bound_error = 1

others = 2.

clear: x_message.

*- transfer the message data to screen fields

loop at lt_text into lx_text.

if sy-tabix = 1.

x_message-msgv1 = lx_text-tdline.

elseif sy-tabix = 2.

x_message-msgv2 = lx_text-tdline.

elseif sy-tabix = 3.

x_message-msgv3 = lx_text-tdline.

elseif sy-tabix = 4.

x_message-msgv4 = lx_text-tdline.

else.

exit.

endif.

endloop.

endmethod. "message_format

Regards

Vijay