Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Adding more fields to a transparent table

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.

Tags:
Former Member
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question