2009 Jun 27 10:57 AM
-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
2009 Jun 27 11:25 AM
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
-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
2009 Jun 27 11:05 AM
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.
2009 Jun 27 11:18 AM
hi Avinash,
thanks,
but this is the obvious solution,i try to find other way to do so.
BR
nina
2009 Jun 27 11:25 AM
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