How we create dynamic add form field in web form
How we create dynamic add form field in web form?
Hi,
Thanks for reply.
I need to create a form in which "add more" input field dynamically. For
example sometime we need field on or more. Please look at the demo, I need
to create form as per demo in business catalyst:
http://www.openjs.com/scripts/examples/addfield.php
Similar Messages
-
How can I dynamicly add control elements to a form
Hello,
I want to dynamicly add elements to a JPanel.
The elements with the properties are stored in a database
each record contains one element
Label
Combobox
Checkbox
I`m programming in NetBeans 5.5
Something like:
public void test()
try
stmt = GeneralDBConnect.createStatement();
ResultSet rs = stmt.executeQuery("select device_option_id, objecttype, device_option, size, location, tooltip from device_option where ...");
int i = 0;
if(rs.next())
i = i + 1;
switch(rs.getString(2))
case "Label" : JLabel Element[i] = new JLabel();
Element.setText(rs.getString(3));
break;
case "Textbox" : JTextField Element[i] = new JTextField();
break;
case "Combobox" : JComboBox Element[i] = new JCombobox();
Element[i].setToolTipText(rs.getString(6));
ResultSet List = stmt.executeQuery("select device_option_value_id, option_value from device_option_value where ...");
while(List.next)
Element[i].addItem(List.getString(2));
List.close();
break;
case "Checkbox" : JCheckBox Element[i] = new JCheckBox();
break;
jPanel_Device_Option.add(Element[i])
rs.close();
stmt.close();
catch (SQLException ex)
ex.printStackTrace();
I know the Element[i] is wrong code but I need to give the elements an unique name.
Can anyone assist me in this matterHello everybody,
I figured it out. I had to change the layout model of the JPanel.
I`ve chosen to use the gridbaglayout because its very flexibel. See http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html
Here is my code:
Description:
Whenever an item in a Combobox is changed (representing devices) the optional elements (a collection of Textfields, checkboxes, comboboxes) are shown in a JPanel.
Which Elements are shown is stored in a database. (Tabels device, device_option and device_option_value (stores the JCombobox items))
First create a JPanel in the graphical editor and right click it choose set layout\gridbaglayout
jPanel_Device_Option.setLayout(new java.awt.GridBagLayout());
jPanel_Device_Option.setBorder(javax.swing.BorderFactory.createTitledBorder("Device Options"));
jPanel_Device_Option.setAutoscrolls(true);Then to create an empty border so the elements don`t clip to the edge of the JPanel add the following code in the properties window in the code section under node "Post-Init code"
Border bBorder = jPanel_Device_Option.getBorder();
Border bMargin = new EmptyBorder(0,10,0,10);
jPanel_Device_Option.setBorder(new CompoundBorder(bBorder, bMargin));Then declare the public variables at the beginning of the code
public static ArrayList aDatasetElements;
public static JLabel[] aLabel;
public static JLabel[] aTextfieldLabel;
public static JTextField[] aTextfield;
public static JLabel[] aComboboxLabel;
public static JComboBox[] aCombobox;
public static JLabel[] aCheckboxLabel;
public static JCheckBox[] aCheckbox;And now the method that`s creating the elements
public void setOutputSettings()
jPanel_Device_Option.removeAll();//Clear all existing elements from the JPanel
jPanel_Device_Option.repaint();//Refresh the JPanel
if(jComboBox_Output.getSelectedItem().toString().length() > 0)//Check if any elements should be added
GridBagConstraints gbConstraint = new GridBagConstraints();//Create a new gridbagcontraint (properties of layout) check http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html
gbConstraint.fill = GridBagConstraints.HORIZONTAL;
gbConstraint.anchor = GridBagConstraints.PAGE_START;
gbConstraint.weightx = 0.5;
try
stmt = GeneralDBConnect.createStatement();
/*Collect data from the database (Which elements should be displayed)
deviceoption: The name of the option this is displayed in the elements label as text
tooltip: Show a tooltip on both label and element
device_optio_id: gets the ID needed to get the list values for a combobox also easy to use when getting the data afterwards (stored in a public variable
objecttype: Label, Textfield, Checkbox, Combobox*/
ResultSet rsElements = stmt.executeQuery("select device_option, tooltip, device_option_id, objecttype from device_option where deviceid = (select device_id from device where devicename = \'" + jComboBox_Output.getSelectedItem() + "\') order by sequence_order asc");
aDatasetElements = new ArrayList(); // Makes an array
while(rsElements.next()) //get data in arraylist (a resultset closes after a while (garbitch collector) resulting in errors I recieved some errors resulset allready closed. Also needed to acces data afterwards
aDatasetElements.add(new String(rsElements.getString(1)) + " ;" + new String(rsElements.getString(2)) + ";" + new Integer(rsElements.getInt(3)) + ";" + new String(rsElements.getString(4)));
rsElements.close();
aLabel = new JLabel[aDatasetElements.size()]; //Makes an array
aTextfieldLabel = new JLabel[aDatasetElements.size()]; //Makes an array
aTextfield = new JTextField[aDatasetElements.size()]; //Makes an array
aCheckboxLabel = new JLabel[aDatasetElements.size()]; //Makes an array
aCheckbox = new JCheckBox[aDatasetElements.size()]; //Makes an array
aComboboxLabel = new JLabel[aDatasetElements.size()]; //Makes an array
aCombobox = new JComboBox[aDatasetElements.size()]; //Makes an array
for(int i = 0; i < aDatasetElements.size(); i++) //loop through the foundset
String sDatasetElements = aDatasetElements.get(i).toString(); //get the data from the array
//Creation of Elements of type Label
if(sDatasetElements.split(";")[3].equals("Label")) //Check objecttype
gbConstraint.gridx = 0; //X position in layout (Label)
gbConstraint.gridy = i; //Y position in layout (Label)
aLabel[i] = new JLabel(sDatasetElements.split(";")[0], aLabel.TRAILING); //Makes a JLabel at an array place
aLabel[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aLabel[i], gbConstraint); //Adds a JLabel to the JPanel
//Creation of Elements of type TextField
if(sDatasetElements.split(";")[3].equals("Textfield"))
gbConstraint.gridx = 0; //X position in layout (Label)
gbConstraint.gridy = i; //Y position in layout (Label)
aTextfieldLabel[i] = new JLabel(sDatasetElements.split(";")[0], aTextfieldLabel[i].TRAILING); //Makes a JTextfield at an array place
aTextfieldLabel[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aTextfieldLabel[i], gbConstraint); //Adds a JLabel to the JPanel
gbConstraint.gridx = 1; //X position in layout (Element)
gbConstraint.gridy = i; //Y position in layout (Element)
aTextfield[i] = new JTextField(); //Makes a JTextfield at an array place
aTextfield[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aTextfield[i], gbConstraint); //Adds a JTextField to the JPanel
//Creation of Elements of type Checkbox
if(sDatasetElements.split(";")[3].equals("Checkbox"))
gbConstraint.gridx = 0; //X position in layout (Label)
gbConstraint.gridy = i; //Y position in layout (Label)
aCheckboxLabel[i] = new JLabel(sDatasetElements.split(";")[0], aCheckboxLabel[i].TRAILING); //Makes a JLabel at an array place
aCheckboxLabel[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aCheckboxLabel[i], gbConstraint); //Adds a JLabel to the JPanel
gbConstraint.gridx = 1; //X position in layout (Element)
gbConstraint.gridy = i; //Y position in layout (Element)
aCheckbox[i] = new JCheckBox(); //Makes a JCheckbox at an array place
aCheckbox[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aCheckbox[i], gbConstraint); //Adds a JCheckbox to the JPanel
//Creation of Elements of type Combobox
if(sDatasetElements.split(";")[3].equals("Combobox"))
gbConstraint.gridx = 0; //X position in layout (Label)
gbConstraint.gridy = i; //Y position in layout (Label)
aComboboxLabel[i] = new JLabel(sDatasetElements.split(";")[0], aComboboxLabel[i].TRAILING); // Makes a JLabel at an array place
aComboboxLabel[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aComboboxLabel[i], gbConstraint); //Adds a JLabel to the JPanel
gbConstraint.gridx = 1; //X position in layout (Element)
gbConstraint.gridy = i; //Y position in layout (Element)
aCombobox[i] = new JComboBox(); //Makes a JCombobox at an array place
aCombobox[i].setToolTipText(sDatasetElements.split(";")[1]);
jPanel_Device_Option.add(aCombobox[i], gbConstraint); //Adds a JCombobox to the JPanel
//Get the listvalues from the database option_value is the value that is shown in the list
ResultSet rsValuelist = stmt.executeQuery("select option_value from device_option_value where device_optionid = " + sDatasetElements.split(";")[2] + " and (option_state = " + iOptionState + " or option_state = 40) order by sequence_order");
while(rsValuelist.next())
if(rsValuelist.getString(1) == null)
aCombobox[i].addItem("");
else
aCombobox[i].addItem(rsValuelist.getString(1));
rsValuelist.close();
//Place an empty label at the bottom otherwice the labels are centered in the JPanel
gbConstraint.anchor = GridBagConstraints.PAGE_END;
gbConstraint.weighty = 1.0;
gbConstraint.gridx = 0;
gbConstraint.gridy = aDatasetElements.size() + 1;
jPanel_Device_Option.add(new JLabel(""), gbConstraint); //Adds an empty JLabel to the JPanel
catch (SQLException ex)
ex.printStackTrace();
The is triggered in the init method and the event Item changed of the JCombobox
private void jComboBox_Output_ItemStateChanged(java.awt.event.ItemEvent evt) {
//Removed some irrelevant code here
setOutputSettings();
}To collect the data that the user has entered in the elements
private void jButton_Collect_User_Data_ActionPerformed(java.awt.event.ActionEvent evt) {
String sList = "";
for(int i = 0; i < aDatasetElements.size(); i++)
String sDatasetElements = aDatasetElements.get(i).toString();
if(sDatasetElements.split(";")[3].equals("Label"))
sList = sList + aLabel.getText() + "\n";
if(sDatasetElements.split(";")[3].equals("Textfield"))
sList = sList + aTextfield[i].getText() + "\n";
if(sDatasetElements.split(";")[3].equals("Checkbox"))
sList = sList + aCheckbox[i].isSelected() + "\n";
if(sDatasetElements.split(";")[3].equals("Combobox"))
sList = sList + aCombobox[i].getSelectedItem().toString() + "\n";
JOptionPane.showMessageDialog(null, sList);
I hope ths is helpfull information.
Since I`m totally new to Java it is possible that a different approach is better however this is working for me.
I`m open for any remarks on the code and feel free to give any comments.
Kind Regards Rene -
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 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^ -
How to create Dynamic Table Control
Hi
How to create Dynamic Table control , The field names and values to be displayed in table control are to be fetched from Add-on Tables.
Regards
PrasathHi Jonathan,
Actually the columns to be displayed are not constant . It will be increased based on the database values, Anyhow it will not exceed 100.
Please confirm my understanding.
1. In this case I have to create 100 custom columns and make it visible / invisible based on my requirement and I can set the title at runtime.
2. How can i assosicate / reassociate the datadictionary reference for the columns that i use. Because I need to show the search help values for the
dynamic columns.
Your opinion on this will be helpful.
Regards
Prasath -
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 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 -
How to Map Proces form field with Resource form field?
Hi,
How to Map Proces form field with Resource form field while creating Process form in Form designerAre you talking about Provisioning ?
then you do that in Data Flow under Process Defintion in OIM 10g
In OIM 11g you use Request Dataset. In that you can directly map fields to process form. -
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. -
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 Webi 3.1 filename in Publication
I have a webi 3.1 report that is being called from a publication used for bursting using the eFashion universe. I want the file name to be dynamic, based on the profile. Within the webi report I created a free standing cell that I set to "Western States" or "Eastern States" based on the states in the report at the time of the run (set by the profile). This works correctly. But there does not seem to be a way to get the report to use the free standing cell value as part of the report name. From the publication, properties, destinations, use specific name I can only pick title and document name. Neither of these is the free standing cell in the report. I saw that version 4.0 has this ability but I can't upgrade for another year and deski is not an option. Any suggestions? Thank you.
I figured out how to create dynamic report names with 2 fields within the Publication tool. I padded fullname and email in dynamic recipients to be the two fields I wanted from the report. Then in Destinations, File Name:, Use specific name I picked userfullname and email address to create the report name. But that would not work if I actually needed to use the email address to send the report to. We don't have Java programmers and may have to find other options. Thanks.
-
How to create dynamic nested internal table
Hi Experts,
Pleae tell me or give sample code, how to create dynamic nested internal table ?
I have seen threads saying creation of dynamic internal tables using some table structure only. But now the requirement is to create dynamic nested internal table.
For example the internal table contains two fields viz., one is field1 of dynamic internal table and other is normal field2 and values as shown below:
Nested internal table:
field1 | field2 ...
<table content1> | value2..
<table content1> | value2..
Here the [table content] should also a dynamic internal table.
Let me know if you need any other info.
regards
Saravanan Rsee the complete code..i am currently working in ECC6.0 EHP4. just check which version you are using..
REPORT yst_test_000.
DATA:
lt_comptab TYPE cl_abap_structdescr=>component_table,
ls_comp LIKE LINE OF lt_comptab,
lref_newstr TYPE REF TO cl_abap_structdescr,
lref_tab_type TYPE REF TO cl_abap_tabledescr,
lt_fcat TYPE lvc_t_fcat,
ls_fcat TYPE lvc_s_fcat,
ls_dd03p TYPE dd03p,
lt_data type ref to data.
field-symbols: <fs_table> type standard table.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SCARR'
CHANGING
ct_fieldcat = lt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT lt_fcat INTO ls_fcat.
IF ls_fcat-ref_table IS NOT INITIAL.
CLEAR ls_dd03p.
CALL FUNCTION 'BUS_DDFIELD_GET'
EXPORTING
i_tabnm = ls_fcat-ref_table
i_fldnm = ls_fcat-fieldname
IMPORTING
e_dd03p = ls_dd03p
EXCEPTIONS
field_not_found = 1
OTHERS = 2.
IF sy-subrc EQ 0.
ls_comp-name = ls_fcat-fieldname.
ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_dd03p-rollname ).
APPEND ls_comp TO lt_comptab.
CLEAR ls_comp.
ENDIF.
ELSE.
ls_comp-name = ls_fcat-fieldname.
ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
APPEND ls_comp TO lt_comptab.
CLEAR ls_comp.
ENDIF.
ENDLOOP.
*Now for the Field which you want deep table then you can do like this
ls_fcat-fieldname = 'NESTED_TABLE'.
ls_fcat-inttype = 'C'.
ls_fcat-intlen = '000006'.
ls_fcat-rollname = 'SFLIGHT_TAB1'. "For SFLIGHT
APPEND ls_fcat TO lt_fcat.
ls_comp-name = ls_fcat-fieldname.
ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
APPEND ls_comp TO lt_comptab.
CLEAR ls_comp.
lref_newstr = cl_abap_structdescr=>create( lt_comptab ).
lref_tab_type = cl_abap_tabledescr=>create( lref_newstr ).
create data lt_data type handle lref_tab_type.
assign lt_data->* to <fs_table>.
break-point.
Edited by: Vijay Babu Dudla on Apr 28, 2009 8:05 AM -
How to create Formula based value field in COPA
Hi,
I want to know how to create formula based value field in COPA
My Requirement is i want to collect some value in formula based value field and want to use in copa allocation cycle as a tracing
factor.
anybody give some light on the same topic or requirement ?
Thanks
Nilesh RThe key figure you are creating in KE2K is not a value field, i.e. you can't post to it and you can't use it in a report. It is a caluculated value that can be used only in assessment and top-down-distribution.
In Ke2K, enter a name for your key figure, then click on the the white sheet button to create it. Now the formular area is open for input. Input your formular (e.g. VV001 + VV002 - VV003 .... where VVXXX are the technical names of value fields).
Now click the "check formuar"-button. Then save.
Before you can use the key figure in assessment, execute TC KEUG.
Now the key figure is available as any value field in the tracing factor selection of your assessment cycle.
I hope this made it clearer.
Regards
Nikolas
Maybe you are looking for
-
BED and ecess - usd values are flowing in J1IG during import procurement?
HI, When I am doing import procurement with CVD & ecess on CVD, Secess on CVD conditions - all the condition values are flowing in USD values even though the condition base value is copied in INR in J1IG (excise invoice at depot, kindly let me know w
-
How to start WAD report from MSS with Hierarchy ?
Hello to all. I have a WAD Report that the parameters for it are: Org unit - as the root, and a year/month. The report receive an org unit and display data for it and for all org units under it in the Org. structure. I start the report from the MSS.
-
SAP Standard BAPI Issue ---BAPI_PROCORDCONF_CREATE_TT
Hi We are using the standard BAPI-- BAPI_PROCORDCONF_CREATE_TT to do Process order confirmations , which is invoked by an MII BLS using data from the MES system. Everything worked like a charm ( Partial confirmations, Final Confirmations, Goods Move
-
I want to create a new email address
CAN I GET A NEW EMAIL ADDRESS HERE OR DO I USE THUNDERBIRD?
-
Specific Workitems should not go to substitutes
Hi We have developed some custom workflow which has some sensitive data. If a user has maintained substitutes for himself the sensitive workflow should not be recived by substitutes. We have a custom clasification for the tasks. we tried creating a p