Application Development 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: 

How to create Dynamic Internal table based on unknown columns?

former_member184119
Active Contributor
0 Kudos
710

I have a internal table Say ITAB.

DATA: Begin of itab,

F1 TYPE C, F2 TYPE N, F3 TYPE P DECIMALS 2 , F4(20) TYPE C,

end of itab.

User want to exclude certain fields from the output based on the if the fields are initial.

I.e, user want to maintain F2 AND F4 Fields names in TVARAVC.

I have to check for the all the employees that F2 OR F4 is initial , then I will eiminate from the output that particular employee and I need to send email with Employee number, F2 , F4 as columns( what ever fields TVARVC is maintained).

I am able to verify whch are empty dynmaically but unable to create email where I dont know how to capture the unknown fields in columns.

I need to create <zdynamin_fs> to be created with the fields that are maintained in the TVARVC,

how Can I do that , thanks in advance.

Regards

sas

10 REPLIES 10

Tomas_Buryanek
Active Contributor
0 Kudos
303

Do you really need dynamic internal table? What is the output that user wants to exclude fields from? Is it ALV (if so you can just not display these columns)?

-- Tomas --

former_member184119
Active Contributor
0 Kudos
303

Hi Tomas,

I have to send the output of missing fields in email with attachment, so I need to dynamic internal table to so I can fit in those. Thanks.

Edit:

I have ITAB to send the output to the application server.

and I am excluding certain fields from ITAB, so those fields that are excluded from ITAB i need to notify the user.so to notify we need the attachment.

Regards

SAS

s1252
Participant
0 Kudos
303

Hi, did you try googling it . below is an example how to create dynamic internal table

https://blogs.sap.com/2013/06/11/dynamic-internal-table-iilustrated-with-an-example-of-creating-the-...

DoanManhQuynh
Active Contributor
303

I find it little hard to understand your question. Are you talking that you have to check the data in an internal table and which field need to checked will be defined in tvarvc? You have the field name, have the internal table so what stop you using field symbols to do that?

former_member184119
Active Contributor
0 Kudos
303

Thanks Krishna Sandala!! Yeah I have some good internet connection and I have access to google.

The example you are referring I have gone through multiple times is we have internal table, and you are going to create a structure based on all fields , my requirement is to creaet the structure with those particular fields which we dont know. Thanks for your suggestion.

303

Please use the COMMENT button to reply to someone asking for details. ANSWER is only to propose a solution.

0 Kudos
303

Do you have any success in creating a structure with the field which you don't know?

former_member184119
Active Contributor
0 Kudos
303

ok Sandra , Mistake happened and unable to revert !! Will make sure for future.

303

But you didn't. You did it again just now!

ArthurParisius
Contributor
0 Kudos
303

Since you are able to find which fields are initial, than why not create a csv type string where you place this information in, instead of creating a dynamic table?