Via Form using TextBox to insert a Paragraph in the place of text
I developed a form in VBA in Word but it shows error here, actually i a beginner to macros
The word "2Details2" to be replace with 5 to 8 line paagraph
So by searching internet I am doing this,
Dim para As Paragraph
para = TextBox23.Text
Selection.MoveRight Unit:=wdCharacter, Count:=28, Extend:=wdExtend
Selection.Copy
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "2Details2"
.Replacement.Text = para
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Thanks in advance
First, you have defined:
Dim para As Paragraph
yet you're trying to populate what you've defined as a paragraph object with what appears to be text:
para = TextBox23.Text
Second, you're doing a lot of stuff with Selection which is inefficient. In general, you should use range objects instead. Moreover, you have 'Selection.Copy', but it's not apparent that you doing anything with what you've copied to the clipboard.
It appears your code could be reduced to:
With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "2Details2"
.Replacement.Text = TextBox23.Text
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
though, other than extending the selection, I don't know what you're trying to achieve with:
Selection.MoveRight Unit:=wdCharacter, Count:=28, Extend:=wdExtend
Cheers
Paul Edstein
[MS MVP - Word]
Similar Messages
-
Hi,
I am using Access 2013 and I have the following VBA code,
strSQL = "INSERT INTO Master SELECT * from Master WHERE ID = 1"
DoCmd.RunSQL (strSQL)
when the SQL statement is run, I got this error.
SELECT * cannot be used in an INSERT INTO query when the source or destination table contains a multivalued field
Any suggestion on how to get around this?
Please advice and your help would be greatly appreciated!Rather than modelling the many-to-many relationship type by means of a multi-valued field, do so by the conventional means of modelling the relationship type by a table which resolves it into two one-to-many relationship types. You give no indication
of what is being modelled here, so let's assume a generic model where there is a many-to-many relationship type between Masters and Slaves, for which you'd have the following tables:
Masters
....MasterID (PK)
....Master
Slaves
....SlaveID (PK)
....Slave
and to model the relationship type:
SlaveMastership
....SlaveID (FK)
....MasterID (FK)
The primary key of the last is a composite one of the two foreign keys SlaveID and MasterID.
You appear to be trying to insert duplicates of a subset of rows from the same table. With the above structure, to do this you would firstly have to insert rows into the referenced table Masters for all columns bar the key, which, presuming this to be
an autonumber column, would be assigned new values automatically. To map these new rows to the same rows in Slaves as the original subset you would then need to insert rows into SlaveMastership with the same SlaveID values as those in Slaves referenced
by those rows in Slavemastership which referenced the keys of the original subset of rows from Masters, and the MasterID values of the rows inserted in the first insert operation. This would require joins to be made between the original and the new subsets
of rows in two instances of Masters on other columns which constitute a candidate key of Masters, so that the rows from SlaveMastership can be identified.
You'll find examples of these sort of insert operations in DecomposerDemo.zip in my public databases folder at:
https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.
In this little demo file non-normalized data from Excel is decomposed into a set of normalized tables. Unlike your situation this does not involve duplication of rows into the same table, but the methodology for the insertion of rows into a table which
models a many-to-many relationship type is broadly the same.
The fact that you have this requirement to duplicate a subset of rows into the same table, however, does make me wonder about the validity of the underlying logical model. I think it would help us if you could describe in detail just what in real world
terms is being modelled by this table, and the purpose of the insert operation which you are attempting.
Ken Sheridan, Stafford, England -
When printing form using Adobe Acrobat X, I get squares over my italic text
Hi,
I have created an Adobe Form using Adobe Acrobat XI Pro and just printed it to check whether this works and the following occured:
- When printing my 14 page document using adobe reader everything looked great
- When printing my 14 page document using adobe prof X (not XI !) the italic text had some (non filled, seethrough) squares throughout it. The squares are not constant (5-15 squares per sentence) and I cannot recognize a pattern. However, they appear each time I print the entire document.
- When printing only one page of the document (that has italic text on it) it prints fine with either the free adobe reader or adobe pro X.
Font is Verdana,Italic. Size is 8,27 pt. Data is sometimes embedded (I did not use this feature and have no idea what is means). I always use Windows. Right now windows 7 to be exact.
One more thing: as you can see above the file was created using adobe XI. However, my company uses adobe pro X and therefore the document had to be printable using adobe pro X.
Can someone please help me? I have put a lot of time in the design of this form and not being able to print it correctly is a real dealbreaker for using it which would mean my efforts were wasted.
I added an example to clearify:
Best,
LindaThis is all I can find in KB:
http://kb2.adobe.com/cps/877/cpsid_87775.html#main_Known_issues_on_Windows_
I downloaded MS hotfix and the issue still persists.
We have to identify if this is an adobe issue or a microsoft issue. -
Using textboxes in insert command
Sir,
I had a doubt about insert command while I was trying to give the content of the swing text boxes as the arguments to the insert command.Is it possible?.How can i give values to the fields of a table through GUI components.Hi,
I meant using text boxes in insert statement.because all time we should not give literals.we should have got inputs from swing panel from which we have to
insert data into tables.So I asked how can i give variables or input GUI Components as arguments of insert statement. Also I gave the code below
//CRM Sections Campaign
//package marketing;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
public class CRM_Marketing_1B extends JFrame implements ActionListener
JOptionPane joptMessage;
JButton jbtnSave;
JButton jbtnClear;
JButton jbtnExit=new JButton("Exit");
public CRM_Marketing_1B(String title)
Container conMarketingPane=getContentPane();
conMarketingPane.setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel lblCustomer_Id=new JLabel("Customer ID");
JLabel lblCustomer_Name=new JLabel("Customer Name");
JLabel lblCompany_Name=new JLabel("Company Name");
JLabel lblDesignation=new JLabel("Designation");
JLabel lblAddress1=new JLabel("Address1");
JLabel lblAddress2=new JLabel("Address2");
JLabel lblQuantity=new JLabel("Quantity");
JLabel lblUnit_Price=new JLabel("Unit Price");
JLabel lblInterest_Level=new JLabel("Interest Level");
JLabel lblContact_No=new JLabel("Contact No");
JLabel lblMobile_No=new JLabel("Mobile No");
JLabel lblEmail=new JLabel("Email Address");
JLabel lblEmployee_Id=new JLabel("Employee ID");
JLabel lblCampaign_Date=new JLabel("Campaign Date");
JLabel lblNext_Appointment=new JLabel("Next Appointment");
JLabel lblCampaign_Id=new JLabel("Campaign ID");
JLabel lblTeam_Id=new JLabel("Team ID");
JLabel lblOrder_No=new JLabel("Order No");
JLabel lblResult=new JLabel("Result");
JTextField txfCustomer_Id=new JTextField(30);
JTextField txfCustomer_Name=new JTextField(30);
JTextField txfCompany_Name=new JTextField(30);
JTextField txfDesignation=new JTextField(30);
JTextField txfAddress1=new JTextField(30);
JTextField txfAddress2=new JTextField(30);
JTextField txfQuantity=new JTextField(30);
JTextField txfUnit_Price=new JTextField(30);
JTextField txfInterest_Level=new JTextField(30);
JTextField txfContact_No=new JTextField(30);
JTextField txfMobile_No=new JTextField(30);
JTextField txfEmail=new JTextField(30);
JTextField txfEmployee_Id=new JTextField(30);
JTextField txfCampaign_Date=new JTextField(30);
JTextField txfNext_Appointment=new JTextField(30);
JTextField txfCampaign_Id=new JTextField(30);
JTextField txfTeam_Id=new JTextField(30);
JTextField txfOrder_No=new JTextField(30);
JTextField txfResult=new JTextField(30);
JButton jbtnSave=new JButton("Save");
JButton jbtnClear=new JButton("Clear");
JButton jbtnExit=new JButton("Exit");
conMarketingPane.add(lblCustomer_Id);
conMarketingPane.add(lblCustomer_Name);
conMarketingPane.add(lblCompany_Name);
conMarketingPane.add(lblDesignation);
conMarketingPane.add(lblAddress1);
conMarketingPane.add(lblAddress2);
conMarketingPane.add(lblQuantity);
conMarketingPane.add(lblUnit_Price);
conMarketingPane.add(lblInterest_Level);
conMarketingPane.add(lblContact_No);
conMarketingPane.add(lblMobile_No);
conMarketingPane.add(lblEmail);
conMarketingPane.add(lblEmployee_Id);
conMarketingPane.add(lblCampaign_Date);
conMarketingPane.add(lblNext_Appointment);
conMarketingPane.add(lblCampaign_Id);
conMarketingPane.add(lblTeam_Id);
conMarketingPane.add(lblOrder_No);
conMarketingPane.add(lblResult);
conMarketingPane.add(txfCustomer_Id);
conMarketingPane.add(txfCustomer_Name);
conMarketingPane.add(txfCompany_Name);
conMarketingPane.add(txfDesignation);
conMarketingPane.add(txfAddress1);
conMarketingPane.add(txfAddress2);
conMarketingPane.add(txfQuantity);
conMarketingPane.add(txfUnit_Price);
conMarketingPane.add(txfInterest_Level);
conMarketingPane.add(txfContact_No);
conMarketingPane.add(txfMobile_No);
conMarketingPane.add(txfEmail);
conMarketingPane.add(txfEmployee_Id);
conMarketingPane.add(txfCampaign_Date);
conMarketingPane.add(txfNext_Appointment);
conMarketingPane.add(txfCampaign_Id);
conMarketingPane.add(txfTeam_Id);
conMarketingPane.add(txfOrder_No);
conMarketingPane.add(txfResult);
conMarketingPane.add(jbtnSave);
conMarketingPane.add(jbtnClear);
conMarketingPane.add(jbtnExit);
setSize(900,900);
setVisible(true);
lblCustomer_Id.setLocation(50,50);
lblCustomer_Name.setLocation(50,70);
lblCompany_Name.setLocation(50,90);
lblDesignation.setLocation(50,110);
lblAddress1.setLocation(50,130);
lblAddress2.setLocation(50,150);
lblQuantity.setLocation(50,170);
lblUnit_Price.setLocation(50,190);
lblInterest_Level.setLocation(50,210);
lblContact_No.setLocation(50,230);
lblMobile_No.setLocation(50,250);
lblEmail.setLocation(50,270);
lblEmployee_Id.setLocation(50,290);
lblCampaign_Date.setLocation(50,310);
lblNext_Appointment.setLocation(50,330);
lblCampaign_Id.setLocation(50,350);
lblTeam_Id.setLocation(50,370);
lblOrder_No.setLocation(50,390);
lblResult.setLocation(50,410);
txfCustomer_Id.setLocation(250,50);
txfCustomer_Name.setLocation(250,70);
txfCompany_Name.setLocation(250,90);
txfDesignation.setLocation(250,110);
txfAddress1.setLocation(250,130);
txfAddress2.setLocation(250,150);
txfQuantity.setLocation(250,170);
txfUnit_Price.setLocation(250,190);
txfInterest_Level.setLocation(250,210);
txfContact_No.setLocation(250,230);
txfMobile_No.setLocation(250,250);
txfEmail.setLocation(250,270);
txfEmployee_Id.setLocation(250,290);
txfCampaign_Date.setLocation(250,310);
txfNext_Appointment.setLocation(250,330);
txfCampaign_Id.setLocation(250,350);
txfTeam_Id.setLocation(250,370);
txfOrder_No.setLocation(250,390);
txfResult.setLocation(250,410);
jbtnSave.setLocation(250,450);
jbtnClear.setLocation(350,450);
jbtnExit.setLocation(450,450);
txfCustomer_Id.setRequestFocusEnabled(true);
txfCustomer_Id.requestFocus();
jbtnSave.addActionListener(this);
jbtnClear.addActionListener(this);
jbtnExit.addActionListener(this);
public void actionPerformed(ActionEvent ae)
if(ae.getSource().equals(jbtnSave))
//' &txfAddress1& ',' &txfAddress2& ',' &txfQuantity& ',
//' &txfUnit_Price& ',' &txfInterest_Level& ',' &txfContact_No& ',
//' &txfMobile_No& ',' &txfEmail& ',' &txfEmployee_Id& ',' &txfCampaign_Date& ',
//' &txfNext_Appointment& ',' &txfCampaign_Id& ',' &txfTeam_Id& ',' &txfOrder_No& ',' &txfResult& '
try
Class.forName("jdbc.odbc.JdbcOdbcDriver");
Connection connCampaign=DriverManager.getConnection("jdbc:odbc:CRMSource");
Statement stmtCampaign=connCampaign.createStatement();
/* stmt.executeUpdate("insert into Campaign values('" &jtxfCustomer_ID& "',&jtxfCustomer_Name&,
' &jtxfCustomer_ID& ',' &txfCompany_Name& ',' &txfDesignation& ',' &txfAddress1& ',' &txfAddress2& ',
' &txfQuantity& ',' &txfUnit_Price& ',' &txfInterest_Level& ',' &txfContact_No& ',
' &txfMobile_No& ',' &txfEmail& ',' &txfEmployee_Id& ',' &txfCampaign_Date& ',
' &txfNext_Appointment& ',' &txfCampaign_Id& ',' &txfTeam_Id& ',' &txfOrder_No& ',' &txfResult& ')");*/
JOptionPane.showMessageDialog(this,"Statement was saved");
catch(Exception ex)
ex.printStackTrace();
I got "unclosed character literal" error when i tried to execute the above java source file .
help me to get the required result. -
Hi for past 3 days i was thinking and breaking my head on how to add entire new at top table created in pdf report from c# windows forms with iTextSharp.
First: I was able to create/export sql server data in form of table in pdf report from c# windows forms. Given below is the code in c#.
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using System.Data;
using System.IO;
using System.Data.SqlClient;
using System.Windows.Forms;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace DRRS_CSharp
public partial class frmPDFTechnician : Form
public frmPDFTechnician()
InitializeComponent();
private void btnExport_Click(object sender, EventArgs e)
Document doc = new Document(PageSize.A4.Rotate());
var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
doc.SetMargins(50, 50, 50, 50);
doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
doc.Open();
PdfPTable table = new PdfPTable(7);
table.TotalWidth=585f;
table.LockedWidth = true;
PdfPTable inner = new PdfPTable(1);
inner.WidthPercentage = 115;
PdfPCell celt=new PdfPCell(new Phrase(new Paragraph("Institute/Hospital:AIIMS,NEW DELHI",FontFactory.GetFont("Arial",14,iTextSharp.text.Font.BOLD,BaseColor.BLACK))));
inner.AddCell(celt);
Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
para.Alignment = iTextSharp.text.Element.TITLE;
iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
png.ScaleToFit(95f, 95f);
png.Alignment = Element.ALIGN_RIGHT;
SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
conn.Open();
SqlDataReader dr;
dr = cmd.ExecuteReader();
table.AddCell("ID");
table.AddCell("First Name");
table.AddCell("Middle Name");
table.AddCell("Last Name");
table.AddCell("DOB" );
table.AddCell("Gender");
table.AddCell("Designation");
while (dr.Read())
table.AddCell(dr[0].ToString());
table.AddCell(dr[1].ToString());
table.AddCell(dr[2].ToString());
table.AddCell(dr[3].ToString());
table.AddCell(dr[4].ToString());
table.AddCell(dr[5].ToString());
table.AddCell(dr[6].ToString());
dr.Close();
table.SpacingBefore = 15f;
doc.Add(para);
doc.Add(png);
doc.Add(inner);
doc.Add(table);
doc.Close();
The code executes well with no problem and get all datas from tables into table in PDF report from c# windows forms.
But here is my problem how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
As the problem i am facing is my title or Header(DCS Clinical Report-Technician wise) is at top of my image named:logo5.png and not coming to it's center position of my image.
Second the problem i am facing is how to add new entire row to top of existing table in pdf report from c# windows form using iTextSharp?.
given in below is the row and it's data . So how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
as you can see how i create my columns in table in pdf report and populate it with sql server data. Given the code below:
Document doc = new Document(PageSize.A4.Rotate());
var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
doc.SetMargins(50, 50, 50, 50);
doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
doc.Open();
PdfPTable table = new PdfPTable(7);
table.TotalWidth=585f;
table.LockedWidth = true;
Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
para.Alignment = iTextSharp.text.Element.TITLE;
iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
png.ScaleToFit(95f, 95f);
png.Alignment = Element.ALIGN_RIGHT;
SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
conn.Open();
SqlDataReader dr;
dr = cmd.ExecuteReader();
table.AddCell("ID");
table.AddCell("First Name");
table.AddCell("Middle Name");
table.AddCell("Last Name");
table.AddCell("DOB" );
table.AddCell("Gender");
table.AddCell("Designation");
while (dr.Read())
table.AddCell(dr[0].ToString());
table.AddCell(dr[1].ToString());
table.AddCell(dr[2].ToString());
table.AddCell(dr[3].ToString());
table.AddCell(dr[4].ToString());
table.AddCell(dr[5].ToString());
table.AddCell(dr[6].ToString());
dr.Close();
table.SpacingBefore = 15f;
doc.Add(para);
doc.Add(png);
doc.Add(table);
doc.Close();
So my question is how to make my column headers in bold?
So these are my questions.
1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
3.how to make my column headers in bold?
I know that i have to do some modifications to my code but i dont know how to do it. Can anyone help me please.
Any help or guidance in solving this problem would be greatly appreciated.
vishalHi,
>>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
3.how to make my column headers in bold?<<
I’m sorry for the issue that you are hitting now.
This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
http://sourceforge.net/projects/itextsharp/
Thanks for your understanding.
Regards,
Marvin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
I need to fill a form using adobe reader in safari...
I need to fill a form using Adobe reader in Safari, and although the plug-in is in my Library/internret plug-ins folder, I always get the message, when I get to the site form page in Safari to install plug-in.
Any thoughts ?
YvesThis one, from the site :
It says, in french : you must have adobe reader installed to be able to submit a demand... -
How to run a form using tree node selection??
hi...
i have populated a tree with all the form name.There is a particular id for every form.i want to show a form using tree node selection.What i did...i write a trigger in button's click event when the tree node is selected then i get a id.if id=1 then open_form('test.fmx').when i want to execute this code then it is showing the same form 2 times.Can anyone help me to solve my problem?If so plz tell me what code i have to write to show a form using node selection?.I've done the same thing, and i think it works fine.
Check this code (Sorry for the long post, but i cannot find how to attach files.
PACKAGE menu_pk IS
--Initialization of the menu.
procedure Init;
--Called from WHEN-TREE-NODE-EXPANDED
procedure Expanded;
--Called from WHEN-TREE-NODE-ACTIVATED
procedure ExecuteCommand;
END;
PACKAGE BODY menu_pk IS
MENU_NAME constant varchar2(30) := 'menu.menu';
cursor c_menu(pRoot in varchar2) is
select apm_code, apm_parcode, apm_descr, decode(apm_type, 0, Ftree.EXPANDED_NODE, Ftree.LEAF_NODE) apm_type,
decode(apm_type, 0, 'menu', 1, 'form', 2, 'report') || '.ico' apm_icon
from app_menu
where apm_parcode = pRoot
order by apm_code asc;
procedure Init is
new_node ftree.node;
begin
for i in c_menu('root')
loop
new_node := Ftree.add_tree_node(MENU_NAME, FTree.ROOT_NODE,
Ftree.PARENT_OFFSET, Ftree.LAST_CHILD,
i.apm_type, i.apm_descr, i.apm_icon, i.apm_code);
end loop;
end;
procedure FillNode(pNode in FTree.Node) is
new_node ftree.node;
begin
for i in c_menu(FTree.get_tree_node_property(MENU_NAME, pNode, FTree.NODE_VALUE))
loop
new_node := Ftree.add_tree_node(MENU_NAME, pNode,
Ftree.PARENT_OFFSET, Ftree.LAST_CHILD,
i.apm_type, i.apm_descr, i.apm_icon, i.apm_code);
end loop;
end;
procedure DeleteNodeChilds is
node FTree.NODE;
begin
loop
node := FTree.Find_Tree_Node(MENU_NAME, '',
FTree.FIND_NEXT_CHILD, FTree.NODE_VALUE,
name_in('system.trigger_node'), name_in('system.trigger_node'));
exit when Ftree.ID_NULL(node);
FTree.delete_tree_node(MENU_NAME, node);
end loop;
end;
procedure Expanded is
begin
if (FTree.GET_TREE_NODE_PROPERTY(MENU_NAME, :system.trigger_node, FTree.Node_State) = FTree.EXPANDED_NODE) then
menu_pk.FillNode(name_in('system.trigger_node'));
else
menu_pk.DeleteNodeChilds;
end if;
end;
procedure ExecuteCommand is
cursor c_command(pCode in varchar2) is
select apm_form, apm_type
from app_menu
where apm_code = pCode;
fCommand c_command%rowtype;
fMenuCode varchar2(20);
begin
-- if it is as menu node then exit.
if (not FTree.Get_Tree_Node_Property(MENU_NAME, :system.trigger_node, FTree.NODE_STATE) = FTree.LEAF_NODE) then
return;
end if;
fMenuCode := FTree.Get_Tree_Node_Property(MENU_NAME, :system.trigger_node, FTree.NODE_VALUE);
open c_command(fMenuCode);
fetch c_command into fCommand;
close c_command;
if (fCommand.apm_type = 1) and (fCommand.apm_form is not null) then
globals.Set_MenuChoice(fMenuCode);
OPEN_FORM(fCommand.apm_form);--, ACTIVATE, SESSION);
end if;
end;
END;
The menu table definition follows.
create table APP_MENU
APM_CODE VARCHAR2(10) not null,
APM_PARCODE VARCHAR2(10) not null,
APM_DESCR VARCHAR2(40) not null,
APM_TYPE NUMBER(1) not null,
APM_FORM VARCHAR2(50)
alter table APP_MENU
add constraint APP_MENU_PRI primary key (APM_CODE);
Hope this helps -
Update a system form using XML
Hi all,
I'm trying to update a system form by adding a tab (folder). The form is Customer Equipment Card (nb 60150), in the service menu.
I just want to add a folder called Counter.
When I load the XML file below, I get the following error :
System.Runtime.InteropServices.COMException (0xFFFFFFFE): Function not supported on current SBO Version - upgrade is required
If I want to add a button, it's working, but not a folder.
Something's false in this XML file (I add the good uid before I load it) ?
Thanks for your help
Sébastien> - Drop the datasource section
> The error is gone, but I don't see the folder in
> in the form
You could try and check wether it's there but invisible (access it in your code and wait for an exception).
> - Linkto Objet
> If you look at the XML code of the form, you can
> can see that all the folder are links to this item.
> Moreover, when I add the form using VB (it's working
> that way), the XML result will show linkto = "54"
I believe. I analyzed another system form and my own forms: None of the tabs are linked to anything. Is this documented? What does it mean?
> - the data source is SYS_71 for all the folder of the
> form. I don't understand what you mean when you want
> me to set the val_on to this datasource
I looked at the XML source of another system form and the tabs had val_on="SYS_whatever". With my own forms I set val_off="N" and val_on="Y". I remember having had some problems there, but I can't put my finger on it now.
> - item group
> I'm using SBO 6.5, I can't find help on that, maybe
> it's only on 2004.
No, it's 6.5. It's not in the documentation but you will find it somewhere inside the guts of this forum. As I said, I once had trouble adding tabs cleanly to a custom form using XML.
Of course, all this is just blindly stabbing into the dark. What else can we do? -
How to create software request form using Info path functionality?
Hi All,
i am trying to create a Software Request Form using Info path functionality. Following are the steps:
1. Users will fill out the form with all necessary fields.
2. once they click on Submit button, it will send an email to two specific groups with a link so that they can see the form and Approve/Deny or can put comments on that.
Thanks in advanced!Hi Rakib,
There are many ways you can achieve this.
Either by Creating a SharePoint list and then modify it using InfoPath to get all your required fields added
or
Use InfoPath application and select any template or blank form template to get all your required fields added and then publish it to SharePoint site
For the second step you can create an OOTB workflow which can send email to view an approve items using Approval workflow feature
For the advance notification you can use SPD workflows as well.
Refer this article for more on InfoPath and SPD integration - http://gallery.technet.microsoft.com/office/Step-By-Step-build-30f84363
Let us know if this helps, thanks
Regards,
Pratik Vyas | SharePoint Consultant |
http://sharepointpratik.blogspot.com
Posting is provided AS IS with no warranties, and confers no rights
Please remember to click Mark As Answer if a post solves your problem or
Vote As Helpful if it was useful. -
Offline adobe forms using webservices-how to print table data
HI,
i have created offline adobe form using webservices which call rfc to pull the data ...to get inspection lot details ...
iam getting header data....but iam not able to get multiple line items of the table data ..here in scenario there are 4 line items but only 1 line item is getting displayed in the form...
is there any need to handle seperately to display tables data in offline adobe forms if we call from webservices
Tousif
Moderator message: please have a look in the dedicated forum for "Adobe Interactive Forms".
Edited by: Thomas Zloch on Jan 18, 2011 3:08 PM
<< Moderator message - New question asked, so this is locked >>
Edited by: Rob Burbank on Jan 18, 2011 10:19 AMThis is oofline adobe form which is created throgh webservices
Edited by: tousif_ig on Jan 18, 2011 3:19 PM -
Can we build a new custom form using self service web applications in 11i?
I have been using Template.fmb to build new custom forms in Oracle Applications 11i. We wanted to know If we can build new forms using self service web applications to get the web form feel in 11i.
Please let me know the reason.
Thanks in advance
NelI have been using Template.fmb to build new custom forms in Oracle Applications 11i. We wanted to know If we can build new forms using self service web applications to get the web form feel in 11i.
Please let me know the reason.
Thanks in advance
Nel -
Opening .pdf files from forms using OLE
Hi,
I want to open, print , save and save as pdf files from forms using OLE . Please help me with the same.
Thanks
VidyaIf you are in client/server mode, you can put an OLE container component on your form. However, be warned that this method does not work when you convert to the forms server web enabled mode. If you anticipate moving your application to the web anytime soon, my advice would be to web-enable first and then add in the feature to view .pdf (or other) files. In our client/server app, I went to a lot of trouble to add in OLE features such as you describe, and now I have to completely re-write those features for the web.
-
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 -
Insert sound file into Oracel DB via Forms 6i
Dear All
Pls let me know how to insert sound files in to Oracle DB via Forms 6i.
Regards
Lakmal Marasingeby the way - just for info : Sound-Items in Forms 6i can't be migrated to 10g. They are now obsolet.
So, the best way is to develop in 6i a solution based on java. Then you use it and communicate with it per java bean.
try it
Gerd -
Is there a way to use the validate form without using the mx
kollection insert or update or delete transaction, and use the
default dreamweaver insert server behavior.short answer : no, MX Kollection´s (also applies to
ADDT) form validation routines will only work for forms which have
been generated with MX Kollection/ADDT
>>
and use the default dreamweaver insert server behavior.
>>
but if you´re going to insert a record anyway, you can
as well use Kollection´s "Insert Record Form Wizard" to create
that form for you, which in turn does provide the required
validations.
Maybe you are looking for
-
Ipod Nano: Sync won't complete
I've been trying to sync an Ipod nano with Itunes. The clip in question is "Jack Jack Attack". It synced fine on one of my kid's Ipod's, but it gets stuck on the other kid's Ipod. It gets about two thirds of they way through the sync and then just st
-
Flat File with unequal spacing as delimiter
I am trying to import multiple flat files with unequal spacing as delimiter in sql server using SSIS 2012, however when I import the file, all the data in the file is imported into only one column. None of the predefined delimiters in SSIS works with
-
Hi, I would like to add custom fields to my UWL . Example : I have ActivationTime, ActualOwner fields in my process and I would like show these fields also in UWL apert from the standard fields like Subject,sentdate etc etc Note : I am looking for
-
Dear All, I have created WebDynpro application by importing track. When I deploy the application, it say, Deployment completed with warning. The warning is "Clusterwide exception: Failed to prepare application". Here I guess I need to find out which
-
Send & Return with Fireface 800 not working with Logic 8
Hello all. I'm having a bear of a time setting up an FX loop from Logic to a FireFace 800. I suspect the problem is in Totalmix, but I can't seem to configure that at all. Trying to route Track #1, through the FF and into Helicon VoicePro, then back