Skip to Content

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 09:16 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 09:35 AM

    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.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 09:49 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 09:51 AM

    Hi,

    Check these programs

    demo_dynpro_tabcont_loop

    demo_dynpro_tabcont_loop_at

    You will have a better idea on table controls.

    Regards

    Thiru.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 11:31 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 08:37 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 09:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 09:18 AM

    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.


    a.jpg (115.8 kB)
    a.jpg (38.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2014 at 11:51 AM

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

    Regards

    satish

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.