Skip to Content
1
Former Member
Jul 19, 2007 at 03:00 PM

how to get field name for a specific value in internal table

289 Views

Hello All,

I want to know how should I get the name of the field for a matching entry in the internal table I mean this : I have table called IT1 and IT1 has 4 fields.

Data: begin of it1 occur 0,

printer(10) type c,

paper1(20) type c,

paper2(20) type c,

paper3(20) type c,

end of it1.

Now it1 has 2 records like :

Printer Paper1 Paper2 Paper3

MUC123 KBLOGO BLANK DINA5

MUC124 DINA5 BLANK KBLOGO

now in internal table I want to know, for value KBLOGO for the first record what is the name of the field(In this case it is "Paper1") and for the second record also the name of the field(In this case it is "Paper3").

I can tell you because I can see KBLOGO exists under which field name but dynamically this value or other value may fall under any field name.

So how to fetch the field name for a record for a matching value.

I hope I am clear with my question.

Thanks,

Mark