Skip to Content
author's profile photo Former Member
Former Member

Populate data inside table control

Hi,can someone help me with this problem...

I have a Reference Table Input help and I need to populate the values from the selected table names(selected from the input help) into the table control with the respective table fields displayed.

Refer to this diagram if unclear: [http://img166.imageshack.us/img166/1066/tablecontrolwt4.png]

Please give me sample codes.

thanks.

will reward marks if useful.

Edited by: Evonne Gow on Dec 26, 2007 3:11 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2007 at 06:09 AM

    Hai,

    Use CASE and ENDCASE stament for that Reference Table parameter.

    Get the Ref.Table name into a variable.

    Now:

    case reftabname.

    when 'ZDM_A_CCO'.

    perform select_database_values using reftabname field1 field2 ..

    changing it_tabc.

    when 'ZDM_B_CCO'.

    perform select_database_values using reftabname field1 field2 ..

    changing it_tabc.

    endcase.

    To build WHERE clause dynamically, use function module: DYNSQL_GENERATE_WHERE_CLAUSE

    under each WHEN statement using Subroutine select_database_values by passing the Table name and field names as parameters.

    Example:

    CALL FUNCTION 'DYNSQL_GENERATE_WHERE_CLAUSE'

    EXPORTING

    fieldname_key_1 = 'AUART'

    fieldname_key_2 = 'VKORG'

    fieldname_value = 'ERDAT'

    operator = '<='

    TABLES

    where_clause = dyn_sql

    control_table = ztvara

    all_values_key_1 = auart_all

    values_key_1 = auart_teil

    all_values_key_2 = vkorg_all

    values_key_2 = vkorg_teil

    EXCEPTIONS

    dynsql_too_large = 1

    wrong_entry_in_control_table = 2

    key_values_inconsistent = 3

    no_entry_found = 4

    function_already_called = 5.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2007 at 06:13 AM

    can u give examples of the function: DYNSQL_GENERATE_WHERE_CLAUSE and is it we jus need to type in the codes into the function only?

    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.