Programming logic
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
Similar Messages
-
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. -
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. -
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 -
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 -
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 -
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 -
Programming logic, passing data from a page to another
Hi,
I just began with developing with APEX 4.1.1, and I think I don't get how I should use it efficiently, I am more used to C-like programming.
I have a table which contains the state of some electricity meters taken at some non-regularly spaced dates. I want to make a chart of the electricity consumption, e.g for each month. This (I think) implies that the application must do that (I used this logic for the same application made with php and sqlite and it worked):
- User chooses a meter
- Application tells him the available range of dates and the mean interval between measurements
- User chooses the range of dates and the interval
- Application verifies that the range of dates is valid (not outside the real data)
- Interpolate the state of the meters at the requested regular interval
- Calculate the consumption for each interval (simply a difference)
- Draw the chart
For now, I created some procedures which should pass a custom data type containing all the meta-data about the chart and a PL/SQL table containing the actual data to be charted, but I'm stuck at the point of interacting with the user (meaning writing the output of the procedures on a page and passing them to the next procedure and also charting that pl/sql table).
Maybe should I create a temporary table ? But of what I read, this is a "real" table stored on the disk, and I just need this data once (and it is a small dataset, at most 20 points or so) for drawing a chart. This table should also be specific to the chart currently being created, it could happen that the same user or different users make multiple charts at the same time (like in two firefox tabs).
I hope my post is not too confused..
Ben940065 wrote:
Hi,
I just began with developing with APEX 4.1.1, and I think I don't get how I should use it efficiently, I am more used to C-like programming.Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "940065".
APEX is intended for the development of database centric applications. It's a physical implementation of Tom Kyte's philosophy of database application development—possibly replacing Java with JavaScript ;-) .
To use it efficiently you need to stop thinking procedurally in C-like terms and think in terms of the set operations that SQL uses effectively.
I have a table which contains the state of some electricity meters taken at some non-regularly spaced dates. I want to make a chart of the electricity consumption, e.g for each month. This (I think) implies that the application must do that (I used this logic for the same application made with php and sqlite and it worked):
- User chooses a meter
- Application tells him the available range of dates and the mean interval between measurements
- User chooses the range of dates and the interval
- Application verifies that the range of dates is valid (not outside the real data)
- Interpolate the state of the meters at the requested regular interval
- Calculate the consumption for each interval (simply a difference)
- Draw the chart
For now, I created some procedures which should pass a custom data type containing all the meta-data about the chart and a PL/SQL table containing the actual data to be charted,
but I'm stuck at the point of interacting with the user (meaning writing the output of the procedures on a page and passing them to the next procedure and also charting that pl/sql table).It seems that you don't really get APEX yet: have you read the introductory documentation and taken the <i>Oracle® Database 2 Day + Application Express Developer's Guide</i> tutorial in order to understand basic APEX techniques and terminology?
You should be aiming to collect and validate the required parameters in APEX session state values and use the built-in charting capability with SQL data sources that use these parameter values in query predicates.
If you really can't generate the chart series from queries run on the original table, generate the chart data using an APEX collection rather than a "PL/SQL table" (preferred terminology is "collection type", but it's even better to specifically say "associative array", "nested table" or "varying array") or temporary database table.
Maybe should I create a temporary table ? But of what I read, this is a "real" table stored on the disk, and I just need this data once (and it is a small dataset, at most 20 points or so) for drawing a chart. This table should also be specific to the chart currently being created, it could happen that the same user or different users make multiple charts at the same time (like in two firefox tabs).Temporary tables are rarely required in any Oracle application, but standard Oracle Global Temporary Tables are database-session specific and so have no concurrency issues. However there are issues when using them in APEX, so APEX collections are the preferred method for temporary, session-based storage. -
Hr programming - logical database - macro
Hi everyone !
I use pnp logical database.
Now how the program familiar the macro RP-PROVIDE-FROM-FIRST
from table trmac ? ?
i know that macro can be familiar from the program between lines:
define .......
end-of-definition.
someone can explain to me ?Hi
See this sample program for using the LDB PNP and the MAcros
report zporgr0030
line-size 193
line-count 60(1)
no standard page heading
message-id zndc.
Database Tables
tables: pernr, " Logical PNP
t001p, " Personnel Subarea
t005t, " Country Descriptions
t500p, " Personnel Area
t501, " Employee Group
t503k, " Employee Subgroup
csks, " Cost Centers
cskt, " Cost Center Texts
t513c, " Job (Previous) Texts
t513s, " Job Titles
t517t, " Edn Est.Text
t518b, " Discipline Text
t519t, " Certificate Text
t528t, " Positions Texts
t538t, " Unit Text
pa0003. " Payroll Status
infotypes:
0000, " Actions
0001, " Organizational Assignment
0002, " Personal Data
0007, " Planned working time
0008, " Payroll Data
0022, " Education Data
0023, " Previous Employer data
0025, " Performance Appraisal Data
0041, " Date Spcifications
2001. " Absences
Declaration of Internal Tables
Internal Table for Personal Data
data: begin of pers_tab occurs 0,
pernr like pa0001-pernr, " Personal Number
ename like pa0001-ename, " Employee Name
trfgr like pa0008-trfgr, " Grade
natio like pa0002-natio, " Nationality
hdate like pa0041-dat01, " Hire Date
gbdat like pa0002-gbdat, " Birth Date
plans like pa0001-plans, " Position
werks like pa0001-werks, " Pers.Area
kostl like pa0001-kostl, " Cost Center
ctext(40), " Cost Center Text
ptext(25), " Position Text
ntext(15), " Nation Text
name1(23), " Location
end of pers_tab.
Internal Table for Payroll Data
data: begin of pay_tab occurs 0,
pernr like pa0008-pernr, " Personal Number
waers like pbwla-waers, " Grade
basic like pa0008-bet01, " Basic Pay
hra_allow like pa0008-bet01, " Housing Allowance
sup_allow like pa0008-bet01, " Supp. Allowance
soc_allow like pa0008-bet01, " Social Allowance
chl_allow like pa0008-bet01, " Child Allowance
fix_allow like pa0008-bet01, " Fixed Overtime
ra_allow like pa0008-bet01, " RA Allowance
per_allow like pa0008-bet01, " Perform. Allowance
pen_allow like pa0008-bet01, " Pension Allowance
oth_allow like pa0008-bet01, " Other Allowances
tot_allow like pa0008-bet01, " Total Allowances
end of pay_tab.
Internal Table for Educational Data
data: begin of edn_tab occurs 0,
pernr like pa0022-pernr, " Personal Number
ausbi like pa0022-ausbi, " Discipline Name
slart like pa0022-slart, " Edn Establishment
insti like pa0022-insti, " Institute
sland like pa0022-sland, " Country
slabs like pa0022-slabs, " Certificate
anzkl like pa0022-anzkl, " Duration
anzeh like pa0022-anzeh, " Unit for Duration
atext like t518b-atext, " Discipline Text
stext like t517t-stext, " Edn Est.Text
landx like t005t-landx, " Country Text
ctext like t519t-stext, " Certificate Text
etext like t538t-etext, " Unit Text
end of edn_tab.
Internal Table for Previous Employment Data
data: begin of pemp_tab occurs 0,
pernr like pa0023-pernr, " Personal Number
arbgb like pa0023-arbgb, " Previous Employer
begda like pa0023-begda, " Start Date
endda like pa0023-endda, " End Date
taete like pa0023-taete, " Last Position
land1 like pa0023-land1, " Country
stltx like t513s-stltx, " Position Text
landx like t005t-landx, " Country Text
end of pemp_tab.
Internal Table for Job History Data
data: begin of job_tab occurs 0,
pernr like pa0001-pernr, " Personal Number
begda like pa0001-begda, " Promotion Date
plans like pa0001-plans, " Position
stell like pa0001-stell, " Job Key
stltx like t513s-stltx, " Job Text
ptext like t528t-plstx, " Position Text
end of job_tab.
Internal Table for Performance Appraisal Data
data: begin of app_tab occurs 0,
pernr like pa0001-pernr, " Personal Number
year(4) type c, " Current Year
appr(35) type c, " C Y Appraisal
year1(4) type c, " Last Year
appr1(35) type c, " Last Year Appraisal
year2(4) type c,
appr2(35) type c,
year3(4) type c,
appr3(35) type c,
year4(4) type c,
appr4(35) type c,
end of app_tab.
Internal Table for Performance Appraisal Data
data: begin of app1_tab occurs 0,
year(4) type c, " Year
appr(35) type c, " Appraisal
end of app1_tab.
Internal Table to get the Payroll Amounts
data wage_tab like pbwla occurs 0 with header line.
Internal table for retreiving Employee Appraisals
data app_in_tab like hrsobid occurs 0 with header line .
data app_out_tab like hrpe_profa occurs 0 with header line .
Declaration of Variables
data : v_year(4) type c,
v_ayear(4) type c,
v_cyear(4) type c,
v_year1(4) type c,
v_year2(4) type c,
v_year3(4) type c,
v_year4(4) type c,
v_year5(4) type c,
v_year6(4) type c,
v_mon(2) type c,
v_date2 like sy-datum,
v_date3 like sy-datum,
v_date like sy-datum,
v_date1 like sy-datum.
Declaration of Constants
constants : c_x type c value 'X', " Sign
c_pernr(8) type n value '00000000', " Pernr
c_p like hrp1007-otype value 'P', " Object Type
c_01 like hrp1001-plvar value '01', " Version
c_val1(2) type c value '31', " Date Type
c_val2(2) type c value '12', " Date Type
c_val like p0041-dar01 value '01', " Date Type
c_1 like pernr-persg value '1', " Emp Group
c_type like hrp1001-otype value 'S', " Object Type
c_date1 like sy-datum value '18000101', " Date
c_date2 like sy-datum value '99991231', " Date
c_lga01 like pa0008-lga01 value '0101', " Wage Type
c_lga02 like pa0008-lga01 value '0102', " Wage Type
c_lga03 like pa0008-lga01 value '0103', " Wage Type
c_lga04 like pa0008-lga01 value '0105', " Wage Type
c_lga05 like pa0008-lga01 value '0109', " Wage Type
c_lga06 like pa0008-lga01 value '0110', " Wage Type
c_lga07 like pa0008-lga01 value '0114', " Wage Type
c_lga08 like pa0008-lga01 value '0116', " Wage Type
c_lga09 like pa0008-lga01 value '0267', " Wage Type
c_kokrs like cskt-kokrs value '1000'. " Controlling Area
Selection Screen
selection-screen begin of block b1 with frame title text-003.
selection-screen begin of line.
selection-screen comment 1(33) text-060.
parameters: r_all radiobutton group rb1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-020.
parameters: r_per radiobutton group rb1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-021.
parameters: r_pay radiobutton group rb1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-022.
parameters: r_edn radiobutton group rb1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-023.
parameters: r_pemp radiobutton group rb1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-024.
parameters: r_job radiobutton group rb1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-025.
parameters: r_app radiobutton group rb1.
selection-screen end of line.
selection-screen end of block b1.
At selection-screen
at selection-screen.
Validate the Selection Screen fields
perform validate_screen.
Start-of-Selection
start-of-selection.
Selection of Period
perform get_period.
Get PERNR from LDB
get pernr.
if pernr-persg eq c_1 or pernr-pernr ne c_pernr.
if r_all eq c_x.
Get the Personal data from PA0001,PA0002, PA0008, PA0041
perform get_pers_data.
Get the Payroll data from PA0008
perform get_pay_data.
Get the Education data from PA0022
perform get_edn_data.
Get the Previous Employment data from PA0023
perform get_pemp_data.
Get the Job History data
perform get_job_data.
Get the Performance Appraisal data
perform get_app_data.
elseif r_per eq c_x.
Get the Personal data from PA0001,PA0002, PA0008, PA0041
perform get_pers_data.
elseif r_pay eq c_x.
Get the Payroll data from PA0008
perform get_pay_data.
elseif r_edn eq c_x.
Get the Education data from PA0022
perform get_edn_data.
elseif r_pemp eq c_x.
Get the Previous Employment data from PA0023
perform get_pemp_data.
elseif r_job eq c_x.
Get the Job History data
perform get_job_data.
elseif r_app eq c_x.
Get the Performance Appraisal data
perform get_app_data.
endif.
endif.
Top-of-page
top-of-page.
Write the Report and Column Headings
perform top_of_page.
End-of-Page
end-of-page.
perform end_of_page.
End-of-Selection
end-of-selection.
Display the Output Report.
perform display_report.
Form-Routines
*& Form validate_screen
Validation of selection Screen fields
form validate_screen.
Validation of Personnel Number
clear pa0003.
if not pnppernr[] is initial.
select pernr
from pa0003 up to 1 rows
into pa0003-pernr
where pernr in pnppernr.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Personnel Number Entered'(001).
endif.
endif.
Validation of Cost Center
clear csks.
if not pnpkostl[] is initial.
select single kostl
into csks-kostl
from csks
where kostl in pnpkostl.
if sy-subrc <> 0.
message e999 with 'Invalid Cost Center'(002).
endif.
endif.
Validation of Personnel Area
clear t500p.
if not pnpwerks[] is initial.
select persa
from t500p up to 1 rows
into t500p-persa
where persa in pnpwerks.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Personnel Area Entered'(004).
endif.
endif.
Validation of Personnel Sub Area
clear t001p.
if not pnpbtrtl[] is initial.
select btrtl
from t001p up to 1 rows
into t001p-btrtl
where btrtl in pnpbtrtl.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Personnel Sub Area Entered'(005).
endif.
endif.
Validation of Employee Group
clear t501.
if not pnppersg[] is initial.
select persg
from t501 up to 1 rows
into t501-persg
where persg in pnppersg.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Employee Group Entered'(006).
endif.
endif.
Validation of Employee Sub Group
clear t503k.
if not pnppersk[] is initial.
select persk
from t503k up to 1 rows
into t503k-persk
where persk in pnppersk.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Employee Sub Group Entered'(007).
endif.
endif.
endform. "validate_screen
*& Form get_period
Get the Correct Period based on Selection screen selection
form get_period.
clear: v_year,v_mon, v_date, v_date1.
v_year = sy-datum+0(4).
v_mon = sy-datum+4(2).
if pnptimr1 = c_x. " Current Date
pnpbegda = sy-datum.
pnpendda = sy-datum.
elseif pnptimr2 = c_x. " Current Month
concatenate v_year v_mon c_val into v_date.
concatenate v_year v_mon c_val1 into v_date1.
pnpbegda = v_date.
pnpendda = v_date1.
elseif pnptimr3 = c_x. " Current Year
concatenate v_year c_val c_val into v_date.
concatenate v_year c_val2 c_val1 into v_date1.
pnpbegda = v_date.
pnpendda = v_date1.
elseif pnptimr4 = c_x. " Upto Today
pnpbegda = c_date1.
pnpendda = sy-datum.
elseif pnptimr5 = c_x. " From Today
pnpbegda = sy-datum.
pnpendda = c_date2.
else.
if ( pnpbegda is initial and pnpendda is initial ).
pnpbegda = c_date1.
pnpendda = c_date2.
elseif pnpbegda is initial and not pnpendda is initial.
pnpbegda = c_date1.
pnpendda = pnpendda.
elseif not ( pnpbegda is initial and pnpendda is initial ).
pnpbegda = pnpbegda.
pnpendda = pnpendda.
endif.
endif.
endform. "get_period
*& Form get_pers_data
Get the Personal Data from PA0001,PA0002,PA0008, PA0041
form get_pers_data.
Get data from Respective Infotypes
rp_provide_from_last p0001 space pnpbegda pnpendda.
rp_provide_from_last p0002 space pnpbegda pnpendda.
rp_provide_from_last p0008 space pnpbegda pnpendda.
rp_provide_from_last p0041 space pnpbegda pnpendda.
pers_tab-pernr = p0001-pernr.
pers_tab-ename = p0001-ename.
pers_tab-werks = p0001-werks.
pers_tab-plans = p0001-plans.
pers_tab-kostl = p0001-kostl.
pers_tab-gbdat = p0002-gbdat.
pers_tab-trfgr = p0008-trfgr.
Get the Engaged Date
read table p0041 with key dar01 = c_val.
if sy-subrc = 0.
pers_tab-hdate = p0041-dat01.
endif.
Get the Cost Center Text
clear cskt-ltext.
select single ltext into cskt-ltext from cskt
where spras = sy-langu and
kokrs = c_kokrs and
kostl = p0001-kostl.
if sy-subrc = 0.
pers_tab-ctext = cskt-ltext.
endif.
Get the Position Text
clear t528t-plstx.
select single plstx into t528t-plstx from t528t
where plans = p0001-plans and
otype = c_type and
sprsl = sy-langu.
if sy-subrc = 0.
pers_tab-ptext = t528t-plstx.
endif.
Get the Nationality
clear t005t-natio.
select single natio into t005t-natio from t005t
where spras = sy-langu and
land1 = p0002-natio.
if sy-subrc = 0.
pers_tab-ntext = t005t-natio.
endif.
Get the Location (Personal Area) Text
clear t500p-name1.
select single name1 into t500p-name1 from t500p
where persa = p0001-werks.
if sy-subrc = 0.
pers_tab-name1 = t500p-name1.
endif.
append pers_tab.
clear pers_tab.
sort pers_tab by pernr.
endform. "get_pers_data
*& Form get_pay_data
Get the Payroll Data from Infotype 0008
form get_pay_data.
Get the Payroll data from Respective Infotypes
rp_provide_from_last p0008 space pnpbegda pnpendda.
pay_tab-pernr = pernr-pernr.
call function 'RP_FILL_WAGE_TYPE_TABLE_EXT'
exporting
appli = 'E'
begda = p0008-begda
endda = p0008-endda
infty = '0008'
objps = ' '
tclas = 'A'
pernr = pernr-pernr
seqnr = ' '
subty = '0 '
dlspl = 'X'
msgflg = ''
nordct = ''
tables
pp0001 = p0001
pp0007 = p0007
pp0008 = p0008
ppbwla = wage_tab
PP0230 =
PP0014 =
PP0015 =
PP0052 =
EXCEPTIONS
ERROR_AT_INDIRECT_EVALUATION = 1
OTHERS = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at wage_tab.
pay_tab-waers = wage_tab-waers.
case wage_tab-lgart.
when c_lga01.
pay_tab-basic = wage_tab-betrg.
when c_lga02.
pay_tab-sup_allow = wage_tab-betrg.
when c_lga03.
pay_tab-hra_allow = wage_tab-betrg.
when c_lga04.
pay_tab-chl_allow = wage_tab-betrg.
when c_lga05.
pay_tab-soc_allow = wage_tab-betrg.
when c_lga06.
pay_tab-fix_allow = wage_tab-betrg.
when c_lga07.
pay_tab-ra_allow = wage_tab-betrg.
when c_lga08.
pay_tab-per_allow = wage_tab-betrg.
when c_lga09.
pay_tab-pen_allow = wage_tab-betrg.
when others.
pay_tab-oth_allow = pay_tab-oth_allow + wage_tab-betrg.
endcase.
pay_tab-tot_allow = pay_tab-basic + pay_tab-sup_allow +
pay_tab-hra_allow + pay_tab-chl_allow +
pay_tab-soc_allow + pay_tab-fix_allow +
pay_tab-ra_allow + pay_tab-per_allow +
pay_tab-oth_allow - pay_tab-pen_allow.
endloop.
append pay_tab.
clear pay_tab.
endform. "get_pay_data
*& Form get_edn_data
Get the Education Data from Infotype 0022
form get_edn_data.
Get the Education data from Respective Infotypes
loop at p0022 where pernr = pernr-pernr.
edn_tab-pernr = pernr-pernr.
edn_tab-ausbi = p0022-ausbi.
edn_tab-slart = p0022-slart.
edn_tab-insti = p0022-insti.
edn_tab-sland = p0022-sland.
edn_tab-slabs = p0022-slabs.
edn_tab-anzkl = p0022-anzkl.
edn_tab-anzeh = p0022-anzeh.
Get the Discipline Text
clear t518b-atext.
select single atext into t518b-atext from t518b
where langu = sy-langu and
ausbi = p0022-ausbi.
if sy-subrc = 0.
edn_tab-atext = t518b-atext.
endif.
Get the Edn Establishment Text
clear t517t-stext.
select single stext into t517t-stext from t517t
where slart = p0022-slart and
sprsl = sy-langu.
if sy-subrc = 0.
edn_tab-stext = t517t-stext.
endif.
Get the Certificate Text
clear t519t-stext.
select single stext into t519t-stext from t519t
where slabs = p0022-slabs and
sprsl = sy-langu.
if sy-subrc = 0.
edn_tab-ctext = t519t-stext.
endif.
Get the Unit Text
clear t538t-etext.
select single etext into t538t-etext from t538t
where zeinh = p0022-anzeh and
sprsl = sy-langu.
if sy-subrc = 0.
edn_tab-etext = t538t-etext.
endif.
Get the Country Description
clear t005t-landx.
select single landx into t005t-landx from t005t
where spras = sy-langu and
land1 = p0022-sland.
if sy-subrc = 0.
edn_tab-landx = t005t-landx.
endif.
append edn_tab.
clear edn_tab.
endloop.
endform. "edn_data
*& Form get_pemp_data
Get the Previous Employment Data from Infotype 0023
form get_pemp_data.
Get the Previous Employment data from Respective Infotypes
loop at p0023 where pernr = pernr-pernr.
pemp_tab-pernr = pernr-pernr.
pemp_tab-arbgb = p0023-arbgb.
pemp_tab-begda = p0023-begda.
pemp_tab-endda = p0023-endda.
pemp_tab-taete = p0023-taete.
pemp_tab-land1 = p0023-land1.
Get the Last Job Text
clear t513c-ltext.
select single ltext into t513c-ltext from t513c
where taete = pemp_tab-taete and
spras = sy-langu.
if sy-subrc = 0.
pemp_tab-stltx = t513c-ltext.
endif.
Get the Country Description
clear t005t-landx.
select single landx into t005t-landx from t005t
where spras = sy-langu and
land1 = pemp_tab-land1.
if sy-subrc = 0.
pemp_tab-landx = t005t-landx.
endif.
append pemp_tab.
clear pemp_tab.
endloop.
sort pemp_tab by pernr.
endform. "pemp_data
*& Form get_job_data
Get the Job History Data from Infotype
form get_job_data.
Get the Job History data from Respective Infotypes
loop at p0001 where pernr = pernr-pernr.
job_tab-pernr = pernr-pernr.
job_tab-begda = p0001-begda.
job_tab-plans = p0001-plans.
job_tab-stell = p0001-stell.
Get the Last Job Text
clear t513s-stltx.
select single stltx into t513s-stltx from t513s
where stell = job_tab-stell and
sprsl = sy-langu.
if sy-subrc = 0.
job_tab-stltx = t513s-stltx.
endif.
Get the Position Text
clear t528t-plstx.
select single plstx into t528t-plstx from t528t
where plans = job_tab-plans and
otype = c_type and
sprsl = sy-langu.
if sy-subrc = 0.
job_tab-ptext = t528t-plstx.
endif.
append job_tab.
clear job_tab.
endloop.
sort job_tab by pernr.
endform. "get_job_data
*& Form get_app_data
Get the Performance Appraisal Data from Infotype
form get_app_data.
clear: v_cyear, v_year1, v_year2, v_year3, v_year4,
v_year5, v_year6, v_ayear, v_date2, v_date3.
v_cyear = sy-datum+0(4) - 1.
v_year1 = v_cyear - 1.
v_year2 = v_cyear - 2.
v_year3 = v_cyear - 3.
v_year4 = v_cyear - 4.
v_year5 = v_cyear - 5.
v_year6 = v_cyear - 6.
concatenate v_cyear c_date2+4(4) into v_date2.
concatenate v_year6 c_date1+4(4) into v_date3.
clear: app_in_tab, app_out_tab.
refresh: app_in_tab, app_out_tab.
app_in_tab-plvar = c_01.
app_in_tab-otype = c_p.
app_in_tab-sobid = pernr-pernr.
append app_in_tab.
Get Appraisals data from Respective Infotypes
call function 'RHPA_APPRAISEES_APP_READ'
exporting
begda = v_date3
endda = v_date2
WITH_STEXT = 'X'
WITH_ADD_INFO = 'X'
tables
appraisees = app_in_tab
appraisals = app_out_tab
exceptions
no_authority = 1
undefined = 2
others = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
sort app_out_tab by sobid vbegd vendd appraisal_adate descending .
delete adjacent duplicates from app_out_tab
comparing sobid vbegd vendd.
loop at app_out_tab where appraisal_histo = 'X' .
condense app_out_tab-appraisal_result.
app1_tab-year = app_out_tab-vendd+0(4).
app1_tab-appr = app_out_tab-appraisal_result_text.
append app1_tab.
clear app1_tab.
endloop.
sort app1_tab by year descending.
loop at app1_tab.
app_tab-pernr = pernr-pernr.
move-corresponding app1_tab to app_tab.
append app_tab.
clear: app1_tab, app_tab.
endloop.
refresh app1_tab.
sort app_tab by pernr.
delete app_tab where year = ' ' and appr = ' ' .
endform. "get_app_data
*& Form top_of_page
Write the Report and Column Headings
form top_of_page.
skip.
format color col_heading on.
if r_all eq c_x.
write: /1(193) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(193) 'Employee Details Report'(066) centered.
elseif r_per eq c_x.
write: /1(193) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(193) 'Employee Details - Personal Data'(010)
centered.
elseif r_pay eq c_x.
write: /1(172) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(172) 'Employee Details - Payroll Data'(027)
centered.
elseif r_edn eq c_x.
write: /1(172) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(172) 'Employee Details - Education Data'(028)
centered.
elseif r_pemp eq c_x.
write: /1(97) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(97) 'Employee Details - Previous Employment Data'(029)
centered.
elseif r_job eq c_x.
write: /1(75) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(75) 'Employee Details - Job History Data'(030)
centered.
elseif r_app eq c_x.
write: /1(192) 'NATIONAL DRILLING COMPANY'(009) centered,
/1(192) 'Employee Details - Performance Appraisal Data'(031)
centered.
endif.
format color off.
if pnptimr1 = c_x. " Current Date
write: /2 'Period From :'(008), sy-datum,
'To:'(019), sy-datum.
elseif pnptimr2 = c_x. " Current Month
write: /2 'Period From :'(008), v_date, 'To:'(019), v_date1.
elseif pnptimr3 = c_x. " Current Year
write: /2 'Period From :'(008), v_date, 'To:'(019), v_date1.
elseif pnptimr4 = c_x. " Upto Today
write: /2 'Period From :'(008), c_date1, 'To:'(019), sy-datum.
elseif pnptimr5 = c_x. " From Today
write: /2 'Period From :'(008), sy-datum, 'To:'(019), c_date2.
else.
if ( pnpbegda is initial and pnpendda is initial ).
write: /2 'Period From :'(008), c_date1, 'To:'(019), c_date2.
elseif pnpbegda is initial and not pnpendda is initial.
write: /2 'Period From :'(008), c_date1, 'To:'(019), pnpendda.
elseif not ( pnpbegda is initial and pnpendda is initial ).
write: /2 'Period From :'(008), pnpbegda,
'To:'(019), pnpendda.
endif.
endif.
if not ( r_pemp eq c_x or r_job eq c_x ).
write: 140 'Report Run Date:'(073), sy-datum.
if not pnpkostl[] is initial.
if pnpkostl-high is initial.
write: /2 'Cost Center :'(074), pnpkostl-low,
125 'Time :'(075), sy-uzeit.
else.
write: /2 'Cost Center From:'(076), pnpkostl-low+7(3),
'To:'(019), pnpkostl-high,
140 'Time :'(075), sy-uzeit.
endif.
else.
write: /140 'Time :'(075), sy-uzeit.
endif.
if not pnppernr[] is initial.
if pnppernr-high is initial.
write: /2 'Personal Number :'(077), pnppernr-low,
140 'User :'(078), sy-uname.
else.
write: /2 'Personal No.From:'(079), pnppernr-low,
'To:'(019), pnppernr-high,
140 'User :'(078), sy-uname.
endif.
else.
write: /140 'User :'(078), sy-uname.
endif.
write: /140 'Page No :'(080), sy-pagno.
else.
write: 48 'Report Run Date:'(073), sy-datum.
if not pnpkostl[] is initial.
if pnpkostl-high is initial.
write: /2 'Cost Center :'(074), pnpkostl-low,
48 'Time :'(075), sy-uzeit.
else.
write: /2 'Cost Center From:'(076), pnpkostl-low+7(3),
'To:'(019), pnpkostl-high,
48 'Time :'(075), sy-uzeit.
endif.
else.
write: /48 'Time :'(075), sy-uzeit.
endif.
if not pnppernr[] is initial.
if pnppernr-high is initial.
write: /2 'Personal Number :'(077), pnppernr-low,
48 'User :'(078), sy-uname.
else.
write: /2 'Personal No.From:'(079), pnppernr-low,
'To:'(019), pnppernr-high,
48 'User :'(078), sy-uname.
endif.
else.
write: /48 'User :'(078), sy-uname.
endif.
write: /48 'Page No :'(080), sy-pagno.
endif.
skip.
if r_per eq c_x.
write /1(193) sy-uline.
format color col_heading on.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(40) 'Name'(012) centered,
53 sy-vline, 54(8) 'Grade'(013) centered,
62 sy-vline, 63(15) 'Nationality'(017) centered,
78 sy-vline, 79(10) 'Eng.Date'(014) centered,
89 sy-vline, 90(10) 'Birth Date'(016) centered,
100 sy-vline,101(25) 'Location'(026) centered,
126 sy-vline,127(25) 'Position'(015) centered,
152 sy-vline,153(40) 'Division'(018) centered,
193 sy-vline.
format color off.
write /1(193) sy-uline.
elseif r_pay eq c_x.
write /1(188) sy-uline.
format color col_heading on.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(15) 'Basic'(033) centered,
28 sy-vline, 29(15) 'Housing Allow.'(034) centered,
44 sy-vline, 45(15) 'Sup.Allow.'(035) centered,
60 sy-vline, 61(15) 'Social Allow.'(036) centered,
76 sy-vline, 77(15) 'Child Allow.'(037) centered,
92 sy-vline, 93(15) 'Fixed Overtime'(038) centered,
108 sy-vline,109(15) 'R.A.Allow.'(041) centered,
124 sy-vline,125(15) 'Perform.Allow.'(039) centered,
140 sy-vline,141(15) 'Pension.Allow.'(059) centered,
156 sy-vline,157(15) 'Others'(040) centered,
172 sy-vline,173(15) 'Total'(042) centered,
188 sy-vline.
format color off.
write /1(188) sy-uline.
elseif r_edn eq c_x.
write /1(172) sy-uline.
format color col_heading on.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(25) 'Discipline'(043) centered,
38 sy-vline, 39(20) 'Edu.Establishment'(044) centered,
59 sy-vline, 60(45) 'Institute'(045) centered,
105 sy-vline,106(15) 'Country'(046) centered,
121 sy-vline,122(30) 'Certificate'(047) centered,
152 sy-vline,153(19) 'Duration of Course'(048) centered,
172 sy-vline.
format color off.
write /1(172) sy-uline.
elseif r_pemp eq c_x.
write /1(97) sy-uline.
format color col_heading on.
write:/1 sy-vline, 12 sy-vline,
33 sy-vline, 34(21) 'Employment Period'(055) centered,
55 sy-vline, 81 sy-vline,
97 sy-vline.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(20) 'Employer'(049) centered,
33 sy-vline, 34(10) 'From'(050) centered,
44 sy-vline, 45(10) 'To'(051) centered,
55 sy-vline, 56(25) 'Last Position'(052) centered,
81 sy-vline, 82(15) 'Country'(053) centered,
97 sy-vline.
format color off.
write /1(97) sy-uline.
elseif r_job eq c_x.
write /1(75) sy-uline.
format color col_heading on.
write:/1 sy-vline,
12 sy-vline,13(10) 'Date of'(054) centered,
23 sy-vline,49 sy-vline,
75 sy-vline.
write:/1 sy-vline,2(10) 'Employee #'(011),
12 sy-vline,13(10) 'Upgrading/'(058) centered,
23 sy-vline,24(25) 'Position'(015) centered,
49 sy-vline,50(25) 'Job'(056) centered,
75 sy-vline.
write:/1 sy-vline, 12 sy-vline,
13(10) 'Promotion'(057) centered,
23 sy-vline, 49 sy-vline,
75 sy-vline.
format color off.
write /1(75) sy-uline.
elseif r_app eq c_x.
format color col_heading on.
write: /1 sy-vline,2(56) sy-uline, 58 sy-vline,
/1 sy-vline, 2(56) text-025 centered color 3, 58 sy-vline.
write /1(58) sy-uline.
format color col_heading on.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(4) 'Year'(067),
17 sy-vline, 18(40) 'Appraisal Text'(068) centered,
58 sy-vline.
format color off.
write /1(58) sy-uline.
endif.
endform. "top_of_page
*& Form end_of_page
Write the Page footers
form end_of_page.
if r_per eq c_x.
write : /(193) sy-uline.
elseif r_pay eq c_x.
write : /(188) sy-uline.
elseif r_edn eq c_x.
write : /(172) sy-uline.
elseif r_pemp eq c_x.
write /1(97) sy-uline.
elseif r_job eq c_x.
write /1(75) sy-uline.
elseif r_app eq c_x.
write /1(217) sy-uline.
endif.
endform. "end_of_page
*& Form Display_report
Write the Report Output
form display_report.
if r_all eq c_x.
if pers_tab[] is initial.
message i999 with
'No Personal Data found'(061).
else.
write: /1 sy-vline,2(51) sy-uline, 53 sy-vline,
/1 sy-vline, 2(50) text-020 centered color 3, 53 sy-vline.
write /1(193) sy-uline.
format color col_heading on.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(40) 'Name'(012) centered,
53 sy-vline, 54(8) 'Grade'(013) centered,
62 sy-vline, 63(15) 'Nationality'(017) centered,
78 sy-vline, 79(10) 'Eng.Date'(014) centered,
89 sy-vline, 90(10) 'Birth Date'(016) centered,
100 sy-vline,101(25) 'Location'(026) centered,
126 sy-vline,127(25) 'Position'(015) centered,
152 sy-vline,153(40) 'Division'(018) centered,
193 sy-vline.
format color off.
write /1(193) sy-uline.
sort pers_tab by pernr.
loop at pers_tab.
format color col_normal.
write:/1 sy-vline, 2(10) pers_tab-pernr,
12 sy-vline, 13(40) pers_tab-ename,
53 sy-vline, 56(6) pers_tab-trfgr,
62 sy-vline, 63(15) pers_tab-ntext,
78 sy-vline, 79(10) pers_tab-hdate,
89 sy-vline, 90(10) pers_tab-gbdat,
100 sy-vline,101(25) pers_tab-name1,
126 sy-vline,127(25) pers_tab-ptext,
152 sy-vline,153(40) pers_tab-ctext,
193 sy-vline.
endloop.
write /1(193) sy-uline.
endif.
skip 3.
if pay_tab[] is initial.
message i999 with
'No Standard Pay Data found'(062).
else.
write: /1 sy-vline,2(42) sy-uline, 44 sy-vline,
/1 sy-vline, 2(42) text-021 centered color 3, 44 sy-vline.
format color col_heading on.
write /1(188) sy-uline.
write:/1 sy-vline, 2(10) 'Employee #'(011),
12 sy-vline, 13(15) 'Basic'(033) centered,
28 sy-vline, 29(15) 'Housing Allow.'(034) centered,
44 sy-vline, 45(15) 'Sup.Allow.'(035) centered,
60 sy-vline, 61(15) 'Social Allow.'(036) centered,
76 sy-vline, 77(15) 'Child Allow.'(037) centered,
92 sy-vline, 93(15) 'Fixed Overtime'(038) centered,
108 sy-vline,109(15) 'R.A.Allow.'(041) centered,
124 sy-vline,125(15) 'Perform.Allow.'(039) centered,
140 sy-vline,141(15) 'Pension.Allow.'(059) centered,
156 sy-vline,157(15) 'Others'(040) centered,
172 sy-vline,173(15) 'Total'(042) centered,
188 sy-vline.
format color off.
write /1(188) sy-uline.
sort pay_tab by pernr.
loop at pay_tab.
format color col_normal.
write:/1 sy-vline, 2(10) pay_tab-pernr,
12 sy-vline,
13(15) pay_tab-basic currency pay_tab-waers no-zero,
28 sy-vline,
29(15) pay_tab-hra_allow currency pay_tab-waers no-zero,
44 sy-vline,
45(15) pay_tab-sup_allow currency pay_tab-waers no-zero,
60 sy-vline,
61(15) pay_tab-soc_allow currency pay_tab-waers no-zero,
76 sy-vline,
77(15) pay_tab-chl_allow currency pay_tab-waers no-zero,
92 sy-vline,
93(15) pay_tab-fix_allow currency pay_tab-waers no-zero,
108 sy-vline,
109(15) pay_tab-ra_allow currency pay_tab-waers no-zero,
124 sy-vline,
125(15) pay_tab-per_allow currency pay_tab-waers no-zero,
140 sy-vline.
pay_tab-pen_allow = pay_tab-pen_allow * -1.
write: 141(15) pay_tab-pen_allow currency pay_tab-waers no-zero,
156 sy-vline,
157(15) pay_tab-oth_allow currency pay_tab-waers no-zero,
172 sy-vline,
173(15) pay_tab-tot_allow currency pay_tab-waers no-zero,
188 sy-vline.
endloop.
write /1(188) sy-uline.
endif.
skip 3.
if edn_tab[] is in -
Script Print Program Logic.......
Hi All
This is the print program of my script, i am not getting the logic..can any body help me with this..
INCLUDE rvadtabl.
TABLES: vbuk, "Vertriebsbeleg (Kopf)-Status
vbco3, "Schlüsselfelder Vertriebsbeleg
vbpla, "Allgemeine Transportdaten
vbplk, "Versandelement Kopfdaten
vbplp, "Versandelement Positionsdaten
vbpls, "Verpackung Summendaten
vekp,
adrc,
vbfa. "DEVK937590
TABLES: vbkd. "DEVK942078
*DEVK9A0EB4 - Add define
TYPES:
ty_itcsy TYPE STANDARD TABLE OF itcsy.
start of change for DEVK937590
DATA: BEGIN OF t_deliveryflow OCCURS 0, "VBFA delivery flow
vbeln LIKE vbfa-vbeln, "Subsequent sales and distribu
END OF t_deliveryflow.
DATA: v_lin TYPE i.
CONSTANTS: c_x(1) TYPE c VALUE 'X'.
end of change for DEVK937590
DATA: BEGIN OF xvbplk OCCURS 10.
INCLUDE STRUCTURE vbplk.
DATA: END OF xvbplk.
DATA : BEGIN OF vbdkl OCCURS 10.
INCLUDE STRUCTURE vbdkl.
DATA : END OF vbdkl.
DATA: BEGIN OF tvbdpl OCCURS 0. "Internal table for items
INCLUDE STRUCTURE vbdpl.
DATA: END OF tvbdpl.
DATA: BEGIN OF xvbplp OCCURS 50.
INCLUDE STRUCTURE vbplp.
DATA: END OF xvbplp.
DATA: BEGIN OF xvbpls OCCURS 10.
INCLUDE STRUCTURE vbpls.
DATA: END OF xvbpls.
DATA: retcode LIKE sy-subrc.
DATA: xscreen(1) TYPE c. "Ausgabe auf Drucker oder Bildschirm
DATA: t_vepo LIKE vepo OCCURS 0 WITH HEADER LINE, "VEPO internal table
BEGIN OF t_cartons OCCURS 0, "Internal table for cartons
venum LIKE vepo-venum, "Shipping unit # for carton
END OF t_cartons,
BEGIN OF t_boxes OCCURS 0, "Internal table for BOXES
venum LIKE vepo-venum, "Shipping unit # for BOXES
laeng LIKE vekp-laeng,
breit LIKE vekp-breit,
hoehe LIKE vekp-hoehe,
meabm LIKE vekp-meabm,
END OF t_boxes,
BEGIN OF t_pack_dim OCCURS 0,
laeng LIKE vekp-laeng,
breit LIKE vekp-breit,
hoehe LIKE vekp-hoehe,
meabm LIKE vekp-meabm,
box_qty TYPE i,
END OF t_pack_dim,
v_venum LIKE vepo-venum, "Shipping unit number
i_cartons TYPE i, "# of cartons (Integer type)
i_boxes TYPE i, "# of boxes (Integer type)
i_box_count TYPE i, "# of boxes/carton "DEVK926768
c_cartons(4) TYPE c, "# of cartons (Character type)
c_boxes(4) TYPE c, "# of boxes (Character type)
c_bolnr(35) TYPE c,
v_tel_number LIKE adrc-tel_number,
v_adrnr LIKE adrc-addrnumber,
v_kdmat LIKE lips-kdmat,
v_btgew LIKE likp-btgew,
v_gewei LIKE likp-gewei,
v_arktx LIKE lips-arktx.
******DEVK9A0IK7 Addition by RAMARAJG Starts here
types : BEGIN OF t_item ,
posnr1 type vbplp-posnr,
material1 TYPE mara-matnr,
brgew1 type vbplp-brgew,
vemeh1 type vbplp-vemeh,
item_weight1 TYPE n,
arktx1 type vbplp-arktx,
vboxcnt type n,
end of t_item.
*types : BEGIN OF t_item1 ,
posnr1 type vbplp-posnr,
material1 TYPE mara-matnr,
vemng1 type vbplp-brgew,
vemeh1 type vbplp-vemeh,
item_weight1 TYPE n,
arktx1 type vbplp-arktx,
v_boxcnt type n,
end of t_item1.
DATA: it_item TYPE TABLE OF t_item,
wa_item TYPE t_item.
data: it_item1 type table of t_item,
wa_item1 type t_item.
*data: wa_itab1 like itab1.
data: v_grwt type lips-brgew, "Gross Weight in KG
v_gunit type likp-gewei, "Gross Weight Unit
v_netwt type lips-ntgew, "Net Weight
v_unit type likp-gewei. "Net Weight Unit
v_tboxes type i,
******DEVK9A0IK7 Addition by RAMARAJG ends here
A. Nachricht (allgemein) *
FORM entry USING return_code us_screen.
CLEAR retcode.
xscreen = us_screen.
PERFORM processing USING us_screen.
IF retcode NE 0.
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDFORM. "entry
FORM PROCESSING *
--> PROC_SCREEN *
FORM processing USING proc_screen.
PERFORM get_data. " <-- speziell
PERFORM form_open USING proc_screen vbpla-land1.
CHECK retcode = 0.
PERFORM shipping_point_tel_no.
PERFORM boxes_and_cartons.
PERFORM gross_weight.
***********DEVK9A0IK7 starts here
*******Perform to get the Net weight
*******Perform to get Total weight for each line item
Perform net_weight. "DEVK9A0IK7
Perform Total_weight. "DEVK9A0IK7
***********DEVK9A0IK7 ends here
PERFORM bill_of_lading.
CHECK retcode = 0.
PERFORM check_repeat.
PERFORM text_print. " <-- speziell
begin shb
PERFORM get_end_customer_po.
*end shb
PERFORM packing_dimensions.
PERFORM remarks.
CHECK retcode = 0.
PERFORM form_close.
CHECK retcode = 0.
ENDFORM. "processing
FORM FORM_OPEN *
--> US_SCREEN *
--> US_COUNTRY *
FORM form_open USING us_screen us_country.
INCLUDE rvadopfo.
ENDFORM. "form_open
FORM FORM_CLOSE *
FORM form_close.
CALL FUNCTION 'CLOSE_FORM' "...Ende Formulardruck
EXCEPTIONS OTHERS = 1.
IF sy-subrc NE 0.
retcode = 1.
PERFORM protocol_update.
ENDIF.
SET COUNTRY space.
ENDFORM. "form_close
FORM CHECK_REPEAT *
FORM check_repeat.
SELECT * INTO *nast FROM nast WHERE kappl = nast-kappl
AND objky = nast-objky
AND kschl = nast-kschl
AND spras = nast-spras
AND parnr = nast-parnr
AND parvw = nast-parvw
AND nacha BETWEEN '1' AND '4'.
CHECK *nast-vstat = '1'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'REPEAT'
window = 'REPEAT'
EXCEPTIONS
element = 1
window = 2.
IF sy-subrc NE 0.
PERFORM protocol_update.
ENDIF.
EXIT.
ENDSELECT.
ENDFORM. "check_repeat
FORM PROTOCOL_UPDATE *
FORM protocol_update.
CHECK xscreen = space.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = syst-msgid
msg_nr = syst-msgno
msg_ty = syst-msgty
msg_v1 = syst-msgv1
msg_v2 = syst-msgv2
msg_v3 = syst-msgv3
msg_v4 = syst-msgv4
EXCEPTIONS
OTHERS = 1.
ENDFORM. "protocol_update
B. Packliste (speziell) *
Die Verpackung von Lieferungen wird durch Versandelemente (VSE)
realisiert. Technisch ist ein Versandelement ein Beleg mit Kopf-
und Positionsdaten (Strukturen VBPLK/XVBPLK und VBPLP/XVBPLP).
Eine Position in einem VSE ist entweder wieder ein VSE oder Teil
eine Lieferposition (also mit den zum VSE gehörenden Materialen/
Versandhilftsmitteln verpackt). Der Zusammenhang zur Lieferung
wird durch die beiden Felder VBELN (Lieferung) und POSNR (Position)
in der Struktur VBPLP realisiert. Es ist zu beachten, daß ein VSE
keine Positionsdaten enthalten muß: Die Lieferung wurde dann nicht
vollständig verpackt.
Mathematisch gesehen stellen die VSE einen Wald (aus Bäumen) dar.
An den Knoten können noch Lieferpositionsdaten hängen. Um zu
erkennen ob ein Knoten eine Wurzel oder (und) ein Blatt ist, gibt
es im VSE-Kopf Kennzeichen. Ist KZOBE gesetzt, so ist das VSE ein
oberes Element, also eine Wurzel. Ist KZUNT gesetzt, stellt das VSE
ein unteres Element dar, also ein Blatt. Ist keines der beiden
Kennzeichen gesetzt dann ist das VSE ein innerer Knoten. Es ist
zu beachten, daß beiden Kennzeichen gesetzt sein können: Der Baum
besteht aus einem Knoten. Die Tiefe eines Knotens durch das Feld
TIVEL gegeben.
Weiterhin ist der Baum doppelt verkettet. Es ist also möglich,
nicht nur einen Weg von der Wurzel (eines Teilbaums) zu einem
Blatt zu finden, sondern auch umgekehrt von einem Blatt zur Wurzel
zu gelangen. Dazu existiert (im VSE-Kopf) das Feld UEVEL, also
das übergeordnete VSE.
Um schließlich zu entscheiden, ob ein VSE-Position ein VSE oder
eine Lieferposition ist, wird das Feld POSNR ausgewertet. Ist
das Feld initial, stellt die Position ein VSE dar, im anderen Fall
enthält es die Lieferposition. Ist die Position ein VSE, steht im
Feld UNVEL das zugehörige untergeordnete VSE.
FORM get_data.
vbco3-vbeln = nast-objky.
vbco3-spras = nast-spras.
vbco3-kunde = nast-parnr.
vbco3-parvw = nast-parvw.
*mod+
CALL FUNCTION 'RV_DELIVERY_PRINT_VIEW'
EXPORTING
comwa = vbco3
IMPORTING
kopf = vbdkl
TABLES
pos = tvbdpl.
CALL FUNCTION 'SD_PACKING_PRINT_VIEW'
EXPORTING
comwa = vbco3
IMPORTING
vbpla_wa = vbpla
TABLES
vbplk_tab = xvbplk
vbplp_tab = xvbplp
vbpls_tab = xvbpls
EXCEPTIONS
OTHERS = 01.
LOOP AT xvbplk WHERE kzobe = 'X'.
EXIT.
ENDLOOP.
IF sy-subrc > 0.
syst-msgid = 'VL'.
syst-msgno = '490'.
syst-msgty = 'E'.
PERFORM protocol_update.
retcode = 1.
ENDIF.
ENDFORM. "get_data
FORM TEXT_PRINT *
FORM text_print.
Die Kopfdaten werden implizit ausgegeben, ...
... dann die Überschriften der Positionen ...
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'HEADER'
type = 'TOP'.
... und schließlich die Positionen ausgeben ...
LOOP AT xvbplk WHERE kzobe = 'X'.
PERFORM packing_tree USING xvbplk-venum.
ENDLOOP.
ENDFORM. "text_print
Rekursive Prozedur
FORM packing_tree USING value(shenr).
Daten des Versandelements shenr ausgeben, also Wurzel des Teilbaums
MOVE space TO xvbplk.
xvbplk-venum = shenr.
READ TABLE xvbplk.
vbplk = xvbplk.
READ TABLE t_cartons WITH KEY venum = vbplk-venum.
IF sy-subrc = 0.
IF vbplk-brgew <> 0.
PERFORM set_textsymbol USING '&CARTON_WEIGHT&'
vbplk-brgew.
ELSE.
PERFORM set_textsymbol USING '&CARTON_WEIGHT&'
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'SHELEM'.
ENDIF.
Nun die Positionen abarbeiten (Teilbäume durchlaufen).
Hier wäre eventuell ein Sortierung zwischen Lieferpositionen
und weiteren Versandelementen sinnvoll. Alle nachgeordneten
Positionen liegen eine Stufe tiefer.
LOOP AT xvbplp WHERE venum = shenr.
IF xvbplp-posnr IS INITIAL.
Versandelement
PERFORM packing_tree USING xvbplp-unvel.
ELSE.
Lieferposition (Anteil)
vbplp = xvbplp.
PERFORM customer_material.
***ramarajg starts.
perform item_list.
***ramarajg end.
IF vbplp-brgew <> 0.
PERFORM set_textsymbol USING '&ITEM_WEIGHT&'
vbplp-brgew.
ELSE.
PERFORM set_textsymbol USING '&ITEM_WEIGHT&'
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'DELPOS'.
ENDIF.
ENDLOOP.
***ramarajg starts.
perform TOTAL_WEIGHT.
loop at it_item into wa_item.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ITEMPOS'.
endloop.
break ramarajg.
***ramarajg end.
ENDFORM. "packing_tree
FORM SET_TEXTSYMBOL *
FORM set_textsymbol USING text_symbol
text_value.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
EXPORTING
name = text_symbol
value = text_value.
ENDFORM. "set_textsymbol
*& Form BOXES_AND_CARTONS
text
--> p1 text
<-- p2 text
FORM boxes_and_cartons.
CLEAR: t_cartons,
t_boxes,
i_cartons,
i_boxes.
REFRESH: t_cartons,
t_boxes.
start of change for DEVK937590
CLEAR t_deliveryflow[].
SELECT vbeln
FROM vbfa
INTO CORRESPONDING FIELDS OF TABLE t_deliveryflow
WHERE vbelv = vbpla-vbeln AND vbtyp_n = c_x.
Select data
DESCRIBE TABLE t_deliveryflow LINES v_lin.
CHECK v_lin GT 0.
SELECT venum vbeln
FROM vepo
INTO CORRESPONDING FIELDS OF TABLE t_vepo
FOR ALL ENTRIES IN t_deliveryflow
WHERE venum = t_deliveryflow-vbeln.
SELECT VENUM
VBELN
FROM VEPO
INTO CORRESPONDING FIELDS OF TABLE T_VEPO
WHERE VBELN = VBPLA-VBELN.
end of change for DEVK937590
SORT t_vepo BY venum.
DELETE ADJACENT DUPLICATES FROM t_vepo COMPARING venum.
Determine the number of cartons and boxes to be shipped.
To determine the number of cartons, shipping unit number (VENUM) is
checked if it a lower-level shipping unit. This is done by reading
table VEPO and checking if VENUM exist in UNVEL (Lower-level shipping
unit). If it does, this means that VENUM is contained within
another container. If it does not exist, it is considered the highest
level of packing for that specific delivery.
LOOP AT t_vepo.
check if VENUM is a lower level shipping unit.
SELECT SINGLE venum INTO v_venum
FROM vepo
WHERE unvel = t_vepo-venum.
If shipping unit number is found, count as carton.
IF sy-subrc = 0.
check if carton already exist for the carton.
READ TABLE t_cartons WITH KEY venum = v_venum.
if carton does not exist, append table
IF sy-subrc <> 0.
t_cartons-venum = v_venum.
APPEND t_cartons.
ENDIF.
ENDIF.
ENDLOOP.
count boxes and cartons
DESCRIBE TABLE t_vepo LINES i_boxes.
DESCRIBE TABLE t_cartons LINES i_cartons.
Convert cartons and boxes field values to CHARACTER type FORMAT.
In order to save the output values to the output fields, the
fields are converted to CHARACTER type formats.
MOVE: i_cartons TO c_cartons,
i_boxes TO c_boxes.
PERFORM set_textsymbol USING '&BOXES&'
c_boxes.
PERFORM set_textsymbol USING '&CARTONS&'
c_cartons.
ENDFORM. " BOXES_AND_CARTONS
*& Form BILL_OF_LADING
text
--> p1 text
<-- p2 text
FORM bill_of_lading.
SELECT SINGLE bolnr
FROM likp
INTO c_bolnr
WHERE vbeln = vbpla-vbeln.
PERFORM set_textsymbol USING '&BILL_OF_LADING&'
c_bolnr.
ENDFORM. " BILL_OF_LADING
*& Form PACKING_DIMENSIONS
text
--> p1 text
<-- p2 text
FORM packing_dimensions.
CLEAR: T_BOXES,
T_PACK_DIM.
REFRESH: T_BOXES,
T_PACK_DIM.
SELECT VENUM
LAENG
BREIT
HOEHE
MEABM
FROM VEKP
INTO CORRESPONDING FIELDS OF TABLE T_BOXES
FOR ALL ENTRIES IN T_VEPO
WHERE VENUM = T_VEPO-VENUM.
LOOP AT T_BOXES.
READ TABLE T_PACK_DIM WITH KEY LAENG = T_BOXES-LAENG
BREIT = T_BOXES-BREIT
HOEHE = T_BOXES-HOEHE
MEABM = T_BOXES-MEABM.
IF SY-SUBRC = 0.
T_PACK_DIM-BOX_QTY = T_PACK_DIM-BOX_QTY + 1.
MODIFY T_PACK_DIM INDEX SY-TABIX.
ELSE.
T_PACK_DIM-LAENG = T_BOXES-LAENG.
T_PACK_DIM-BREIT = T_BOXES-BREIT.
T_PACK_DIM-HOEHE = T_BOXES-HOEHE.
T_PACK_DIM-MEABM = T_BOXES-MEABM.
T_PACK_DIM-BOX_QTY = 1.
APPEND T_PACK_DIM.
ENDIF.
ENDLOOP.
LOOP AT T_PACK_DIM.
AT FIRST.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'PACKING_DIMENSIONS_HEADER'.
ENDAT.
CLEAR: VEKP,
C_BOXES.
VEKP-LAENG = T_PACK_DIM-LAENG.
VEKP-BREIT = T_PACK_DIM-BREIT.
VEKP-HOEHE = T_PACK_DIM-HOEHE.
VEKP-MEABM = T_PACK_DIM-MEABM.
MOVE: T_PACK_DIM-BOX_QTY TO C_BOXES.
PERFORM SET_TEXTSYMBOL USING '&BOX_QTY&'
C_BOXES.
IF VEKP-LAENG <> 0 AND
VEKP-BREIT <> 0 AND
VEKP-HOEHE <> 0.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'PACKING_DIMENSIONS'.
ENDIF.
ENDLOOP.
ENDFORM. " PACKING_DIMENSIONS
*& Form REMARKS
text
--> p1 text
<-- p2 text
FORM remarks.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'REMARKS'.
ENDFORM. " REMARKS
*& Form SHIPPING_POINT_TEL_NO
text
--> p1 text
<-- p2 text
FORM shipping_point_tel_no.
SELECT SINGLE adrnr
FROM tvst
INTO v_adrnr
WHERE vstel = vbpla-vstel.
SELECT SINGLE tel_number
FROM adrc
INTO adrc-tel_number
WHERE addrnumber = v_adrnr.
ENDFORM. " SHIPPING_POINT_TEL_NO
*& Form CUSTOMER_MATERIAL
text
--> p1 text
<-- p2 text
FORM customer_material.
CLEAR: v_kdmat.
begin of mod*
IF vbdkl-lfart = 'LO'.
SELECT SINGLE kdmat postx
INTO (v_kdmat , v_arktx)
FROM knmt
WHERE vkorg = vbdkl-vkorg
AND vtweg = '01'
AND kunnr = vbdkl-kunag
AND matnr = vbplp-matnr.
IF NOT v_kdmat IS INITIAL.
vbplp-matnr = v_kdmat.
vbplp-arktx = v_arktx.
ENDIF.
ELSE.
SELECT SINGLE kdmat
FROM lips
INTO v_kdmat
WHERE vbeln = vbplp-vbeln AND
posnr = vbplp-posnr AND
matnr = vbplp-matnr.
ENDIF.
**ramarajg
IF v_kdmat <> ' '.
PERFORM set_textsymbol USING '&MATERIAL&'
v_kdmat.
ELSE.
PERFORM set_textsymbol USING '&MATERIAL&'
vbplp-matnr.
ENDIF.
ENDFORM. " CUSTOMER_MATERIAL
FORM ITEM_WEIGHTS *
--> IN_TAB4 *
--> OUT_TAB4 *
FORM item_weights TABLES in_tab4 STRUCTURE itcsy
out_tab4 STRUCTURE itcsy.
DATA: n_vbeln(10) TYPE n,
v_btgew LIKE likp-btgew,
v_ntgew1 LIKE vekp-ntgew,
v_btgew1 LIKE likp-btgew,
v_ntgew2 LIKE likp-ntgew,
v_btgew2 LIKE likp-btgew,
BEGIN OF t_venum OCCURS 0,
venum LIKE vepo-venum,
END OF t_venum.
READ TABLE in_tab4 INDEX 1.
CHECK sy-subrc = 0.
MOVE in_tab4-value TO n_vbeln. "convert to numeric type.
start of change for DEVK937590
*break ramarajg.
CLEAR t_deliveryflow[].
SELECT vbeln
FROM vbfa
INTO CORRESPONDING FIELDS OF TABLE t_deliveryflow
WHERE vbelv = n_vbeln AND vbtyp_n = c_x.
Select data
DESCRIBE TABLE t_deliveryflow LINES v_lin.
CHECK v_lin GT 0.
SELECT venum
FROM vepo
INTO CORRESPONDING FIELDS OF TABLE t_venum
FOR ALL ENTRIES IN t_deliveryflow
WHERE venum = t_deliveryflow-vbeln.
SELECT VENUM
FROM VEPO
INTO CORRESPONDING FIELDS OF TABLE T_VENUM
WHERE VBELN = N_VBELN.
end of change for DEVK937590
CLEAR v_btgew.
DESCRIBE TABLE t_venum LINES v_lin. "DEVK937590
CHECK v_lin GT 0. "DEVK937590
SELECT ntgew
FROM vekp
INTO v_btgew
FOR ALL ENTRIES IN t_venum
WHERE venum = t_venum-venum.
v_btgew1 = v_btgew1 + v_btgew.
ENDSELECT.
SELECT SUM( ntgew )
FROM lips
INTO v_ntgew1
WHERE vbeln = n_vbeln.
SELECT SINGLE ntgew
btgew
FROM likp
INTO (v_ntgew2, v_btgew2)
WHERE vbeln = n_vbeln.
IF v_ntgew1 = v_ntgew2 AND
v_btgew1 = v_btgew2.
READ TABLE out_tab4 WITH KEY name = 'PRINT_WEIGHT'.
IF sy-subrc = 0 .
out_tab4-value = 'X'.
ELSE.
out_tab4-value = ' '.
ENDIF.
MODIFY out_tab4 INDEX sy-tabix.
ENDIF.
ENDFORM. "item_weights
*& Form GROSS_WEIGHT
text
--> p1 text
<-- p2 text
FORM gross_weight.
CLEAR: v_btgew.
SELECT SINGLE btgew
gewei
FROM likp
INTO (v_btgew, v_gewei)
WHERE vbeln = vbpla-vbeln.
PERFORM set_textsymbol USING '&GROSS_WEIGHT&'
v_btgew.
PERFORM set_textsymbol USING '&GROSS_WEIGHT_UNIT&'
v_gewei.
changes added by RAMARAJG starts here
clear v_grwt.
clear v_gunit.
v_grwt = v_btgew.
v_gunit = v_gewei.
if v_gunit = 'G'.
v_grwt = v_grwt / 1000.
v_gunit = 'KG'.
endif.
PERFORM set_textsymbol USING '&GROSS_WEIGHT1&'
v_grwt.
PERFORM set_textsymbol USING '&GROSS_WEIGHT_UNIT1&'
v_gunit.
changes added by RAMARAJG ends here
ENDFORM. " GROSS_WEIGHT
*& Form GET_END_CUSTOMER_PO
Retrieve End Customer PO#
--> p1 text
<-- p2 text
FORM get_end_customer_po.
DATA: v_zvgbel LIKE lips-vgbel.
DATA v_bstkd_e TYPE bstkd_e.
CLEAR: v_bstkd_e, v_zvgbel.
SELECT SINGLE vgbel INTO v_zvgbel
FROM lips
WHERE vbeln = vbpla-vbeln.
SELECT SINGLE bstkd_e INTO v_bstkd_e
FROM vbkd
WHERE vbeln = v_zvgbel
AND bstkd_e > ''.
PERFORM set_textsymbol USING '&V_BSTKD_E&'
v_bstkd_e.
ENDFORM. " GET_END_CUSTOMER_PO
*DEVK9A0EB4 - Add a form
*& Form shipper_acct
Get shipper account at customer
FORM shipper_acct TABLES in_tab1 TYPE ty_itcsy
out_tab1 TYPE ty_itcsy.
DATA: v_kunag TYPE likp-kunag, " Sold to party
v_eikto TYPE knvv-eikto. "Shipper account number at customer
DATA v_strlen(10) TYPE c.
DATA wa_tab1 TYPE itcsy.
DATA n_vbeln(10) TYPE n.
Get kunnr from likp
CLEAR wa_tab1.
READ TABLE in_tab1 INTO wa_tab1 WITH KEY name = 'VBPLA-VBELN'.
IF sy-subrc = 0.
n_vbeln = vbpla-vbeln.
ENDIF.
CHECK sy-subrc = 0.
SELECT kunag
FROM likp
INTO v_kunag
WHERE vbeln = n_vbeln.
ENDSELECT.
IF sy-subrc = 0.
Get shipper account
SELECT eikto INTO v_eikto
FROM knvv
WHERE kunnr = v_kunag.
ENDSELECT.
IF sy-subrc = 0.
*append the field to the out_tab1 printing output
wa_tab1-name = 'VKNN-EIKTO'.
wa_tab1-value = v_eikto.
APPEND wa_tab1 TO out_tab1.
ENDIF.
ENDIF.
ENDFORM. "shipper_acct
***********DEVK9A0IK7 starts here
*& Form net_weight
text
--> p1 text
<-- p2 text
form net_weight .
CLEAR: v_btgew.
SELECT SINGLE ntgew
gewei
FROM likp
INTO (v_netwt, v_unit)
WHERE vbeln = vbpla-vbeln.
if v_unit = 'G'.
v_netwt = v_netwt / 1000.
v_unit = 'KG'.
endif.
PERFORM set_textsymbol USING '&NET_WEIGHT&'
v_netwt.
PERFORM set_textsymbol USING '&NET_WEIGHT_UNIT&'
v_unit.
endform. " net_weight
***********DEVK9A0IK7 ends here
*& Form item_list
text
--> p1 text
<-- p2 text
form item_list.
move vbplp-posnr to wa_item-posnr1.
*move material to wa_itab1-material1.
move vbplp-brgew to wa_item-brgew1.
move vbplp-vemeh to wa_item-vemeh1.
*move item_weight to wa_itab1-item_weight1.
*move gross_weight_unit to wa_itab1-gross_weight_unit1.
move v_arktx to wa_item-arktx1.
if v_kdmat <> ' '.
move v_kdmat to wa_item-material1.
else.
move vbplp-matnr to wa_item-material1.
endif.
wa_item-vboxcnt = 1.
append wa_item TO it_item.
CLEAR : wa_item1, wa_item.
it_item1[] = it_item[].
REFRESH it_item[].
break-point.
endform. " item_list
*& Form TOTAL_WEIGHT
text
--> p1 text
<-- p2 text
form TOTAL_WEIGHT .
LOOP AT it_item1 into wa_item1.
READ TABLE it_item INTO wa_item WITH KEY material1 = wa_item1-material1 posnr1 = wa_item1-posnr1.
IF sy-subrc NE 0.
APPEND wa_item1 TO it_item.
ELSE.
wa_item1-brgew1 = wa_item1-brgew1 + wa_item-brgew1.
Wa_item1-vboxcnt = wa_item1-vboxcnt + wa_item-vboxcnt.
MODIFY it_item FROM wa_item1 TRANSPORTING brgew1 vboxcnt
WHERE material1 = wa_item1-material1
AND posnr1 = wa_item1-posnr1.
ENDIF.
ENDLOOP.
endform. " TOTAL_WEIGHTthe Logic to be added is this
b. Remove the carton ID & box ID from the print out, the line item should just print the total delivery quantity, do not split the printing by different box ID or carton ID.
i. Delivery Item= LIPS-POSNR
ii. Delivery Qty for Item = LIPSD-G_LFIMG= LIPSD-PIKMG
c. Add Total Boxes for each item, this should be a calculation field for each material HUMV4-MATNR, count how many handling unit VEKPVB-EXIDV has been used to pack the same material , output the total boxes for each delivery item.
d. Add Gross Weight for each item , retrieve data from LIPS-BRGEW
e. Add Net weight to the print out, below the gross weight retrieve data from LIKP-NTGEW -
Hi all,
I have requirement saying that transfer data from one program to another transaction selection screen.
Requirement is.
In a programi will l have final data in one internal table.
This data i need to send it for another program selection screen as input.
Please provide me the logic.
Thanks in advanceuse the first program as an include for the second program
then in the intilisation of the second program
use the values of the internal table of 1st program.
regards,
srinivas
<b>*reward for useful answers*</b> -
Question on program logic using SKC1A
Account - Using SAKNR and selected company code (BUKRS) get alternative account using table SKB1
Description - To be obtained from SKA1 using account number found above in chart of accounts CEFR
Carry-forward debit - UMSAV
Debit period from 1 to n - ii=01 to pp UMiiS
Credit period from 1 to n - ii=01 to pp UMiiH
In order to obtain this text file, an ABAP program should be written. The extraction program should use structure SKC1A to obtain data and use the following selections:
BUKRS : Company code
SAKNR : no selection
GJAHR : Fiscal Year
GSBER : no selection
CURTP : 10 (can be hardcoded and displayed)
HWAER : EUR (can be hard-coded and displayed)
Period : pp (from 01 to special period 13)
I wrote the program using the function 'FOR_ALL_SKC1A'. I have attached it below.
after the final specs came from the user, this following line was included
An example of the use of this structure can be found in program RFSSLD00
I looked at the program RFSSLD00 and it's logic is nowhere near mine. It uses a statement GET SKC1A. after looking at this program,
I am not I have the program coded correctly based on the specs.
can somebody let me know if I am doing this correctly or if I need to mirror my program after the RFSSLD00.
*& Report ZFI_FR_ETAFI
REPORT ZFI_FR_ETAFI.
TABLES
TABLES:
skat. "G/L Account Master Record (Chart of Accounts: Description)
TYPES
TYPES: BEGIN OF ty_skat,
saknr TYPE skat-saknr, "Account Number
txt50 TYPE skat-txt50, "account Description
END OF ty_skat.
DATA
data: begin of itab occurs 0,
filler1(5) TYPE C,
account(6) TYPE C,
filler2(4) TYPE C,
description(35) TYPE c,
filler3(39) TYPE c,
carryfwdamt(21) TYPE c,
filler4(70) TYPE c,
totdeb(18) TYPE c,
filler5(63) TYPE c,
totcred(18) TYPE c,
end of itab.
data: iskc1a TYPE TABLE of skc1a with header line.
data: it_skat TYPE STANDARD TABLE OF ty_skat with header line.
data: w_totcred like skc1a-um01s.
data: w_totdeb like skc1a-um01s.
data: w_cramount like skc1a-um01s.
data: w_dbamount like skc1a-um01s.
*SELECT-OPTIONS:
PARAMETERS *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_ktopl TYPE skat-ktopl OBLIGATORY,
p_bukrs TYPE skb1-bukrs OBLIGATORY,
p_year TYPE payr-gjahr OBLIGATORY,
p_poper TYPE bkpf-monat OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
*START-OF-SELECTION *
START-OF-SELECTION.
SELECT saknr txt50
FROM skat INTO TABLE it_skat
WHERE ktopl = p_ktopl.
loop at it_skat.
CLEAR iskc1a. REFRESH iskc1a.
call function 'FOR_ALL_SKC1A'
exporting
xbukrs = p_bukrs
xsaknr = it_skat-saknr
tables
xskc1a = iskc1a
exceptions
key_incomplete = 1
not_authorized = 2
not_found = 3.
loop at iskc1a.
if iskc1a-gjahr = p_year.
w_cramount = 0.
w_dbamount = 0.
w_totcred = 0.
w_totdeb = 0.
do p_poper times
varying w_cramount from iskc1a-um01s next iskc1a-um02s.
w_totcred = w_totcred + w_cramount.
enddo.
do p_poper times
varying w_dbamount from iskc1a-um01h next iskc1a-um02h.
w_totdeb = w_totdeb + w_dbamount.
enddo.
if it_skat-saknr(4) = '0000'.
itab-account = it_skat-saknr+4.
else.
itab-account = it_skat-saknr.
endif.
itab-description = it_skat-txt50.
itab-carryfwdamt = iskc1a-umsav.
shift itab-carryfwdamt right deleting trailing space.
itab-totdeb = w_totdeb.
shift itab-totdeb right deleting trailing space.
itab-totcred = w_totcred.
shift itab-totcred right deleting trailing space.
if itab-carryfwdamt <> 0 or
itab-totdeb <> 0 or
itab-totcred <> 0.
append itab.
endif.
endif.
endloop.
endloop.
call function 'GUI_DOWNLOAD'
exporting
filename = 'C:\ETAFI.txt'
tables
data_tab = itab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
write: / ' process unsuccessful'.
ELSE.
write: / 'process successful'.
ENDIF.
*END-OF-SELECTION *That program uses a logical database to get the data. This is why it looks different. Don't worry, as long as you can verify the data against something else, you can do it the way that you are. Personally, I never use logical databases.
REgards,
Rich Heilman -
Can anyone please lemme know abt the logic used in the Report Customer Payment History. The T code used is f.99.
Points will be awardedYou can hook up a 2nd drive to the 1st drive - this called "daisy-chaining".
Two external disks is optimal - especially if you use large 3rd party Sample libraries. But it is no 'must'. If you only use Logics' own sampled instruments you don't need to use a dedicated disk for that. The same goes for recording; if you only record 1 or 2 tracks at a time you can easily use the startup disk for that. However, depending on how much you record you run the risk of filling up the startup disk, an for efficiency reasons it is advisable to keep at least 20 GB free on the startup disk, or +at least+ 10 % of the disks' capacity if it is 250 GB or bigger.
There is such a thing as a FireWire hub, but in your situation it is not necessary. Plus they tend to cause trouble, that vary depending on what devices are hooked up and how.
regards, Erik (6 feet guy)
Maybe you are looking for
-
Notebook Lenovo V570c и Windows XP
Здравствуйте , раз уж мне выпала честь открыть первой темой этот раздел. Имею ноутбук V570c В использовании в рабочих целях выявилась не обходимость пользоваться старыми программами и соотвественно к ним требуются старые ОС. Моя конкретно модификация
-
Cursor moves when in tablet mode (screen touching the pointing stick on an X220T)
Hi there, when I put my X220T in tablet mode, the screen moves just enough to move the pointing stick in the middle of the keyboard to cause the cursor to move. I can't rest my hand on the screen without causing the cursor to move all the way accross
-
How to get the id of jsf Template Component
Dear All, I have a page template with adding attribute like pageName, companyId. Then I Page Fragment that use that page template. In this jsff page I fill the pageName and companyId. My question is How can I get the value of these attribute (pageNam
-
Collecting images from imovie/idvd project
Though now I know I should have collected all images in a folder before using in imovie project, is there any way to collect them back from the project now. I wanted to put all images used on a disc for my records.... thanks for any suggestions.
-
Viewing Icons in Oracle Forms on the Web - any solutions?
Has anyone had problems viewing icons when deploying forms on the web? In client server mode it used to be .ico files. I recently converted our files to .gif and added a register UI_ICON to recognize the icon images when running the forms. I still ca