2009 Jun 21 10:38 AM
hello friends,
we use field or chain to enable field if error occurs within pai module.
i use tabstrip control
in main screen there is one tabstrip control.
for that i have two subscreen.
when errors occurs on main screen module then how can i enable the subscrren fields for input mode.
hello friends,
we use field or chain to enable field if error occurs within pai module.
i use tabstrip control
in main screen there is one tabstrip control.
for that i have two subscreen.
when errors occurs on main screen module then how can i enable the subscrren fields for input mode.
2009 Jun 21 12:59 PM
Try this
"main screen's PAI
CHAIN.
FIELD ...
FIELD ...
MODULE main_pai.
ENDCHAIN.
CALL SUBSCREEN sub.
"in program
data: flag type c.
MODULE main_pai INPUT.
if condition = true.
flag = 'X'.
endif.
ENDMODULE.
"subscreen's PAI
CHAIN.
FIELD ...
FIELD ...
MODULE sub_pai.
ENDCHAIN.
"in program
MODULE sub_pai INPUT.
if flag = 'X'.
message 'Please enter correct value' type 'E'.
endif.
ENDMODULE.
Regards
Marcin
2009 Jun 22 3:29 PM
i say when i execute the module of main program. Main program throws the error to me at that time all subscrren fields are disable for input mode so what i do for enabling the subscreen fields.
2009 Jun 22 4:12 PM
Ok, there is no direct soltion because you are working with two screen and can't group those field together.
You could send a W message on main screen's PAI, so after you press ENTER all fields will be back ready for input. The problem is that you want only those fields from subscreen be left active, not those from main screen. This is kind of overcomming solution which comes to my mind:
Lets say we have two fields in main screen:
- SFLIGHT-CARRID
- SFLIGHT-CONNID
And one field in subscreen
- SFLIGHT-FLDATE
Now lets say when you enter CARRID diffetent than 'LH' we will disable CONNID field but leave FLDATE input enabled.
"first in program we declare a strcutre to transfer data b/w screen and program
tables: sflight.
"then we use field FLAG which will indicate when user picks value different from LH
DATA: flag type c.
"and we use additional field for storing field name which is not to be disabled at main screen
DATA: field_name LIKE screen-name.
Now lets say screen 100 is mian screen and 200 is subscreen so the flow dialog will look like:
"screen 100
PROCESS BEFORE OUTPUT.
MODULE pbo_0100.
CALL SUBSCREEN sub_area INCLUDING sy-repid '0200'.
PROCESS AFTER INPUT.
CALL SUBSCREEN sub_area.
FIELD sflight-carrid MODULE validate. "this field we want to validate
Our validate module would look like
MODULE validate INPUT.
IF sflight-carrid ne 'LH'.
MESSAGE 'Only LH entry allowed' TYPE 'W'. "<- message type W will allow to leave rest fields input ready
"we will disable rest fields ourselves
flag = 'X'. "mark that error was encountered
field_name = 'SFLIGHT-CARRID'. "remeber field name where error was raised (we wan't to have ability to correct our entry, so this field must stay input ready)
ELSE.
CLEAR: flag, field_name. "otherwise LH entry so everything input enabled
ENDIF.
ENDMODULE.
In PBO we will therefore disable all fields except this one if error was raised
MODULE pbo_0100 OUTPUT.
LOOP AT SCREEN.
IF flag = 'X' AND screen-name NE field_name.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.
This way each time user select entry other than LH, CONNID field will be disabled, CARRID we will be enabled for correction and subscreen field FLDATE is left input enabled
Regards
Marcin
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |