12-11-2009 4:19 AM
Hi folks,
How to enable fields after displaying an error message without chain-end chain codes???
Any pointers to this problem.
Thanking you
12-11-2009 4:29 AM
Try using
MESSAGE S001 DISPLAY LIKE 'E'.
The field wil not go in display mode .. if u do so..
Nag
12-11-2009 4:40 AM
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.
12-11-2009 4:42 AM
12-11-2009 5:14 AM
12-11-2009 5:26 AM
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
12-11-2009 9:30 AM
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.
12-11-2009 9:42 AM
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
12-11-2009 10:19 AM
Hi Max,
the problem is I am writing the code for a subscreen. so leave screen statements does not work for subscreens
12-11-2009 10:32 AM
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
12-11-2009 10:38 AM
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
12-11-2009 10:46 AM
Hi max,
I have only a function module exit to code .
I cant change the existing standard programs.
12-11-2009 10:51 AM
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
12-11-2009 6:03 AM
Hi,
I think message display like 'E' still disable the field. Try message type 'S' then stop.
12-11-2009 6:34 AM
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
12-11-2009 6:53 AM
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.
12-11-2009 7:00 AM
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
12-11-2009 9:25 AM
*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?
12-11-2009 9:43 AM
Hi..
Please check below code..
MESSAGE s000 DISPLAY LIKE 'E' WITH text-003 .
LEAVE TO LIST-PROCESSING.
12-11-2009 9:51 AM
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!