‎2009 May 27 3:25 PM
Hi Experts,
Can any one solve my Problem?
I have to display data in Module Pool Table control. I have completed this.
But my problem is at the end of the all records there should be provision to give new input values. I have to arrange one Push button say u2018DISPu2019 .After clicking this push button the new entry should be displayed and input disabled mode. Again I should able to give new values.
Please solve my problem.
Thanks in advance.
Regards,
Kumar.
‎2009 May 27 3:32 PM
Hi Kumar,
first goto screen layout and add button and add function key for the button and use
the same function in PBO for screen disable and enalbel logic..
to disable the table control fields write the Logic in the PBO..
sample code..
PROCESS BEFORE OUTPUT.
* Module screen GUI-Screen&Status and Screen Logic
MODULE status_1020.
* Table control for OUTPUT
LOOP AT t_zcxref_classes INTO wa_zcxref_classes
WITH CONTROL tc_batch .
MODULE charac_classname_out.
ENDLOOP.
MODULE charac_classname_out OUTPUT.
if sy-ucomm = 'DISP' or OK_CODE = 'DISP'.
* Table control reading values from input screen & displaying on screen
READ TABLE t_zcxref_classes INTO wa_zcxref_classes
INDEX tc_batch-current_line.
* Logic for screen to make display mode when data is entered
IF wa_zcxref_classes-required_flag is not initial.
LOOP AT SCREEN.
IF screen-name = 'WA_ZCXREF_CLASSES'. "passing work area of a particular line to make disable mode
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
endif.
ENDMODULE. " CHARAC_CLASSNAME_OUT OUTPUT
Regards,
Prabhudas
‎2009 May 27 3:32 PM
Hi Kumar,
first goto screen layout and add button and add function key for the button and use
the same function in PBO for screen disable and enalbel logic..
to disable the table control fields write the Logic in the PBO..
sample code..
PROCESS BEFORE OUTPUT.
* Module screen GUI-Screen&Status and Screen Logic
MODULE status_1020.
* Table control for OUTPUT
LOOP AT t_zcxref_classes INTO wa_zcxref_classes
WITH CONTROL tc_batch .
MODULE charac_classname_out.
ENDLOOP.
MODULE charac_classname_out OUTPUT.
if sy-ucomm = 'DISP' or OK_CODE = 'DISP'.
* Table control reading values from input screen & displaying on screen
READ TABLE t_zcxref_classes INTO wa_zcxref_classes
INDEX tc_batch-current_line.
* Logic for screen to make display mode when data is entered
IF wa_zcxref_classes-required_flag is not initial.
LOOP AT SCREEN.
IF screen-name = 'WA_ZCXREF_CLASSES'. "passing work area of a particular line to make disable mode
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
endif.
ENDMODULE. " CHARAC_CLASSNAME_OUT OUTPUT
Regards,
Prabhudas
‎2009 May 27 4:31 PM
Hi,
You can achieve the same by adding a push button on the Dynpro. You need to handle the user action at the Process After Input event of the screen.
You can have a look at the SAP Demo Code on Table Control which will give you a good idea as to how to proceed with the toggle display change functionality. Also this code will give you an idea about the addition of the rows in the table control. The Demo Report is DEMO_DYNPRO_TABCONT_LOOP_AT.
Let me know if you need any more details.
Hope this will help.
Thanks,
Samantak.