‎2006 Jul 31 6:26 AM
Hi,
I have a maintainance view. One of the fields contains a checkbox. If I check the checkbox i want to change input fields of that row to output fields. And if I uncheck the checkbox, the viceversa should happen.
I tried doing this by calling a module in PAI block. In that module I looped through the screen structure and made screen-input = 0 for the fields I want to make as output fields.
But I dont get the result.
Can anyone help me out as how I can do this?
Thanks,
Reena
‎2006 Jul 31 7:08 AM
Hi Prashant,
I already tried as you said but by giving screen-input = 0 as I want to make the fields as output fields. But it doesn't work. When i debug, I find the function module gets called and screen-input value for fields is set to 0. But I dont see the result in the view.
I guess that screen-input is getting reset back to 1 after my module is called. So I am not sure if i am calling my module from the right place.
Here is my PAI block. The code in bold below is where i am calling the module. Is it the right place?
PROCESS AFTER INPUT.
MODULE liste_exit_command AT EXIT-COMMAND.
MODULE liste_before_loop.
LOOP AT extract.
MODULE liste_init_workarea.
CHAIN.
FIELD v_t5asrmsgmap1s-msgty .
FIELD v_t5asrmsgmap1s-msgid .
FIELD v_t5asrmsgmap1s-msgno .
FIELD v_t5asrmsgmap1s-msgtxt .
FIELD v_t5asrmsgmap1s-hide_message .
FIELD v_t5asrmsgmap1s-alt_msgty .
FIELD v_t5asrmsgmap1s-alt_msgid .
FIELD v_t5asrmsgmap1s-alt_msgno .
FIELD v_t5asrmsgmap1s-alt_msgtxt .
MODULE check_fields_view1s.
MODULE set_update_flag ON CHAIN-REQUEST.
MODULE complete_v_t5asrmsgmap1s ON CHAIN-REQUEST.
ENDCHAIN.
FIELD vim_marked MODULE liste_mark_checkbox.
CHAIN.
FIELD v_t5asrmsgmap1s-msgty .
FIELD v_t5asrmsgmap1s-msgid .
FIELD v_t5asrmsgmap1s-msgno .
MODULE liste_update_liste.
ENDCHAIN.
<b> chain.
FIELD v_t5asrmsgmap1s-hide_message .
module on_hide_message.
endchain</b>.
ENDLOOP.
MODULE liste_after_loop.
-Reena
‎2006 Jul 31 6:42 AM
Hi,
In the PAI, use the following :
CHAIN.
Field : p_checkbox.
Module Change_fields.
ENDCHAIN.
In Module Change_fields.
if p_checkbox = `X`.
LOOP at screen.
if screen-name = `EMPID`.
screen-input = 1.
endif.
modify screen.
endloop.
endif.
CHAIN. ENDCHAIN. helps to track all kind of changes in the screen fields. For anychange in the screen field CHECKBOX, module Change_fields would be called. You can check the same in Debug mode.
Best regards,
Prashant
‎2006 Jul 31 7:08 AM
Hi Prashant,
I already tried as you said but by giving screen-input = 0 as I want to make the fields as output fields. But it doesn't work. When i debug, I find the function module gets called and screen-input value for fields is set to 0. But I dont see the result in the view.
I guess that screen-input is getting reset back to 1 after my module is called. So I am not sure if i am calling my module from the right place.
Here is my PAI block. The code in bold below is where i am calling the module. Is it the right place?
PROCESS AFTER INPUT.
MODULE liste_exit_command AT EXIT-COMMAND.
MODULE liste_before_loop.
LOOP AT extract.
MODULE liste_init_workarea.
CHAIN.
FIELD v_t5asrmsgmap1s-msgty .
FIELD v_t5asrmsgmap1s-msgid .
FIELD v_t5asrmsgmap1s-msgno .
FIELD v_t5asrmsgmap1s-msgtxt .
FIELD v_t5asrmsgmap1s-hide_message .
FIELD v_t5asrmsgmap1s-alt_msgty .
FIELD v_t5asrmsgmap1s-alt_msgid .
FIELD v_t5asrmsgmap1s-alt_msgno .
FIELD v_t5asrmsgmap1s-alt_msgtxt .
MODULE check_fields_view1s.
MODULE set_update_flag ON CHAIN-REQUEST.
MODULE complete_v_t5asrmsgmap1s ON CHAIN-REQUEST.
ENDCHAIN.
FIELD vim_marked MODULE liste_mark_checkbox.
CHAIN.
FIELD v_t5asrmsgmap1s-msgty .
FIELD v_t5asrmsgmap1s-msgid .
FIELD v_t5asrmsgmap1s-msgno .
MODULE liste_update_liste.
ENDCHAIN.
<b> chain.
FIELD v_t5asrmsgmap1s-hide_message .
module on_hide_message.
endchain</b>.
ENDLOOP.
MODULE liste_after_loop.
-Reena
‎2006 Jul 31 7:21 AM
Reena,
no it's not the right place. The formatting of your output has to be done at the pbo. So you have to recognise that the request has been made at pai and then act on it at pbo.
‎2006 Jul 31 7:28 AM
‎2006 Jul 31 7:13 AM
Hi,
Please paste the Module module on_hide_message.
Best regards,
Prashant
‎2006 Jul 31 7:19 AM
Here is the code for on_hide_message module
MODULE on_hide_message INPUT.
hide_message = v_t5asrmsgmap1s-hide_message.
IF hide_message = true.
LOOP AT SCREEN.
IF screen-name = 'V_T5ASRMSGMAP1S-ALT_MSGTY'
OR screen-name = 'V_T5ASRMSGMAP1S-ALT_MSGID'
OR screen-name = 'V_T5ASRMSGMAP1S-ALT_MSGNO'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.