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

Populate data inside table control

Former Member
0 Likes
386

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

2 REPLIES 2
Read only

Former Member
0 Likes
347

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.

Read only

Former Member
0 Likes
347

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?