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: 

working with daynamic values

Former Member
0 Kudos

-Hi,

i had FM with import value type any that can be type of 5 structure,

and in the fm i need to do insert to DB tables( i have 5 related db tables),

my question is if from the value that i get(the structure name) in the import parameter i can know to which table i need to do the insert?

-

e.g.

import

im_value type any

in im_value i get str1

insert (str1) to DB1

and so on...

Best regards

Nina

1 ACCEPTED SOLUTION

martin_voros
Active Contributor
0 Kudos

Hi,

check this [presentation|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae?overridelayout=true]. It contains lots of useful information. For example the method DESCRIBE_BY_DATA of class CL_ABAP_STRUCTDESCR will return object with description of some variable. Then just call method GET_RELATIVE_NAME on returned object and you will get structure name. You can use this name to determine your target table.

Cheers

3 REPLIES 3

Former Member
0 Kudos

Hi,

If you are developing the FM too..then add one more field for the table name in which table name will be passed for the table you are going to update.

0 Kudos

hi Avinash,

thanks,

but this is the obvious solution,i try to find other way to do so.

BR

nina

martin_voros
Active Contributor
0 Kudos

Hi,

check this [presentation|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae?overridelayout=true]. It contains lots of useful information. For example the method DESCRIBE_BY_DATA of class CL_ABAP_STRUCTDESCR will return object with description of some variable. Then just call method GET_RELATIVE_NAME on returned object and you will get structure name. You can use this name to determine your target table.

Cheers