2014 Aug 28 5:57 AM
Hi Experts,
I have one module pool report. There are two parts of the screen for header and item details.
Now the requirement is if one field in the header part is ticked then dynamically all other fields(both header and item) on the screen should be disabled for input.
And if the user removes the tick mark then all the fields should be dynamically enabled for input.
I know in an executable program this can be done using at selection screen output event. but how to achieve this on screen programming ??
Thanks,
Vishal
2014 Aug 28 1:01 PM
Hi Vishal,
First you have to set a function code for check box, refer snap.
Now on-wards when ever you click on check box the events PAI and then PBO will get triggered.
Write code for disable fields in PBO.
if g_cbox = 'X' .
loop at screen.
endloop.
endif.
Regards
Sreekanth
Hi Experts,
I have one module pool report. There are two parts of the screen for header and item details.
Now the requirement is if one field in the header part is ticked then dynamically all other fields(both header and item) on the screen should be disabled for input.
And if the user removes the tick mark then all the fields should be dynamically enabled for input.
I know in an executable program this can be done using at selection screen output event. but how to achieve this on screen programming ??
Thanks,
Vishal
2014 Aug 28 6:05 AM
Hi
You can use loop at screen in the PBO of the module pool .
You ca check the value of the checkbox and then maintain the input/output characteristics of the fields.
Regards
Vaibhav Juneja
2014 Aug 28 6:15 AM
Hi
create a module in PBO
PROCESS BEFOR OUTPUT.
MODULE screen.
______________________
MODULE screen output.
IF CHECK = 'X'.
loop at screen
<write the logic for disabling like in report.>
endloop.
endif.
ENDMODULE.
regards
laxman
2014 Aug 28 6:34 AM
Hi Laxman,
Thanks for your reply.
Is your logic going to work after the screen is loaded??
Because my requirement is that if the user unchecks the tick mark then the screen fields should be enabled for input.
Regards,
Vishal
2014 Aug 28 6:40 AM
hi
yeah it will work. and also you need to write disbaling logic when user click checkbox
and enabling logic if user not click check box.
regards.
laxman
2014 Aug 28 7:26 AM
Hi Laxman,
I have written the code and it works but I have to press ENTER every time I check or uncheck the checkbox then only the fields are enabled/disabled.
So how to make it work without pressing the Enter button ?
Thanks,
Vishal
2014 Aug 28 9:17 AM
Hi
no need to press enter, can you share your code
regards
laxman
2014 Aug 28 9:58 AM
Hi Laxman,
Below is my screen flow logic. I have written the code you have suggested in the MODULE deactive_screen.
++++++++++++++++++++++++++++++++
PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'YIT_CHG'
MODULE yit_chg_change_tc_attr.
*&SPWIZARD: MODULE YIT_CHG_CHANGE_COL_ATTR.
LOOP AT it_gp
INTO wa_gp
WITH CONTROL yit_chg
CURSOR yit_chg-current_line.
MODULE yit_chg_get_lines.
*&SPWIZARD: MODULE YIT_CHG_CHANGE_FIELD_ATTR
ENDLOOP.
* MODULE STATUS_6001.
*
MODULE status_9001.
MODULE deactive_screen.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'YIT_CHG'
LOOP AT it_gp.
CHAIN.
FIELD wa_gp-yposnr.
FIELD wa_gp-matnr.
FIELD wa_gp-maktx.
FIELD wa_gp-meins.
FIELD wa_gp-gp_qty.
FIELD wa_gp-chall_qty.
FIELD wa_gp-netwr.
FIELD wa_gp-remarks.
FIELD wa_gp-exp_ret.
FIELD wa_gp-cancel.
* FIELD WA_GP-REC_QTY.
* FIELD WA_GP-DOC_QTY.
MODULE yit_chg_modify ON CHAIN-REQUEST.
ENDCHAIN.
FIELD wa_gp-chk
MODULE yit_chg_mark ON REQUEST.
ENDLOOP.
MODULE yit_chg_user_command.
*&SPWIZARD: MODULE YIT_CHG_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE YIT_CHG_CHANGE_COL_ATTR.
* MODULE USER_COMMAND_6001.
MODULE user_command_9001.
+++++++++++++++++++++++++++++++++++
*&---------------------------------------------------------------------*
*& Module DEACTIVE_SCREEN OUTPUT
IF ygp_header_mas-auth = 'X'."This is the check box for enabling/disabling fields,its fetched from DB
LOOP AT SCREEN.
IF screen-name <> 'YGP_HEADER_MAS-AUTH'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE. "deactive_screen OUTPUT
++++++++++++++++++++++++++++++++++
2014 Aug 28 10:01 AM
Hi
check once when you click on checkbox whether the control goes to debugging or not.
regards.
laxman
2014 Aug 28 12:50 PM
Hi,
It only goes to debugging when I check/uncheck and press ENTER button.
Otherwise it doesn't make any changes to the screen fields.
I think PBO wont get triggered without pressing ENTER button.
Is there any other way to do this ?
Thanks,
Vishal .
2014 Aug 28 6:42 AM
Hi Vishal,
Go through following standard report you will get idea.
DEMO_DYNPRO_MODIFY_SCREEN
Regards,
Gireesh
2014 Aug 28 7:38 AM
Hi,
Use this logic, set group for fields,
If check = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'G1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = 'G1'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.
Regards,
Karthik.
2014 Aug 28 1:01 PM
Hi Vishal,
First you have to set a function code for check box, refer snap.
Now on-wards when ever you click on check box the events PAI and then PBO will get triggered.
Write code for disable fields in PBO.
if g_cbox = 'X' .
loop at screen.
endloop.
endif.
Regards
Sreekanth
2014 Aug 28 1:39 PM
Hi Sreekanth,
Awesome...its working perfect now.
You are solving my problems amazingly brother.
Thanks,
Vishal
2016 Apr 05 2:19 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |