Application Development and Automation 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: 
Read only

Module pool check box - dynamic enable/disable screen fields possible ?

Former Member
0 Likes
9,762

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

1 ACCEPTED SOLUTION
Read only

former_member202818
Active Contributor
0 Likes
5,648

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

14 REPLIES 14
Read only

Former Member
0 Likes
5,648

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

Read only

Former Member
0 Likes
5,648

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

Read only

0 Likes
5,648

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

Read only

0 Likes
5,648

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

Read only

0 Likes
5,648

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

Read only

0 Likes
5,648

Hi

no need to press enter, can you share your code

regards

laxman

Read only

0 Likes
5,648

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

++++++++++++++++++++++++++++++++++

Read only

0 Likes
5,648

Hi

check once when you click on checkbox whether the control goes to debugging or not.

regards.

laxman

Read only

0 Likes
5,648

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 .

Read only

gireesh_kokate
Explorer
0 Likes
5,648

Hi Vishal,

Go through following standard report you will get idea.

DEMO_DYNPRO_MODIFY_SCREEN

Regards,

Gireesh

Read only

Former Member
0 Likes
5,648

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.

Read only

former_member202818
Active Contributor
0 Likes
5,649

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

Read only

0 Likes
5,648

Hi Sreekanth,

Awesome...its working perfect now.

You are solving my problems amazingly brother.

Thanks,

Vishal

Read only

Former Member
0 Likes
5,648

Solved my problem.

Thanks Sreekanth