Skip to Content

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

values in itab1 should be fields in itab2

Hi All,

Kindly help me with the below requirement.

I have a internal table itab1 as below

CODE DESC GROUP COUNT

11 airbrake PA1 1

11 airbrake PA2 0

12 airbrake PA2 1

13 airbrake PA3 1

14 airbrake PA2 1

NOW from this internal table another internal table itab2 should be automatically be defined and the fields

in this internal table should be some fields of itab1 and values of itab1. so the fields will be

CODE DESC PA1 PA2 PA3.... PAn

then this structure should be passed to ALV ....

main problem iam facing here is changing the values of itab1 into fields of itab2.

these values in itab1 are not static they can vary it can be pa1 pa2 pa3 pa4......or pa1 pa3 pa5 etc

depending on these values the itab2 should be created.

Kindly help

Thanks and regards

Sujeer

Tags:
Former Member
Former Member replied

Hi,

You can not declare table dynamically.

So declare itab2 with all possible values of group.

then while populating itab2 those fields which are not in itab1 will be initial.

then depending on groups in itab1 at run time you can display only those field in itab2 in the alv.

regards,

Dhan

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