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

Adding more fields to a transparent table

Former Member
0 Likes
580

I have a transparent table that has the following fields in it.

Table: zhpa_uc_census

Client

Job Codes and Description for IT1610

Job Code description for IT1610

End Date

Start Date

EEO Census Job Code Description

Male Count

Female Count

Total Count

Minority Count

Ethnic01 Count

Ethnic02 Count

Ethnic03 Count

Ethnic04 Count

Ethnic05 Count

Next year, I will need to add more ethnic groups to the table, but I do not know how many. The year after that, more ethnic groups could be added. My problem is that each time they add more ethnic groups, I will need to update my transparent tables and also update the program code to take these new ethnic groups into consideration. Is there a better way to do this?

Below is one of the loops from my program where I am gathering data from one of the transparent tables.

LOOP AT t_zhpa_uc_census.

IF t_zhpa_feeder_grps-zzfeedergrp = t_zhpa_uc_census-zzjobcode.

t_zhpa_uc_census_total-zzjobcode = t_zhpa_feeder_grps-zzjobcode.

t_zhpa_uc_census_total-begda = sy-datum.

t_zhpa_uc_census_total-endda = 99991231.

t_zhpa_uc_census_total-zmale = t_zhpa_uc_census-zmale.

t_zhpa_uc_census_total-zfemale = t_zhpa_uc_census-zfemale.

t_zhpa_uc_census_total-ztotal = t_zhpa_uc_census-ztotal.

t_zhpa_uc_census_total-ztotal_min = t_zhpa_uc_census-ztotal_min.

t_zhpa_uc_census_total-zethnic01 = t_zhpa_uc_census-zethnic01.

t_zhpa_uc_census_total-zethnic02 = t_zhpa_uc_census-zethnic02.

t_zhpa_uc_census_total-zethnic03 = t_zhpa_uc_census-zethnic03.

t_zhpa_uc_census_total-zethnic04 = t_zhpa_uc_census-zethnic04.

t_zhpa_uc_census_total-zethnic05 = t_zhpa_uc_census-zethnic05.

COLLECT t_zhpa_uc_census_total.

CLEAR t_zhpa_uc_census_total.

ENDIF.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
528

Hi,

Instead of field in horizonatal way, you need to change table design


Table: zhpa_uc_census
Client
Job Codes and Description for IT1610
Job Code description for IT1610
Ethnic_code "<<<<<<< Create it as key field, it will be of value 01,02,03,04, 05 ....
End Date
Start Date
EEO Census Job Code Description
Male Count
Female Count
Total Count
Minority Count
Ethnic_count " <<<<<< No of count of Ethnic Code    

or as suggested by Niamesh

a®

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
528

Is it possible to change entire design of the table?

I would suggest to make header table and item table...

Head table would have columns

Client

Job Codes and Description for IT1610

Job Code description for IT1610

End Date

Start Date

EEO Census Job Code Description

Male Count

Female Count

Total Count

Minority Count

Item table wold have columns,

PRIMARY KEY form header

Counter .. length 3

ETHINC ... one one...

So, when you fill the data you can generate the counter in the details table. You will have all your ETHINC01 to ETHINC05 in the rows .. not in column.

Regards,

Naimesh Patel

Read only

former_member194669
Active Contributor
0 Likes
529

Hi,

Instead of field in horizonatal way, you need to change table design


Table: zhpa_uc_census
Client
Job Codes and Description for IT1610
Job Code description for IT1610
Ethnic_code "<<<<<<< Create it as key field, it will be of value 01,02,03,04, 05 ....
End Date
Start Date
EEO Census Job Code Description
Male Count
Female Count
Total Count
Minority Count
Ethnic_count " <<<<<< No of count of Ethnic Code    

or as suggested by Niamesh

a®