01-04-2007 4:03 AM
Hi All,
I have to add fields dynamically on screen based on the no. of data records.
Is there any way to add field dynamically.
I need field like this:
first a check box second not editable field third editable field.
Table control is another way to solve the problem but only constraint about check box.
Please help me find out any solution.
Thanks in advance.
Piyush Mathur
01-04-2007 4:25 AM
hello piyush
if u want check box for selection of row u can create table control with selection columan . and the column name for the selection column will be same column for which u want to create check box. u can enable multiselect of table control and handle same as u handle check box. but this will not work in case u have to handle some events on checkbox selection. u have to provide some button for that
see if it works for you
01-04-2007 4:28 AM
Hi,
Check this link for table control.Here I am explaining database manipulation using table control.
01-04-2007 4:59 AM
your question is not clear.. are you dealing with table controls or just some fields in the screen...
instead dynamically adding try hiding and displaying the fields..
LOOP AT SCREEN.
IF screen-name = 'CHECK1'.
screen-invisible = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
01-04-2007 5:20 AM
for the fields to be displayed in this manner you can do it PBO of the screen
like at selection-screen output event.
here you have to write
loop at screen.
if screen-name = 'S_FIELD-LOW' or screen-name = 'S_FIELD-HIGH'
screen-output = '1'.
screen-input = '0'.
modify screen.
endif.
endloop.
i have given the example for selection screen.
but for your own screen you have to code in PBO module and there you have to use loop at screen and screen fieldname.
regards
shiba dutta
01-04-2007 5:27 AM
write your code as :
AT SELECTION-SCREEN OUTPUT.
for making data set 2# inactive
IF rdt1 = c_x.
LOOP AT SCREEN.
IF screen-name EQ 'S_BELNR-LOW' OR
screen-name EQ 'S_BELNR-HIGH' OR
screen-name EQ 'P_GJAHR'.
screen-input ='0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
for making data set 1# inactive
IF rdt2 = c_x.
LOOP AT SCREEN.
IF screen-name EQ 'S_BUDAT-LOW'
OR screen-name EQ 'S_BUDAT-HIGH'
OR screen-name EQ 'S_KUNNR-LOW'
OR screen-name EQ 'S_KUNNR-HIGH'
OR screen-name EQ 'RDS1'
OR screen-name EQ 'RDS2'.
screen-input ='0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
END-OF-SELECTION.