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: 

enabling field after an error message without chain-end chain.

Former Member
0 Kudos

Hi folks,

How to enable fields after displaying an error message without chain-end chain codes???

Any pointers to this problem.

Thanking you

19 REPLIES 19

Former Member
0 Kudos

Try using

MESSAGE S001 DISPLAY LIKE 'E'.

The field wil not go in display mode .. if u do so..

Nag

0 Kudos

The execution should stop at the message and should allow the user to edit the field.

By using the status message , the execution is continued.

0 Kudos

Hi..

Exit the loop using flag after the message.

Nag

0 Kudos

exit does not work here

0 Kudos

i hope you are writing this cod ein Module... Endmodule//

This is sample code one of my program

IF (Condition fails).

LF_ERROR = 'X'.

MESSAGE S397(CO) WITH 'Std hours =' GT_TCACTIVITIES-SLM

'/ Max hours =' LF_FACTOR

DISPLAY LIKE 'E'.

ENDIF.

CHECK LF_ERROR IS INITIAL.

PERFORM GET_DATA.

ENDMODULE. " uSER COMMAND

Let me know if u need more info..

Nag

0 Kudos

Hi Naga.

Can u explain it more clearly?

I am writing the code inside a funciton module exit. My module is NOT placed inside the chain - end chain statement. The program execution has to stop once it displays the message and should allow the user to input the value . If i use status or information message, the program execution will not stop.

0 Kudos

Hi Rollinrock

You can't do it out of CHAIN/ENDCHAIN, but you can skip PAI and return to PBO:

PROCESS PBO.

PROCESS PAI.

  MODULE CHECK_ERROR.

MODULE CHECK_ERROR.
   IF FIELD IS INITIAL.
      MESSAGE I208(00) WITH 'Fill FIELD'.
      LEAVE SCREEN.
  ENDIF.
ENDMODULE.

The command LEAVE SCREEN leaves the current screen and goes to the screen set by command SET SCREEN, if this command is not used, the command LEAVE SCREEN goes to pbo of the current screen.

Max

0 Kudos

Hi Max,

the problem is I am writing the code for a subscreen. so leave screen statements does not work for subscreens

0 Kudos

Hi

Use some tricks: for example a flag:

DATA P_1 TYPE FLAG.  "Input/output field of subscreen 101
DATA: FL_LEAVE TYPE FLAG.

CALL SCREEN 100.

Logic of main screen 100

PROCESS BEFORE OUTPUT.
  CALL SUBSCREEN SUBAREA INCLUDING SY-REPID '0101'.
*
PROCESS AFTER INPUT.
  CALL SUBSCREEN SUBAREA.
  MODULE GO_TO_PBO.

Logic of subscreen 101:

PROCESS BEFORE OUTPUT.
*
PROCESS AFTER INPUT.
  MODULE CHECK_P1.

Modules:

MODULE CHECK_P1 INPUT.
  CLEAR FL_LEAVE.
  IF P_1 IS INITIAL.
    MESSAGE I208(00) WITH 'Fill P_1'.
    FL_LEAVE = 'X'.
  ENDIF.
ENDMODULE.                 " CHECK_P1  INPUT

MODULE GO_TO_PBO INPUT.
  CHECK FL_LEAVE = 'X'.
  LEAVE SCREEN.
ENDMODULE.

Max

0 Kudos

Hi,

if you want to enable the fields, then use loop at screen then show an error message.

sample code what i did in my subscreens

LOOP AT SCREEN.

IF screen-name NE 'WB2_EXPENSES_WORKAREA-NETWR' OR

fieldname EQ 'WB2_EXPENSES_WORKAREA-NETWR'.

IF screen-name = fieldname.

screen-required = 1.

screen-input = 1.

ELSE.

screen-input = 0.

ENDIF.

ENDIF.

SET CURSOR FIELD fieldname.

MODIFY SCREEN.

ENDLOOP.

MESSAGE e055(00).

i hope this helps.

Regards,

Yadesh

0 Kudos

Hi max,

I have only a function module exit to code .

I cant change the existing standard programs.

0 Kudos

Hi

That means all u can do it is to submit the module to a FIELD statament in the PAI of subscreen

FIELD <FIELD> MODULE <MODULE>.

Of course...it'll mean to change a standard object if the subscreen is standard

Max

Former Member
0 Kudos

Hi,

I think message display like 'E' still disable the field. Try message type 'S' then stop.

0 Kudos

True,

Displaying the message like 'E' also disables the field to edit. Better would be display the message like 'S' or you can even try like 'I'.... it won't disable the field for editing & you can continue writing in there..

Hope that helps

Rgds

Prateek

Former Member
0 Kudos

Hi,

To my knowledge, in module pool, you gotto use CHAIN...ENDCHAIN to make your other fields open for input even when there is an error.

Try giving an Information message.

Former Member
0 Kudos

Hi ,

I think u have given the error message depending on some condition,

Add the other fields too in CHAIN--ENDCHAIN.

CHAIN

Field ABC

FIeld CDF

MODULE <Error>

ENDCHAIN.

Thanks

Amresh

0 Kudos

*I am writing the code inside a funciton module exit. My module is NOT placed inside the chain - end chain statement. The program execution has to stop once it displays the message and should allow the user to input the value . If i use status or information message, the program execution will not stop.*

Any idea to overcome this problem?

0 Kudos

Hi..

Please check below code..


  MESSAGE s000 DISPLAY LIKE 'E' WITH text-003 .
      LEAVE TO LIST-PROCESSING.

0 Kudos

Mentioning only Module as Exit or not is not an issue. For example Without Using At EXIT-COMMAND module I can simply provide the function type of the Screen Element as E and it will work accordingly. Similarly you can use your logics well with SET SCREEN and LEAVE SCREEN.

Hope this hint was good enough for you.

Regards!