How to create dynamically a method of a class??
I would like to create dynamically a method of a class. Is this possible?
By means of a report I would like to choose a class, to which the defined method should be added and after that I would like to define the name of the method and its parameters. The result should be, that the method is added to the selected class.
How to do this?
Regards
Christian
Christian,
looks like an interesting development project. Though I share the doubts Rich has.
Anyway, what you could possibly do is, start a runtime analysis for SE24, open an existing class, create a new method including desired interface parameters.
Then analyze it and see what functions/methods are used.
But It might be more complex than expected.
Regards,
Clemens
Similar Messages
-
How to create dynamic context based on a structure defined in the program?
Hi Experts,
I need to create a dynamic context based on a structure wa_struc which i have define programatically.
When I pass wa_struc to structure_name parameter of create_nodeinfo_from_struc, i get a runtime error:
"Parameter STRUCTURE_NAME contains an invalid value wa_struc."
How to create dynamic context based on a structure defined in the program?
I have written the code like this:
TYPES: BEGIN OF t_type,
v_carrid TYPE sflight-carrid,
v_connid TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
wa_struc type t_type.
data: dyn_node type ref to if_wd_context_node.
data: rootnode_info type ref to if_wd_context_node_info.
rootnode_info = wd_context->get_node_info( ).
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = 'dynflight'
structure_name = 'wa_struc'
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( name = 'dynflight' ).
dyn_node->bind_table( i_struc ).
Thanks
Gopal
Message was edited by: gopalkrishna baligaHi Michelle,
First of all Special thanks for your informative answers to my other forum questions. I really appreciate your help.
Coming back to this question I am still waiting for an answer. Please help. Note that my structure is not in a dictionary.
I am trying to create a new node. That is
CONTEXT
- DYNFLIGHT
CARRID
CONNID
As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
Also I cannot define the structure in the ABAP dictionary because it changes based on condition
I have updated my code like the following and I am getting error:
TYPES: BEGIN OF t_type,
CARRID TYPE sflight-carrid,
CONNID TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
dyn_node type ref to if_wd_context_node,
rootnode_info type ref to if_wd_context_node_info,
i_node_att type wdr_context_attr_info_map,
wa_node_att type line of wdr_context_attr_info_map.
wa_node_att-name = 'CARRID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
insert wa_node_att into table i_node_att.
wa_node_att-name = 'CONNID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
insert wa_node_att into table i_node_att.
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
rootnode_info = wd_context->get_node_info( ).
rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
attributes = i_node_att
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
dyn_node->bind_table( i_struc ).
l_ref_interfacecontroller->set_data( dyn_node ).
But now I am getting the following error :
The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
-Gopal
Message was edited by: gopalkrishna baliga -
Salmple at How to Create Dynamical Object for RTTC
Hi all, I need a sample at How to Create Dynamical Object for RTTC.
you can help me?.Hello Martinez,
I have attached a sample for structure types. With the Where-Used-List on the Create() Method of the various RTTC classes one may find more samples. If you meant with object on OO Type then it is to mention that this is not possible yet.
Regards
Klaus
PROGRAM sample.
DATA: sdescr1 TYPE REF TO cl_abap_structdescr,
sdescr2 TYPE REF TO cl_abap_structdescr,
tdescr1 TYPE REF TO cl_abap_tabledescr,
tdescr2 TYPE REF TO cl_abap_tabledescr,
tref1 TYPE REF TO data,
tref2 TYPE REF TO data,
comp TYPE abap_component_tab,
wa TYPE t100,
xbuf TYPE xstring.
FIELD-SYMBOLS: <tab1> TYPE table,
<tab2> TYPE table.
sdescr1 ?= cl_abap_typedescr=>describe_by_name( 'T100' ).
comp = sdescr1->get_components( ).
sdescr2 = cl_abap_structdescr=>create( comp ).
tdescr1 = cl_abap_tabledescr=>create( sdescr2 ).
tdescr2 = cl_abap_tabledescr=>create( sdescr2 ).
CREATE DATA: tref1 TYPE HANDLE tdescr1,
tref2 TYPE HANDLE tdescr2.
ASSIGN: tref1->* TO <tab1>,
tref2->* TO <tab2>.
wa-sprsl = 'E'. wa-arbgb = 'SY'. wa-msgnr = '123'. wa-text = 'first text'. INSERT wa INTO TABLE <tab1>.
wa-sprsl = 'D'. wa-arbgb = 'SY'. wa-msgnr = '456'. wa-text = 'second text'. INSERT wa INTO TABLE <tab1>.
wa-sprsl = 'D'. wa-arbgb = 'XY'. wa-msgnr = '001'. wa-text = 'third text'. INSERT wa INTO TABLE <tab1>.
wa-sprsl = 'D'. wa-arbgb = 'ZZ'. wa-msgnr = '123'. wa-text = 'fourth text'. INSERT wa INTO TABLE <tab1>.
wa-sprsl = 'E'. wa-arbgb = 'SY'. wa-msgnr = '123'. wa-text = 'ABAP is a miracle'. INSERT wa INTO TABLE <tab1>.
EXPORT tab = <tab1> TO DATA BUFFER xbuf.
IMPORT tab = <tab2> FROM DATA BUFFER xbuf.
LOOP AT <tab2> INTO wa.
WRITE: / wa-sprsl, wa-arbgb, wa-msgnr, wa-text.
ENDLOOP. -
How to create Dynamic Window in Smartforms
Hi all,
Could you please help me out on how to create Dynamic Window in smartforms excluding Main Window.
Thanks in Advance.
Vinay.hi,
Hi,
1.If you are creating the Different windows for the Countries,then In conditions tab of window specify the Condition i.e.
company -code = '2201'.
2.Then that window can trigger ofr that condition.
3.Other wise, if you are using the different layouts ,then write the condition in Print program and call that form .
reward me if helpful. -
How to create dynamic connection in business view manager.
Hi Sir,
Can u explain how to create dynamic connection in business view manager.
Thanks
Vishali Raghava RajuHI Vaishali,
Can you please elaborate your requirement ?
-Regards
B -
How to create dynamic variable in Java?
Hi,
I want to create dynamic varible , using ArrayList or Vector. The number of array i dont knwo, so how to create dynamic ArrayList or Vector.
for example:
ArrayList1,ArrayList2,ArrayList3.....n
or
Vector1,Vector2,Vector3 .....n, the n value i will get at run time, so how to create the dynamic ArrayList or Vector or i can use any other Object in java,
Pls provide your input.
Sridhar1. I have a HashMap with dataok ... fair enough.
2. depending on its size, i need to create variable
to store them.uhm ... why? If you have a variable number of elements in the map then you'd need to generate a variable number of variables (a number, that is not know at compile time, as it seems). Now if you could somehow create those variables, how would you access them? You'd have to generate the code handling them as well ...
Tell us what kind of data you've got and what you want to do with it. There's certainly a better solution to your problem.
how to generate variables as per content size of the
HashMapYou don't. -
How to create dynamic ed flash charts based on user selected fields in Orac
Hi all,
Can any of the experts please tellme "how to create dynamic ed flash charts based on user selected fields in Oracle apex".
Thanks
ManishHello,
Lots of different ways to do this, I blogged about one way (using a Pipelined function) here -
http://jes.blogs.shellprompt.net/2006/05/25/generic-charting-in-application-express/
Other options include using a PL/SQL function returning the string to use as the dynamic query etc.
Hope this helps,
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
How to create dynamic view in hr report category
i want to make company code mandetory in in selection screen given by logical data base PNP here i want to make field mandetory. so how to create dynamic view in hr report category.
thanks in advancesolved by self
-
How to create dynamic screen using module pool programming
Hi,
Could anybody help me how to create dynamic screens?
I am developing a screen with HR Person with assignment info. If PERNR have multiple assignments, i need to show all the details one by one. How to show the details on screen. I need to call one by one assignment information dynamically.
Please suggest me how to do, apart from using table controls.
Thanks,
KamalYou may have the below options:
1) Table Control
2) Individual fields
3) ALV
4) pop-up screen -
How to create dynamic window in smartform
<i>HI Floks</i>
my requirement is invoice smartform having few line items .i can print this line items with different categories with dynamically placed in smartfom. there how many items with in particular category print its self . how is it possible to printing .is it possible to print dynamic fields and window without changing driver program and structure .How to create dynamic window.
any body knows reply me fast
thanks in advance ,
sureshHi suresh,
You can create all the windows, but if you go to specific window you will see different tabs like general attributes, output options and conditions. In that conditions tab, you can give condition. so based on that condition, that window will be printed.
Dont forget to reward points if helpful.
regards,
Chandra. -
How to create Dynamic Menu in 11g?
Hello All,
I am using JDeveloper/Adf 11g.
Can you please tell me how to create Dynamic menu(means Menu will be created from table if we make any changes in table it will reflect to the Menu).
Thanks.
Neelmani Jaiswal
(Madhav, Hayaghat)
Edited by: Neelmani Jaiswal on Jan 6, 2009 11:01 AM
Edited by: Neelmani Jaiswal on Jan 6, 2009 11:01 AM
Edited by: Neelmani Jaiswal on Feb 3, 2009 8:46 AMNeelmani,
How: write some code.
The Web User Interface Developer's Guide for Oracle Application Development Framework will be helpful. Hint: you may want to read section 14.2 (especially 14.2.1, item 2, which talks about using iterators in a menu) OR section 17.5, which talks about creating menus to support page hierarchies.
John -
How To create Dynamic destination in blazeDS
Hi,
Can anyone tell me how to create dynamic destinations ?
thnkshi,
Basically you could read the destination and Endpoint from an xmlfile then feed the values as required, the following is a simple hardcoded setup but it doesn't take much to set vars in the creationcomplete event. At least this way you don't need baked in settings.
<fx:Declarations>
<s:Producer id="myProducer" destination="{myService}" acknowledge="myProducer_acknowledgeHandler(event)"/>
<s:Consumer id="myConsumer" destination="{myService}" message="messageHandler(event)"/>
</fx:Declarations>
private var channelSet:ChannelSet;
private var myService:String;
protected function application1_creationCompleteHandler(event:FlexEvent):void
channelSet = new ChannelSet();
myService = "chat";
//var channel:AMFChannel = new AMFChannel("my-polling-amf","http://localhost:8080/blazeds/messagebroker/amfpolling");
var channel:AMFChannel = new AMFChannel("my-polling-amf","http://ezflex.net:8080/blazeds/messagebroker/amfpolling");
channelSet.addChannel(channel);
myProducer.channelSet=channelSet;
myConsumer.channelSet=channelSet; -
How to create dynamic variable in HANA
Hello experts,
Please help me on how to create dynamic variable in calculation view.
Ex: variable automatically should take YTD, or MTD values so that I can directly consume column in BW on hana or BO reporting.Hi ,
Not sure on what are looking for. Have a look on the below blog once, if this is what you are looking out for:
Applying YTD in SAP HANA with SAP BO Analysis Office
Regards,
Krishna Tangudu -
How to create dynamic connection string with variables using ssis.
Hello,
Can anyone let me know on how to create dynamic connection string with variables using ssis?
Any help would be appreciated.Hi vinay9738,
According to your description, you want to connect multiple database from multiple servers using dynamic connection.
If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings. We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances.
For more details, please refer to the following blog:
http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
If there are any other questions, please feel free to let me know.
Regards,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to create dynamic strcture and accepting runtime value in work area
Hi,
I am using RFC_READ_TABLE for joining more than table and written select query but into clause work area value is passed but it is short dump is displaying with too few many fields in into clause .work area WA need some casting type conversion which accepts the some run time value and should have some structure for it.how to create dynamic structure?hi
good
go through this and use in your report accordingly.
If you are trying to read some information from SAP and you can't find the right BAPI then RFC_READ_TABLE can do the job for you.
RFC_READ_TABLE is powerful RFC it gives you the access to all tables and views in SAP. I basically used RFC_READ_TABLE for Material Master Search application on the Intranet.
Now you may say there are lots of BAPI for this functionality. You are right but I had to work around the BAPI to get Prices (Moving Average Price) and it just did not work very well. Because of the nature of the application I had to use RFC_READ_TABLE because then I can use powerful SQL expression for searching. RFC_READ_TABLE give you the ability to code the where clause which is quite enough.
I have included part of the code use in asp page to read ENT1027 for Mgroup and M description & number but without object creation. The other part of the code reads MBEW for price & quantity.
Code
lt;%
'#######################Diming the Structures
Call BAPIRFC.DimAs("Rfc_Read_Table", "FIELDS", MaterialSelection_RS)
Call BAPIRFC.DimAs("Rfc_Read_Table", "OPTIONS", Selection_RS)
'########################Search Type########################
' C contanis
' S Start with
' E Ends with
if searchtype = "C" then
FormatedSearch_Keyword = "%" & Search_Keyword & "%"
elseif searchtype = "S" then
FormatedSearch_Keyword = Search_Keyword & "%"
else searchtype = "E" then
FormatedSearch_Keyword = "%" & Search_Keyword
end if
'################# Flaged for deletion Materials #####################
if showdeleted = "No" then
Selection_RS.AddNew Array("TEXT"),Array("LVORM <> 'X' AND")
end if
'############## users can search three material group ################
'############## GROUPS: OFFICESUP TECOMHARD TECOMSOFT ###############
'##USER STILL CAN NAROW THEIR SEARCH BY SELECTING ON OF THREE#########
if MGroup = "ALL" then
Selection_RS.AddNew Array("TEXT"),Array("MATKL IN ('OFFICESUP','TECOMHARD','TECOMSOFT')")
else
Selection_RS.AddNew Array("TEXT"),Array("MATKL = '"& MGroup &"' and ")
end if
'#######################ADDING SEARCH KEYWORD TO STRUCTURE##############
if not Search_Keyword = "" then
Selection_RS.AddNew Array("TEXT"),Array(" MAKTG LIKE '" & FormatedSearch_Keyword & "'")
end if
Selection_RS.Update
'#######################ADD RETURNED FIELDS#########################
MaterialSelection_RS.AddNew array("FIELDNAME","OFFSET","LENGTH","TYPE","FIELDTEXT"),array("MATNR","000000","000000" ,"","")
MaterialSelection_RS.AddNew array("FIELDNAME","OFFSET","LENGTH","TYPE","FIELDTEXT"),array("MATKL","000000","000000" ,"","")
MaterialSelection_RS.AddNew array("FIELDNAME","OFFSET","LENGTH","TYPE","FIELDTEXT"),array("MAKTG","000000","000000" ,"","")
MaterialSelection_RS.Update
call BAPIRFC.Rfc_Read_Table("ENT1027", Material_RS, MaterialSelection_RS, Selection_RS, "~", "", "0", "0")
If Err.Number > 0 then
Response.Write "Error:" & "<BR>"
Response.Write " Err.number...... " & Err.Number & "<BR>"
Response.Write " Err.Description. " & Err.Description & "<BR>"
end if
'###########LOOP THROUGH RECORDSET
if not Material_RS is nothing then
do while not Material_RS.eof
loop
end if
%>
thanks
mrutyun^
Maybe you are looking for
-
JMX API to Create Event Generator
Is there any JMX API available to create JMS event generator? Thanks
-
MacBook Pro Late 2008 (Unibody) doesn't boot
Hello, my good old MacBook Pro Late 2008 running Mountain Lion won't boot anymore. The sleep light does not light on, the green battery status indicator light is showing that the battery is full. I had this problem two or three times, and usually my
-
I keep losing midi sound in my 49e synth
I select it in the track channel but for some reason I keep losing the sound or don't know how to get the 49e sound back. I am new to Logic 8 and was wondering if there is an easy tip on keeping track of my 49e synth sounds and not losing them? Thank
-
Ok, I think I had to be signed in to ask. I upgraded from PSE 12 to Photoshop/Lightroom cc. Did this today. Loaded some of my actions in PS. But it won't open my raw files. I have a 70D Canon. Says I need camera raw 8.2 or higher. There wasn't ju
-
SQ01 - Join of different tables or ABAP Code in SAP Query
Hello, I am trying to link some TO tables LTAK and LTAP together with the header table of the production orders AFKO. It seems that the SQ01 won't let me joint the LT* and the AFKO table. But I need to read some values from the AFKO table according t