Data communication b/w different panels!!!
I have two different panels CFtree and CMyTab and I am trying to call a function of CFtree from CMyTab
//+++++++++++++++++++++++++++++
//CFtree code...
// Generating only one object of this class like
public class CFTree extends JTree implements ActionListener {
private static CFTree objFeatureTree = null;
public static CFTree createObject() {
if (objFeatureTree == null) {
objFeatureTree = new CFTree();
return objFeatureTree;
return objFeatureTree;
* Get object of CFTree
* @return CFTree
public static CFTree getObject() {
return objFeatureTree;
public void dummy(){
System.out.println("Feature tree function called");
// CMyTab pseudo-code..
public class CMyTab
extends JPanel {
CFTree mFtrTree = CFTree.getObject(); // calling to get current object of CFTree
// and function acess like
mFtrTree.dummy();
As soon as mFtrTree.dummy() is called, following exception is thrown:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
What can be the reason for this? How can I specify in CMyTab that it is going to call a function placed in a different panel CFTree. What are the way to tackle this problem?
Please comment!
Thanks,
rdh
In the following statement, please replace "getObject" with "createObject":
CFTree mFtrTree = CFTree.getObject(); // calling to get current object of CFTree
Similar Messages
-
Hi,
I am trying to update the value of a control on one panel when the value of another control on a different panel is changed. The two panels are saved in two different .uir files, so there are two associated .h files generated by CVI. The problem is that, inside the callback function for the control that is being modified (Ctrl_Id_A on Panel_A), when I call SetCtrlVal(Panel_B, Ctrl_Id_B, Value); 'Panel_B' and 'Ctrl_Id_B' (which have the same numeric values as Panel_A = 1 and Ctrl_Id_A = 2 in their respective .h files) are being interpreted as Panel_A and Ctrl_Id_A. I never understood how CVI makes this distinction, eg. knowing which of PANEL_A = 1 and PANEL_B = 1 is being referred to, but didn't worry about it since I never needed cross-communication between panels until now. Any help on how to implement this would be greatly appreciated. Thanks!
Solved!
Go to Solution.This is a basic issue on which you can find tons of forum posts
The online help for the function recitates:
int SetCtrlVal (int panelHandle, int controlID, ...);
Parameters
Input
Name
Type
Description
panelHandle
int
Specifier for a particular panel that is currently in memory. You obtain this
handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID
int
The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
value
New value of the control. The data type of value must match the data type of the control.
That is, you must not use the panel constant name in the first parameter of SetCtrlVal, use the panel handle instead. The system guarantees that all panel handles are unique throughout the whole application whichever is the number of panels used in every moment.
int SetCtrlVal (int panelHandle, int controlID, ...);
Purpose
Sets the value of a control to a value you specify.
When you call SetCtrlVal on a list box or a ring control, SetCtrlVal
sets the current list item to the first item that has the value you
specify. To set the current list item through a zero-based index, use SetCtrlIndex.
When you call SetCtrlVal on a text box, SetCtrlVal appends value to the contents of the text box and scrolls the text box to display value. Use ResetTextBox to replace the contents of the text box with value.
Note This function updates the displayed value immediately. Use SetCtrlAttribute with ATTR_CTRL_VAL to set the control value without immediately updating the displayed value. For this reason, SetCtrlAttribute with ATTR_CTRL_VAL is generally faster than SetCtrlVal. However, if the control in which you are setting the value is the active control in the panel, SetCtrlAttribute with ATTR_CTRL_VAL displays the value immediately.
Note This function is not valid for graph and strip chart controls.
Parameters
Input
Name
Type
Description
panelHandle
int
Specifier for a particular panel that is currently in memory. You obtain this
handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID
int
The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
value
New value of the control. The data type of value must match the data type of the control.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Best Practices for Remote Data Communication?
Hello all
I am developing a full-fledged website in Flex 3.4 and Zend Framework, PHP. I am using the Zend_AMF class in Zend framework for communicating the data to remote server.
I will be communicating to database in the following way...
get data from server
send form data to server
send requests to server to get data in response
Right now I have created just a simple login form which just sends two fields username and password in the method in service class on remote server.
Here is a little peek into how I did that...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:RemoteObject id="loginService" fault="faultHandler(event)" source="LoginService" destination="dest">
<mx:method name="doLogin" result="resultHandler(event)" />
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
private function resultHandler(event:ResultEvent):void
Alert.show("Welcome " + txtUsername.text + "!!!");
]]>
</mx:Script>
<!-- Login Panel -->
<mx:VBox>
<mx:Box>
<mx:Label text="LOGIN"/>
</mx:Box>
<mx:Form>
<mx:FormItem>
<mx:Label text="Username"/>
<mx:TextInput id="txtUsername"/>
</mx:FormItem>
<mx:FormItem>
<mx:Label text="Password"/>
<mx:TextInput id="txtPassword" displayAsPassword="true" width="100%"/>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Login" id="loginButton" click="loginService.doLogin(txtUsername.text, txtPassword.text)"/>
</mx:FormItem>
</mx:Form>
</mx:VBox>
</mx:Application>
This works fine. But if I create a complicated form which has many fields then it would be almost unbearable to sent each fields as an argument of a function.
Another method that can be used is using HttpService which supports XML like request and response.
I want to ask what are best practices in Flex when using remote data communication on a large scale? Like may be using some classes or objects which store data? Can somebody guide me on how to approach data storing?
Thanks and Regards
VikramOh yes, I have done study about Cairngorm, haven't really applied it though. I thought that it helps in separating the data models, presentation and business logic into various layers.
Although what I am looking for is something about data models may be?
Thanks and Regards
Vikram -
How to creat a Data provider based on different fields in SAP BW ?
Hi,
Experts,
There are 20 fields of Plant Maintainace like :
SWERK
BEBER
STORT
TPLNR
EQUNR
INGRP
QMDAT ---peroid
STTXT
QMDAT - Date of Notification
QMNUM
QMTXT
QMART
AUSVN
AUZTV
AUSBS
AUZTB
AUSZT
ERNAM
QMDAB
AUFNR
I want to creat a Report based upon these fields ?
For that I h'v checked the relevant Fields to the existing standard Datasource in Bw side &
Checked cubes created based upon these Datasource in Bw side !
i h'v found some fields are existing different cubes & some are missing .
How to creat a Data provider based on different fields in SAP BW ?
plz suggest !!!!!!!
Thanx,
Asit
Edited by: ASIT_SAP on Jul 15, 2011 6:25 AM
Edited by: ASIT_SAP on Jul 15, 2011 6:27 AM
Edited by: ASIT_SAP on Jul 15, 2011 12:37 PMHi Lee, Please see below..
DECLARE @Machine2 TABLE
DispatchDate DATE
INSERT INTO @Machine2 VALUES ('2014/02/01'), ('2014/02/02'), ('2014/02/03')
DECLARE @DateFrom DATE
SELECT @DateFrom = DATEADD(D,1,MAX(DispatchDate)) FROM @Machine2
SELECT @DateFrom AS DateFrom
Please mark as answer, if this has helped you solve the issue.
Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles. -
Make sure both attached files (Run LabVIEW_Cursor_TestCase.vi, SimpleVI.vi) are in the same folder. Run LabVIEW_Cursor_TestCase.vi notice that the -3 error code is returned from "Set Cursor.vi" after it has been called with 30 different panel refs. If "Set Cursor.vi" is replaced with "Set Busy.vi" the same error occurs.Is there a workaround for this problem other that setting the cursor image manually in user32.dll? I must be able to open more than 30 panels and set them all to busy. In the test case I used a single VI, simply to demonstrate the error.
Message Edited by Jerred on 05-04-2007 10:06 AM
Attachments:
LabVIEW_Cursor_TestCase.vi 68 KB
SimpleVI.vi 13 KBThis bug is fixed in LabVIEW 8.0 and later. Unfortunately, I know of no workaround in LabVIEW 7.x. When I encountered this bug in one of my UIs in LabVIEW 7.x, my "fix" was simply to ignore the error outputs from the cursor VIs, and to live with the fact that I had no custom cursors after 30 windows had been opened.
-D
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman -
HP Color LaserJet CM3530fs
The printer is printing when asked to do so by a computer but the display says:
Error
Communication lost (device <-> control panel); Turn off then on.
The orange attention light is illuminated and the display is always lit and shows the statement above.
It does not improve when switched off and on or power disconnected for long periods or pushing reset button at rear of unit.
Embedded web server works normally and thinks that all is ok.
Buttons on control panel do nothing. eg. I cannot photocopy or scan.
The printer is about 2 years old but gets very light use in a family home.
Please help
Thank you.
HaigThis seems to be a commercial product. For the best chance at finding a solution I would suggest posting in the forum for HP Business Support!
You can find the Commercial Laserjet board here:
http://h30499.www3.hp.com/t5/Printers-LaserJet/bd-p/bsc-413
Best of Luck!
You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too. -
Spry Accordion Different Panel Heights
I'm building a Spry Accordion Widget as a left nav menu with
25 different panels. Some of my panels contain 10 different links
and others contain only 1 single link. Therefore I would like to
adjust the height of each panel individually according to the
number of links they contain, so I don't end up with huge white
spaces in panels that contain fewer links. My initial idea, in
addition to the .AccordionPanelContent class was to add an "id" to
each panel and control each panels height through CSS. But for some
reason I haven't been successful that way. It looks like all panels
tend to take the height of the first panel, regardless of their
individual set heights. I wonder if I can resolve my problem
uniquely with CSS, or I do I have to go and change something in the
SpryAccordion.js file.
Thanks.Hi Donald, I inserted <script type="text/javascript">
var acc1 = new Spry.Widget.Accordion("Acc1", {
useFixedPanelHeights: false });
</script> into my code. It's almost there, but not
quite. I can see that it is trying to re-ajust the panels' height,
but for panels that have a larger content it tends to show the
whole panel's content and then hides the half of it. Also for
panels with fewer content it doesn't seem to have an effect at all.
I don't know if I have to fix something in the CSS or place the
Acc1 ID in a different location within my accordion HTML code.
Thank you.
Here's the URL I'm working on if you want to take a look.
http://64.49.218.100/product_p/00-120-0ll.htm -
Urgent!!!Want to add different panels in different rows..
i am trying to add different Panels in differnt rows of same column..
But each time i am getting the default panel which is being retuned by the MyTableCellRenderer class which i have implemented from TableCellRenderer .
Would you like reply whats wrong in my approach...Can anyone modify my code???
public class TablePanel extends JPanel
JTable alertInsertTable;
JScrollPane alertInsertPane;
String columnnames[]={"Insert Alert"};
Object[][] values={
new JPanel()
DefaultTableModel tableModel= new DefaultTableModel(values,columnnames);
TablePanel()
setLayout(new BorderLayout());
alertInsertTable= new JTable(tableModel);
alertInsertPane = new JScrollPane(alertInsertTable);
alertInsertTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
this.add(alertInsertPane,BorderLayout.CENTER);
setDataInTable();
public void setDataInTable()
int count=0;
alertInsertTable.setRowHeight(80);
MyTableCellRenderer ob=new MyTableCellRenderer();
this.alertInsertTable.getColumn("Insert Alert").setCellRenderer(ob);
JPanel panel1=new JPanel();
JPanel panel2=new JPanel();
panel1.add(new JLabel("HIiiiiiiiiiiiiiii"));
panel2.add(new JLabel("Hellooooooooooooo"));
Object[] ob1={panel1};
Object[] ob2={panel2};
model.addRow(ob1);
//its always adding to the Panel with label new JLabel("Oppsssss")
//which is the panel instance returned by MyTableCellRender
model.addRow(ob2);
// this also adding to the Panel with label new JLabel("Oppsssss")
//which is the panel instance returned by MyTableCellRender
// ? What code should i write here so that i can add panel1 and panel2
//which i have created here.
class MyTableCellRenderer extends JPanel implements TableCellRenderer
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex)
JPanel panel = new JPanel();
panel.add(new JLabel("Oppsssss"));
return panel;
}Only three exclamation marks; can't be that urgent.And only 1 cross-post...
Let's continue here:
http://forum.java.sun.com/thread.jspa?threadID=742590 -
Received 2 appointments from a customer, same date, same content, just different hours. Since then I receive message from iCal: Access to “Subject” in account “iCloud” is not permitted. The server responded "403" to CalDAVWriteEntityQueueableOperation. In my opinion this is a bug, because iCloud is not able to handle 2 appointments at the same date with same content, just at different hours. The different hours should be enough individuality for each event on calendar.
In my opinion this is a bug, because iCloud is not able to handle 2 appointments at the same date with same content, just at different hours. The different hours should be enough individuality for each event on calendar.
Here are 4 identical events (other than time) in Calendar on my mac
Here is how they appear at iCloud.com
I concluded that iCloud has no problem with identical events seperated by time, so the question becomes what is wrong with your setup as opposed to what is wrong with iCloud. -
One Components into 2 different panel problems
Hi,
I have one component, just call it A, and 2 different
panels just call it PA and PB.
I put A into PA and then I put A into PB,
and display PA & PB into screen together.
The problem is A is missing in PA but displayed
into PB. I know this is behavior of AWT/Swing,
but maybe some of you know how to solve
this problem without creating two instances of A.
Thank you in advance...You could make something like this:
public class multicomponent
Vector activecomponents=new Vector
//all methods you intend to use on this component this way
public method(somearg arg)
for //all c in vector
c.method(arg);
public void addto(Container co)
comp=new yourcomponent();
co.add(comp);
activecomponents.add(comp);
}You can enhance that by using weak references for the elements in the vector and you will have to think what to do for get methods. -
Adding different images to different panels
If I am having a class which is extending Applet not JApplet and in that I am having CardLayout with 4 different panels. If I want to add 4 different images 2 these Panels what is the solution? Can anyone please help?
sorry
myPanel p1, p2, p3, p4;
class myPanel extends Panel
Image image;
public myPanel(Image img)
image = img;
public void paint (Graphics g)
if (image == null)
return;
g.drawImage(image, 0, 0, this);
} -
Uploading data in MM01 for different material types
Hi,
I have a doubt regarding uploading the data in MM01 for different material types.
Generally in MM01, we have different views for different material types. The number of views will vary depending upon the material type that we select.
I have a scenario, where in to upload the data, I have a flat file that consists of data for different message types. So, how to upload the data in such case.
Can anyone help me on the same by providing explanation or sample code...? What would be the possible ways to upload data in such scenario.
That would be of great help.
Thanks & Regards,
Pradeep.See the below code and use FM SELECTION_VIEWS_FIND..
REPORT zjpmuim306 NO STANDARD PAGE HEADING LINE-SIZE 250 MESSAGE-ID
zjpm001.
*& I N B O U N D V I A A B A P : Batch input Session method *
*& Development ID: IM_DD_306_LJP *
*& Report : ZJPMUIM306 *
*& The Purpose of the Object is to interface Create Input Record *
*& for SAP Migration from the Material master of BPCS All the *
*& information received at BPCS is collected into a single record. *
*& By using session method upload data from file ,one item is
*& created for one record *
*& Change Log: *
*& Init Who Date Text *
*& MALIKDH1 Seshu Reddy 26-07-2003 Initial Version *
Constants *
CONSTANTS:c_vkorg(4) type c value 'JP20', " Sales Organization
c_vtweg(2) type c value 'TR' , " Distribution Channel
c_werks(4) Type c value 'JP01' , " Plant
c_viewlist(15) VALUE 'KDEALBSZXVPCFQG'," View list
c_scm_view TYPE msichtausw-dytxt VALUE 'SCM View',
c_sd_view TYPE msichtausw-dytxt VALUE 'SD View',
c_seq_code(2) VALUE 'Z1', " Sequential Code
c_keep(1) TYPE c VALUE 'X', " Keep
c_group LIKE apqi-groupid VALUE 'IM306', " Session Name
c_tcode LIKE tstc-tcode VALUE 'MM02', " Transaction Code
c_blank(1) VALUE ' ', " Blank
c_intls(1) VALUE 'N'. " Logistic Status
Variables *
DATA: g_flag1(1), " Variable to hold
g_flag(1), " Variable to hold
g_file LIKE rlgrap-filename VALUE
'C:\Documents and Settings\seshur\Desktop\HCLT123.CSV'. " File name
Internal tables/ Work area *
Internal Table for Delimter
DATA : BEGIN OF t_delim OCCURS 0,
text(1000),
END OF t_delim.
Internal table for BDC processing
DATA : t_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Internal table for holding the data which has to be uploaded.
DATA: BEGIN OF t_bpcs OCCURS 0,
matnr(15) TYPE c, " material no
dosage(40) TYPE c, " Dosage form(Local)
appearance(40) TYPE c, " Appearance
idcode(6) TYPE c, " Identification Code
prostformno(10) TYPE c, "SOP
weitab(7) TYPE c, " Weight/tablet
uom1(2) TYPE c, " UOM of Carton
uom2(2) TYPE c, " UOM of Case
carsize(14) TYPE c, " Carton size
cassize(14) TYPE c, " Case size
rupqty(11) TYPE c, " Round up
abvname(3) TYPE c, " Product short name
END OF t_bpcs.
*Internal table for t_bpcs
DATA: BEGIN OF t_mdata OCCURS 0,
matnr LIKE marc-matnr, " Material number
zzjp_dos_frm LIKE marc-zzjp_dos_frm, " Dosage form(Local)
zzjp_aprn LIKE marc-zzjp_aprn, " Appearance
zzjp_con_id LIKE marc-zzjp_con_id," Identification Code
zzjp_nyu_sop LIKE marc-zzjp_nyu_sop,"SOP
zzjp_wei_tab(10) type c , " Weight/tablet
zzjp_bio LIKE marc-zzjp_bio,"Biologics Indicator
zzjp_itf LIKE marc-zzjp_itf, " ITF code
zzjp_car(2) type c, " UOM of Carton
zzjp_cas(2) type c, " UOM of Case
zzjp_car_size(11) type c," Carton size
zzjp_cas_size(11) type c, " Case size
zzjp_rupqty(11) type c, " Round up
zzjp_init_ls LIKE marc-zzjp_init_ls, " Logistic Status
zzjp_re1 LIKE marc-zzjp_re1, "Document type(Local)
zzjp_re2 LIKE marc-zzjp_re2, "Report type
zzjp_re3 LIKE marc-zzjp_re3, "Shipping report type
zzjp_pro_id LIKE mvke-zzjp_pro_id," Product output sequence
zzjp_bu_id LIKE mvke-zzjp_bu_id, " Business unit indicator
zzjp_abv_name LIKE mvke-zzjp_abv_name," Product short name
zzjp_abv_id1 LIKE mvke-zzjp_abv_id1," Product short name output
zzjp_abv_id2 LIKE mvke-zzjp_abv_id2," Product short name internal
zzjp_spl_id LIKE mvke-zzjp_spl_id, " Sample internal order
END OF t_mdata.
Internal table for Mara Table
DATA: BEGIN OF t_mara OCCURS 0,
matnr LIKE mara-matnr, " material Number
vpsta LIKE mara-vpsta, " Maintenance status of complete material
pstat like mara-pstat, " Maintenance status
END OF t_mara.
Internal table for Material Master View Selection Screens
DATA: BEGIN OF t_bildtab OCCURS 0.
INCLUDE STRUCTURE mbildtab.
DATA: END OF t_bildtab.
internal table for T_bildtab
DATA: t_bildtab_dup LIKE t_bildtab OCCURS 0 WITH HEADER LINE.
*Work area for T_bildtab internal table(Views Selection)
DATA: BEGIN OF w_data,
flag1 type c,
anzd70 TYPE i,
field1(20) type c,
field2(20) type c,
field3(20) type c,
field4(20) type c,
count(2) TYPE c,
END OF w_data.
Main Processing *
START-OF-SELECTION.
Store data from file into internal table
PERFORM f_uplaod_data.
Transfer the uploaded data into t_mdata internal Table
PERFORM f_process_data.
Selecting The views based on Material number
PERFORM f_view_list.
Open a BDC Session
PERFORM f_bdc_open.
*Selecting the fields from mara table
SELECT matnr
vpsta
pstat
FROM mara
INTO TABLE t_mara
FOR ALL ENTRIES IN t_mdata
WHERE matnr = t_mdata-matnr.
SORT t_mara BY matnr.
SORT t_mdata BY matnr.
Transfer the uploaded data into BDCDATA structure
PERFORM f_process_bdc.
Close The BDC Session
PERFORM f_close_group.
*& Form F_VIEW_LIST *
Routine to used for Calling the function module *
Selection_views_find *
FORM f_view_list.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = c_seq_code
pflegestatus = c_viewlist
TABLES
bildtab = t_bildtab
EXCEPTIONS
call_wrong = 1
empty_selection = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_VIEW_LIST
*& Form f612_view_sort *
Routine to used for Selecting The views based on Material Number *
FORM f612_view_sort.
t_bildtab_dup[] = t_bildtab[].
Reading the Internal table t_mara
READ TABLE t_mara WITH KEY matnr = t_mdata-matnr.
TRANSLATE t_mara-pstat USING ' $'.
CLEAR: w_data-flag1, w_data-anzd70.
LOOP AT t_bildtab_dup.
IF t_bildtab_dup-pstat CA t_mara-pstat.
w_data-anzd70 = w_data-anzd70 + 1.
IF t_bildtab_dup-kzanz IS INITIAL.
t_bildtab_dup-kzanz = 'X'.
w_data-flag1 = 'X'.
MODIFY t_bildtab_dup.
ENDIF.
ELSE.
IF NOT t_bildtab_dup-kzanz IS INITIAL.
CLEAR t_bildtab_dup-kzanz.
w_data-flag1 = 'X'.
MODIFY t_bildtab_dup.
ENDIF.
ENDIF.
ENDLOOP.
TRANSLATE t_mara-pstat USING '$ '.
IF NOT w_data-flag1 IS INITIAL.
SORT t_bildtab_dup BY kzanz DESCENDING idxbd ASCENDING.
ENDIF.
*Reading The internal table for T_bildtab_dup
READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
IF t_bildtab_dup-kzanz = 'X'.
WRITE sy-tabix TO w_data-count.
w_data-count = w_data-count + 2.
IF w_data-anzd70 > 18.
w_data-count = w_data-count - 18.
ENDIF.
CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field1.
CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field2.
ENDIF.
READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
IF t_bildtab_dup-kzanz = 'X'.
WRITE sy-tabix TO w_data-count.
IF w_data-anzd70 > 18.
w_data-count = w_data-count + 2.
w_data-count = w_data-count - 18.
ENDIF.
CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field3.
CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field4.
ENDIF.
ENDFORM. " f612_view_sort
*& Form f_uplaod_data *
Routine to used for Uploading the data from file to Internal table *
FORM f_uplaod_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = g_file
filetype = 'DAT'
TABLES
data_tab = t_delim
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF t_bpcs IS INITIAL.
LOOP AT t_delim.
SPLIT t_delim-text AT ',' INTO t_bpcs-matnr
t_bpcs-dosage
t_bpcs-appearance
t_bpcs-idcode
t_bpcs-prostformno
t_bpcs-weitab
t_bpcs-uom1
t_bpcs-uom2
t_bpcs-carsize
t_bpcs-cassize
t_bpcs-rupqty
t_bpcs-abvname.
APPEND t_bpcs.
ENDLOOP.
ENDIF.
ENDFORM. " f_uplaod_data
*& Form F_BDC_OPEN
Routine to create BDC Session to be processed
FORM f_bdc_open.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = c_group
keep = c_keep
user = sy-uname
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE S000 WITH 'Batch input session is created successfully'(T02).
ENDIF.
ENDFORM. " F_BDC_OPEN
*& Form F_PROCESS_BDC
Processing of BDCDATA Structure
FORM f_process_bdc.
LOOP AT t_mdata.
PERFORM f612_view_sort.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=AUSW'.
PERFORM f_bdc_field USING 'RMMG1-MATNR'
t_mdata-matnr.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
IF w_data-anzd70 > 18.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
ENDIF.
reading the t_bildtab internal table
READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
IF t_bildtab_dup-kzanz = 'X'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
w_data-field1.
PERFORM f_bdc_field USING w_data-field2 'X'.
g_flag = 'X'.
ENDIF.
reading the t_bildtab internal table
READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
IF sy-subrc EQ 0.
g_flag = 'X'.
ENDIF.
IF t_bildtab_dup-kzanz = 'X'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
w_data-field3.
PERFORM f_bdc_field USING w_data-field4 'X'.
g_flag1 = 'X'.
ENDIF.
IF g_flag = 'X' AND g_flag1 = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RMMG1-VKORG'
c_vkorg.
PERFORM f_bdc_field USING 'RMMG1-VTWEG'
c_vtweg.
CLEAR g_flag.
CLEAR g_flag1.
ELSE.
IF g_flag = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
ELSE.
IF g_flag1 = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RMMG1-VKORG'
c_vkorg.
PERFORM f_bdc_field USING 'RMMG1-VTWEG'
c_vtweg.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDIF.
ENDIF.
*Processing of SCM View
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM f_bdc_field USING 'BDC_CURSOR' 'MARC-ZZJP_DOS_FRM'.
PERFORM f_bdc_field USING 'MARC-ZZJP_DOS_FRM'
t_mdata-zzjp_dos_frm.
PERFORM f_bdc_field USING 'MARC-ZZJP_APRN'
t_mdata-zzjp_aprn.
PERFORM f_bdc_field USING 'MARC-ZZJP_CON_ID'
t_mdata-zzjp_con_id.
PERFORM f_bdc_field USING 'MARC-ZZJP_NYU_SOP'
t_mdata-zzjp_nyu_sop.
PERFORM f_bdc_field USING 'MARC-ZZJP_WEI_TAB'
t_mdata-zzjp_wei_tab.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAR'
t_mdata-zzjp_car.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAS'
t_mdata-zzjp_cas.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAR_SIZE'
t_mdata-ZZJP_CAR_SIZE.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAS_SIZE'
t_mdata-ZZJP_CAS_SIZE.
PERFORM f_bdc_field USING 'MARC-ZZJP_RUPQTY'
t_mdata-ZZJP_RUPQTY.
PERFORM f_bdc_field USING 'MARC-ZZJP_BIO'
t_mdata-zzjp_bio.
PERFORM f_bdc_field USING 'MARC-ZZJP_ITF'
t_mdata-zzjp_itf.
PERFORM f_bdc_field USING 'MARC-ZZJP_INIT_LS'
t_mdata-zzjp_init_ls.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE1'
t_mdata-zzjp_re1.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE2'
t_mdata-zzjp_re2.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE3'
t_mdata-zzjp_re3.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'/00'.
*Processing of SD View
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM f_bdc_field USING 'BDC_CURSOR' 'MVKE-ZZJP_PRO_ID'.
PERFORM f_bdc_field USING 'MVKE-ZZJP_PRO_ID'
t_mdata-zzjp_pro_id.
PERFORM f_bdc_field USING 'MVKE-ZZJP_BU_ID'
t_mdata-zzjp_bu_id.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_NAME'
t_mdata-zzjp_abv_name.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_ID1'
t_mdata-zzjp_abv_id1.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_ID2'
t_mdata-zzjp_abv_id2.
PERFORM f_bdc_field USING 'MVKE-ZZJP_SPL_ID'
t_mdata-zzjp_spl_id.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM f_bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=YES'.
perform f_bdc_insert.
REFRESH T_BDCDATA.
ENDLOOP.
ENDFORM. " F_PROCESS_BDC
*& Form f_bdc_dynpro
p_prog is the program name to which data is passed *
p_dyno is the screen number to which the data is passed
Routine for populating the BDCDATA structure with the
Screen related information
FORM f_bdc_dynpro USING p_prog
p_dyno.
t_bdcdata-program = p_prog.
t_bdcdata-dynpro = p_dyno.
t_bdcdata-dynbegin = 'X'.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " F_bdc_dynpro
*& Form F_BDC_FIELD
p_fnam is the field name to which value is passed
p_fval is the field value which is passed
p_fnam is the field name to which value is passed
p_fval is the field value which is passed
FORM f_bdc_field USING p_fnam
p_fval.
t_bdcdata-fnam = p_fnam.
t_bdcdata-fval = p_fval.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " F_bdc_field
*& Form F_PROCESS_DATA *
Routine to used for moving data from T_bpcs internal table to *
t_mdata Internal Table *
FORM f_process_data.
LOOP AT t_bpcs.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_bpcs-matnr
IMPORTING
output = t_mdata-matnr.
MOVE t_bpcs-dosage TO t_mdata-zzjp_dos_frm.
MOVE t_bpcs-appearance TO t_mdata-zzjp_aprn.
MOVE t_bpcs-idcode TO t_mdata-zzjp_con_id.
MOVE t_bpcs-prostformno TO t_mdata-zzjp_nyu_sop.
MOVE t_bpcs-weitab TO t_mdata-zzjp_wei_tab.
MOVE c_blank TO t_mdata-zzjp_bio.
MOVE c_blank TO t_mdata-zzjp_itf.
MOVE t_bpcs-uom1 TO t_mdata-zzjp_car.
MOVE t_bpcs-uom2 TO t_mdata-zzjp_cas.
MOVE t_bpcs-carsize TO t_mdata-zzjp_car_size.
MOVE t_bpcs-cassize TO t_mdata-zzjp_cas_size.
MOVE t_bpcs-rupqty TO t_mdata-zzjp_rupqty.
MOVE c_intls TO t_mdata-zzjp_init_ls.
MOVE c_blank TO t_mdata-zzjp_re1.
MOVE c_blank TO t_mdata-zzjp_re2.
MOVE c_blank TO t_mdata-zzjp_re3.
MOVE c_blank TO t_mdata-zzjp_pro_id.
MOVE c_blank TO t_mdata-zzjp_bu_id.
MOVE t_bpcs-abvname TO t_mdata-zzjp_abv_name.
MOVE c_blank TO t_mdata-zzjp_abv_id1.
MOVE c_blank TO t_mdata-zzjp_abv_id2.
MOVE c_blank TO t_mdata-zzjp_spl_id.
APPEND t_mdata.
ENDLOOP.
ENDFORM. " F_PROCESS_DATA
*& Form f_bdc_close
Routine to close the BDC Session
FORM f_close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_close_group
*& Form f_bdc_insert
routine to input batch data into the Transaction MM02 from the
session created
FORM f_bdc_insert.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = c_tcode
TABLES
dynprotab = t_bdcdata
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_bdc_insert
Reward Points if it is useful
Thanks
Seshu -
I just updated my MAC operating system and when I went to open a recent document in numbers, the document that opened had none of my data and was formatted differently. Can I get my document with all my information back?
I suggest the easy stuff first:
1) quite Numbers and restart Numbers
2) reboot the computer
After that try opening the same document in another user space -
How do i decide which method to use when uploading data from legacy system to sap?
In session method
suppose they are 10 records to upload ,if an error occurs at 6th record when uploading data through session ,will the 7,8,9,10 records be processed ,what willhappen?
what is direct input methodHi Aravind,
Data Transfer
BDC
Batch Data Communication
It is used to transfer data from Sap to Sap or from Non Sap to sap system. It uses the normal transaction codes to transfer the data.
Data Transfer Methods
You can use the following methods to transfer data:
CALL TRANSACTION: Data consistency check with the help of screen logic.
Batch input with batch input sessions: Data consistency check with the help of screen logic
Difference between Batch Input and CALL TRANSACTION
If the direct input cannot be used for your task, this makes creating a data transfer program easier since the underlying transactions ensure that the data consistency checks are executed.
In the case of an error during the data transfer (if data records are inconsistent, for example), you can restart the transfer at the point in the program where the error occurred.
Data Transfer Overview
Batch input methods
With the batch input method, an ABAP program reads the external data that is to be entered in the SAP system and stores the data in a batch input session. The session records the actions that are required to transfer data into the system using normal SAP transactions.
When the program has generated the session, you can run the session to execute the SAP transactions in it. You can explicitly start and monitor a session with the batch input management function (by choosing System  Services  Batch input), or have the session run in the background processing system.
CALL TRANSACTION methods
In the second method, your program uses the ABAP statement CALL TRANSACTION USING to run an SAP transaction. External data does not have to be deposited in a session for later processing. Instead, the entire batch input process takes place inline in your program.
Choosing Data Transfer Methods
Selecting a Data Transfer Method
When you transfer data in ABAP, you have three options to submit the data for the data transfer. Only the first two methods can be recommended without reservation. The third method, by way of CALL DIALOG, is outmoded. CALL DIALOG is less comfortable than the other methods. You should use it only if you must.
Use the CALL TRANSACTION USING statement
Summary: With CALL TRANSACTION USING, the system processes the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
The most important features of CALL TRANSACTION USING are:
o Synchronous processing
o Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
o You can update the database both synchronously and asynchronously
The program specifies the update type
o Separate LUW (logical units of work) for the transaction
The system executes a database commit immediately before and after the CALL TRANSACTION USING statement
o No batch input processing log
Create a session on the batch input queue.
Summary: Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.
Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP program.
The most important aspects of the session interface are:
o Asynchronous processing
o Transfers data for multiple transactions
o Synchronous database update
During processing, no transaction is started until the previous transaction has been written to the database.
o A batch input processing log is generated for each session
o Sessions cannot be generated in parallel
The batch input program must not open a session until it has closed the preceding session.
Executing Data Transfer Programs
Procedure
If you are using an SAP data transfer program, follow the procedure specified in the program documentation.
If you are using a generated data transfer program, proceed as follows:
1. Start the data transfer program.
2. Decide which batch input method you want to use for the data transfer.
a) CALL TRANSACTION USING:
You must specify the:
Processing mode: You use this parameter to specify whether processing should take place in the background or in dialog mode.
Possible values are:
A Display all
E Display only errors
N No display
Update mode: This parameter determines how the data is to be updated:
Possible values are:
S Synchronous
A Asynchronous
L Local update
Error session: Here you have the option to specify a session name for a batch input session in which data is to be written in the case of an error. You can use this to identify incorrect data records after the batch input program has run and to import the records into the R/3 System once you have corrected them.
If you are creating an error session, you must also specify:
User: Specify the user with whose authorizations the sessions are processed.
Keep session: This specifies whether or not the session should be deleted once it has been processed.
Lock date: Specify the processing date for the error session.
b) Generate session:
Session name: Specify a name for the batch input session to be generated.
User: Specify the user with whose authorizations the sessions are processed.
Keep session: This specifies whether or not the session should be deleted once it has been processed.
Lock date: Specify the processing date for the error session.
3. Specify a character that is to be used as the NODATA character.
4. Specify the path of the data file from which the data is to be imported into the R/3 System.
5. Execute the program.
6. If you have generated a session, or if errors occurred in CALL TRANSACTION USING mode, you must now edit the generated sessions. You can find information on this in BC - System services in batch input sessions.
Creating a Session with BDC_OPEN_GROUP
Use the BDC_OPEN_GROUP function module to create a new session. Once you have created a session, then you can insert batch input data into it with BDC_INSERT.
You cannot re-open a session that already exists and has been closed. If you call BDC_OPEN_GROUP with the name of an existing session, then an additional session with the same name is created.
A batch input program may have only one session open at a time. Before opening a session, make sure that any sessions that the program closes any sessions that it previously had opened.
BDC_OPEN_GROUP takes the following EXPORTING parameters:
CLIENT
Client in which the session is to be processed.
Default: If you don't provide a value for this parameter, the default is the client under which the batch input program runs when the session is created.
GROUP
Name of the session that is to be created. May be up to 12 characters long.
Default: None. You must specify a session name.
HOLDDATE
Lock date. The session is locked and may not be processed until after the date that you specify. Only a system administrator with the LOCK authorization for the authorization object Batch Input Authorizations can unlock and run a session before this date.
Format: YYYYMMDD (8 digits).
Default: No lock date, session can be processed immediately. A lock date is optional.
KEEP
Retain session after successful processing. Set this option to the value X to have a session kept after it has been successfully processed. A session that is kept remains in the input/output queue until an administrator deletes it.
Sessions that contain errors in transactions are kept even if KEEP is not set.
Default: If not set, then sessions that are successfully processed are deleted. Only the batch input log is kept.
USER
Authorizations user for background processing. This is the user name that is used for checking authorizations if a session is started in background processing. The user must be authorized for all of the transactions and functions that are to be executed in a session. Otherwise, transactions will be terminated with no authorization errors.
The user can be of type dialog or background. Dialog users are normal interactive users in the SAP system. Background users are user master records that are specially defined for providing authorizations for background processing jobs.
Advantages:
Types of BDC :
CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
<b>Regards,
Azhar</b> -
CS6 Illustrator panel auto-collapses when expanding a different panel
Hi,
Can anyone explain how to stop a panel from auto-collapsing when expanding other group panels?
For example: if I have 'layers' panel expanded and I click the 'color' panel, the 'layers' panel collapses to icon. (I have disabled 'Auto-Collapse Iconic Panels' but it still doesn't allow me to have 2 different panels expanded at the same time)
ThanksDouble click on the green square and the dialoge box will come up. If you double click on the red square it will just make the name of the layer editable in the pallette. I hope this helps.
Maybe you are looking for
-
We haven't got this program to work yet on a failry new Mac. Tried the delete preference route as listed in other areas, still crashes within the first 2 mins. Very frustrating and cannot use it even though we really need it ASAP. Please help! Crash
-
Workflow for purchase requisition?
Dear all; I would like to know if there is any standar workflow for MM that can map this requeriment: user A creates a purchase requsition, the WF sends a mail to the user B to release it, user B releases it and then the WF sends a mail to user A to
-
EFT payments config - ACH ID?
Hi Guys, I would like to know what ACH ID means in EFT payments? is it the bank key ? we have sent the ACH/Wires test files to bank and they came back saying "An incorrect ACH ID was included in the ACH test file" Thanks in advance, God bless
-
Get server health via SNMP get
Hello, is it possible to get the health of a server (or deployment) in weblogic using snmpget? All documentation and examples I found so far assume that a use traps. I tried to walk over the bea tree once when a specific server is stopped and once wh
-
Material For Oracle Applications
Hai Friend(s)... I want to learn Oracle Applications 1) Financial and 2) Technical material . Can u give some good sites to learn. my mail id : [email protected] adv thanks Madhava