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

how to display the hardcoded values in table control column in module pool?

satish_kumar127
Participant
0 Likes
3,850

HI Experts,

I have a requirement that i need to display hard-coded values in table control column when i execute tcode.

let's say i'm having 3 columns in my table control

Area               weightage    hygienescore

malt                  1

brewhouse         1

unitank              3

BBT                  3

Bottling              3

so here we can able to give input for hygiene column only. rest should come through coding.  how to handle this in program.

please help me out in this.  

Thanks in Advance

regards

satish

HI Experts,

I have a requirement that i need to display hard-coded values in table control column when i execute tcode.

let's say i'm having 3 columns in my table control

Area               weightage    hygienescore

malt                  1

brewhouse         1

unitank              3

BBT                  3

Bottling              3

so here we can able to give input for hygiene column only. rest should come through coding.  how to handle this in program.

please help me out in this.  

Thanks in Advance

regards

satish

9 REPLIES 9
Read only

Former Member
0 Likes
2,897

Hi Satish,

In the Table control Layout mark columns as display only and it should achieve first part. FOr the second part, Write modules in PBO and should do it.

Please ask if not clear?

BR.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,897

Set attribute of the columns as display only and append other values in internal table in PBO. Better will be to store these values in custom table so that later if some one want to change description only table change will be made no change in program

Do not hardcode.

Nabheet

Read only

Former Member
0 Likes
2,897

Use a internal table to create a table control.

Suppose an internal table ITAB we are using to create a table contol.

In PBO add the values which you want to display when your screen run.

and also make the field like:  Area weightage disable.

Only field hygienescore should enable to accept the values.

IN PAI event

when you fill value for field hygienescore , at that time modify the internal table.

I am sure it will work.

Regards

Neeraj

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
2,897

Hello Satish.

     * First table control has to be created with attribute Input Control.

     * As suggested by fellow experts, make the first two fields Output field.

     * Prepare the internal table with first two column data and then Call Screen.

     * In the table control, when user enters data in the third column, automatically it will be saved in the internal table.

  

Regards.

Read only

davis_raja
Active Participant
0 Likes
2,897

Dear Satish,

Please make sure that the Internal Table which you are using in the table control is already appended with the hard-coded values or you need to append the values in the PBO of the screen.

MODULE append_table.

MODULE append_table OUTPUT.

  wa-area = 'Malt'.

  wa-weigh = '1'.

  APPEND wa to itab.

  CLEAR wa.

ENDMODULE.


To prevent the user from editing the Area and Weightage colums, you can goto Properties windows -> Attributes -> Program tab -> Untick Input Field.


Read only

Former Member
0 Likes
2,897

Hi,

   Generally by using PBO event we initialize the field values. So, in the PBO of the table control we maintain one loop with our required fields. First fill the internal table with you required fields .

in the main program..

  wa-area = 'Malt'.

  wa-weigh = '1'.

  APPEND wa to itab.

  CLEAR wa.


do same for the remaing.


in the Flow logic of the screen.


under the PBO.


loop at it into wa with control ctl.

endloop.

Read only

Former Member
0 Likes
2,897

Hi,

Check these programs

demo_dynpro_tabcont_loop

demo_dynpro_tabcont_loop_at

You will have a better idea on table controls.

Regards

Thiru.

Read only

Former Member
0 Likes
2,897

Hi Satish,

Make the first  two columns in display mode so that the user cannot enter any values.

For that  use  the below logic in PBO.

Loop at screen.

     if screen-name eq <field_name>

          screen-input = 0.

     endif.

Endloop.

To hardcode the values in the module pool screen, use the below logic in PBO.



   wa-area   = 'Malt'.

   wa-weigh = '1'.

  APPEND wa to itab.

  CLEAR wa.


   wa-area   = 'brewhouse'.

   wa-weigh = '1'.

  APPEND wa to itab.

  CLEAR wa.


Hope this helps you.


Regards,

Riju Thomas.

Read only

satish_kumar127
Participant
0 Likes
2,897

Thank u guys, my issue has been resolved with the help of your suggestions.

Regards

satish