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: 

Treat work area text as a field reference

former_member258584
Participant
0 Kudos

Hi All,

I have trying to do some different type of coding but i dont is there any provision abap for the same so i sharing this with all of you to help in this ;

I m working of Working Clearance Management in which there are number of different customize catalog codes like 'H001' , 'R001' etc.

Whatever the codes user select and then print relevant mapped checkbox displays as selected.

Now on the runtime i want to code so that it can communicate with checkbox e.g  ZCAT_CODE-H002 = '1'.

Now my query is i picks the code on runtime in the internal table and when i loop this internal table using work area it comes in the form of suppose

wa_catalog-code = 'H002', it means user has selected this code.

Now what i want to do is  'H002' i want to use this text as the reference field of structure like  ZCAT_CODE-H002 because i had already defined the structure fields with the name of codes.

I want to use this because i want to get rid of using when statement or if statement.

Please help me how we can achieve it.

Thanks in advance.

Regards,

Deepak kansal.

3 REPLIES 3

Former Member
0 Kudos

Hi Deepak .

It is possible .

change the structure of the internal table .Add one more column to internal table of the type (structure of ZCAT_CODE ). Lets say the new added column is "col1" . For all the entries of the internal table you can assign the col1  = ZCAT_CODE .

you can access the details  like this :

wa_code-col1-text  .

0 Kudos

Hello Rohit,

Thanks for your reply !!!

Can u please let me how can i define a Col1 = zcat_code for all enteries in internal table.

Regards,

Deepak kansal.

0 Kudos

Hello Rohit,

Its not working or might be i am making some mistake.

Can u please ellaborate it a little bit.

Regards,

Deepak kansal.