How to use the first row function value for the rest of records
Hi all,
I am having a select statement like this. We are calling function enabled for each row. So it is taking
time. As per our bussiness logic, we can use what the function 'enabled' will give for the first row to
other rows also. so that we can avoid calling the function 'enabled' next row onwars.
Before
SELECT
decode(enabled(col1, col2, col3),'TRUE','xxx', col4),
decode(enabled(col1, col2, col3),'TRUE','xxx', col5),
decode(enabled(col1, col2, col3),'TRUE','xxx', col6),
decode(enabled(col1, col2, col3),'TRUE','xxx', col7),
decode(enabled(col1, col2, col3),'TRUE','xxx', col8),
from
table1 t1, table2 t2 where t1.col1 = t2.col1
After
SELECT
decode(enabled(col1, col2, col3),'TRUE','xxx', col4),
decode('true/false','TRUE','xxx', col5), --Here 'true/false' is the first row value after calling the function 'enabled'
decode('true/false','TRUE','xxx', col6),
decode('true/false','TRUE','xxx', col7),
decode('true/false','TRUE','xxx', col8),
from
table1 t1, table2 t2 where t1.col1 = t2.col1
Any thoughts on this, how to implement this logic
Thanks,
Pal
It's not clear where col1, col2, col3... etc. come from, so I've assumed they're in table1.
with table1_X as (select enabled(col1, col2, col3) as enbl
,col1, col2, col3, col4, col5, col6, col7, col8
from table1)
SELECT decode(t1.enbl,'TRUE','xxx', col4)
,decode(t1.enbl,'TRUE','xxx', col5)
,decode(t1.enbl,'TRUE','xxx', col6),
,decode(t1.enbl,'TRUE','xxx', col7),
,decode(t1.enbl,'TRUE','xxx', col8),
from table1_x t1 join table2 t2 on (t1.col1 = t2.col1)p.s. you'd be better leaving out the enabled function altogether and incorporating the logic of the function directly in the SQL, and then you would be avoiding any context switching which will clearly impact performance on any large amount of data.
Edited by: BluShadow on 14-May-2013 08:26
Similar Messages
-
How to use color picker or RGB values in the hue-saturation colorize adjustment
I have a monochromatic adornment that I want to match to the color of a logo. I am attempting to use the colorize option of a hue saturation adjustment layer to match color. But I cannot quite get the colors to match. I know the RGB values of the color, but how do these translate into the Hue/Sat/Lightness numbers of the adjustment dialog? I tried using the correlating H/S/B values fro9m the color picker but that did not work.
Any suggestions?Thanks Zeno. Creating a layer with the color and using the blend mode worked fine. But as I stated in the original post, using the H/S/B (there is no HSL) values from the color picker does not work when you place them into the H/S/L values in the hue-adjustment layer with (or without) the colorize box checked. But your first suggestion worked like a charm. Thank you.
-
How to use interactive layout in Photoshop CC for the photomerge function?
I find it really hard to combine the images together because the end result from photomerge does not have the snap in function like the interactive layout. Does anyone know how can I bring back the interactive layout in Photoshop CC? I downloaded the PhotomergeUI plugin but error came up saying 'Could not complete your request because it is not the right kind of doument'. Any help will be greatly appreciated.
I was able to get PhotomergeUI to work in CS6 (both x64 and x86) by the following method:
If you download Photoshop CS5 Optional Plugins and (for 64-bit versions of Adobe Photoshop on Windows) extract "\\CS5OptionalPlugins_Win_en_US.zip\PSCS5OptionalPlugins_Win_en_US\Optional Plug-Ins\Win64\PhotomergeUI.8BF" to "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Plug-ins\Automate" and "C:\Program Files\Common Files\Adobe\Plug-Ins\CS6\Automate" then the Photomerge UI becomes available in Photoshop CS6.
If the "Automate" directories are not available (existent), then you may first create them in their respective directories. This is not necessary, however, as the plugins may be dropped anywhere in the 'plugins' folder.
However, this method doesn't seem to work with Adobe Photoshop CC. I will continue to investigate how to implement this plug-in in Adobe Photoshop CC.. -
In portlets, how to use a html form passing values to the another page?
it is well known that in web developing , we have two methods to pass values to another page.<!--
1. passing values
2.<form action="nextPage" method ="post"></form>-->
but how to use two methods in oracle portal portlets?
I have got a simple example which submit two values to the page for itself, means a page has a form with submit botton, user input the form with values and then submit them by submit botton, then the page recevice those values and show it .
this example is powered by oracle ,
please have a look at these code:
<br><br>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="java.util.*, oracle.portal.provider.v2.*" %>
<%@page import="oracle.portal.provider.v2.http.HttpCommonConstants" %>
<%@page import="oracle.portal.provider.v2.render.PortletRendererUtil" %>
<%@page import="oracle.portal.provider.v2.render.PortletRenderRequest" %>
<%@page import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil" %>
<%@page import="oracle.portal.provider.v2.url.UrlUtils" %>
<%
// The form submit URL refers to the current Portal page. All portlets
// on this page share this URL. This means that the per portlet parameters
// are in the same request. Portlets must ensure that its paramerters don't
// collide either with other portlets or other instances of itself. This
// is generally accomplished by using "fully-qualified" parameter names. A
// fully-qualified parameter name prepends the (unique) portlet reference to
// the parameter. The JPDK provides a utility to accomplish this.
String portletParamName = "mName";
String portletParamAge = "mAge";
String portletParamSubmit = "mSubmit";
String fName = HttpPortletRendererUtil.portletParameter(request, portletParamName);
String fAge = HttpPortletRendererUtil.portletParameter(request, portletParamAge);
String fSubmit = HttpPortletRendererUtil.portletParameter(request, portletParamSubmit);
// These are the session attribute names used to store the current values.
// Because all instances of this portlet share the same user session we must
// also fully-qualify these names to avoid collisions.
String sName = HttpPortletRendererUtil.portletParameter(request, "sName");
String sAge = HttpPortletRendererUtil.portletParameter(request, "sAge");
PortletRenderRequest pRequest = (PortletRenderRequest)
request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
String formName = UrlUtils.htmlFormName(pRequest,null);
ProviderUser user = pRequest.getUser();
ProviderSession providerSession = user.getSession();
if (providerSession == null)
%>
Your provider session has been terminated or has timed out
and you need to logout and then login to re-establish the session.
<%
else
// Record, in session storage, the last values submitted.
if (pRequest.getQualifiedParameter(portletParamSubmit) != null)
providerSession.setAttribute(sName, pRequest.getQualifiedParameter(portletParamName));
providerSession.setAttribute(sAge, pRequest.getQualifiedParameter(portletParamAge));
%>
<!-- Output the HTML content -->
<center>
<table width="70%">
<tr>
<td>
<b>This portlet shows how to post and process information from HTML forms.</b>
</td>
</tr>
</table>
<form name="<%= formName %>" method="POST"
action="<%= UrlUtils.htmlFormActionLink(pRequest,UrlUtils.PAGE_LINK) %>">
<%= UrlUtils.htmlFormHiddenFields(pRequest,UrlUtils.PAGE_LINK, formName) %>
<table>
<tr>
<td>
<b>Name :</b>
</td>
<td>
<input type="text" size="20" name="<%= fName %>" value="">
</td>
</tr>
<tr>
<td>
<b>Age : </b>
</td>
<td>
<input type="text" size="3" name="<%= fAge %>" value="">
</td>
</tr>
</table>
<br>
<INPUT TYPE=submit name="<%= fSubmit %>" Value="Submit">
</form>
<%
if ((providerSession.getAttribute(sName) == null)&& (providerSession.getAttribute(sAge) == null)) {
%>
<b>No values have been submitted yet.</b>
<%
} else {
%>
<b> Last submitted values:</b><br>
<table>
<tr>
<td>
<b>Name: </b>
</td>
<td>
<b><%= providerSession.getAttribute(sName) %></b>
</td>
</tr>
<tr>
<td>
<b>Age: </b>
</td>
<td>
<b><%= providerSession.getAttribute(sAge) %></b>
</td>
</tr>
</table>
<%
%>
</center>
<%
%>
<br><br>
<br><br>
<br><br>
but I want to write the form in a page , and then show it on another page , how to write it ?
I have read the pdk:
oracle.portal.provider.v2.url Classes
UrlUtils
then I use these method , as this :
//frist page:
<br><br><br><br>
<%@page contentType="text/html; charset=Big5"
import="oracle.portal.provider.v2.render.PortletRenderRequest"
import="oracle.portal.provider.v2.http.HttpCommonConstants"
%>
<%@ page import="oracle.portal.provider.v2.*"%>
<%@ page import="oracle.portal.provider.v2.render.PortletRendererUtil"%>
<%@ page import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"%>
<%@ page import="oracle.portal.provider.v2.url.UrlUtils"%>
<%
PortletRenderRequest pReq = (PortletRenderRequest)
request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
%>
<P>Hello <%= pReq.getUser().getName() %>.</P>
<P>This is the <b><i>Show</i></b> render mode!</P>
this is a program to test the passing value
<%
String portletParamName = "mName";
String portletParamAge = "mAge";
String portletParamSubmit = "mSubmit";
String fName = HttpPortletRendererUtil.portletParameter(request, portletParamName);
String fAge = HttpPortletRendererUtil.portletParameter(request, portletParamAge);
String fSubmit = HttpPortletRendererUtil.portletParameter(request, portletParamSubmit);
PortletRenderRequest pr=(PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
String formName=UrlUtils.htmlFormName(pr, null);
%>
<form name="<%=formName%>" method="post" action="<%=UrlUtils.htmlFormActionLink("/htdocs/passingvalues4/getValues.jsp")%>">
<%= UrlUtils.htmlFormHiddenFields("/htdocs/passingvalues4/getValues.jsp") %>
name:<input type="text" size="20" name="<%= fName %>" value="">
p w :<input type="text" size="3" name="<%= fAge %>" value="">
<INPUT TYPE=submit name="<%= fSubmit %>" Value="Submit">
</form>
//getValues.jsp<br><br>
<br><br>
<%@page contentType="text/html; charset=Big5"
import="oracle.portal.provider.v2.render.PortletRenderRequest"
import="oracle.portal.provider.v2.http.HttpCommonConstants"
%>
<%@ page import="oracle.portal.provider.v2.*"%>
<%@ page import="oracle.portal.provider.v2.render.PortletRendererUtil"%>
<%@ page import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"%>
<%@ page import="oracle.portal.provider.v2.url.UrlUtils"%>
<% String portletParamName = "mName";
String portletParamAge = "mAge";
String portletParamSubmit = "mSubmit";
String fName = HttpPortletRendererUtil.portletParameter(request, portletParamName);
String fAge = HttpPortletRendererUtil.portletParameter(request, portletParamAge);
String fSubmit = HttpPortletRendererUtil.portletParameter(request, portletParamSubmit);%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Big5">
<title>untitled</title>
</head>
<body>
Name:<%=fName%>
Age :<%=fAge%>
</body>
</html>
<br>then I deployed them on the portal , run it , the result is :after I submit it , the browser give me : http 404 page not found!
[b]here is the provider.xml<br>[b[i]]<?xml version = '1.0' encoding = 'UTF-8'?>
<?providerDefinition version="3.1"?>
<provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
<session>true</session>
<passAllUrlParams>true</passAllUrlParams>
<portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
<id>1</id>
<name>PassingValues4</name>
<title>PassingValues4</title>
<description>PassingValues4</description>
<timeout>60</timeout>
<showEditToPublic>false</showEditToPublic>
<hasAbout>false</hasAbout>
<showEdit>false</showEdit>
<hasHelp>false</hasHelp>
<showEditDefault>false</showEditDefault>
<showDetails>false</showDetails>
<renderer class="oracle.portal.provider.v2.render.RenderManager">
<renderContainer>true</renderContainer>
<renderCustomize>true</renderCustomize>
<autoRedirect>true</autoRedirect>
<contentType>text/html</contentType>
<showPage>/htdocs/passingvalues4/PassingValues4InputPage.jsp</showPage>
<showPage>/htdocs/passingvalues4/getValues.jsp</showPage>
</renderer>
</portlet>
</provider>
<br><br><br>
<br><br>
would you kind enough to help me ? thanks!!!
Message was edited by:
moonsoftHi Moonsoft,
I have already answered this query in the other post at Re: how to link more than one links in portlet?(jsp develop)
<form name = "showPageForm" method = "POST" action = "<%= UrlUtils.htmlFormActionLink(pReq,UrlUtils.PAGE_LINK) %>">
<%= UrlUtils.htmlFormHiddenFields(pReq,UrlUtils.PAGE_LINK, "showPageForm") %>
<input type="text" name="param1">
<input type="text" name="param2">
<input type="hidden" name="myPPN" value="/htdocs/page2.jsp">
</form>then in your jsp code on page2.jsp, you will extract the parameters by specifying
<%
String p1 = request.getParameter("param1");
String p2 = request.getParameter("param2");
%>
>>this is easy common jsp or asp development, but in oracle is too diffcult!!!!
:-) .. there is a difference between web-applications and portlets, you just need to get used to it once. I hope this does clarify your doubts.
thanks,
Harsha -
How to use JavaScript to supply a value for a MessageTextInput field
With the text attribute you can supply a deafult value for text field. Is it possible to supply this field with a default value determined by javascript ?
<messageTextInput name="startDate" text="..." ...Marcel,
If you want to dynamically set a value for a text field, there are two approaches you can use:
1. use javascript (the browser language) and then for your <body> element's onload handler, invoke a javascript method that sets your form value.
2. use java (the compiled language) and databind the "text" attribute of messageTextInput to a dataobject that gives the current date. If all you're looking to do is bind to the current date, I'd recommend this approach.
Hope this helps,
Ryan -
Here's how to use your own custom Webclip icons for the sites you visit.
This method is pretty much 95% taken from this URL: http://allinthehead.com/retro/319/how-to-set-an-apple-touch-icon-for-any-site , so credit where credit is due. The instructions are a bit hard to understand though, so I'll try to make it easier for everyone.
Fortunately, this works for both Macs and PCs.
INSTRUCTIONS:
Requirements:
- iPhone on 1.1.3 and any version of iTunes that can sync to iPhone
- Adobe Photoshop or any other image editing program that can crop, alter image size, and save .png image files. (Recommended 24-bit .pngs as they are higher quality)
- Apple Safari ( http://www.apple.com/safari/, and yes, you need it.)
- A website or ftp where you can upload images and directly link to them, like Google Pages.
Warning:
- This requires you to sync your Safari bookmarks to your iPhone. You will probably lose all of your iPhone's bookmarks if you don't already sync your Safari bookmarks with your iPhone. Only proceed if you do not mind losing your iPhone's current bookmarks and do not mind re-entering them after the bookmark sync. NOTE: The bookmark sync DOES NOT get rid of your current Webclips though, so don't worry about those.
Easy Steps:
1) First, make sure that you are following these instructions in the Apple Safari web browser.
2) Find an image you wish to make into a Webclip icon. (ex: I prefer to use movies.yahoo.com to look at movie showtimes, so I found an image of a movie reel from Google Image Search and decided to use that.)
3) Open the image with your preferred image editor and crop your desired image into a perfect square. Resize that picture down to 57x57 pixels. Save as a 24-bit .png file. Upload the icon to your webpage or ftp. (ex: I ended up with this icon of a movie reel: http://ctolpin.googlepages.com/appleicon01.png )
4) Select and copy the javascript code in this .txt file: http://ctolpin.googlepages.com/webclipcode.txt
5) Go to Bookmarks and select "Add Bookmark..."
6) Type in "Webclip Icon URL"
7) Go to Bookmarks again and select "Show all Bookmarks."
8) Right-click your new "Webclip Icon URL" bookmark and select "Edit Address"
9) Paste your clipboard's contents into the field.
10) Plug your iPhone into the computer if it's not connected already.
11) In iTunes, select your iPhone from the right column. Select the Info tab. Scroll down to "Web Browser" and check "Sync bookmarks with: Safari" (obviously, make sure Safari is selected from the dropdown menu).
12) Once your iPhone is synced, use your iPhone to navigate to your intended website target to make into a Webclip. Remember that Webclips save where you zoom in as well! (ex: For me, it was movies.yahoo.com and then entering in my zip code.)
13) Once you've loaded your target website, open up the bookmarks in iPhone's Safari, select Bookmarks Bar, then select Webclip Icon URL.
14) Type in the address of your uploaded icon. (ex: In my case, it is http://ctolpin.googlepages.com/appleicon01.png)
15) iPhone's Safari will seem like it didn't do anything. However, add that webpage now to your home screen as a Webclip. Magic.
Additional note:
It is easiest to make a bunch of icons at first and to upload them. However, once that "Webclip Icon URL" bookmark is in your iPhone, there is no need to go back and do any of the computer Safari steps again
My front page icons in order (Sorry Stocks, it's the second page for you!):
Google, Wikipedia, Definr, Showtimes
http://ctolpin.googlepages.com/iphonecampics007.jpg
Message was edited by: LumpOfCole3 Go to the port forwarding section and copy down the Applied Rules.
Example:
Network Computer/Device: 192.168.1.100:63145
Application & Ports Forward: Application UDP Any -> 6347
Note: There may be up to three entries for each one of your Set Top Boxes.G
Your display obviously is not like mine as mine does not dosplay the port associated with the ip address
whatever, the STB's start at 192.168.1.100 and icement by 1 for each
the port addr's will be 63145 alo incrementing by 1
there is 1 entry for each in my pf list
however each ip addr also has a port entry starting at 35000 also incrementing by 1 for each ip addr
For some unknow reason these are duplicated e.g I appear to have 11 entries exaactly the same for each stb and as the fios services rules have no action switc there is nowhere to delete the extraneous garbage.
Why do you clone the mac addr?? -
How to set the first row as selected in single selection of table
when the page renders how do we make the first row as selected for single selection in a table.
Thansk a lot for your helpset the selection Attribute's value to 'Y' for the first row. Thats enough.
eg;
Row row=vo.first();
row.setAttribute("SelectionAttribute", "Y");
--Prasanna -
I am trying to change the following code so then the fixed rows will stay on top(but below the headers!), but when I change getContentPane().add(fixedScroll, BorderLayout.SOUTH); to getContentPane().add(fixedScroll, BorderLayout.NORTH); it stays above the headers. How can I put the first rows on top, but below the headers ? Thanks.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
* @version 1.0 03/05/99
public class FixedRowExample extends JFrame {
Object[][] data;
Object[] column;
JTable fixedTable,table;
private int FIXED_NUM = 2;
public FixedRowExample() {
super( "Fixed Row Example" );
data = new Object[][]{
{ "a","","","","",""},
{ "","b","","","",""},
{ "","","c","","",""},
{ "","","","d","",""},
{ "","","","","e",""},
{ "","","","","","f"},
{"fixed1","","","","","","",""},
{"fixed2","","","","","","",""}};
column = new Object[]{"A","B","C","D","E","F"};
AbstractTableModel model = new AbstractTableModel() {
public int getColumnCount() { return column.length; }
public int getRowCount() { return data.length - FIXED_NUM; }
public String getColumnName(int col) {
return (String)column[col];
public Object getValueAt(int row, int col) {
return data[row][col];
public void setValueAt(Object obj, int row, int col) {
data[row][col] = obj;
public boolean CellEditable(int row, int col) {
return true;
AbstractTableModel fixedModel = new AbstractTableModel() {
public int getColumnCount() { return column.length; }
public int getRowCount() { return FIXED_NUM; }
public Object getValueAt(int row, int col) {
return data[row + (data.length - FIXED_NUM)][col];
table = new JTable( model );
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setAutoCreateRowSorter(true);
fixedTable = new JTable( fixedModel );
fixedTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
fixedTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroll = new JScrollPane( table );
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
JScrollPane fixedScroll = new JScrollPane( fixedTable ) {
public void setColumnHeaderView(Component view) {} // work around
// fixedScroll.setColumnHeader(null);
fixedScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
JScrollBar bar = fixedScroll.getVerticalScrollBar();
JScrollBar dummyBar = new JScrollBar() {
public void paint(Graphics g) {}
dummyBar.setPreferredSize(bar.getPreferredSize());
fixedScroll.setVerticalScrollBar(dummyBar);
final JScrollBar bar1 = scroll.getHorizontalScrollBar();
JScrollBar bar2 = fixedScroll.getHorizontalScrollBar();
bar2.addAdjustmentListener(new AdjustmentListener() {
public void adjustmentValueChanged(AdjustmentEvent e) {
bar1.setValue(e.getValue());
scroll.setPreferredSize(new Dimension(400, 100));
fixedScroll.setPreferredSize(new Dimension(400, 52)); // Hmm...
getContentPane().add( scroll, BorderLayout.CENTER);
getContentPane().add(fixedScroll, BorderLayout.SOUTH);
public static void main(String[] args) {
FixedRowExample frame = new FixedRowExample();
frame.addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent e ) {
System.exit(0);
frame.pack();
frame.setVisible(true);Sorry, this code missed a very important line:
table.setAutoCreateRowSorter(true);
So you meant:
Object[][] header;//class atribute
header=new Object[][]{//in the constructor
{ "h","i","j","k","l","m"},
{ "h","i","j","k","l","m"}
public Object getValueAt(int row, int col) {//in the TableModel
if (row==0){
return header[row][col];
else {
return data[row][col];
I tried, but when I sort, the first row get sorted with the rest. -
Infopath submit button only works for the first row in a repeating table
Hi, I have a InfoPath Email submit button issue I could not figure out. I have a master/detail repeating table in my form, and one of fields is "EmailAddress" which shows customer's email address. I created a submit button and put the "EmailAddress"
field to "TO" object. When I tested it, the submit button only would return the first row of emailaddress from the repeating table, but not the rest of it..
What I want is when I highlighted a customer, and click the submit button, the current customer's email address would show up in "TO" list. I did some research and saw some suggestions about using current() function. So I put current() in the front,
like this:
current()/dfs:dataFields/d:vw_HZLeadLists/@EmailAddress
Still not working..Just return the first record of emailaddress from master repeating table... Does anyone know what's going on here? Thanks a lot!Hello,
Use double eval to get all rows values. See my reply for more information in below thread:
eval(eval(EmailAddress, 'concat(ToField, ";")'), "..")
http://social.technet.microsoft.com/Forums/sharepoint/en-US/cc22aeb7-351f-45a7-8a4c-94132c3e0db2/eval-semicolon-function-issue?forum=sharepointcustomizationprevious
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to use FTP_COMMAND to put a file in the target system
Hi All,
I have the requirement to put an excel file from apllication server to another remote system for this i am using the function modules
1) FTP_CONNECT to connect to the sourece as well as the destination systems --- Here i am able to hit the both systems.
2) for sending the data to the target system i am using FTP_COMMAND by passing the 'put' statement along with the soruce and destinations for the command parameter.
See the bellow code
CONCATENATE 'put' v_fname '
' 'wbrs1\' folder
into cmd separated by space.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = dhdl
command = cmd
COMPRESS = 'N'
VERIFY =
RFC_DESTINATION =
IMPORTING
FILESIZE =
FILEDATE =
FILETIME =
tables
data = result
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4
Here v_name is the file path and name in the application server suppose say :
/usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS
and wbrs1 is the target system and 'Waynesboro DFS' is the folder name i ma passing to the command .
Also I tried with the following statement
CONCATENATE 'put' v_fname '
' dhost folder
into cmd separated by space.
Here v_name is the file path and name in the application server suppose say :
/usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS,
Dhost is wbrs1.wb.na.webdti.com
And Waynesboro DFS is the folder .
Here i am getting the error as invalid argument.
See the bellow messages from result internal table.
put /usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS
wbrs1\ Waynesboro DFS
open /usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS errno 22: Invalid argument
Please let me know how i can resolve this problem and how can I put this file in the destination system.
Thanks in advance.
Regards,
Venkatcheck this code....here data is transferred from SAP to Informatica box..
REPORT zfo_phoenix_acc_reconciliation NO STANDARD PAGE HEADING
MESSAGE-ID zz
LINE-SIZE 255
LINE-COUNT 65.
PROGRAM DECLARATION
PROGRAM ID : ZFO_PHOENIX_ACC_RECONCILIATION
DESCRIPTION : Phoneix Account Reconcilation Program-Feed
Balance sheet account balances from GL
3 files needed to be enhanced. The files are " Master
Attribute File" & "Transaction File(GL Balance)". For
Master Attribute File, data needs to be retrieved from
T001, ZDATSRC_T, SKA1, T003, T856. The corresponding
data from all the tables is downloaded into file
according to the condition specified. For Transaction
File, data needs to be retrieved from ZGEIST based on
Ledger(GG), Record Type(0), Fiscal Year, Period(016).
Then the current period is used to determine which TSLxx
& KSLxx needs to be used. Also, the conditions are
specified in specs which have been used accordingly.
The final data fetched will need to processed as files
which neednot be downloaded to Presentation/Application
server. Instead the files are been FTPed to the
Informatica Server using FTP. The location where the
files need to be located is ERC\GLOBALSAP.
TABLES
TABLES : ADR6.
TYPES
Output File - Master COA(Chart of Account)
TYPES : BEGIN OF ty_coacode ,
coa_code(20), "COA Code
coa_description(50), "COA Description
field11 TYPE x, "Line Feed
END OF ty_coacode.
Output File - Master Account
TYPES : BEGIN OF ty_acctcode ,
act_code(20), "GL Account Number
act_desc(60), "GL Account Description
act_act_flag(1), "Account marked for deletion indicator
glact_type(1), "GL Account type
fi_line(20), "Corporate Financial Statement Line
coa_code(20), "COA Code
act_defcode(3), "Account Defination Code
field11 TYPE x, "Line Feed
END OF ty_acctcode.
Output File - Master Entity
TYPES : BEGIN OF ty_entitycode,
entity_code(12), "Entity Code
com_desc(40), "Company Name
coa_code(20), "COA Code
field11 TYPE x, "Line Feed
END OF ty_entitycode.
Output File - Master Attribute
TYPES : BEGIN OF ty_attribcode,
attrib_code(5), "Attribute Code
attrib_value(20), "Attribute Value
attrib_desc(60), "Attribute Description
field11 TYPE x, "Line Feed
END OF ty_attribcode.
Output File - Transaction GL Balance
TYPES : BEGIN OF ty_glbal,
gl_reccode(2), "GL Reconciliation Code
gl_entity(12), "GL Entity - Company Code
gl_accnum(20), "Gl Group Account Number
site(4), "Site
currency_type(6), "Transaction Currency Code
year(4) TYPE n, "Year
month(2) TYPE n, "Month
as_of_date(8), "Date Account Balance
tran_cur_amt(21), "Transaction Currency Amount
usd_amount(21), "USD Amount
racct(20), "GL Account Number
zzbewar(20), "Consolidation Transaction Type
zzdatsrc(20), "Data Source
zzblart(20), "Document Type
rassc(20), "Trading Partner
field1(20), "Attribute field1
field2(20), "Attribute field2
field3(20), "Attribute field3
field4(20), "Attribute field4
field5(20), "Attribute field5
field11 TYPE x, "Line Feed
END OF ty_glbal.
Output File - Control
TYPES :BEGIN OF ty_globalsap,
clnt_name(6), "Client Name
source_name(12), "Source Name
as_of_date(8), "AS of Date
time_stamp(6), "Time Stamp
time_zone(8), "Time Zone
num_of_files(3), "Number of Files
num_of_records(9), "Number of Records
user_ids(60), "User ID(s)
field11 TYPE x, "Line Feed
END OF ty_globalsap.
Int'table to hold ZGEIST Data
TYPES : BEGIN OF ty_zgeist_data,
rldnr TYPE rldnr, "Ledger
rrcty TYPE rrcty, "Record Type
rvers TYPE rvers, "Version
ryear TYPE gjahr, "Fiscal Year
rbukrs TYPE bukrs, "Company Code
racct TYPE racct, "Account Number
robjnr TYPE gobjnr_r, "Object Number for objects
cobjnr TYPE gobjnr_c, "Object Number for transaction
sobjnr TYPE gobjnr_s, "Object Number for partner
rtcur TYPE rtcur, "Currency Key
runit TYPE meins, "Base Unit of Measure
drcrk TYPE shkzg, "Debit/Credit Indicator
rpmax TYPE rpmax, "Period
rzzstagr TYPE stagr, "Statistical key figure
zzaltkt TYPE altkt, "Account Number in Group
zzdatsrc TYPE zdatsrc, "Data Source code
zzbewar TYPE rmvct, "Transaction Type
zzblart TYPE blart, "Document Type
rassc TYPE rassc, "Trading Partner
zzvbund TYPE rassc, "Trading Partner
tslvt TYPE tslvt9, "Transactional Currency
kslvt TYPE kslvt9, "Group Currency
END OF ty_zgeist_data.
Int'table to hold ZGEIST Error Data based on conditions
TYPES : BEGIN OF ty_zgeist_error_data,
rldnr TYPE rldnr, "Ledger
rrcty TYPE rrcty, "Record Type
rvers TYPE rvers, "Version
ryear TYPE gjahr, "Fiscal Year
rbukrs TYPE bukrs, "Company Code
robjnr TYPE gobjnr_r, "Object Number for objects
cobjnr TYPE gobjnr_c, "Object Number for transaction
sobjnr TYPE gobjnr_s, "Object Number for partner
rtcur TYPE rtcur, "Currency Key
runit TYPE meins, "Base Unit of Measure
drcrk TYPE shkzg, "Debit/Credit indicator
rpmax TYPE rpmax, "Period
END OF ty_zgeist_error_data.
FIELD SYMBOLS
FIELD-SYMBOLS : <fs> TYPE ANY.
CONSTANTS
DATA : c_selected TYPE c VALUE 'X', "Field for constant value 'X'
c_y TYPE c VALUE 'Y', "For Acc marked for deletion
c_n TYPE c VALUE 'N', "For Acc not marked for deletion
c_a TYPE c VALUE 'A', "For GL Account type Asset
c_l TYPE c VALUE 'L', "For GL Account type Liability
c_q TYPE c VALUE 'Q', "For GL Account type Equity
c_r TYPE c VALUE 'R', "For GL Account type Revenue
c_e TYPE c VALUE 'E', "For GL Account type Expense
c_t TYPE c VALUE 'T', "For GL Account type
c_userid(60) TYPE c ,
c_curtp TYPE curtp VALUE '10', "Currency type
c_curtp1 TYPE curtp VALUE '30', "Currency type
c_rassc(5) TYPE c VALUE 'RASSC', "Trading Partner
c_dtsrce(6) TYPE c VALUE 'DTSRC', "Data Source
c_sacct(5) TYPE c VALUE 'SACCT', "GL Account
c_docty(5) TYPE c VALUE 'DOCTY', "Document Type
c_trxtp(5) TYPE c VALUE 'TRXTP', "Transaction Type
c_tradptn(15) TYPE c VALUE 'Trading Partner', "Trading Partner
c_datsrc(11) TYPE c VALUE 'Data Source', "Data Source
c_glacc(10) TYPE c VALUE 'GL Account', "GL Account
c_doctyp(13) TYPE c VALUE 'Document Type', "Document Type
c_trantyp(16) TYPE c VALUE 'Transaction Type'. "Transaction Type
DATA (Simple Fields)
DATA: w_cnt1 TYPE i, "No Of records in output file COA Code
w_cnt2 TYPE i, "No Of records in output file Account
w_cnt3 TYPE i, "No Of records in output file Entity
w_cnt4 TYPE i, "No Of records in output file attribute
w_cnt5 TYPE i, "No Of records in output file GL Balance
w_tot_recs TYPE i, "TOtal number of records downloaded
w_date LIKE sy-datum, "System date
w_timediff LIKE sy-uzeit, "Time Difference to GMT
w_timezone(10) TYPE c, "Time Difference to GMT
w_file_count(3) TYPE n, "File Count
w_period TYPE poper, "To hold Period Value
w_year LIKE t009b-bdatj, "To hold Fiscal Year Value
w_outfile TYPE char64, "FTPed file path
w_hdl TYPE i. "Handle for FTP
INTERNAL TABLES
Intenal table for GL Account details
DATA: BEGIN OF it_gl_detail OCCURS 0,
saknr TYPE saknr,
txt50_skat TYPE txt50_skat,
xloev TYPE xloev,
END OF it_gl_detail.
DATA: it_company_list LIKE bapi0014_1 OCCURS 0 WITH HEADER LINE,
it_coacode TYPE STANDARD TABLE OF ty_coacode WITH HEADER LINE,
it_acctcode TYPE STANDARD TABLE OF ty_acctcode WITH HEADER LINE,
it_entitycode TYPE STANDARD TABLE OF ty_entitycode
WITH HEADER LINE,
it_attribcode TYPE STANDARD TABLE OF ty_attribcode
WITH HEADER LINE,
it_glbal TYPE STANDARD TABLE OF ty_glbal WITH HEADER LINE,
it_globalsap TYPE STANDARD TABLE OF ty_globalsap WITH HEADER LINE,
it_t001 TYPE STANDARD TABLE OF t001 WITH HEADER LINE,
it_zdatsrc TYPE STANDARD TABLE OF zdatsrc_t WITH HEADER LINE,
it_ska1 TYPE STANDARD TABLE OF ska1 WITH HEADER LINE,
it_t003 TYPE STANDARD TABLE OF t003 WITH HEADER LINE,
it_t856 TYPE STANDARD TABLE OF t856 WITH HEADER LINE,
it_zgeist_data TYPE STANDARD TABLE OF ty_zgeist_data
WITH HEADER LINE,
it_zgeist_data1 TYPE STANDARD TABLE OF ty_zgeist_data
WITH HEADER LINE,
it_zgeist_data_all TYPE STANDARD TABLE OF zgeist,
wa_it_zgeist_data1 TYPE ty_zgeist_data,
wa_it_zgeist_data TYPE zgeist,
it_zgeist_error_data TYPE STANDARD TABLE OF ty_zgeist_error_data,
wa_it_zgeist_error_data TYPE ty_zgeist_error_data.
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-009.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-006,
POSITION POS_LOW.
PARAMETERS : P_USER(30) TYPE C LOWER CASE OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-007,
POSITION POS_LOW.
PARAMETERS : P_PWD(30) TYPE C LOWER CASE OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-008,
POSITION POS_LOW.
PARAMETERS : P_HOST(64) TYPE C LOWER CASE OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-010,
POSITION POS_LOW.
SELECT-OPTIONS : S_EMAIL FOR ADR6-SMTP_ADDR NO INTERVALS.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
-- Password not visible--
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_PWD'.
screen-invisible = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
I N I T I A L I Z A T I O N *
INITIALIZATION.
w_date0(2) = sy-datum4(2).
w_date2(2) = sy-datum6(2).
w_date4(4) = sy-datum0(4).
S_EMAIL-SIGN = 'I'.
S_EMAIL-OPTION = 'EQ'.
S_EMAIL-LOW = '[email protected]'.
APPEND S_EMAIL.
S_EMAIL-SIGN = 'I'.
S_EMAIL-OPTION = 'EQ'.
S_EMAIL-LOW = '[email protected]'.
APPEND S_EMAIL.
START - OF - SELECTION
START-OF-SELECTION.
Geting Company Details
PERFORM get_company_list.
Geting GL Account Details
PERFORM get_gl_acc_detail.
Geting GL Balance Details
PERFORM get_zgeist_data.
END - OF - SELECTION
PERFORM process_coacode.
PERFORM process_acctcode.
PERFORM process_entitycode.
PERFORM process_attribcode.
PERFORM process_glbal.
PERFORM process_ftp_file.
IF NOT it_zgeist_error_data[] IS INITIAL.
PERFORM write_error_report.
ENDIF.
*& Form GET_COMPANY_LIST
Form to get Company List *
FORM get_company_list.
CALL FUNCTION 'BAPI_COMPANY_GETLIST'
TABLES
company_list = it_company_list.
ENDFORM. "GET_COMPANY_LIST
*& Form GET_GL_ACC_DETAIL
Form to get the GL Account details *
FORM get_gl_acc_detail.
DATA : l_txt50 LIKE skat-txt50,
l_tabix LIKE sy-tabix.
SELECT saknr xloev
INTO TABLE it_gl_detail
FROM ska1
WHERE ktopl = 'G001'
AND ( saknr GE '1000000000' AND saknr LE '4500000000' ).
LOOP AT it_gl_detail.
l_tabix = sy-tabix.
SELECT SINGLE txt50
INTO l_txt50
FROM skat
WHERE spras = 'EN'
AND ktopl = 'G001'
AND saknr = it_gl_detail-saknr.
it_gl_detail-txt50_skat = l_txt50.
MODIFY it_gl_detail INDEX l_tabix.
CLEAR l_txt50.
ENDLOOP.
ENDFORM. "GET_GL_ACC_DETAIL
*& Form PROCESS_COACODE
Form to Populate COA data to Output internal table IT_COACODE *
FORM process_coacode.
it_coacode-coa_code = text-023. "GLOBAL.
it_coacode-coa_description = text-022. "Global SAP for ERC
it_coacode-field11 = '11'.
APPEND it_coacode.
CLEAR it_coacode.
ENDFORM. "PROCESS_COACODE
*& Form PROCESS_ACCTCODE
Form to Populate Account data to Output Internal table IT_ACCTCODE *
FORM process_acctcode.
DATA:l_saknr(10).
DATA : it_gl_detail2 LIKE it_gl_detail OCCURS 0 WITH HEADER LINE.
IF NOT it_gl_detail[] IS INITIAL.
it_gl_detail2[] = it_gl_detail[].
SORT it_gl_detail2 BY saknr.
DELETE ADJACENT DUPLICATES FROM it_gl_detail2 COMPARING saknr.
ENDIF.
IF NOT it_gl_detail2[] IS INITIAL.
LOOP AT it_gl_detail2.
MOVE it_gl_detail2-saknr TO it_acctcode-act_code.
MOVE it_gl_detail2-txt50_skat TO it_acctcode-act_desc.
Check GL Account is marked for deletion or not
IF it_gl_detail2-xloev = c_selected.
it_acctcode-act_act_flag = c_n.
ELSE.
it_acctcode-act_act_flag = c_y.
ENDIF.
Determine GL Account type based on GL account number
l_saknr = it_gl_detail2-saknr.
SHIFT l_saknr LEFT DELETING LEADING '0'.
IF l_saknr CP '1*'.
it_acctcode-glact_type = c_a.
ELSEIF l_saknr CP '2*'.
it_acctcode-glact_type = c_l.
ELSEIF l_saknr CP '3*'.
it_acctcode-glact_type = c_q.
Start of Addition by C.Ramesh Babu on 11/04/2005 "DR1K907900
ELSEIF l_saknr CP '4*'.
it_acctcode-glact_type = c_l.
End of Addition by C.Ramesh Babu on 11/04/2005 "DR1K907900
ELSEIF l_saknr CP '5*'.
it_acctcode-glact_type = c_r.
ELSEIF l_saknr CP '6*'.
it_acctcode-glact_type = c_e.
ELSEIF l_saknr CP '7*'.
it_acctcode-glact_type = c_t.
ENDIF.
it_acctcode-fi_line = 'CDR'.
it_acctcode-coa_code = 'GLOBAL'.
it_acctcode-act_defcode = '001'.
it_acctcode-field11 = '11'.
APPEND :it_acctcode.
CLEAR :it_acctcode,it_gl_detail2.
ENDLOOP.
ENDIF.
ENDFORM. "PROCESS_ACCTCODE
*& Form PROCESS_ENTITYCODE
Form to Populate Entiti data to Output file internal table *
FORM process_entitycode.
IF NOT it_company_list[] IS INITIAL.
LOOP AT it_company_list.
SHIFT it_company_list-company LEFT DELETING LEADING '0'.
MOVE it_company_list-company TO it_entitycode-entity_code.
MOVE it_company_list-name1 TO it_entitycode-com_desc.
it_entitycode-coa_code = 'GLOBAL'.
it_entitycode-field11 = '11'.
APPEND it_entitycode.
CLEAR : it_company_list,it_entitycode.
ENDLOOP.
ENDIF.
ENDFORM. "PROCESS_ENTITYCODE
*& Form PROCESS_ATTRIBCODE
Form to Populate Attribute data to output file internal table *
FORM process_attribcode.
Getting data from T001.
SELECT * FROM t001 INTO TABLE it_t001.
LOOP AT it_t001.
MOVE c_rassc TO it_attribcode-attrib_code.
MOVE it_t001-bukrs TO it_attribcode-attrib_value.
MOVE c_tradptn TO it_attribcode-attrib_desc.
it_attribcode-field11 = '11'.
APPEND it_attribcode.
CLEAR it_attribcode.
ENDLOOP.
Getting data from table ZDATSRC_T.
SELECT * FROM zdatsrc_t INTO TABLE it_zdatsrc.
LOOP AT it_zdatsrc.
MOVE c_dtsrce TO it_attribcode-attrib_code.
MOVE it_zdatsrc-zdatsrc TO it_attribcode-attrib_value.
MOVE c_datsrc TO it_attribcode-attrib_desc.
it_attribcode-field11 = '11'.
APPEND it_attribcode.
CLEAR it_attribcode.
ENDLOOP.
Getting data from table SKA1.
SELECT * FROM ska1 INTO TABLE it_ska1.
LOOP AT it_ska1.
MOVE c_sacct TO it_attribcode-attrib_code.
MOVE it_ska1-saknr TO it_attribcode-attrib_value.
MOVE c_glacc TO it_attribcode-attrib_desc.
it_attribcode-field11 = '11'.
APPEND it_attribcode.
CLEAR it_attribcode.
ENDLOOP.
Getting data from table T003.
SELECT * FROM t003 INTO TABLE it_t003.
LOOP AT it_t003.
MOVE c_docty TO it_attribcode-attrib_code.
MOVE it_t003-blart TO it_attribcode-attrib_value.
MOVE c_doctyp TO it_attribcode-attrib_desc.
it_attribcode-field11 = '11'.
APPEND it_attribcode.
CLEAR it_attribcode.
ENDLOOP.
Getting data from table T856.
SELECT * FROM t856 INTO TABLE it_t856.
LOOP AT it_t856.
MOVE c_trxtp TO it_attribcode-attrib_code.
MOVE it_t856-trtyp TO it_attribcode-attrib_value.
MOVE c_trantyp TO it_attribcode-attrib_desc.
it_attribcode-field11 = '11'.
APPEND it_attribcode.
CLEAR it_attribcode.
ENDLOOP.
ENDFORM. "PROCESS_ATTRIBCODE
*& Form PROCESS_GLBAL
Form to Populate GL Balance data to Output file internal table *
FORM process_glbal.
DATA : l_ctran_amt(21),
l_cusd_amt(21).
LOOP AT it_zgeist_data INTO wa_it_zgeist_data1.
*Start of change by 501030559 on 11/04/2005
it_glbal-gl_reccode = '04'.
it_glbal-gl_reccode = '05'.
*End of change by 501030559 on11/04/2005
it_glbal-gl_entity = wa_it_zgeist_data1-rbukrs.
it_glbal-gl_accnum = wa_it_zgeist_data1-zzaltkt.
it_glbal-site = 'ERC'.
it_glbal-currency_type = wa_it_zgeist_data1-rtcur.
it_glbal-year = w_year.
it_glbal-month = w_period.
it_glbal-as_of_date = w_date.
l_ctran_amt = wa_it_zgeist_data1-tslvt.
Put sign to left side of the value
IF l_ctran_amt LT 0.
TRANSLATE l_ctran_amt USING ' 0'.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = l_ctran_amt.
ELSE.
Trailing Zero's to the value
SHIFT l_ctran_amt RIGHT DELETING TRAILING space.
TRANSLATE l_ctran_amt USING ' 0'.
REPLACE '0' WITH '' INTO l_ctran_amt.
ENDIF.
it_glbal-tran_cur_amt = l_ctran_amt.
l_cusd_amt = wa_it_zgeist_data1-kslvt.
Put Sign to leftside of the value
IF l_cusd_amt LT 0.
TRANSLATE l_cusd_amt USING ' 0'.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = l_cusd_amt.
ELSE.
Trailing Zero's to the value
SHIFT l_cusd_amt RIGHT DELETING TRAILING space.
TRANSLATE l_cusd_amt USING ' 0'.
REPLACE '0' WITH '' INTO l_cusd_amt.
ENDIF.
it_glbal-usd_amount = l_cusd_amt.
it_glbal-racct = wa_it_zgeist_data1-racct.
it_glbal-zzbewar = wa_it_zgeist_data1-zzbewar.
it_glbal-zzdatsrc = wa_it_zgeist_data1-zzdatsrc.
it_glbal-zzblart = wa_it_zgeist_data1-zzblart.
it_glbal-rassc = wa_it_zgeist_data1-rassc.
it_glbal-field11 = '11'.
APPEND it_glbal.
CLEAR : wa_it_zgeist_data1, it_glbal.
ENDLOOP.
ENDFORM. "PROCESS_GLBAL
*& Form PROCESS_GLOBALSAP
Form to Populate COntrol data to Output file internal table *
FORM process_globalsap.
DATA :l_total(9),
l_len(3) type c.
Logic to get Time Zone
w_timediff = sy-tzone.
IF sy-tzone LT '0'.
w_timediff = sy-tzone * -1.
CONCATENATE 'GMT-' w_timediff(4) INTO w_timezone.
ELSE.
w_timediff = sy-tzone.
CONCATENATE 'GMT+' w_timediff(4) INTO w_timezone.
ENDIF.
LOOP AT S_EMAIL.
CONCATENATE C_USERID S_EMAIL-LOW ',' INTO C_USERID.
ENDLOOP.
l_len = strlen( c_userid ).
l_len = l_len - 1.
c_userid = c_userid+0(l_len).
it_globalsap-clnt_name = 'ERC'.
it_globalsap-source_name = 'GLOBALSAP'.
it_globalsap-as_of_date = w_date.
it_globalsap-time_stamp = sy-uzeit.
it_globalsap-time_zone = w_timezone.
it_globalsap-num_of_files = w_file_count.
MOVE w_tot_recs TO l_total.
SHIFT l_total RIGHT DELETING TRAILING space.
TRANSLATE l_total USING ' 0'.
it_globalsap-num_of_records = l_total.
it_globalsap-user_ids = c_userid.
it_globalsap-field11 = '11'.
APPEND it_globalsap.
CLEAR it_globalsap.
ENDFORM. "PROCESS_GLOBALSAP
*& Form COUNT_RECORDS
Form to count total number of records Downlaoded *
FORM count_records.
DESCRIBE TABLE it_coacode LINES w_cnt1.
DESCRIBE TABLE it_acctcode LINES w_cnt2.
DESCRIBE TABLE it_entitycode LINES w_cnt3.
DESCRIBE TABLE it_attribcode LINES w_cnt4.
DESCRIBE TABLE it_glbal LINES w_cnt5.
w_tot_recs = w_cnt1 + w_cnt2 + w_cnt3 + w_cnt4 + w_cnt5.
ENDFORM. "COUNT_RECORDS
*& Form get_zgeist_data
Form used to fetch data from ZGEIST table for the GL BAL file
FORM get_zgeist_data .
PERFORM get_period_year.
SELECT * INTO TABLE it_zgeist_data_all
FROM zgeist
WHERE rldnr EQ 'GG'
AND ryear EQ w_year
AND rrcty EQ 0
AND rpmax EQ '016'
AND ( zzaltkt GE '1000000000' AND zzaltkt LE '4500000000' )
AND rzzstagr = space.
sort it_zgeist_data_all by rbukrs rldnr zzaltkt racct
zzdatsrc zzbewar zzblart rtcur rassc.
LOOP AT it_zgeist_data_all INTO wa_it_zgeist_data.
IF wa_it_zgeist_data-zzaltkt EQ space.
wa_it_zgeist_error_data-rldnr = wa_it_zgeist_data-rldnr.
wa_it_zgeist_error_data-rrcty = wa_it_zgeist_data-rrcty.
wa_it_zgeist_error_data-rvers = wa_it_zgeist_data-rvers.
wa_it_zgeist_error_data-ryear = wa_it_zgeist_data-ryear.
wa_it_zgeist_error_data-rbukrs = wa_it_zgeist_data-rbukrs.
wa_it_zgeist_error_data-robjnr = wa_it_zgeist_data-robjnr.
wa_it_zgeist_error_data-cobjnr = wa_it_zgeist_data-cobjnr.
wa_it_zgeist_error_data-sobjnr = wa_it_zgeist_data-sobjnr.
wa_it_zgeist_error_data-rtcur = wa_it_zgeist_data-rtcur.
wa_it_zgeist_error_data-runit = wa_it_zgeist_data-runit.
wa_it_zgeist_error_data-drcrk = wa_it_zgeist_data-drcrk.
wa_it_zgeist_error_data-rpmax = wa_it_zgeist_data-rpmax.
APPEND wa_it_zgeist_error_data TO it_zgeist_error_data.
ELSE.
it_zgeist_data1-rbukrs = wa_it_zgeist_data-rbukrs.
it_zgeist_data1-rldnr = wa_it_zgeist_data-rldnr.
it_zgeist_data1-zzaltkt = wa_it_zgeist_data-zzaltkt.
it_zgeist_data1-racct = wa_it_zgeist_data-racct.
it_zgeist_data1-zzdatsrc = wa_it_zgeist_data-zzdatsrc.
it_zgeist_data1-zzbewar = wa_it_zgeist_data-zzbewar.
it_zgeist_data1-zzblart = wa_it_zgeist_data-zzblart.
it_zgeist_data1-rassc = wa_it_zgeist_data-rassc.
it_zgeist_data1-rtcur = wa_it_zgeist_data-rtcur.
PERFORM get_tslvt_kslvt_values USING w_period.
COLLECT it_zgeist_data1.
ENDIF.
CLEAR : wa_it_zgeist_data, wa_it_zgeist_error_data,
it_zgeist_data1.
ENDLOOP.
it_zgeist_data[] = it_zgeist_data1[].
ENDFORM. " get_zgeist_data
*& Form write_error_report
Form used to display error data for the GL BAL fetched data
FORM write_error_report .
DATA : l_text(80) TYPE c.
CASE w_period.
WHEN '001' OR '01'.
l_text = text-e01.
WHEN '002' OR '02'.
l_text = text-e02.
WHEN '003' OR '03'.
l_text = text-e03.
WHEN '004' OR '04'.
l_text = text-e04.
WHEN '005' OR '05'.
l_text = text-e05.
WHEN '006' OR '06'.
l_text = text-e06.
WHEN '007' OR '07'.
l_text = text-e07.
WHEN '008' OR '08'.
l_text = text-e08.
WHEN '009' OR '09'.
l_text = text-e09.
WHEN '010' OR '10'.
l_text = text-e10.
WHEN '011' OR '11'.
l_text = text-e11.
WHEN '012' OR '12'.
l_text = text-e12.
WHEN '013' OR '13'.
l_text = text-e13.
WHEN '014' OR '14'.
l_text = text-e14.
WHEN '015' OR '15'.
l_text = text-e15.
WHEN '016' OR '16'.
l_text = text-e16.
ENDCASE.
SKIP 2.
WRITE:/45 text-h01 COLOR COL_HEADING.
SKIP 2.
FORMAT COLOR 4.
WRITE:/(234) sy-uline.
WRITE:/1 sy-vline,
2 text-h02,
9 sy-vline,
10 text-h03,
19 sy-vline,
20 text-h04,
28 sy-vline,
29 text-h05,
41 sy-vline,
42 text-h06,
49 sy-vline,
50 text-h07,
69 sy-vline,
70 text-h08,
89 sy-vline,
90 text-h09,
109 sy-vline,
110 text-h10,
119 sy-vline,
120 text-h11,
130 sy-vline,
131 text-h12,
144 sy-vline,
145 text-h13,
152 sy-vline,
153 text-h14,
234 sy-vline.
WRITE:/(234) sy-uline.
FORMAT COLOR OFF.
LOOP AT it_zgeist_error_data INTO wa_it_zgeist_error_data.
FORMAT COLOR 2.
WRITE:/1 sy-vline,
4 wa_it_zgeist_error_data-rldnr,
9 sy-vline,
13 wa_it_zgeist_error_data-rrcty,
19 sy-vline,
22 wa_it_zgeist_error_data-rvers,
28 sy-vline,
32 wa_it_zgeist_error_data-ryear,
41 sy-vline,
42 wa_it_zgeist_error_data-rbukrs,
49 sy-vline,
50 wa_it_zgeist_error_data-robjnr,
69 sy-vline,
70 wa_it_zgeist_error_data-cobjnr,
89 sy-vline,
90 wa_it_zgeist_error_data-sobjnr,
109 sy-vline,
112 wa_it_zgeist_error_data-rtcur,
119 sy-vline,
123 wa_it_zgeist_error_data-runit,
130 sy-vline,
135 wa_it_zgeist_error_data-drcrk,
144 sy-vline,
147 wa_it_zgeist_error_data-rpmax,
152 sy-vline,
153 l_text,
234 sy-vline.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/(234) sy-uline.
ENDFORM. " write_error_report
*& Form get_tslvt_kslvt_values
Form used to get TSLxx & KSLxx values for the period fetched
FORM get_tslvt_kslvt_values USING period.
FIELD-SYMBOLS : <f1> TYPE ANY,
<f2> TYPE ANY.
DATA : l_tslvt_val(25) VALUE 'wa_it_zgeist_data-tsl',
l_kslvt_val(25) VALUE 'wa_it_zgeist_data-ksl',
l_tslvt TYPE tslvt9,
l_kslvt TYPE kslvt9,
l_period TYPE poper.
clear l_period.
l_period = period.
DO l_period TIMES.
CONCATENATE l_tslvt_val l_period+1(2) INTO l_tslvt_val.
CONCATENATE l_kslvt_val l_period+1(2) INTO l_kslvt_val.
ASSIGN (l_tslvt_val) TO <f1>.
l_tslvt = <f1>.
it_zgeist_data1-tslvt = it_zgeist_data1-tslvt + l_tslvt.
ASSIGN (l_kslvt_val) TO <f2>.
l_kslvt = <f2>.
it_zgeist_data1-kslvt = it_zgeist_data1-kslvt + l_kslvt.
l_period = l_period - 1.
clear : l_tslvt, l_kslvt, l_tslvt_val, l_kslvt_val.
l_tslvt_val = 'wa_it_zgeist_data-tsl'.
l_kslvt_val = 'wa_it_zgeist_data-ksl'.
if l_period = 0.
exit.
endif.
ENDDO.
ENDFORM. "get_tslvt_kslvt_values
*& Form process_ftp_file
Form used to connect & disconnect to Informatica Server using FTP
Also, used to transfer files to the Informatica location
--> p1 text
<-- p2 text
FORM process_ftp_file .
DATA: l_slen TYPE i,
l_error,
l_pwd(30) TYPE c.
CONSTANTS: c_dest TYPE rfcdes-rfcdest VALUE 'SAPFTP',
c_key TYPE i VALUE 26101957.
l_error = 0.
connect to ftp server
l_pwd = p_pwd.
l_slen = STRLEN( l_pwd ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = l_pwd
sourcelen = l_slen
key = c_key
IMPORTING
destination = l_pwd.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = 'Connect to FTP Server'.
To Connect to the Server using FTP
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = p_user
password = l_pwd
host = p_host
rfc_destination = c_dest
IMPORTING
handle = w_hdl
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR : w_outfile, w_file_count.
MOVE 'ERC/GLOBALSAP/M_ERC_GLOBALSAP_COACODE' TO w_outfile.
PERFORM download_to_ftp TABLES it_coacode USING w_outfile.
w_file_count = w_file_count + 1.
CLEAR : w_outfile.
MOVE 'ERC/GLOBALSAP/M_ERC_GLOBALSAP_ACCTCODE' TO w_outfile.
PERFORM download_to_ftp TABLES it_acctcode USING w_outfile.
w_file_count = w_file_count + 1.
CLEAR : w_outfile.
MOVE 'ERC/GLOBALSAP/M_ERC_GLOBALSAP_ENTITYCODE' TO w_outfile.
PERFORM download_to_ftp TABLES it_entitycode USING w_outfile.
w_file_count = w_file_count + 1.
CLEAR : w_outfile.
MOVE 'ERC/GLOBALSAP/M_ERC_GLOBALSAP_ATTRIBCODE' TO w_outfile.
PERFORM download_to_ftp TABLES it_attribcode USING w_outfile.
w_file_count = w_file_count + 1.
CLEAR : w_outfile.
MOVE 'ERC/GLOBALSAP/ERC_GLOBALSAP_GLBAL' TO w_outfile.
PERFORM download_to_ftp TABLES it_glbal USING w_outfile.
w_file_count = w_file_count + 1.
CLEAR : w_outfile, w_tot_recs.
PERFORM count_records.
PERFORM process_globalsap.
MOVE 'ERC/GLOBALSAP/C_ERC_GLOBALSAP' TO w_outfile.
PERFORM download_to_ftp TABLES it_globalsap USING w_outfile.
To disconnect the FTP
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
handle = w_hdl.
To disconnect the RFC Connection
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
destination = c_dest
EXCEPTIONS
OTHERS = 1.
ENDFORM. " process_ftp_file
*& Form download_to_ftp
Form to put the files in the Informatica Location using FTP
Path is ERC\GLOBALSAP\<filename>
FORM download_to_ftp TABLES it_tab
USING l_string TYPE char64.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
handle = w_hdl
fname = l_string
character_mode = 'X'
TABLES
text = it_tab[]
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING invalid_output_file.
ENDIF.
ENDFORM. " download_to_ftp
*& Form get_period_year
Form to fill the Period & Year based on the Sy-datum
FORM get_period_year .
DATA : l_month(2) TYPE c,
l_day(2) TYPE c,
l_year(4) TYPE c.
l_year = sy-datum+0(4).
l_month = sy-datum+4(2).
l_day = sy-datum+6(2).
CASE l_month.
WHEN '01'.
IF l_day <= '15'.
w_period = '12'.
w_year = l_year - 1.
ELSE.
w_period = '1'.
w_year = l_year.
ENDIF.
WHEN '02'.
IF l_day <= '15'.
w_period = '1'.
w_year = l_year.
ELSE.
w_period = '2'.
w_year = l_year.
ENDIF.
WHEN '03'.
IF l_day <= '15'.
w_period = '2'.
w_year = l_year.
ELSE.
w_period = '3'.
w_year = l_year.
ENDIF.
WHEN '04'.
IF l_day <= '15'.
w_period = '3'.
w_year = l_year.
ELSE.
w_period = '4'.
w_year = l_year.
ENDIF.
WHEN '05'.
IF l_day <= '15'.
w_period = '4'.
w_year = l_year.
ELSE.
w_period = '5'.
w_year = l_year.
ENDIF.
WHEN '06'.
IF l_day <= '15'.
w_period = '5'.
w_year = l_year.
ELSE.
w_period = '6'.
w_year = l_year.
ENDIF.
WHEN '07'.
IF l_day <= '15'.
w_period = '6'.
w_year = l_year.
ELSE.
w_period = '7'.
w_year = l_year.
ENDIF.
WHEN '08'.
IF l_day <= '15'.
w_period = '7'.
w_year = l_year.
ELSE.
w_period = '8'.
w_year = l_year.
ENDIF.
WHEN '09'.
IF l_day <= '15'.
w_period = '8'.
w_year = l_year.
ELSE.
w_period = '9'.
w_year = l_year.
ENDIF.
WHEN '10'.
IF l_day <= '15'.
w_period = '9'.
w_year = l_year.
ELSE.
w_period = '10'.
w_year = l_year.
ENDIF.
WHEN '11'.
IF l_day <= '15'.
w_period = '10'.
w_year = l_year.
ELSE.
w_period = '11'.
w_year = l_year.
ENDIF.
WHEN '12'.
IF l_day <= '15'.
w_period = '11'.
w_year = l_year.
ELSE.
w_period = '12'.
w_year = l_year.
ENDIF.
ENDCASE.
ENDFORM. " get_period_year -
Unable to refresh page when insert the first row in viewobject
I am using JDeveloper 10g to develop a JSP page, DataAction, AppModule and ViewObject. But when I am trying to use the following code to insert the first row, the page is not getting refresh. The quite weird thing is when I insert the second row, it returns me the first row as well as the second row. And it works well when I am trying to insert the third row, forth row....
//code in AppModule
ViewObject vo= this.getSampleView();
vo.insertRow(newRow);
vo.setNewRowState(Row.STATUS_INITIALIZED);
vo.setAttribute("STR1", str1);
vo.setAttribute("NUMBER1",new NUMBER(1));
vo.setAttribute("STR2", str2);
getTransaction().postChanges();
getTransaction().commit();
//Note: SampleView is a simply view created from a EnityObject mapping to a single table.
Anybody could help me? Thanks very much!//The following code is the method in AppModule, which is invoked when clicks on the Add Remarks button on web page.
public void addRemarks(String strCustCode,String strRemarks,String strUserID)
ViewObject voRemarks1 = this.getCrmCustomerRemarksView();
ViewObject voRemarks2 = this.getCrmCustomerRemarksView();
NUMBER newSeq = new NUMBER();
try
voRemarks1.setWhereClause(" CRM_CUST_CODE ='" + strCustCode + "'");
voRemarks1.setOrderByClause(" CRM_SEQ_NO DESC");
voRemarks1.executeQuery();
if (voRemarks1.getEstimatedRowCount()<1)
newSeq = new NUMBER(1);
else
Row row = voRemarks1.first();
NUMBER seq = (NUMBER)row.getAttribute("CrmSeqNo");
newSeq = seq.add(new NUMBER(1));
SimpleDateFormat tmpLocalFormat = new SimpleDateFormat();
Date tmpDate = new Date();
tmpDate = Calendar.getInstance().getTime();
tmpLocalFormat.applyPattern("yyyy-MM-dd");
System.out.println("NGNCM003 add Remarks with " + strCustCode + "," strRemarks "," + strUserID);
Row newRow = voRemarks2.createRow();
voRemarks2.insertRow(newRow);
newRow.setNewRowState(Row.STATUS_INITIALIZED);
newRow.setAttribute("CrmCustCode", strCustCode);
newRow.setAttribute("CrmSeqNo",newSeq);
newRow.setAttribute("CrmCreatedBy", strUserID);
newRow.setAttribute("CrmRemarks", strRemarks);
newRow.setAttribute("CrmLastModifiedBy", strUserID);
newRow.setAttribute("CrmCreationTimestamp",tmpLocalFormat.format(tmpDate));
newRow.setAttribute("CrmLastModificationTime",tmpLocalFormat.format(tmpDate));
getTransaction().postChanges();
getTransaction().commit();
catch (Exception ex)
throw new RuntimeException("Invalid Sequence No.");
} -
Threshold limit value for the mic?
Hello community,
I have a nice setting for my microphone on adobe audition 6. But I have one big problem.
How can I setup a threshold limit value for the microphone voice? The issue is, that I have all my ambient noises on the recording, so I need a "minimum" activation line. (the same as the "speech activation" in teamspeak 3). There must be a limit and noises under this limit have to be ignored/not recorded.
I hope you know what I mean.
Thanks in advance for any help and best greetings from Germany.
MercilessHallo Merciless
because you mentioned "greetings from Germany" I'll now switch language, hope you understand German too.
Was Du suchst ist ein Noise Gate.
Das findest Du wenn Du im Effekte-Rack "Amplitude und Komprimierung > Dynamikverarbeitung" auswählst.
Am oberen Rand dieses Fensters findest Du dann ein Drop-Downmenü "Vorgaben" und hierunter zwei "Noise Gate" Einstellungen.
Jetzt vielleicht noch ein bisschen mit den Einstellern spielen und das Grundrauschen sollte weg sein.
Ich hoffe die Info hilft weiter
Viel Erfolg -
Target finish value and Actual confirmed value for the header material
Hi guys,
For a given production order, I need to get the below mentioned two values for the header material of the production order:
1. Planned or Target finish value
2. Actual confirmed value
will this value be calculated like:
Target finish quantity x standard price of the material (maintained in MBEW-STPRS) = Target Finish Value
Actual confirmed quantity x standard price of the material (maintained in MBEW-STPRS) = Actual confirmed Value
OR
I can get these required value directly in DB table.
Please guide here.
Thanks & regards,
Ravish
Edited by: Ravish Kumar Ojha on Oct 28, 2009 5:41 AM
Edited by: Ravish Kumar Ojha on Oct 28, 2009 5:41 AMCO03- go to Costs-- Analysis should give you these details.
if you are not OK with the columns appearing, you can change by selecting the change Layout and selecting the required options.
Regards
Ratan -
I have a multi-row region based on a table in which I have two particular columns of interest. The first has an LOV defined for which I have set up a pick-list of codes associated with the item's status as "OK" or having some problem, for which there are a small number of set codes associated. Most rows will be OK, but when there is a problem, the pick-list will be used.
When that pick list has been used, there is an optional "comments" column that can be filled in. I want my screen to dynamically enable/disable a pushbutton that links to the comment based on the code. This being row-based, the push-button needs enabling or disabling by row, not as a whole "conditional column". That bit is ok, I think, but I don't know and can't find the syntax for how within the javascript onchange function I set the current row value for a different column to the one that triggered it.
My header function (that doesn't work) is going to be something like this (where the status column LOV having a value = 6 means "OK"). Note I'm using alert for a debug mechamism. The $s line is my failed attempt to set he column value, here with a hard-coded string "Changed COMMENTS":
<script type="text/javascript">
function doActivateButton(object)
if(parseInt(object.value)!='6')
alert('It is not 6!');
$s('#COMMENTS','Changed COMMENTS','Changed COMMENTS',TRUE);
else
alert('It is 6, you know!');
</script>
Ideally, I want any existing comments blanked if the user picks "OK" (6) as the new status, whereas for debug above I'm setting the hardcoded debug string. You will probably also note I realise I haven't properly understood the purpose of the third parameter in the $s API.
(This is a reports region, by the way. A detail block, in forms-speak, with a header block above it.)
Thanks for any assistance.
MarkSorry, versions are: Apex 4.1 on Oracle RDBMS 11.2.
-
How to select the first row for each pair of values ?
Hi guys, am hoping someone can help me here.
If I have 4 tables - Building, Dept, Emp, Text
B D E T
A 1 Z blah1
A 1 X blah2
A 1 W blah3
A 2 V blah4
A 2 G blah5
A 2 H blah6
B 1 K blah7
B 1 L blah8
B 2 E blah9
B 2 F blah0
I need a query that will bring back the first bit of text for each pair of building and dept records.
So the results I would get would be
A 1 blah1
A 2 blah4
B 1 blah7
B 2 blah9
blah2 wouldnt be returned, because we have already had a record from the Building A, dept 1 pairing.
Likewise we wouldnt get blah5 because we have already had a record from the Building A, dept 2 pairing.
Can this be done in 1 query??
Thanks all.
Message was edited by:
Scott Hillierhere you go
SQL> drop table t;
Table dropped.
SQL> create table t(B char(1), D integer, E char(1), T varchar2(5));
Table created.
SQL> insert into t values('A', 1, 'Z', 'blah1');
1 row created.
SQL> insert into t values('A', 1, 'X', 'blah2');
1 row created.
SQL> insert into t values('A', 1, 'W', 'blah3');
1 row created.
SQL> insert into t values('A', 2, 'V', 'blah4');
1 row created.
SQL> insert into t values('A', 2, 'G', 'blah5');
1 row created.
SQL> insert into t values('A', 2, 'H', 'blah6');
1 row created.
SQL> insert into t values('B', 1, 'K', 'blah7');
1 row created.
SQL> insert into t values('B', 1, 'L', 'blah8');
1 row created.
SQL> insert into t values('B', 2, 'E', 'blah9');
1 row created.
SQL> insert into t values('B', 2, 'F', 'blah0');
1 row created.
SQL> select b,d,t
2 from (
3 select row_number() over(partition by b, d order by b,d) rno,b,d,t
4 from t)
5 where rno = 1;
B D T
A 1 blah1
A 2 blah4
B 1 blah7
B 2 blah9karthick
http://karthickarp.blogspot.com/
Maybe you are looking for
-
QTP-11 doesn't recognize "AcroExch.AVDoc" object with "Adobe Acrobat 9.0"
Hi Support Team, I worked with Acrobat 7 and have used the same script after installing Acrobat 9 for Automation Testing with QTP for validating pdf. The object "AcroExch.AVDoc" is not getting identified as object while working in QTP-11 in the syste
-
Hi Experts, I have created SOAP to SOAP sceanrio. I have to test it wheather its working or not. please tell the full procedure how to test this. Thanks
-
Imovie8 Import Incomplete Project
How can I re-inport an incomple imovie8 project back into the Imovie Project library, from its current position in the home imovie projects file? It wont allow it? IDVD wont accept it either with the message... "that it hasnt been prepared for sharin
-
HP 2700 connection to my MacG4 thru network
HI! Can anyone please help me on how to be able to connect my HP 2700 printer to my Mac G4 thru wireless network? Thanks in advance for your kind assistance
-
Hi, i´m triing to call ARAccount.GetBalancedItems from an VB Application. But the Call always ends with "Named Parameter not found!" Sample Code: Set mObj_Buch = mobj_Bapi.GetSAPObject("BUS3007") Set mobj_LineItem = mobj_Bapi.dimas(mObj_Buch,