2007 Dec 19 9:34 AM
Hi,
I created a table control in a standard transaction code.
when iam clicking create button, The table control
is displaying in display mode.Now I should provide to the user
to add the entries in the table control in create mode.
Can any body resolve this issue with coding.
urgent requirement.
hi,
In PBO made one module...
MODULE init_screen OUTPUT.
LOOP AT SCREEN.
IF save_ok = 'CHG'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " init_screen OUTPUT
reward if useful
2007 Dec 19 9:52 AM
hi,
In PBO made one module...
MODULE init_screen OUTPUT.
LOOP AT SCREEN.
IF save_ok = 'CHG'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " init_screen OUTPUT
reward if useful
2007 Dec 19 9:53 AM
Hello,
In PBO of the dynpro containing the table control you should have something like this:
LOOP AT G_T_MAT_CREAR
WITH CONTROL G_CTRL_MAT_CREAR
INTO Z37_MM_E_ROP01.
...
While looping at the table control at PBO,
if you make loop at screen inside the table control loop,
it loops screen elements of the table control.
MODULE MO_MOD_INPUT_GRU.
ENDLOOP.
Content for MO_MOD_INPUT_GRU:
MODULE MO_MOD_INPUT_GRU OUTPUT.
PERFORM F_MOD_INPUT_GRU.
ENDMODULE.
FORM F_MOD_INPUT_GRU .
LOOP AT SCREEN .
"For achieving what you want
IF ( Z37_MM_E_ROP01-FIELD_TO_BECOME_EDITABLE ).
SCREEN-INPUT = 1 .
MODIFY SCREEN .
ENDIF .
ENDLOOP .
ENDFORM.
I hope it will help you.
Edited by: David Garcia Ortega on Dec 19, 2007 10:54 AM
2007 Dec 19 1:21 PM
hi ,
You can ttry with the following Logic :
when transaction mode = create ,
loop at the screen and change the properties of the fields to editable mode .
endloop .
This should solve your probelm .
Regards,
Ranjita
2007 Dec 19 1:40 PM
Hi,
In a PBO module of the screen, ypu have to write a code to find out the number of lines of the internal table used for the table control.
The code for this would be.
DESCRIBE TABLE tb_line LINES lin. * 'tb_line' is the internal table and 'lin' holds the number of lines*
tcl_item-lines = lin. tcl_item is the name of the table control*
Now in the PBO, you have to make the table control editable or non editable by checking with the transaction.
Here i in the below code, there are 3 transactions for create,display and change.
If the transaction code is either 'ZCREATE09' or 'ZCHANGE09' , then the lines in the table control are checked.If the table control is not empty,then it is editable.
During the display transaction,it is kept in non editable mode.
CASE sy-tcode.
WHEN 'ZCREATE09' OR 'ZCHANGE09'.
***Checking if the table control is empty or not***
IF lin NE 0.
LOOP AT SCREEN.
***To make the screen editable****
screen-input = 1.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name CS 'TB_LINE'.
****To make the screen non-editable if no values are present in the
***table control****
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
****To make screen non editable during the display transaction****
WHEN 'ZDISPLAY09'.
LOOP AT SCREEN.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
ENDCASE.
Reward if helpfull.
Thanks,
Kashyap
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |