Application Development and Automation 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: 
Read only

Default Values in table control!

Former Member
0 Likes
1,694

Hi All,

I have a created a table control in modulepool, where I have language,material and description as columns. The requirement is to have english(EN) as default in all rows and non editable.

This should be applicable for all lines...

as of now I tried showing 10 lines as default rows with EN as language. But after pressing enter, new rows are not getting editable. I dont think this is right approach..

any ideas/approach on this would go a long way.

Thanks & Regards

Himayat

7 REPLIES 7
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,295

Please search on sdn you will find many example. Headstart is you have to initializae the parameter TC_TABLE_CONTROL-LINES dynamically in PBO.

Nabheet

Edited by: nabheetmadan09 on Feb 10, 2012 1:58 PM

Read only

0 Likes
1,295

Thanks Nabheet for your reply,

In PBO of the screen, I wrote this but I dont think this is good way of doing. I did search on sdn, couldnt get much help.

Can you please elaborate on this ?

IF it_copy_to_mat IS INITIAL .
    DO 20 TIMES.
      CLEAR w_copy_to_mat.
      w_copy_to_mat-lang = 'EN'.
      APPEND w_copy_to_mat TO  it_copy_to_mat.
      CLEAR w_copy_to_mat.
    ENDDO.
  ENDIF.

Thanks & regards

Himayat

Read only

0 Likes
1,295

Himayat can you please specify your requirment clearly . do you want to default values or make table control lines editable.

Nabheet

Read only

0 Likes
1,295

Hi Nabheet,

My requirement is like this : I have a table control in which there are three columns. Material , Material description, Language.

As part of requirement, the language is always to be EN only. So I need to have EN as default value and non editable in all rows.

So user will fill value for rest two columns only which are editable.

As I mentioned in my earlier post , I wrote the code in PBO for default value as EN in say twenty rows. But I dont think that is write of doing it.

Thanks & Regards

Himayat

Edited by: Himayatullah Md on Feb 10, 2012 12:18 PM

Read only

0 Likes
1,295

Okie..You can simply keep the column as input disabled while designing and in PAI loop default the value to EN inside Loop endloop.

Nabheet

Read only

0 Likes
1,295

Well, don't do it in the PBO; do it in the PAI if any other field is completed.

Rob

Read only

Former Member
0 Likes
1,295

Thanks Nabheet and Rob,

The approach you guys suggested works beautifully.

Marking question as resolved.

Himayat.