Application Development 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: 

Adding field dynamically on screen.

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link for table control.Here I am explaining database manipulation using table control.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table%20c...

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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.