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

Using complex structures in ALV

Former Member
0 Likes
892

Does anyone know if its possible to use complex structures in an ALV grid.

I have a internal table in which one of the components is an other internal table.

Is there a way to use this directly in ALV or do I need to use some kind of workaround.

Regards,

Arthur

3 REPLIES 3
Read only

Former Member
0 Likes
606

Hi

As U mentioned ur one component of internal table is existing in another inter table.

see for ALV display ur values shuld exist in one internal table only. but if ur internal table contains two structure or one strcture and one internal table ,then u can use

REUSE_ALV_FIELDCATALOG_MERGE

to make common catalog for structure and internal table.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
 EXPORTING
   I_PROGRAM_NAME               =
   I_INTERNAL_TABNAME           =
  I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
  CHANGING
    CT_FIELDCAT                  =
* EXCEPTIONS
*   INCONSISTENT_INTERFACE       = 1
*   PROGRAM_ERROR                = 2
*   OTHERS                       = 3

Hope it helps.

If not please send ur code For better understanding of your problem.

Rewards Point If helpful .

Edited by: neetu chhabra on Feb 27, 2008 5:55 AM

Read only

0 Likes
606

Here's the definition of the table, and the different structures used in it, that want to use in the ALV grid.

Any help will be good.

TYPES: BEGIN OF t_0167_opt, "Optional IT0167 fields

dtype LIKE rpbenodp-relation, "Relation

dname LIKE rpbenodp-dep_name, "Full name

dstud LIKE p0106-ben03, "Student indicator

sdisa LIKE p0106-disab, "Disability indicator

END OF t_0167_opt,

BEGIN OF t_0168_opt, "Optional IT0168 fields

itype LIKE rpbenodp-relation, "Relation

iname LIKE rpbenodp-dep_name, "Full name

perct LIKE p0168-bpt01, "Percentage

contf TYPE c, "Contingency flag

END OF t_0168_opt,

BEGIN OF t_0169_opt, "Optional IT0169 fields

stype LIKE rpbenodp-relation, "Relation

sname LIKE rpbenodp-dep_name, "Full name

sperc LIKE p0169-bpt01, "Percentage

sflag TYPE c, "Contingency flag

END OF t_0169_opt,

BEGIN OF t_0379_opt, "Optional IT0379 fields

ptype LIKE rpbenodp-relation, "Relation

pname LIKE rpbenodp-dep_name, "Full name

pperc LIKE p0379-bpt01, "Percentage

pflag TYPE c, "Contingency flag

END OF t_0379_opt,

BEGIN OF t_smchanges, "Changes in smoker status

pernr LIKE pernr-pernr, "Employee number

ename LIKE p0001-ename, "Full name

osmok LIKE p0376-smoke, "Old smoker status

odate LIKE p0376-begda, "Effective date change

nsmok LIKE p0376-smoke, "New smoker status

opsmk LIKE p0106-smoke, "Old spouse smoker status

opdat LIKE p0106-begda, "Effective date change

npsmk LIKE p0106-smoke, "New spose smoker status

END OF t_smchanges,

BEGIN OF t_benchanges, "Changes in beneficiary status

pernr LIKE pernr-pernr, "Employee number

ename LIKE p0001-ename, "Full name

infty(4) TYPE n, "Changed infotype

cdate LIKE sy-datum, "Change date

cplan LIKE p0168-bplan, "Plan change

stext(60) TYPE c, "Free text

END OF t_benchanges.

----


  • GLOBAL STRUCTURES

----


DATA: BEGIN OF t_output_all, "Output table

pernr LIKE p0000-pernr, "Employee numer

ename LIKE p0001-ename, "Employee name

werks LIKE p0001-werks, "Personnel area

btrtl LIKE p0001-btrtl, "Personne sub-area

persg LIKE p0001-persg, "Employee group

persk LIKE p0001-persk, "Employee sub-group

ansvh LIKE p0001-ansvh, "Contract

massn LIKE p0000-massn, "Action

massg LIKE p0000-massg, "Reason

gesch LIKE p0002-gesch, "Gender

provr LIKE p0224-provr, "Province of residence

plstx LIKE t528t-plstx, "Position title

gbdat LIKE p0002-gbdat, "Date of birth

fgbdt LIKE p0021-fgbdt, "Date of birth spouse

ansal LIKE p0008-ansal, "anual salary

bengr LIKE p0171-bengr, "First Program grouping

bstat LIKE p0171-bstat, "Second Program Grouping

smoke LIKE p0376-smoke, "Employee Smoker indicator

ssmok LIKE p0106-smoke, "Spouse smoker indicator

perid LIKE p0002-perid, "Social insurance number

sprsl LIKE p0002-sprsl, "Employee language of preference

stras LIKE p0006-stras, "Home address

ort01 LIKE p0006-ort01, "City

state LIKE p0006-state, "Province

land1 LIKE p0006-land1, "Country

pstlz LIKE p0006-pstlz, "Postal code

rtdat LIKE p9041-dat01, "Retirement Date Day type

bsgrd LIKE p0008-bsgrd, "Capacity Utilization level

zzlocod LIKE p0006-zzlocod, "location code

zzlocat LIKE p0006-zzlocat, "Office / location indicator

hplan LIKE p0167-bplan, "Health plan

bopti LIKE p0167-bopti, "Health plan option

depcv LIKE p0167-depcv, "Health plan coverage

hbedt LIKE p0167-begda, "Health plan start date

hendt LIKE p0167-endda, "Health plan end date

ibedt LIKE p0168-begda, "Insurance plan start date

iendt LIKE p0168-endda, "Insurance plan end date

iplan LIKE p0168-bplan, "Insurance plan code

bcovr LIKE p0168-bcovr, "Insurance plan option

covam LIKE q0168-covam, "Insurance Coverage amount

covov LIKE p0168-covov, "Alternate insurrance coverage amount

splan LIKE p0169-bplan, "Savings plan

pardt LIKE p0169-pardt, "Savings plan participation date

eepct LIKE p0169-eepct, "Pre-tax contribution percentage

bcpct LIKE p0169-bcpct, "Bonus Pre-tax contribution percentage

sbedt LIKE p0169-begda, "Savings plan start date

sendt LIKE p0169-endda, "Savings plan end date

pplan LIKE p0379-bplan, "Stock Purchase plan

sprdt LIKE p0379-pardt, "Participation date

pbedt LIKE p0379-begda, "Start date

pendt LIKE p0379-endda, "End date

ptamt LIKE p0379-ptamt, " Post Tax contribution amount

END OF t_output_all.

----


  • INTERNAL TABLES

----


DATA: BEGIN OF i_total OCCURS 0.

INCLUDE STRUCTURE t_output_all.

DATA: t167 TYPE TABLE OF t_0167_opt,

t168 TYPE TABLE OF t_0168_opt,

t169 TYPE TABLE OF t_0169_opt,

t379 TYPE TABLE OF t_0379_opt,

END OF i_total,

Read only

Former Member
0 Likes
606

Hi ,

You can declae the same internal table in Grid display even as though the components are also in other

internal table