Related to program logic
Hi,
I have filled one table(i_tab) having 1 field called document number(vbeln).than
select SD header information from VBAK
for all entries in i_tab
where vbeln = i_tab-vbeln.
This is given dump bcz table i_tab have alot of data.
How i can solve this problem?
Filling r_vbeln from VBAP,VBBE and VBEP
DELETE ADJACENT DUPLICATES FROM r_vbeln.
SELECT vbeln
auart
vkorg
FROM vbak INTO TABLE p_t_vbak
WHERE vbeln IN r_vbeln.
This is not given dump in development and testing server. It gives problem in production only. This is bcz in production alot of document get selected from table VBAP,VBBE and VBEP.So it given dump when selecting from table VBAK.
May be this is bcz time out problem.
I think this can be solved by splitting r_vbeln into 2 parts. But in that case I need to select 2 times from selecting from VBAK table.
Similar Messages
-
Problem with programming logic in code
I have hit a programming logic problem. What I wanted is for my main program to create a jDialog according to user's choice selection from a jOptionPane and the code in the main body to stop running and rather wait for the user to select the option in the jDialog and then go back to running the main code body but somehow my program doesn't work that way. Anyone have any ideas how to fix it ?
Object[] obj = {"Specific Date","Month/Year"};
String input = (String) JOptionPane.showInputDialog(this,"Choose the following ways to select a date.","Select Date",JOptionPane.INFORMATION_MESSAGE,null,obj,obj[0]);
if(input.equals("Specific Date")){
jDialog1.setSize(400,250);
jDialog1.setVisible(true);
//while(option!=1){
//System.out.println("waiting");
if(option==1){
System.out.println("Year: "+chosenYear);
//break;
data.append("<H1>Other Day / Month / Year Record</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
System.out.println("breaking out soon...");
} else if(input.equals("Month/Year")){
jDialog2.setSize(300,200);
jDialog2.setVisible(true);
//while(option!=1){
//System.out.println("waiting");
if(option==1){
System.out.println("Year: "+chosenYear);
//break;
data.append("<H1>Other Day / Month / Year Record</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
System.out.println("breaking out soon...");
// data.append("<H1>Other Day / Month / Year Record</H1>");
// data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
System.out.println("break executed...");As you can see...I was originally thinking to use a while loop but it failed so I commented it out. I have been stuck in this programming logic of waiting for the user to choose an option form the jDialog before continuning in the main body. The jDialogs are already initiatized and both jDialogs would set the 'option' variable which has been init earlier on (the code is really too long to be placed here to '1' when it is ready for the program to resume to run the main body of the codes as you can see.
So anyone have any ideas how to get it solved ?
I do need a solution fast because these codes have a deadline in 2 weeks time.
nullHere's the entire code for this java class.
* ExportRecord.java
* Created on September 7, 2007, 2:03 PM
package lkgaccount;
import java.util.ArrayList;
import java.util.Calendar;
import javax.swing.*;
import java.awt.*;
import java.io.*;
* @author Owner
public class ExportRecord extends javax.swing.JInternalFrame {
export exp = new export();
String filepath = "";
File toFile;
StringBuffer data;
HTMLBrowser htmlbrowser;
int subOption = 0;
int chosenDay;
int chosenMonth;
String chosenMth;
int chosenYear;
CodeManager cm = new CodeManager();
/** Creates new form ExportRecord */
public ExportRecord() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jDialog1 = new javax.swing.JDialog();
jPanel2 = new javax.swing.JPanel();
jButton6 = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
jCalendar1 = new com.toedter.calendar.JCalendar();
jDialog2 = new javax.swing.JDialog();
jPanel4 = new javax.swing.JPanel();
jButton10 = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox();
jSpinner1 = new javax.swing.JSpinner();
jLabel8 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox();
jButton1 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jButton5 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jDialog1.setTitle("Search By Date");
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Search By: Date ", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11)));
jButton6.setText("Submit");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
jLabel6.setText("Date Parameter:");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(255, Short.MAX_VALUE)
.addComponent(jButton6)
.addContainerGap())
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6)
.addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
.addComponent(jButton6)
.addContainerGap())
jDialog1.getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Search By: Month/Year", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11)));
jButton10.setText("Submit");
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
jLabel7.setText("Month: ");
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "*" }));
jLabel8.setText(" Year: ");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jSpinner1)
.addComponent(jComboBox2, 0, 167, Short.MAX_VALUE)))
.addComponent(jButton10, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton10)
.addContainerGap())
jDialog2.getContentPane().add(jPanel4, java.awt.BorderLayout.CENTER);
setTitle("Export Record");
jLabel1.setText("Export by: ");
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Daily Record", "Current Month's Record", "Current Year's Record", "Other Day / Month / Year Record", "Supplier Names", "All Account Records" }));
jButton1.setText("Close");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jLabel2.setText("Export as: ");
jTextField1.setEditable(false);
jTextField1.setText(".html");
jLabel3.setText("Save to: ");
jButton2.setText("...");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
jLabel4.setText("File Name: ");
jLabel5.setText("( do not add a file extension behind )");
jButton5.setText("Clear");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
jPanel1.add(jButton5);
jButton4.setText("Preview");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
jPanel1.add(jButton4);
jButton3.setText("Export");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
jPanel1.add(jButton3);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3)
.addComponent(jLabel2)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
.addComponent(jTextField1)
.addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE))))))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jButton1))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
// TODO add your handling code here:
String mth = (String)jComboBox2.getSelectedItem();
Integer yr = (Integer)jSpinner1.getValue();
subOption = 2;
chosenMth = mth;
chosenYear = (int)yr;
}//GEN-LAST:event_jButton10ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// TODO add your handling code here:
Calendar calendar = jCalendar1.getCalendar();
int day = calendar.get(Calendar.DATE);
int month = calendar.get(Calendar.MONTH);
int year = calendar.get(Calendar.YEAR);
month ++;
System.out.println("calendar: "+day+"/"+month+"/"+year);
subOption = 1;
chosenDay = day;
chosenMonth = month;
chosenYear = year;
}//GEN-LAST:event_jButton6ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
int index = jComboBox1.getSelectedIndex();
String folderExt = jTextField2.getText();
String fileName = jTextField3.getText();
String urlpath = folderExt+"\\"+fileName+".html";
System.out.println(urlpath);
if(folderExt.equals("")||fileName.equals("")){
JOptionPane.showMessageDialog(this,"Please specific which folder and the name of the file you want to save your exported documents.","Folder and file not specified",JOptionPane.INFORMATION_MESSAGE);
} else{
toFile = new File(urlpath);
if(toFile.exists()){
JOptionPane.showMessageDialog(this,urlpath+" has already existed. Please enter a new file name. ","File Exist",JOptionPane.WARNING_MESSAGE);
data = new StringBuffer();
data = getData(data,index,fileName);
exp.writeHTML(data,toFile);
if(htmlbrowser!=null){
htmlbrowser.dispose();
htmlbrowser = new HTMLBrowser("file:/"+urlpath);
htmlbrowser.setVisible(true);
} else{
htmlbrowser = new HTMLBrowser("file:/"+urlpath);
htmlbrowser.setVisible(true);
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
int index = jComboBox1.getSelectedIndex();
toFile = new File("C:\\Documents and Settings\\Owner\\LKGAccount\\dist\\preview.html");
if(toFile.exists()){
data = new StringBuffer();
data = getData(data,index,"Preview");
exp.writeHTML(data,toFile);
if(htmlbrowser!=null){
htmlbrowser.dispose();
htmlbrowser = new HTMLBrowser("file:/C:\\Documents and Settings\\Owner\\LKGAccount\\dist\\preview.html");
htmlbrowser.setVisible(true);
} else{
htmlbrowser = new HTMLBrowser("file:/C:\\Documents and Settings\\Owner\\LKGAccount\\dist\\preview.html");
htmlbrowser.setVisible(true);
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
// TODO add your handling code here:
jComboBox1.setSelectedIndex(0);
jTextField2.setText("");
jTextField3.setText("");
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
JFileChooser chooser = new JFileChooser();
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = chooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
filepath = chooser.getSelectedFile().getAbsolutePath();
jTextField2.setText(filepath);
}//GEN-LAST:event_jButton2ActionPerformed
public StringBuffer getData(StringBuffer data, int option, String filename){
ArrayList aList = new ArrayList();
Date date = new Date();
int todayDay = date.getDay();
int todayMonth = date.getMonth();
int todayYear = date.getYear();
data.append("<html>");
data.append("<head>");
data.append("<title>Lim Kim Guan Accounting Record: "+filename+"</title>");
data.append("</head>");
data.append("<body>");
if(option==0){
data.append("<H1>Daily Record</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
aList = cm.searchByDate(todayDay,todayMonth,todayYear);
if(aList==null||aList.isEmpty()){
data.append("<p><center><b>There is no data transaction for today.</b></center></p>");
} else{
data.append("<center><table border=\"1\">");
data.append("<tr>");
data.append("<td colspan=\"7\"><center><b>Accounting Records</b></center></td>");
data.append("</tr>");
data.append("<tr>");
data.append("<td><center><B>Acct ID</B></center></td>");
data.append("<td><center><B>Supplier Name</B></center></td>");
data.append("<td><center><B>Invoice #</B></center></td>");
data.append("<td><center><B>Original $ before GST</B></center></td>");
data.append("<td><center><B>GST(%)</B></center></td>");
data.append("<td><center><B>$ after GST</B></center></td>");
data.append("<td><center><B>Date</B></center></td>");
data.append("</tr>");
for(int i=0;i<aList.size();i++){
account acct = (account)aList.get(i);
if(acct != null) {
data.append("<tr>");
data.append("<td>"+Integer.toString(acct.getId())+"</td>");
data.append("<td>"+acct.getSupplierName()+"</td>");
data.append("<td>"+acct.getInvoiceid()+"</td>");
data.append("<td>"+Double.toString(acct.getBeforeGST$())+"</td>");
data.append("<td>"+Integer.toString(acct.getGst())+"</td>");
data.append("<td>"+Double.toString(acct.getAfterGST$())+"</td>");
data.append("<td>"+acct.getDay()+" / "+acct.getMonth()+" / "+acct.getYear()+"</td>");
data.append("</tr>");
data.append("</table></center>");
} else if(option==1){
data.append("<H1>Current Month's Record</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
aList = cm.searchByIntMonthYear(todayMonth,todayYear);
if(aList==null||aList.isEmpty()){
data.append("<p><center><b>There is no data transaction for current month.</b></center></p>");
} else{
data.append("<center><table border=\"1\">");
data.append("<tr>");
data.append("<td colspan=\"7\"><center><b>Accounting Records</b></center></td>");
data.append("</tr>");
data.append("<tr>");
data.append("<td><center><B>Acct ID</B></center></td>");
data.append("<td><center><B>Supplier Name</B></center></td>");
data.append("<td><center><B>Invoice #</B></center></td>");
data.append("<td><center><B>Original $ before GST</B></center></td>");
data.append("<td><center><B>GST(%)</B></center></td>");
data.append("<td><center><B>$ after GST</B></center></td>");
data.append("<td><center><B>Date</B></center></td>");
data.append("</tr>");
for(int i=0;i<aList.size();i++){
account acct = (account)aList.get(i);
if(acct != null) {
data.append("<tr>");
data.append("<td>"+Integer.toString(acct.getId())+"</td>");
data.append("<td>"+acct.getSupplierName()+"</td>");
data.append("<td>"+acct.getInvoiceid()+"</td>");
data.append("<td>"+Double.toString(acct.getBeforeGST$())+"</td>");
data.append("<td>"+Integer.toString(acct.getGst())+"</td>");
data.append("<td>"+Double.toString(acct.getAfterGST$())+"</td>");
data.append("<td>"+acct.getDay()+" / "+acct.getMonth()+" / "+acct.getYear()+"</td>");
data.append("</tr>");
data.append("</table></center>");
} else if(option==2){
data.append("<H1>Current Year's Record</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
aList = cm.searchByMonthYear("*",todayYear);
if(aList==null||aList.isEmpty()){
data.append("<p><center><b>There is no data transaction for today.</b></center></p>");
} else{
data.append("<center><table border=\"1\">");
data.append("<tr>");
data.append("<td colspan=\"7\"><center><b>Accounting Records</b></center></td>");
data.append("</tr>");
data.append("<tr>");
data.append("<td><center><B>Acct ID</B></center></td>");
data.append("<td><center><B>Supplier Name</B></center></td>");
data.append("<td><center><B>Invoice #</B></center></td>");
data.append("<td><center><B>Original $ before GST</B></center></td>");
data.append("<td><center><B>GST(%)</B></center></td>");
data.append("<td><center><B>$ after GST</B></center></td>");
data.append("<td><center><B>Date</B></center></td>");
data.append("</tr>");
for(int i=0;i<aList.size();i++){
account acct = (account)aList.get(i);
if(acct != null) {
data.append("<tr>");
data.append("<td>"+Integer.toString(acct.getId())+"</td>");
data.append("<td>"+acct.getSupplierName()+"</td>");
data.append("<td>"+acct.getInvoiceid()+"</td>");
data.append("<td>"+Double.toString(acct.getBeforeGST$())+"</td>");
data.append("<td>"+Integer.toString(acct.getGst())+"</td>");
data.append("<td>"+Double.toString(acct.getAfterGST$())+"</td>");
data.append("<td>"+acct.getDay()+" / "+acct.getMonth()+" / "+acct.getYear()+"</td>");
data.append("</tr>");
data.append("</table></center>");
} else if(option==3){
data.append("<H1>Other Day / Month / Year Record</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
Object[] obj = {"Specific Date","Month/Year"};
String input = (String) JOptionPane.showInputDialog(this,"Choose the following ways to select a date.","Select Date",JOptionPane.INFORMATION_MESSAGE,null,obj,obj[0]);
if(input.equals("Specific Date")){
jDialog1.setSize(400,250);
jDialog1.setVisible(true);
while(true){
System.out.println("waiting");
if(subOption==1){
System.out.println("Year: "+chosenYear);
break;
} else if(input.equals("Month/Year")){
jDialog2.setSize(300,200);
jDialog2.setVisible(true);
while(true){
System.out.println("waiting");
if(subOption==2){
System.out.println("Year: "+chosenYear);
break;
System.out.println("break executed...");
} else if(option==4){
data.append("<H1>Supplier Names</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
aList = cm.getCompanyList();
if(aList==null||aList.isEmpty()){
data.append("<p><center><b>There is no data transaction for today.</b></center></p>");
} else{
data.append("<center><table border=\"1\">");
data.append("<tr>");
data.append("<td colspan=\"1\"><center><b>Supplier Names</b></center></td>");
data.append("</tr>");
for(int i=0;i<aList.size();i++){
String result = (String)aList.get(i);
if(result != null||result.isEmpty()) {
data.append("<tr>");
data.append("<td>"+result+"</td>");
data.append("</tr>");
data.append("</table></center>");
} else if(option==5){
data.append("<H1>All Account Records</H1>");
data.append("<p>Date: "+todayDay+"/"+todayMonth+"/"+todayYear+"</p><br>");
aList = cm.getAccountRecords();
if(aList==null||aList.isEmpty()){
data.append("<p><b>There is no data transaction for today.</b></p>");
} else{
data.append("<center><table border=\"1\">");
data.append("<tr>");
data.append("<td colspan=\"7\"><center><b>Accounting Records</b></center></td>");
data.append("</tr>");
data.append("<tr>");
data.append("<td -
Update the data into the ZTABLE fields thru program logic ..?
hi all,
i have ZTABLE1,ZTABLE2,ZTABLE3, and this tables like ALV grids using object methods.
in the same table fields now i wanted to update the data into the ZTABLE fields thru program logic .
could anyone please help me ....
please provide if anyone of have any program logic that would be helpfull to me.
thanks in advance...
srinivas....Hi Srinivas,
The following statements are used to upload the data into custom tables.
1. Modify
2. Update
3. Insert
if you are using OO ALV, you should enable the 'SAVE' button in the main toolbar. if the user press the save button, then you should upload the data to the custom table.
please find the example code, in this example 'PERFORM F_SAVE_DATA'(here i gave the message only, you write your own logic here) is used to save the data in custom table.
Report Program: ZB_ALVOOPS_TEST
Line:-----
REPORT ZB_ALVOOPS_TEST MESSAGE-ID ZCR_MESSAGES.
Top Include - Global Data Declaration *
INCLUDE ZB_ALVOOPS_TEST_TOP.
SEL Include - Selection Screen *
INCLUDE ZB_ALVOOPS_TEST_SEL.
AT SELECTION SCREEN *
Initialization Event *
INITIALIZATION.
Initialize Screen Number.
PERFORM F_INITIALIZE.
Initialize Field Catalog for ALV Grid.
PERFORM F_INITIALIZE_GRID.
END-OF-SELECTION.
Call Display Screen *
CALL SCREEN 9000.
Event Handler - Class Definition and Implementation *
INCLUDE ZB_ALVOOPS_TEST_CL01.
PBO Event - Module Implementation *
INCLUDE ZB_ALVOOPS_TEST_PBO.
PAI Event - Module Implementation *
INCLUDE ZB_ALVOOPS_TEST_PAI.
Subroutine Include *
INCLUDE ZB_ALVOOPS_TEST_F01.
Include: ZB_ALVOOPS_TEST_TOP
Line:-------
Type Declaration For Internal Tables *
Collection Data
TYPES: BEGIN OF TY_MARA ,
MATNR TYPE MATNR , " Material
VPSTA TYPE VPSTA , " Maintenance status of complete material
MTART TYPE MTART , " Material Type
MBRSH TYPE MBRSH , " Industry Sector
MATKL TYPE MATKL , " Material Group
BISMT TYPE BISMT , " Old material number
MEINS TYPE MEINS , " Base Unit of Measure
BSTME TYPE BSTME , " Order unit
BRGEW TYPE BRGEW , " Gross weight
MAKTX TYPE MAKTX , " Material Description
ROWCOLOR TYPE CHAR4 , " Row Color
END OF TY_MARA .
Flag *
DATA: FG_REFRESH TYPE XFLD , " Used to Refresh ALV
FG_SAVE TYPE XFLD . " Data Saved Or Not.
Internal Table Declaration *
DATA: IT_MARA TYPE STANDARD TABLE OF TY_MARA , " Internal table for Material
WA_MARA TYPE TY_MARA . " Workarea for Material
Variable Declaration For General Constants *
CONSTANTS: C_SCREEN_SELECT TYPE SYDYNNR VALUE '9001' , " Selection Screen Number
C_SCREEN_SELECT_NIL TYPE SYDYNNR VALUE '9002' , " Empty Screen Number
C_STATUS9000 TYPE CHAR10 VALUE 'STATUS9000' , " PF-Status
C_TITLEBAR TYPE CHAR4 VALUE '9000' , " Title Bar
C_ISSUE_CONTAINER TYPE SCRFNAME VALUE 'WORKCONTAINER', " Container Name (Screen Painter)
C_BUTTON_TYPE TYPE CHAR1 VALUE '3' , " Button Type
C_EXECUTE TYPE CHAR4 VALUE 'SELE' , " Functions 'SELE' -> Execute
C_BACK TYPE CHAR4 VALUE 'BACK' , " Functions 'BACK' -> Back to main screen
C_ENTER TYPE CHAR5 VALUE 'ENTER' , " Functions 'ENTER' -> No Action
C_SEL01 TYPE CHAR5 VALUE 'SEL01' , " Functions 'SEL01' -> Toggle Function
C_SAVE TYPE CHAR4 VALUE 'SAVE' , " Functions 'SAVE' -> Save Function
C_REFRESH TYPE CHAR7 VALUE 'REFRESH' , " Functions 'REFRESH' -> Clear and Fres All objects
C_ADD_MI TYPE CHAR6 VALUE 'ADD_MI' , " Functions 'ADD_MI' -> Add New Media Issue
C_TRUE TYPE CHAR1 VALUE 'X' , " Set X value
C_REQUIRED TYPE CHAR1 VALUE '1' , " Un-Confirmed Qty field obligatory or not.
C_INPUT TYPE CHAR1 VALUE '0' , " Reason field should not be input.
C_ALV_SAVE TYPE CHAR1 VALUE 'A' , " ALV
C_ERROR TYPE CHAR1 VALUE 'E' , " Error Type
C_SIGN TYPE CHAR1 VALUE 'I' , " Sign
C_OPTION TYPE CHAR2 VALUE 'EQ' , " Option.
C_COMMIT_WAIT TYPE CHAR1 VALUE '5' , " Waiting to update in DB
C_TABNAME TYPE CHAR1 VALUE '1' , " Parameter (ALV)
C_CANCEL TYPE CHAR1 VALUE 'N' , " Cancel
C_YES TYPE CHAR1 VALUE 'J' . " Yes.
Variable Declaration For Container and ALV Grid *
DATA: OBJ_CUST_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER , " Container Class
OBJ_CUST_GRID TYPE REF TO CL_GUI_ALV_GRID . " ALV Grid Class
Field Catalog Declaration For Container and ALV Grid *
DATA: IT_FIELDCAT TYPE LVC_T_FCAT , " Field Catalog
IT_EXCLUDE TYPE UI_FUNCTIONS , " Standard Function Exclude from ALV
WA_FIELDCAT TYPE LVC_S_FCAT , " For Field Catalog
WA_LAYOUT TYPE LVC_S_LAYO . " ALV Layout
Global Variable Declaration *
DATA: OK_CODE TYPE SY-UCOMM , " OK CODE ( Screen Attribute Don't Change the var.name)
G_SAVE_CODE TYPE SY-UCOMM , " OK CODE
G_ANSWER TYPE CHAR1 , " OK or Cancel.
G_SELECTION_DYNNR TYPE SYDYNNR , " Screen Number
G_ERROR_TEXT TYPE CHAR128 , " Error Text
G_SELECTION_TOGGLE_TEXT TYPE CHAR50 , " Toggle Text, Value: Hide Selection, Show Selection
G_MATNR TYPE MATNR , " Material
G_SMATNR TYPE MATNR , " Material
G_SMTART TYPE MTART . " Material Type
Include: ZB_ALVOOPS_TEST_SEL
Line:-------
Selection Screen
SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME TITLE TEXT-001 .
SELECT-OPTIONS: S_MATNR FOR G_SMATNR , " Material
S_MTART FOR G_SMTART . " Material Type
SELECTION-SCREEN END OF BLOCK SELECTION .
SELECTION-SCREEN END OF SCREEN 9001 .
Empty Selection
SELECTION-SCREEN BEGIN OF SCREEN 9002 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK SELECTION_NIL WITH FRAME TITLE TEXT-002 .
Nil
SELECTION-SCREEN END OF BLOCK SELECTION_NIL .
SELECTION-SCREEN END OF SCREEN 9002 .
Include: ZB_ALVOOPS_TEST_CL01
Line:-------
CLASS lcl_event_handler DEFINITION *
Event Handler Class Definition *
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLER_TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE ,
HANDLER_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM .
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION *
Event Class Implementation. *
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
Toolbar -----Create 'Add Issue' button
METHOD HANDLER_TOOLBAR.
DATA: L_WA_TOOLBAR TYPE STB_BUTTON. " Toolbar
CLEAR: L_WA_TOOLBAR.
Button Type
L_WA_TOOLBAR-BUTN_TYPE = C_BUTTON_TYPE . " 3.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
Add Issue Button.
CLEAR: L_WA_TOOLBAR.
L_WA_TOOLBAR-FUNCTION = 'ADD_MI' . " 'ADD_MI' .
L_WA_TOOLBAR-ICON = 'ICON_CREATE'.
L_WA_TOOLBAR-QUICKINFO = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-TEXT = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-DISABLED = ''.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR: L_WA_TOOLBAR.
ENDMETHOD. "handler_toolbar
User Actions Events-- Handle 'Add Issue' Button Click.
METHOD HANDLER_USER_COMMAND.
CASE E_UCOMM.
Add Issue Button.
WHEN C_ADD_MI.
IF NOT G_MATNR IS INITIAL.
FG_REFRESH = C_TRUE.
PERFORM F_ADD_MEDIAISSUE.
ENDIF.
ENDCASE.
Refresh Control
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
Handle Exceptions
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
G_ERROR_TEXT = TEXT-026. " 'Control System Error'.
WHEN 2.
G_ERROR_TEXT = TEXT-027. " 'Control CL_GUI_CFW Has Raised Error'.
ENDCASE.
MESSAGE G_ERROR_TEXT TYPE 'E'.
ENDIF.
Refresh Alv Grid.
PERFORM F_REFRESH_GRID.
ENDMETHOD. "handler_user_command
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Object Ref. Event Class.
DATA: OBJ_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
Include: ZB_ALVOOPS_TEST_PBO
Line:----
Module STATUS_9000 OUTPUT *
Set PF-Status *
MODULE STATUS_9000 OUTPUT.
PF Status
SET PF-STATUS C_STATUS9000 .
SET TITLEBAR C_TITLEBAR .
ENDMODULE. " STATUS_9000 OUTPUT
Module Create_Alvgrid OUTPUT *
Create Or Refresh ALV Grid *
MODULE CREATE_ALVGRID OUTPUT.
PERFORM F_PROCESS_ALV .
PERFORM F_REFRESH_GRID.
ENDMODULE. " create_alvgrid OUTPUT
Include: ZB_ALVOOPS_TEST_PAI
Line:----
Module exit_command INPUT *
Exit Command ( Cancel and Exit ) *
MODULE EXIT_COMMAND INPUT.
LEAVE PROGRAM.
ENDMODULE. " exit_command INPUT
Module user_command_9000 INPUT *
User Command - Process toolbar Events *
MODULE USER_COMMAND_9000 INPUT.
Take an Action based on user Input
G_SAVE_CODE = OK_CODE.
CLEAR OK_CODE.
CASE G_SAVE_CODE.
Back
WHEN C_BACK .
Raise the Confirmation Message When User not saved the data.
IF FG_SAVE = C_YES.
PERFORM F_EXITCHECK CHANGING G_ANSWER .
IF G_ANSWER = C_YES.
PERFORM F_SAVE_DATA.
ELSE.
CLEAR G_SAVE_CODE.
ENDIF.
CLEAR: FG_SAVE.
ENDIF.
LEAVE PROGRAM.
Enter
WHEN C_ENTER.
Execute ( F8 )
WHEN C_EXECUTE .
IF IT_MARA IS INITIAL.
PERFORM F_SELECTMATERIAL.
ENDIF.
Toggle Button
WHEN C_SEL01.
PERFORM F_TOGGLE_SELECTION_SCREEN. " USING ok_code.
SAVE ( CTRL+S )
WHEN C_SAVE.
IF NOT G_MATNR IS INITIAL.
PERFORM F_SAVE_DATA.
CLEAR: G_MATNR.
ENDIF.
New Entry ( CTRL+F1 )
WHEN C_REFRESH.
PERFORM F_REFRESH_DATA.
ENDCASE.
ENDMODULE. " user_command_9000 INPUT
Include: ZB_ALVOOPS_TEST_F01
Line:----
Form f_toggle_selection_screen *
Toggle Function - Hide Selection / Show Selection *
FORM F_TOGGLE_SELECTION_SCREEN.
Toggle Function
IF G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_DYNNR = C_SCREEN_SELECT_NIL.
G_SELECTION_TOGGLE_TEXT = TEXT-902.
ELSE.
G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_TOGGLE_TEXT = TEXT-901.
ENDIF.
ENDFORM. " f_toggle_selection_screen
Form f_initialize
Initialize Screen Number and Text
FORM F_INITIALIZE .
Initialize Screen Number
G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_TOGGLE_TEXT = TEXT-901.
ENDFORM. "f_initialize
Form f_selectmaterial *
FORM F_SELECTMATERIAL .
Select the data from Mara Table
SELECT A~MATNR
A~VPSTA
A~MTART
A~MBRSH
A~MATKL
A~BISMT
A~MEINS
A~BSTME
A~BRGEW
B~MAKTX
INTO TABLE IT_MARA
FROM MARA AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR
WHERE A~MATNR IN S_MATNR
AND A~MTART IN S_MTART
AND B~SPRAS = 'EN'.
IF SY-SUBRC = 0.
FG_REFRESH = C_TRUE.
FG_SAVE = C_YES .
G_MATNR = C_TRUE.
LOOP AT IT_MARA INTO WA_MARA WHERE BRGEW >= 200.
WA_MARA-ROWCOLOR = 'C310'.
MODIFY IT_MARA FROM WA_MARA.
ENDLOOP.
ELSE.
MESSAGE 'No data Found' TYPE 'E'.
ENDIF.
ENDFORM. " f_selectmaterial
Form f_initialize_grid *
Initialize Field Catalog. *
FORM F_INITIALIZE_GRID .
field catalog
PERFORM F_ATTRFCAT USING :
'MATNR' '1' '0' TEXT-005 '15' '0' 'X' ' ' ' ',
'VPSTA' '1' '1' TEXT-006 '15' '0' 'X' ' ' ' ',
'MTART' '1' '2' TEXT-007 '15' '0' ' ' ' ' ' ',
'MBRSH' '1' '3' TEXT-008 '15' '0' ' ' ' ' ' ',
'MATKL' '1' '4' TEXT-009 '15' '0' ' ' 'X' ' ',
'BISMT' '1' '5' TEXT-010 '15' '0' ' ' ' ' ' ',
'MEINS' '1' '6' TEXT-011 '15' '0' ' ' ' ' ' ',
'BSTME' '1' '7' TEXT-012 '15' '0' ' ' ' ' ' ',
'MAKTX' '1' '8' TEXT-013 '15' '0' ' ' ' ' 'C711',
'BRGEW' '1' '9' TEXT-014 '15' '0' ' ' ' ' ' '.
Set Editable Fields in ALV.
PERFORM F_SETEDIT_FIELDS CHANGING IT_FIELDCAT.
ENDFORM. "f_initialize_grid
Form f_setedit_fields *
Set Editable Fields in ALV *
C_IT_FIELDCAT <-- Field Catalog *
FORM F_SETEDIT_FIELDS CHANGING C_IT_FIELDCAT TYPE LVC_T_FCAT.
Local Variable Declaration.
DATA: LS_FIELDCAT LIKE LINE OF C_IT_FIELDCAT. " Field Catalog
Create Editable Fields.
LOOP AT C_IT_FIELDCAT INTO LS_FIELDCAT.
CASE LS_FIELDCAT-FIELDNAME.
WHEN 'BRGEW'.
LS_FIELDCAT-EDIT = C_TRUE.
WHEN 'MAKTX'.
LS_FIELDCAT-EDIT = C_TRUE.
ENDCASE.
MODIFY C_IT_FIELDCAT FROM LS_FIELDCAT.
ENDLOOP.
ENDFORM. " f_setedit_fields
Form f_attrfcat *
Update Field Catalog Internal Table *
U_FIELDNAME --> Field Name *
U_ROW_POS --> Row Position *
U_COL_POS --> Column Position *
U_SELTEXT_L --> Display Column Heading *
U_OUTPUTLEN --> Heading Output Length *
U_DECIMALS_OUT --> Number of decimal places in output *
U_KEY --> Key in ALV Display *
U_FIX --> Existence of fixed values *
FORM F_ATTRFCAT USING
U_FIELDNAME TYPE SLIS_FIELDNAME
U_ROW_POS TYPE SYCUROW
U_COL_POS TYPE SYCUCOL
U_SELTEXT_L TYPE SCRTEXT_L
U_OUTPUTLEN TYPE OUTPUTLEN
U_DECIMALS_OUT TYPE CHAR1
U_KEY TYPE CHAR1
U_FIX TYPE VALEXI
U_COL_COLOR TYPE LVC_EMPHSZ.
Update field catalog.
WA_FIELDCAT-FIELDNAME = U_FIELDNAME.
WA_FIELDCAT-ROW_POS = U_ROW_POS.
WA_FIELDCAT-COL_POS = U_COL_POS.
WA_FIELDCAT-COLTEXT = U_SELTEXT_L.
WA_FIELDCAT-SELTEXT = U_SELTEXT_L.
WA_FIELDCAT-OUTPUTLEN = U_OUTPUTLEN.
WA_FIELDCAT-DECIMALS_O = U_DECIMALS_OUT.
WA_FIELDCAT-KEY = U_KEY.
WA_FIELDCAT-VALEXI = U_FIX.
WA_FIELDCAT-EMPHASIZE = U_COL_COLOR.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "ATTR_FCAT
Form f_refresh_data *
Clear All the objects used in the program ( Data Related ) *
FORM F_REFRESH_DATA .
Clear All the Objects Used in Our Program.
CLEAR: S_MATNR ,
S_MTART ,
IT_MARA ,
OK_CODE ,
FG_REFRESH ,
FG_SAVE ,
G_SAVE_CODE ,
G_MATNR .
FREE: S_MATNR ,
S_MTART ,
IT_MARA ,
OK_CODE ,
FG_REFRESH ,
FG_SAVE ,
G_SAVE_CODE ,
G_MATNR .
Refresh Alv.
FG_REFRESH = C_TRUE.
ENDFORM. " f_refresh_data
Form f_process_alv *
1. Create Custom Container *
2. Create ALV Grid *
3. Exclude Standard Functions *
4. Display the ALV *
5. Register the Events. *
FORM F_PROCESS_ALV .
Display ALV
Custom Container
IF OBJ_CUST_CONTAINER IS INITIAL.
CREATE OBJECT OBJ_CUST_CONTAINER
EXPORTING
CONTAINER_NAME = C_ISSUE_CONTAINER.
ALV Grid
IF OBJ_CUST_GRID IS INITIAL.
CREATE OBJECT OBJ_CUST_GRID
EXPORTING
I_PARENT = OBJ_CUST_CONTAINER.
ENDIF.
Exclude Standard Functions
PERFORM F_EXCLUDETOOLBAR USING OBJ_CUST_GRID
CHANGING IT_EXCLUDE.
Layout.
WA_LAYOUT-CWIDTH_OPT = C_TRUE.
WA_LAYOUT-INFO_FNAME = 'ROWCOLOR'.
ALV Grid Display
CALL METHOD OBJ_CUST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_TOOLBAR_EXCLUDING = IT_EXCLUDE
I_SAVE = C_ALV_SAVE
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT[]
IT_OUTTAB = IT_MARA.
ENDIF.
Register Editable ALV Events
CALL METHOD OBJ_CUST_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
EXCEPTIONS
ERROR = 1
OTHERS = 2.
*Create Object for Custom Event Handler Class if the ref. object is
*initial.
IF OBJ_EVENT_HANDLER IS INITIAL.
CREATE OBJECT OBJ_EVENT_HANDLER.
ENDIF.
Register Events
SET HANDLER: OBJ_EVENT_HANDLER->HANDLER_TOOLBAR FOR
OBJ_CUST_GRID,
OBJ_EVENT_HANDLER->HANDLER_USER_COMMAND FOR
OBJ_CUST_GRID.
Set Toolbar
CALL METHOD OBJ_CUST_GRID->SET_TOOLBAR_INTERACTIVE.
ENDFORM. " f_process_alv
Form f_excludetoolbar *
Exclude Standard Functions from ALV *
U_OBJ_CUST_GRID --> Instant for CL_GUI_ALV_GRID *
C_IT_EXCLUDE <-- Internal table for Exclude *
FORM F_EXCLUDETOOLBAR USING U_OBJ_CUST_GRID TYPE REF TO CL_GUI_ALV_GRID
CHANGING C_IT_EXCLUDE TYPE UI_FUNCTIONS.
Exclude Standard Functions
CLEAR: C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_CHECK TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_REFRESH TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_COPY TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_COPY_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_CUT TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_DELETE_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_APPEND_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_INSERT_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_MOVE_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_PASTE TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_PASTE_NEW_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_UNDO TO C_IT_EXCLUDE.
ENDFORM. " f_excludetoolbar
Form f_create_returnrequest *
Create Return Request based on the Work container ( ALV Grid Data) *
FORM F_CREATE_RETURNREQUEST.
Message to save
ENDFORM. " f_create_returnrequest
Form f_add_mediaissue *
Create New Media Issue if the user click 'ADD ISSUE' Button. *
1. Get the Input From User *
2. Get Total Delivery and Return Quantity *
3. Append to Final internal table *
FORM F_ADD_MEDIAISSUE .
Local Variable Declaration.
MESSAGE 'Add Button Clicked' TYPE 'I'.
ENDFORM. " f_add_mediaissue
Form f_refresh_grid *
Refresh ALV Grid *
FORM F_REFRESH_GRID .
Refresh ALV Grid.
IF FG_REFRESH IS NOT INITIAL.
CALL METHOD OBJ_CUST_GRID->REFRESH_TABLE_DISPLAY.
CLEAR: FG_REFRESH.
ENDIF.
ENDFORM. " f_refresh_grid
Form f_getcollectissue *
FORM F_GETCOLLECTISSUE .
Collection Plan Data
ENDFORM. " f_getcollectissue
Form f_perpare_final *
FORM F_PERPARE_FINAL .
Perpare Final Internal table
ENDFORM. " f_perpare_final
Form f_validate_data *
FORM F_VALIDATE_DATA.
Message if any data validation.
ENDFORM. " f_validate_data
Form f_modify_final *
Update Actual Delivery Qty and Return Qty in Final Internal table *
Form f_save_data *
Save the Data When User Click 'Save' Button *
FORM F_SAVE_DATA .
Message
MESSAGE 'Save Button Clicked' TYPE 'I'.
ENDFORM. "f_save_data
Form f_exitcheck *
When User Exit from the Transaction then Raise Confirmation message*
C_ANSWER <-- OK or Cancel. *
FORM F_EXITCHECK CHANGING C_ANSWER TYPE CHAR1.
Security Check.
C_ANSWER = C_CANCEL.
CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'
EXPORTING
TITEL = TEXT-039
IMPORTING
ANSWER = C_ANSWER.
ENDFORM. "f_exitcheck
Screen Numer : 9000
Line:------
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
CALL SUBSCREEN: SELECTIONSCREEN INCLUDING SY-CPROG G_SELECTION_DYNNR.
MODULE CREATE_ALVGRID.
PROCESS AFTER INPUT.
MODULE EXIT_COMMAND AT EXIT-COMMAND.
CALL SUBSCREEN: SELECTIONSCREEN.
MODULE USER_COMMAND_9000.
pls reward if it is useful -
Ho to find script and the related print program for print preview of PO
Hi All,
We are getting some text output on the print preview of a purchase order.
How can we determine the driver script and the corresponding print program for this.
Can you please guide on this.
Thanks in advance.
Regards,
SanjeetU Can check Driver program and form related to that program table is TNAPPR
Goto NACE t.code
Selct Application ---> click on output types
then u wil get one window there select proper output type and
double click on processing routines u wil get form name and related driver program name also
Plz try this....
Edited by: Upender Verma on Feb 9, 2009 1:33 PM
Edited by: Upender Verma on Feb 9, 2009 1:37 PM -
The interface you are trying to use is related to a logical schema that no
"The interface you are trying to use is related to a logical schema that no longer exists"
I'm facing this error when importing a project on Designer connect to a new work repository.
I have an TEST Data Integrator environment and now I need to move objects already created to a new DEV environment. I've created a new master and work repository with distinct ID's according note https://metalink.oracle.com/metalink/plsql/f?p=130:14:4335668333625114484::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,423815.1,1,1,1,helvetica
Any ideas?
ThanksHi,
Nothing occurs. My steps:
1) Export Master Repository from 1st environment (topoloy -> export master repository)
2) Create Master Repository on 2nd environment (through repcreate.bat)
3) Export Topology (1st environment)
4) Export all projects (1st environment)
5) Import Topology (2nd environemtn) ----> com.sunopsis.core.n: This import action has been cancelled because it could damage your repository (problem with the identifier sequences)
Is this sequence of operations correct?
Thanks -
Specify program logic at runtime
Hi,
I have this requirement where the program logic is specified at runtime. My class is fairly complete except that few variables are to be created and set at runtime. Also I need to evaluate an expression made up from these created variables.
Any suggestions ?
In case anyone is thinking whats the need for this - I am writing a translator that is going to translate a program written in some language say 'L' to Java. One way is I can output Java code and compile and run it. But this leaves me with the situation that the users of my application have Java compiler (I can't assume that). Other way is do runtime programming - create required variables, expressions on the fly and evaluate them at runtime.
Thanks,
Tarantasingh wrote:
I was looking for some framework or at least a design pattern hmmm,.. Strategy ? -
Program/Logic behind the Copy functionality in SE38 Transaction
Hi,
In SE38 by using the copy option, Program along with sub-objects can be copied to another object.
Please let me know the Program/Logic behind that functionality.
Also let me know is there any option in SAP to copy program from one system to another system.
Thanks,
Madhuri.Hi Madhuri
This is tha Program logic behind copying object thru se38
where p_operation would have the value 'COPY'' in it.
DATA: l_request TYPE REF TO cl_wb_request,
l_wb_todo_request TYPE REF TO cl_wb_request,
l_object_name TYPE seu_objkey,
l_object_type TYPE seu_objtyp,
l_program_state TYPE REF TO cl_wb_program_state.
IF trdir-subc = 'I'.
l_object_type = swbm_c_type_prg_include.
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = space
p_key_component2 = rs38m-programm
p_external_id = l_object_type
RECEIVING
p_key = l_object_name.
ELSE.
l_object_type = swbm_c_type_prg_source.
l_object_name = rs38m-programm.
ENDIF.
CREATE OBJECT l_program_state.
CREATE OBJECT l_request
EXPORTING p_object_type = l_object_type
p_object_name = l_object_name
p_operation = p_operation
p_object_state = l_program_state .
CALL METHOD
wb_pgeditor_initial_screen->mngr->request_tool_access
EXPORTING
p_wb_request = l_request
IMPORTING
p_wb_todo_request = l_wb_todo_request
EXCEPTIONS
action_cancelled = 1
no_tool_found = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
EXIT.
ENDIF. -
How to show relation attribute on logical model
Hi.
How to show child entity relation attributes on logical model?
Entity properties attribute list contains relation attributes, LM dont show they.
I have model with several subviews. I need to show some entity without related entities but need to save "semantic" of relations on this subview. When relation attributes does not visible - no information about invisible relations on this subview.
I can create my own visible attribute like "reference to customer" to make sense the relation with entity "Customer". This case problem is relation attribute presents in entity implicitly and relation model have 2 attribute - my own and generated FK column.
In logical model i can`t replace child table relation attribute to my own "visible" attribute.
In relational model i should redefine FK manually. Transformation script is posible but very odd way.
Any advice appreciated.I am confused.
I think the legacy Oracle Designer Barker notation could show reation attributes optional or by default, int`t it?
Thanks a lot anyway. -
Programming Logic required for pulling the records for past month /week
Hi All
I need help in the SQL programming logic.
Oracle Database Version: 10.2.0.3.0
Requirement
In a data warehouse environment, I need to programme for weekly and monthly automated batch jobs to insert the data from Data_tbl to Reporting_tbl for generating reports. Tables descriptions are given below.
Table1 - Data_tbl (Source table –this table gets updated everyday).
Record_dt first_name last_name
Table2 - Reporting_tbl_(Target table)
Cycle_dt first_name last_name
1. Monthly Report
In the SQL Query, I have where clause condition—
Where Record_dt >=’01-nov-08’ and record_dt<=’30-nov-08’
Using the above condition in development, I am pulling the data from source table for the past month data. This will be repeated every month and it should be automated.
i.e., if I run this report any time in dec 2008, it should pick records of dates from Nov 01st to Nov 30th 2008. if I run this report any time in Jan 2009, it should pick records of dates from Dec 01st to Dec 31st 2008.
Date Values should be assigned for past month. Value of Cycle_dt in target table should be end date of past month like 30-nov-2008, 31-dec-2008.
2. Weekly Report
In the SQL Query, I have where clause condition—
Where Record_dt >=’01-dec-08’ and record_dt<=’07-dec-08’
Here week start day is Monday and end day is Sunday.
If I run the report between Dec 08th to Dec 14th , it should pull records of dates from Dec 01st to Dec 07th 2008.
On Dec 15th, it should pick from Dec 08th to Dec 14th.
Value of Cycle_dt in target table should be end date of past week like 07-Dec-2008, 14-Dec-2008.
Please help me with the logics for both Monthly and Weekly reports.
ThanksHi,
For the monthly report, instead of
Where Record_dt >=’01-nov-08’ and record_dt<=’30-nov-08’say:
Where Record_dt >= TRUNC (ADD_MONTHS (SYSDATE, -1), 'MM')
and record_dt < TRUNC (SYSDATE, 'MM')SYSDATE is the current DATE.
TRUNC (SYSDATE, 'MM') is the beginning of the current month. (Notice the condition above is less than this date, not equal to it.)
ADD_MONTHS (STSDATE, -1) is a date exactly one month ago, therefore it is in the previous month.
For the weekly report, instead of:
Where Record_dt >=’01-dec-08’ and record_dt<=’07-dec-08’say
Where Record_dt >= TRUNC (SYSDATE - 7, 'IW')
and record_dt < TRUNC (SYSDATE, 'IW')TRUNC (dt, 'IW') is the beginning of the ISO week (Monday-Sunday) that contains dt. Again, notice the end condition is strictly less than the beginning of the current week. -
hi, me havin a very funny prob w one of my mtd. here's a mtd from my bean class.
public boolean checkForEvent (String searchdate) {
boolean hasEvent = true;
try {
// This is the sql statement to modify.
sql = "select * from event where eventstart <= to_date('" +
searchdate + "','dd-mon-yy') and eventend >= to_date('" +
searchdate + "', 'dd-mon-yy') and eventoption = 'yes' order by eventname asc";
stmt = conn.createStatement ();
rs = stmt.executeQuery (sql);
if(rs.next())
hasEvent = true;
else
hasEvent = false;
rs.close ();
} // end try
catch (SQLException e) {}
catch (Exception exp) {}
return hasEvent;
} // end method
the thing i dun understand is that my program will return whatever boolean i initialise hasEvent to, regardless of what goes on inside the resultset. i'm quite sure that it's not problem of database or the if-else part. it just seems like the program dun enter the if-else condition statement. i have debugged many many times but still same old prob. any1 has any idea wat is wrong with my program logic?thksLooks like your getting some exceptions.
Try to see that by putting some print statements in your catch blocks. -
Integration of PLC(programming logic unit) in SAP
i'm facing problem with this, our client is using PLC (programming logic unit) for there manufacturing ,so with out third part tool how can we integrate in SAP plz any one can help
kishore.
i am just throwing ideas now, its impossible to debug over forum.
go ahead and just check all switches between qa and prod in OOAC, confirm they are all the same,
check OOSB - check that the user profile is in both environments, with same dates, and eval paths (display objects).
DFCON = 1 means Deny 99999999, but Evaluate Organizational Unit (if available). Check if there are any differences in IT0001 of the org unit ids, in production perphas Org unit ID is not filled on the record where position is = 99999999.
in general your team should review this link: http://help.sap.com/saphelp_47x200/helpdata/en/56/db5bc71a64c94f9f2e3cb63e14c867/content.htm
review orgpd switch as well:
http://help.sap.com/saphelp_47x200/helpdata/en/c7/4aba3b3bf00152e10000000a114084/content.htm
review how org key works (different than org ID previously mentioned):
http://help.sap.com/saphelp_47x200/helpdata/en/7f/1a7d3c8015d10ee10000000a11405a/frameset.htm
run this in both qa and production. check transaction oosb after as well.
1) Call program RHBAUS02 for uploading Table T77UU and enter users.
2) Call program RHBAUUS00 for generating an index for structural authorization profile -
I want help in one programming logic.For that I make small example ,so that can explain clearly.
public class Mainclass //(situated in package view)
public s0,s1;
public void runFunction()
...some coding and proceedings
s0="Hi";s1"Hello";
......some coding
public MainRunner
public static void main(String a[])
Mainclass m=new Mainclass();
m.runFunction();
public MainUser (situated in package Master)
public static void main(String a[])
Mainclass m=new Mainclass();
System.out.println("S0:"+s0+" S1:"+s1); //should print S0:Hi S1:Hello, but printing S0:null S1:null
In this ,I first run the MainRunner and then MainUser after compiling the classes and expect that print command of MainUser would give me -S0:Hi S1:Hello as result ,but it is yielding the null values for s0 & s1.
What should I do in this to get hi for s0 and hello for s1.hi friend, plz follow the code. I think this code may be suitable for u r requirements...
class MainUser
public String s0,s1;
MainUser()//Here i am using Constructor
s0="Hi";s1="Hello";
public class C extends MainUser
public static void main(String a[])
MainUser m=new MainUser();
System.out.println("S0:"+m.s0+" S1:"+m.s1);
(OR)
class MainUser
static String s0,s1;//Here i am declaring variables as Static
public void runFunction()
s0="Hi";s1="Hello";
class B extends MainUser
public B()//Contructor
MainUser m=new MainUser();
m.runFunction();
public class C extends B
public static void main(String a[])
B b=new B();//when i am creating new Object b then it will call B constructor
System.out.println("S0:"+b.s0+" S1:"+b.s1);
byeeeee -
Adobe form related example programs
hi
can i get few adobe form related example programs.
some standard predefined programs for reference.
it's urgent
regards
sumanU CAN CHECK WITH BC480* I RECENTLY RECIEVED TRAINING FROM SAP LABS
SO KINDLY CHECK THEM
REGARDS
DEVANAND -
Forms and related pritn programs
Hi,
I wanted to know the related forms and print programs for the below -
Sales Order (Order Acknowledgment)
Delivery Creation (Packing Slip)
Invoice
Credit Memo
Also find out the related print programs and forms.
Thankshi deepthi,
document form name program
sales order RVORDER01 RVADOR01
Delivery creation LE_SHP_DELNOTE(smart form) RLE_DELNOTE
Invoice LB_BIL_INVOICE(smart form) RLB_INVOICE
You can find the above forms in system by going into
NACE->choose V1 OR V2 OR V3 (RESPECTIVELY ) -> CLICK OUTPUT TYPES ->
choose BA00 OR LD00 OR RD00 respectively -> click form routines.
Thanks,
Vamshi -
ABAP Report Program Logical Database PNP
I have a ABAP program using the logical database PNP. The report is config to run on MSS using EP. I have added code to capture the Org Unit when it is pass to the program from MSS. My issue is how do i capture the org unit value that is passed to the program. I have added code to capture field pnporgeh in the START OF SELECTION event. This works great if you are running the program from R3, but none of my edit checking against field pnporgeh works.
Hi John,
I am also having same trouble where in i have added a new custom(Z) report in the MSS ->My Staff -> Reporting under report category -> Time Management (MSS). I am not able to find how the value of org unit which is selected on portal screen is passed to report in R/3 which is using PNP logical db.
I tested in debugging but selection screen parameter PNPORGEH contains nothing.
Many Thanks in advance for the help.
Edited by: Ankit Kashyap on Nov 17, 2010 12:40 PM
Maybe you are looking for
-
How do I speed up Lightroom on my new Mac Pro (2013)?
I have tried everything suggested in the forums like running imports in parallel, etc., and all my data is on the super fast built-in PCI-Express SSD of the Mac Pro. However, I have numerous speed problems with Lightroom 5.3 (latest version) when imp
-
Auto-Suggest feature in Combo-box LOV is not displaying non-unique values
Hi, I have an auto-suggest feature implementation on a combo-box lov that displays the name and email-id of a list of people. There are non-unique names in the back-end, for example : Abraham Mason [email protected] Abraham Mason [email protected] Bu
-
Contacts gone from Backup Assistant
My girlfriend's old beloved phone is currently swimming at the bottom of the Charles River in Boston. We just got a new phone today (LG Extravert) but when the lady at the store tried to get her contacts from the backup assistant only 5 showed up. We
-
Is there anyone with CS4 that could convert my CS5 idml file to inx so I can open in CS3?
Is there anyone with CS4 that could convert my CS5 idml file to inx so I can open in CS3? My school upgraded to CS5 and now I can't work on documents on my own computer at home. I want to work on a particular project at home but need it converted I
-
Updating an old classic program to OS 10.4
I am trying to help my sister, who is very resistant to change. She has been using "Easy Grade Pro" for years, running it through the classic environment. But she was forced to upgrade her computer and printer, and is now having problems printing fro