Tricky! Change of navi-attribute values in ABAP and use in selections
Hi gurus,
now I have a teaser that really keeps me busy, and which might be interesting for some of you:
we use several statuses in our <u>Demand Planning in SCM 5.0</u>, some of which can be switched by using a user-function macro which just basically is a ABAP function module that <u>changes navigation attribute values directly on the database</u>, meaning in the master data tables of the respective characteristic.
Now, the code works, the values are changed accordingly, leaving the data set in object status "active" - <b>BUT</b>:
<i>when we call a selection, it still shows the old values, even after activating master data or running the attribute change run!</i>
This is not what we expected. Our wish was, that once the table was updated with the correct field values, we would also see them in our selections.
<u>Details:</u>
we have two statuses as navi-attributes to an article:
<i>DP:</i> YES/NO, and
<i>oDP:</i> YES/NO
Combinations originally are: <i>DP</i> YES/<i>oDP</i> NO
After the status change macro, the table shows the following, as expected:
<i>DP</i> NO/<i>oDP</i> YES
As we have two selections, one on DP status "YES", the other one on oDP status "YES", we would like to see the article vanish in the first selection and show up in the other one...
Does anybody have an idea what is wrong and what we can do to have to proper navi-attribute values from the master data table in the selection? Does the selection not read from the database but from a buffer?
Looking forward to your answers,
Klaus
Hi Fabrice,
yes indeed, I did check the object version, and it is A.
Problem is, the function module changes the data record which is "A" anyway. So the changed data record is active - however, I just had a look at the SID master data table, and it looks that direct changes to the P-table do not affect the X-table where the SIDs are stored. So I guess I will also have to update the X-table with the correct SID-values.
If this works, I let you know. We will be using this change by ABAP quite often, it is rather useful.
Regards and thanks for your prompt reply,
Klaus
Similar Messages
-
Macro help: Nav Attribute Value
Dear Macro Gurus,
I need to realize this
IF the value of the Navigational Attribute "NavChar2" of a POS "Char1" is = a, b, and c
then
do something.
ENDIF
I could do the something
but couldn't get the macro function right for the IF.
Help appreciated
Thanks
BSIs this any help? Function ACT_IOBJNM_VALUE with a double underscore to separate the characteristic from its nav attribute.
ACT_IOBJNM_VALUE( 'characteristic__navattr' ) = 'X'
which could be implemented in macro similar to attachment -
Change the Summary Attribute Value through Java code
Hi ,
I am working on a requirement where I need to set the Attribute value on the final Summary Screen through Java Code.
Code :
InterviewUserData data = new InterviewUserData();
InterviewEntityInstance globalInstance = data.getGlobalInstance();
globalInstance.setValue("Name", value_to_set);
On completion of the interview session Name is displaying as NULL.
I need to set NAME = value_to_set and display it on the final summary screen.
Any help on this will be appreciated.
RegardsThe InterviewUserData object is effectively a change set, to apply this to a session you use the InterviewSession.submit(InterviewUserData) method. You don't say how you are invoking this code but if it's inside an event Interview Engine handler the InterviewSession object should be accessible.
Regards
Ian -
How to add Navigation attributes values via ABAP while creation of CVC
Hi,
I have a requirement like, I have to add navigational attributes to the cvc record while CVC creation ( /sapapo/mc62 transaction).
There were two scenarios: 1. Usually when they load master data from BW side those navigation attributes available and when we do CVC creation it's automatically picks those values. If NOT then i have to bring Market segment and Business unit navigational attributes values from ECC via RFC function module by passing MPN and End customer division as a input.
I am facing problem when BW side if business unit and Market segment were blank.
Do we have any Function modules available to add navigational attributes data and should update corresponding master data tables.
Please help me step by step process on this.
Thanks
Ravi
Edited by: REDDY KALLURI on Jan 22, 2011 10:30 PMMichael,
Are you intending this as a commercial solution or a work around?
To take an existing equivalent, one would build a view in the database tailored for each grid in an Oracle Forms application. Or a separate query layered over tables for each form/grid in a Delphi or Access application? Even if it is ninety nine percent the same over half a dozen forms/grids?
And now you've added a whole slew of "slightly different" rowSetInfos to maintain.
So if you wanted to add a column that needs to appear everywhere... you've just increased the workload multi-fold?
That would be a management nightmare, wouldn't it? Not to mention yet more performance cost and a slower system?
Hmmmm..... I'm not sure I like where this is headed... someone needs to do some convincing...
null -
Where we use Conversions? like Fixed Value and Value mapping? and use of th
where we use Conversions? like Fixed Value and Value mapping?
and what is the use of that....Hi
Have a Look at this
/people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool
Value mapping is used to map different representations of an object to each other.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
You can do value mapping both in IR and ID
IR: Message Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
/people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
ID: Tools --> Value Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/content.htm
Value mapping replication: For uploading data from tables, excel sheet etc. into XI
http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/content.htm
Value mapping
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Thanks -
Automatically Change Database Table Attribute Value.
Hi All,
I am trying to write a tool which will run as a cronjob. This tool which runs periodically, connects to DATABASE and checks the System Central Date of the Server say 20070828(this format!) and also checks the values in Database Table.. if this matches then The Table Attribute should change from "postponed" to "initial".
I have a table named "Task" it has attributes.. ID, TaskDate, Name, State..etc
Now this tool should check the "TaskDate" and alter the "State" if it satisfies the condition.
Could anyone of you help me by giving some tips, so that I can finish the project asap..? This is the last requirement which is pending now.. I am running out of ideas.. ;-(
Let me know, if you require more info to suggest me.
Thanks and Rgds,
PradeepRunning out of ideas in the sense.. my mind is not workin!! ha ha.. just kiddin..
I already know the concept to schedule cron job.. so the problem here ends..
I wanted some tips how can i change the attribute by just checkin the TaskDate.. i need something like 20070828(i.e only the date related) but in database i have something like 20070828102000(total time!!)
If any of you just give an idea.. then it would do a world of good for me..
Thanks! -
How to Change Messages inline attribute value Dinamically
Hi
I'm using Jdev 11.3
Our requirement is if the facesmesage having onlly one message it should come like inline message
else it should come as a popup.
i tried EL for inline attribute but the problem is the method is calling only when submition
public boolean isInline()
boolean flag = true;
Iterator it = FacesContext.getCurrentInstance().getMessages();
if (it.hasNext())
flag = false;
return flag;
regards Abhilashduplicate
-
Get the message attribute values in Orchestration without using property promotion
I have the following schema :
Now I want to get the values of FName,LName in orchestration without using any property promotion ?
PrakashThere are also multiple ways of creating the Xpath:
- Full path with namespaces - Rahul Madaan showed this one
- Full path without namespaces:
FName = xpath(InputMessage, "string(/*[local-name()='Root']/*[local-name()='IntField'])");
I think this method is handy if you have multiple schemas with similar structure but the namespace
changes. This is also easier to read and less prone to errors if there are any changes.
If you for example wanted the node #3, then it would be
FName = xpath(InputMessage, "string(/*[local-name()='Root']/*[local-name()='IntField'][3]/*[local-name()='IntSubField'])");
- Jump directly to the field/node you need (this one works for at least xml elements):
xpath(InputMessage, "string(//*[local-name()='IntField'])");
I find this useful when picking up key-values from the message, that can be available only once.
All the examples above are for elements. Since you are picking up value from an attribute, the actual structure
is
varFName = xpath(InputMessage,"string(/*[local-name()='StudentDetails']/*[local-name()='Student']/@*[local-name()='FName'])");
And to learn the rest of the possibilities of Xpath, like count, different types, more detailed selections
of the correct Node (Like example, I want only the one where FNAME = 'MyFName') You can try something like: http://social.technet.microsoft.com/wiki/contents/articles/6944.biztalk-orchestrations-xpath-survival-guide.aspx
Also get DanSharp XmlViewer. It will help you quite a bit when fine tuning the xpaths. -
How to access attribute value from another VO using groovy?
Hello, I am using JDeveloper 11.1.2.3.0
I read a lot of information about this but still I am missing something. I am trying to set the value of a bind variable through Groovy expression in my VO. I want this Bind variable
to have the value from an attribute from another VO. I tried ''adf.object.MyAppModuleImpl.findViewObject('Users1').currentRow.Iduser''
I am getting "oracle.jbo.expr.JISyntaxError: Variable MyAppModuleImpl not recognized". I tried with 'MyAppModule' only but the result is the same.
Can anyone help please?
ThanksCheck out http://www.oracle.com/technetwork/developer-tools/adf/learnmore/august2011-otn-harvest-457288.pdf Page 18 'Optimized Groovy data access to view objects'
Timo -
Excluding Value Range - ABAP Routine at Infopakage Selection
Hi,
In Production the volume of data is very high, I m splitting the data based on Material No.
000000000000 - 4ZZZZZZZZZ,
500000000000 - 8ZZZZZZZZZ,
900000000000 - FFFFFFFFFFFFF,
and the remaining Material No.s.
I created seperate InfoPaks for the material Ranges for the above three.
I need to load the remaining Material No. data. For the I need to write the ABAP routine at the Infopakage Selections.
Can you help me doing so.
Thanks in Advance.
Surya.Hi,
analyse the data. total data u can split with the help of Organisational values. take the case in souce system i have 40 million records of sales orders. then i will do like how many sales area's we have in our organization. assume. 4 sales areas then i willl create a infopackage for each. so tat u won't miss any data.
don't go for Material number, select organisational values.
all the best.
Nagesh. -
Example of how to call a BadI from an Abap and use the NEW OO ALV Grid
Very easy to do.
<b>REPORT Z_BADI_TEST.
test call Badi from standard abap.
*Only from rel 6.40
do the following
1) define the Badi (SE18).
For Abap call test uncheck multiple use
and filter boxes
2) Implement the badi (SE19).
Add any methods here in the implementation
3) activate
4) define the standard class exithandler to the
Abap. This class is the "Badi caller
5) define an exit variable referring to your Badi
Implementation interface
this interface will normally be
called something like
ZIF_EX***************
You will see the actual name in SE18/SE19.
6) Instantiate your instance of the badi
via method call get_instance
7) Now call any method(s) in the Badi.
*****************start of abap code **************
Define the Badi calling class (standard sap class)
class cl_exithandler definition load. "Declaration
*Interface reference
data exit type ref to zif_ex__jimbotest.
data yes type c.
Used in Fmod call in Badi methods
data: v_knvv type knvv.
start-of-selection.
yes = ' '.
selection-screen begin of block b1.
parameters: r1 radiobutton group rad1,
r2 radiobutton group rad1,
r3 radiobutton group rad1.
selection-screen end of block b1.
parameters: p_kunnr type knvv-kunnr.
select single * into v_knvv
from knvv
where kunnr eq p_kunnr.
export v_knvv to memory id 'CUST6A'.
*Save customer data for the function module call
call method cl_exithandler=>get_instance
exporting
exit_name = 'Z_JIMBOTEST' "Your Badi Name
null_instance_accepted = yes
changing instance = exit.
if not exit is initial.
if r1 = 'X'.
call method exit->dispord . "Badi call
endif.
if r2 = 'X'.
call method exit->dispfakt. "Badi Call
endif.
if r3 = 'X'.
call method exit->dispmat. "Badi call
endif.
end of calling abap******** </b>
In the badi methods code as shown
1)
method ZIF_EX__JIMBOTEST~DISPORD.
CALL FUNCTION 'Z_DISPLAY_CUST'.
endmethod.
2)
method ZIF_EX__JIMBOTEST~DISPFAKT.
CALL FUNCTION 'Z_DISPLAY_FAKT'.
endmethod
3)
method ZIF_EX__JIMBOTEST~DISPMAT.
CALL FUNCTION 'Z_DISPLAY_CUST'.
endmethod.
Copy via SE 41 the status SALV_STANDARD from standard SAP program SALV_DEMO_METADATA into the main program where you've created the 3 function modules below (SAP______TOP)
Global Data for the three function modules I'm calling
FUNCTION-POOL Z_BADI_KNVV. "MESSAGE-ID ..
include <color>.
include <icon>.
include <symbol>.
tables: zknvv.
data: v_zzkvgr6 TYPE KNVV-ZZKVGR6.
data: choice1 type c.
data: choice2 type c.
data: choice3 type c.
data: choice4 Type c.
data: ok-code(5) type c.
data: answer type string.
data: value1 type SPOP-VARVALUE1.
data: answer1 type string.
tables: vbak, vbap, vakpa, vbrk, vrkpa.
data: lr_functions type ref to cl_salv_functions_list.
constants: gc_true type sap_bool value 'X',
gc_false type sap_bool value space.
add for colour displays
data: ls_color type lvc_s_colo.
DATA : LV_SALV_COLUMNS_TABLE TYPE REF TO CL_SALV_COLUMNS_TABLE.
data: lr_columns type ref to cl_salv_columns_table,
lr_column type ref to cl_salv_column_table.
Data:
gr_table TYPE REF TO cl_salv_table.
data: z_datum type sy-datum.
data: v_knvv type knvv.
data : begin of s_vbak,
vkorg type vakpa-vkorg,
vkgrp type vakpa-vkgrp,
vtweg type vakpa-vtweg,
spart type vakpa-spart,
auart type vakpa-auart,
vbeln type vakpa-vbeln,
bstnk type vakpa-bstnk,
audat type vakpa-audat,
netwr type vbak-netwr,
end of s_vbak.
data : begin of s_vbrk,
vbeln type vrkpa-vbeln,
vkorg type vrkpa-vkorg,
fkart type vrkpa-fkart,
fkdat type vrkpa-fkdat,
netwr type vbrk-netwr,
end of s_vbrk.
data: begin of s_vbap,
matnr type vbap-matnr,
arktx type vbap-arktx,
netwr type vbap-netwr,
kwmeng type vbap-kwmeng,
end of s_vbap.
data: t_vbap like table of s_vbap.
data: t_vbak
like table of s_vbak.
data: t_vbrk
like table of s_vbrk.
data: s_name type tabname.
data: gr_selections type ref to cl_salv_selections.
data: gr_events type ref to cl_salv_events_table.
Source code of the function modules.
Function modules themselves
FUNCTION Z_DISPLAY_CUST.
s_name = 'S_VBAK'.
orders in last 6 months
z_datum = sy-datum - 180.
import v_knvv from memory id 'CUST6A'.
get data
select avkorg aaudat avkgrp avtweg aspart aauart abstnk avbeln b~netwr
into corresponding fields of table t_vbak
up to 100 rows
from ( vakpa as a
inner join vbak as b
on avbeln eq bvbeln )
where a~kunde eq v_knvv-kunnr
and a~parvw eq 'AG'
and a~vkorg eq 'EN01'
and a~trvog eq '0'
and a~audat gt z_datum.
sort t_vbak by audat descending.
*data: gt_hyperlink type standard table of g_type_s_hyperlink.
Instead of if_salv_c_bool_sap=>false, you can pass the
value if_salv_c_bool_sap=>true to this method to
see your ALV as a list.
display data in Grid / List
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>false
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = t_vbak.
CATCH cx_salv_msg.
ENDTRY.
try.
LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
ls_color-col = col_negative.
ls_color-int = 0.
ls_color-inv = 0.
lr_column->set_color( ls_color ).
catch cx_salv_not_found.
endtry.
try.
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'VBELN' ).
ls_color-col = col_negative.
ls_color-int = 1.
ls_color-inv = 1.
lr_column->set_color( ls_color ).
catch cx_salv_not_found.
endtry.
try.
*LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
lr_column->set_short_text( 'Short' ).
lr_column->set_medium_text( 'Medium' ).
lr_column->set_long_text( 'Net Value' ).
*lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'URL' ).
catch cx_salv_not_found.
endtry.
gr_table->set_screen_status( pfstatus = 'SALV_STANDARD'
report = sy-repid
set_functions = gr_table->c_functions_all ).
this statement actually does the display.
gr_table->display( ).
ENDFUNCTION.
FUNCTION Z_DISPLAY_FAKT.
s_name = 'S_VBRK'.
invoices in last 6 months
z_datum = sy-datum - 180.
import v_knvv from memory id 'CUST6A'.
get data
select avbeln afkart avkorg afkdat
b~netwr
into corresponding fields of table t_vbrk
up to 100 rows
from ( vrkpa as a
inner join vbrk as b
on avbeln eq bvbeln )
where a~kunde eq v_knvv-kunnr
and a~parvw eq 'RG'
and a~vkorg eq 'EN01'
and a~vbtyp eq 'M'
and a~fkdat gt z_datum.
sort t_vbrk by fkdat descending.
*data: gt_hyperlink type standard table of g_type_s_hyperlink.
Instead of if_salv_c_bool_sap=>false, you can pass the
value if_salv_c_bool_sap=>true to this method to
see your ALV as a list.
display data in Grid / List
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>false
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = t_vbrk.
CATCH cx_salv_msg.
ENDTRY.
try.
LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
ls_color-col = col_negative.
ls_color-int = 0.
ls_color-inv = 0.
lr_column->set_color( ls_color ).
catch cx_salv_not_found.
endtry.
try.
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'VBELN' ).
ls_color-col = col_negative.
ls_color-int = 1.
ls_color-inv = 1.
lr_column->set_color( ls_color ).
catch cx_salv_not_found.
endtry.
try.
*LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
lr_column->set_short_text( 'Short' ).
lr_column->set_medium_text( 'Medium' ).
lr_column->set_long_text( 'Net Value' ).
*lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'URL' ).
catch cx_salv_not_found.
endtry.
gr_table->set_screen_status( pfstatus = 'SALV_STANDARD'
report = sy-repid
set_functions = gr_table->c_functions_all ).
this statement actually does the display.
gr_table->display( ).
ENDFUNCTION.
FUNCTION Z_DISPLAY_MATERIAL.
s_name = 'S_VBAP'.
invoicesrs in last 6 months
z_datum = sy-datum - 180.
import v_knvv from memory id 'CUST6A'.
get data
select avbeln bmatnr barktx bnetwr b~kwmeng
into corresponding fields of table t_vbap
up to 100 rows
from ( vakpa as a
inner join vbap as b
on avbeln eq bvbeln )
where a~kunde eq v_knvv-kunnr
and a~parvw eq 'AG'
and a~vkorg eq 'EN01'
and a~trvog eq '0'
and a~audat gt z_datum.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>false
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = t_vbap.
CATCH cx_salv_msg.
ENDTRY.
try.
LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
ls_color-col = col_negative.
ls_color-int = 0.
ls_color-inv = 0.
lr_column->set_color( ls_color ).
catch cx_salv_not_found.
endtry.
try.
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'ARKTX' ).
ls_color-col = col_negative.
ls_color-int = 1.
ls_color-inv = 1.
lr_column->set_color( ls_color ).
catch cx_salv_not_found.
endtry.
try.
*LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
lr_column->set_short_text( 'Short' ).
lr_column->set_medium_text( 'Medium' ).
lr_column->set_long_text( 'Net Value' ).
*lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'URL' ).
catch cx_salv_not_found.
endtry.
gr_table->set_screen_status( pfstatus = 'SALV_STANDARD'
report = sy-repid
set_functions = gr_table->c_functions_all ).
this statement actually does the display.
gr_table->display( ).
ENDFUNCTION.
You can extend this as far as you like -- it's really easy and MUCH MUCH easier than the old way with fieldcatalogs etc etc.If the pagecontainer_mc holds another movieclip that contains the button you are trying to target, then you need to include that loaded movieclip in the targeting. And if contacts is that movieclip, then you should be able to target it directly using...
var contacts:contatti = new contatti;
contacts.contacts_btn.addEventListener(MouseEvent.CLICK,showContacts); -
How to get the value from a function using a select statement
I have a function(user defined not built in) that returns multiple values(like an array). My question is how do i get those values in a select statement. when i tried to retrieve it,
select pack.my_members from dual;
i am getting an error
ORA-00902: invalid datatype
I am sure this must be a syntax error with the select statement
The following is the function that give the array of data
package pack
package spec
Type my_table is table of varchar2(25);
function the_members
return pack.my_table;
pakcage body
function the_members return pack.my_table
Remarks: This function returns a table containing names of the
members
is
tm pack.my_table:= pack.my_table('first member','second member','third member','fourth member');
begin
return tm;
end the_members;Check this example on Pipelinedfunction
-
Reading values from JTextField and using them?
Hello,
I am trying to make a login screen to connect to an oracle database. Im pretty new to creaing GUI. I need help with reading the values from the JTextField and to be able to use them for my connection. So do I need to apply a listener? How do I go about doing that in this project. Thanks for any code or advice.
import java.util.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.sql.*;
public class UserDialog
String databaseURL;
String driver;
String database;
String username;
String password;
String hostname;
String port;
UserDialog() {
getInfo();
static String[] ConnectOptionNames = { "Login", "Cancel" };
static String ConnectTitle = "Login screen";
public void getInfo() {
JPanel connectionPanel;
JLabel databaseURLLabel = new JLabel("Database URL: ", JLabel.LEFT);
JTextField databaseURLField = new JTextField("");
JLabel driverLabel = new JLabel("Driver: ", JLabel.LEFT);
JTextField driverField = new JTextField("");
JLabel databaseLabel = new JLabel("Database: ", JLabel.LEFT);
JTextField databaseField = new JTextField("");
JLabel usernameLabel = new JLabel("User Name: ", JLabel.LEFT);
JTextField usernameField = new JTextField("");
JLabel passwordLabel = new JLabel("Password: ", JLabel.LEFT);
JTextField passwordField = new JPasswordField("");
JLabel hostnameLabel = new JLabel("Host Name: ", JLabel.LEFT);
JTextField hostnameField = new JTextField("");
JLabel portLabel = new JLabel("Port: ", JLabel.LEFT);
JTextField portField = new JTextField("");
connectionPanel = new JPanel(false);
connectionPanel.setLayout(new BoxLayout(connectionPanel,
BoxLayout.X_AXIS));
JPanel namePanel = new JPanel(false);
namePanel.setLayout(new GridLayout(0, 1));
namePanel.add(databaseURLLabel);
namePanel.add(driverLabel);
namePanel.add(databaseLabel);
namePanel.add(usernameLabel);
namePanel.add(passwordLabel);
namePanel.add(hostnameLabel);
namePanel.add(portLabel);
JPanel fieldPanel = new JPanel(false);
fieldPanel.setLayout(new GridLayout(0, 1));
fieldPanel.add(databaseURLField);
fieldPanel.add(driverField);
fieldPanel.add(databaseField);
fieldPanel.add(usernameField);
fieldPanel.add(passwordField);
fieldPanel.add(hostnameField);
fieldPanel.add(portField);
connectionPanel.add(namePanel);
connectionPanel.add(fieldPanel);
// Connect or quit
databaseURL = databaseURLField.getText();
driver = driverField.getText();
database = databaseField.getText();
username = usernameField.getText();
password = passwordField.getText();
hostname = hostnameField.getText();
port = portField.getText();
int n = JOptionPane.showOptionDialog(null, connectionPanel,
ConnectTitle,
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.PLAIN_MESSAGE,
null, ConnectOptionNames,
ConnectOptionNames[0]);
if (n == 0) {
System.out.println("Attempting login: " + username);
String url = databaseURL+hostname+":"+port+":"+database;
// load the JDBC driver for Oracle
try{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con = DriverManager.getConnection (url, username, password);
System.out.println("Congratulations! You are connected successfully.");
con.close();
System.out.println("Connection is closed successfully.");
catch(SQLException e){
System.out.println("Error: "+e);
else if (n == 1)
System.exit(0);
public static void main (String args []) {
UserDialog ud = new UserDialog();
}thanks again,
Jamesthe reason why you can't get the text is because you are reading the value before some actually inserts anything in any fields.
Here is what you need to do:
Create a JDialog/JFrame. Create a JPanel and set that panel as contentPane (dialog.setContentPane(panel)). Insert all the components, ie JLabels and JTextFields. Add two buttons, Login and Cancel to the panel as well. Now get the username and password field values using getText() inside the ActionListener of the Login.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class LoginDialog extends JDialog
String username, password;
public LoginDialog( ){
setTitle( "Login" );
JPanel content = new JPanel(new GridLayout(0, 2) ); // as many rows, but only 2 columns.
content.add( new JLabel( "User Name" ) );
final JTextField nameField = new JTextField( "" );
content.add( nameField );
content.add( new JLabel( "Password" ) );
final JTextField passField = new JTextField( "" );
content.add( passField );
JButton login = new JButton( "Login" );
login.addActionListener( new ActionListener(){
public void actionPerformed( ActionEvent ae ){
username = nameField.getText();
password = passField.getText();
// call a method or write the code to verify the username and login here...
content.add( login );
JButton cancel = new JButton( "Cancel" );
cancel.addActionListener( new ActionListener( ){
public void actionPerformed( ActionEvent ae ){
dispose(); // close the window or write any code that you want here.
content.add( cancel );
pack( ); // pack everything in the dialog for display.
show(); // show the dialog. -
How to calculate the value from prompt and use the value as filter
Hi everyone,
I am designing a OBI query. I want to write a query and one of it filters comes from the dashboard prompt. Say I want to make a query to pull out the record for 3 consective years and user wants to enter the last year # and omit entering the first 2-year code#.Thanks!Hi,
if i understand your question
you have a prompt for year.. and it's assigned with presentation variable, say: var_year
And you are just entering value for only one year, say 2000.
Then, the request (which is using that prompt value as filter) should display year values 2000, 2000-1 (i.e. 1999), 2000-2 (i.e. 1998).
Is this your requirement?
If then,
Hope you are using edit box as control for year prompt and assign a presentation variable for that prompt.
Now, in report go to filter of year prompt, click on advance > Convert this filter to SQL.
write here... *Times.Year between @{var_year} and @{var_year}-2*
And make sure that your var_year is integer, if not cast it to integer -
How to Take source value remove zero and use it In receiver Determination
Hi
I am working On IDOc to Soap channel.
In idoc Fields ,I am using EMPST field from IDOC and accordingly I am putting Condition in Receiver Determination.
IF EMPST 111 Then Revceive1
IF EMPST 222 Then Revceive2
IF EMPST 333 Then Revceive3
But sometimes values also Come as 000111 or 00111 or 0111 same for Others.
I have used follwong condition in Receiver Determination.
IDOC/E1EDK01/EMPST u2248 *111
But it working fime for leading zero.
But if values come as 8111 or 78111 it is also routing message to Revceive1.
same for others.
Can you plz suggest solution?you can use enhanced receiver determination ,, where you can specify your logic in the mapping
http://wiki.sdn.sap.com/wiki/display/XI/EnhancedReceiverDeterminationinSAP+XI
http://wiki.sdn.sap.com/wiki/display/SI/StepbyStepguidetoExplainEnhancedReceiver+Determination
in the UDF you can write the logic to remove leading zeros if required:
Re: removing leading zeros
Maybe you are looking for
-
Calendar additions made on phone do not correctly display in Outlook
Before I upgraded my iPhone to iOS4, I could add a calendar item, tag the time as "Free" and it would show up correctly on my work Outlook Calendar. Now, it shows up as "Busy". Also, I wish they would provide the capability to mark an item as "Privat
-
Safari Problem with All Numbers Look Strange
All of the numbers accept for the Apple website look odd. I have taken a screenshot of the issue, but I'm not sure how to post it. The numbers are in individual boxes separated by dashes. Similar to old clocks with the flipping numbers. Software upda
-
Regarding the email function in Iphoto
When I email ordinary through mail, I add a attachment in the email, then it is shown inline and as a attachment. But when I use the email function in iphoto it only inlines the picture, it doesnt add the file as regular attachment, is there anyway I
-
I have tried to reninstall lion but to no avail and it wont let me reboot from a previous time whats happened to it and can i repair it please help
-
Why do my photos zoom in when I add them to a video?
I am not experienced at all with premiere pro at all. i have to just splice videos and photos together. My videos come out fine but when I try to add photos to this video it like zooms in or takes only a portion of the picture and adds it. Its very s