JTable's setValueAt() function -URGENT please help!!!
I am using a subclass of the DefaultTableModel for my JTable. The data is in the form of a Vector of vectors. I am catching user input (editing) by implementing the setValueAt() function. The table consists of 1 row, and 4 columns (thats a required limitation). When I edit(change) only one cell of the table, and dont tab out of the cell, I see that the setValueAt() function is not being called, and the model is not being updated. But when I change the cell value and tab out of the cell to the next cell, the setValueAt() function is being called.
How can I force the setValueAt() function to be called without tabbing out of the edited cell. I need to implement this feature as a user can change a single cell and click the "save" button.
here is the setValueAt() function implementation.. Could it be that I might have implemented this in error or need to implement some other methods? Any help/pointers will be greatly appreaciated.
public void setValueAt(Object value, int row, int col)
String cellValue = "";
if (value instanceof String)
cellValue = (String)value;
Vector tmp = (Vector)dataVector.elementAt(row);
tmp.setElementAt(cellValue,col);
fireTableCellUpdated(row,col);
Thank You in advance
Seems to me that the problem is to do with when setValueAt() gets called.
Sounds like you want it to be called when the Cell's editor loses focus.
One solution would be something like the following to ensure editing stops when focus is lost.
There may be other less complicated solutions, but this one should work !
class MyEditor extends AbstractCellEditor implements TableCellEditor {
public MyEditor() {
this.text = new JTextField();
this.text.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
public void focusLost(FocusEvent e) {
stopCellEditing();
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isselected, int row, int col) {
this.text.setText((String)value);
return this.text;
public Object getCellEditorValue() {
return this.text.getText();
private JTextField text;
table.setDefaultEditor(String.class, new MyEditor());
Similar Messages
-
Date function: urgent : please help
This is the problem statement.:
Problem: Given two dates (during the years 1901 and 2999, inclusive), find
the number of days between the two dates.
Input: Two dates consisting of month, day, year. For example, the inputs
'6, 2, 1983' and '6, 22, 1983' represent the date range June 2, 1983 to
June 22, 1983.
Output: The number of days between the given dates, excluding the starting
date and the ending date. For example, there are 19 days between June 2,
1983 and June 22, 1983; namely, June 3, 4, ..., 21.
Test Input (3 sets):
Input Line #1: 6, 2, 1983, 6, 22, 1983
Output #1: 19
Input Line #2: 7, 4, 1984, 12, 25, 1984
Output #2: 173
Input Line #3: 1, 3, 1989, 3, 8, 1983
Output #3: 1979
==========
I have a GregorianCalender function that works. But I want to use a basic java function that can solve the above problem.
regards
~mHere is the code that uses the Gregorian Funtion. Does anybody know of anything basic that replaces what gregorian does in this case.
import java.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.lang.*;
public class Days {
static int year1,month1,day1;
static int year2,month2,day2;
public static void main(String[] args) throws Exception{
parse(args);
GregorianCalendar gc1 = new GregorianCalendar(year1, day1, month1);
GregorianCalendar gc2 = new GregorianCalendar(year2, day2, month2);
DateFormat df1 = DateFormat.getDateInstance();
DateFormat df2 = DateFormat.getDateInstance();
try {
Days ds = new Days();
ds.getDays(gc1, gc2);
System.out.println("Output #: " + (ds.getDays(gc1, gc2) - 1));
} catch (java.lang.IllegalArgumentException e) {
System.out.println("Unable to parse");
// validate input values,
// if input parameters are not correct and not in a proper format
// then throw an exception
private static void parse(String[] args) throws Exception{
boolean flag = true;
if(args == null) output();
if(args != null && args.length != 2) output();
validate(args);
return;
private static void output() throws Exception{
throw new Exception("Input arguments are not correct. You should pass "+
"two input dates with a space such as 1901,1,1 2999,1,1");
private static void validate(String[] args) throws Exception{
String arg1 = args[0];
String arg2 = args[1];
System.out.println(arg1);
System.out.println(arg2);
java.util.StringTokenizer tokenizer = new StringTokenizer(arg1,",");
if(tokenizer.countTokens() < 3) output();
String year1AsString = tokenizer.nextToken(",");
String month1AsString = tokenizer.nextToken(",");
String day1AsString = tokenizer.nextToken(",");
year1 = getInt(year1AsString,4);
month1 = getInt(month1AsString,2);
day1 = getInt(day1AsString,2);
java.util.StringTokenizer tokenizer2 = new StringTokenizer(arg2,",");
if(tokenizer2.countTokens() < 3) output();
String year2AsString = tokenizer2.nextToken(",");
String month2AsString = tokenizer2.nextToken(",");
String day2AsString = tokenizer2.nextToken(",");
year2 = getInt(year2AsString,4);
month2 = getInt(month2AsString,2);
day2 = getInt(day2AsString,2);
private static int getInt(String string, int maxLimit) throws Exception{
if(string.length() > maxLimit) output();
int temp = 0;
try{
temp = Integer.parseInt(string);
}catch(NumberFormatException e){
output();
return temp;
public int getDays(GregorianCalendar g1, GregorianCalendar g2) {
int elapsed = 0;
GregorianCalendar gc1, gc2;
if (g2.after(g1)) {
gc2 = (GregorianCalendar) g2.clone();
gc1 = (GregorianCalendar) g1.clone();
} else {
gc2 = (GregorianCalendar) g1.clone();
gc1 = (GregorianCalendar) g2.clone();
gc1.clear(Calendar.MILLISECOND);
gc1.clear(Calendar.SECOND);
gc1.clear(Calendar.MINUTE);
gc1.clear(Calendar.HOUR_OF_DAY);
gc2.clear(Calendar.MILLISECOND);
gc2.clear(Calendar.SECOND);
gc2.clear(Calendar.MINUTE);
gc2.clear(Calendar.HOUR_OF_DAY);
while (gc1.before(gc2)) {
gc1.add(Calendar.DATE, 1);
elapsed++;
return elapsed;
~m -
Encrypting and Decrypting Data(Its Very Urgent, Please Help.)
Hi,
Can anyone tell me some idea in the below mentioned details.
Iam creating a Function for Encrypting and Decrypting Data Values using
DBMS_OBFUSCATION_TOOLKIT with UTL_RAW.CAST_TO_RAW by using
Key Value as normal.
But the problem, is it possible to have the key value more than 8.
Its showing me error when i give the key value less than 8 or more than 8.
Can u tell me why it happens, is that the limit of the key value or is any other way to do that.
Its Very Urgent, Please Help.
Thanks,
Murali.VIs this what you're looking for?
Usage Notes
If the input data or key given to the DES3DECRYPT procedure is empty, then the procedure raises the error ORA-28231 "Invalid input to Obfuscation toolkit."
If the input data given to the DES3DECRYPT procedure is not a multiple of 8 bytes, the procedure raises the error ORA-28232 "Invalid input size for Obfuscation toolkit." ORA-28233 is NOT applicable for the DES3DECRYPT function.
If the key length is missing or is less than 8 bytes, then the procedure raises the error ORA-28234 "Key length too short." Note that if larger keys are used, extra bytes are ignored. So a 9-byte key will not generate an exception.
C. -
Kernel panics, message saying "You need to restart your computer.Hold down the Power..." I am in the middle of HSC very URGENT please help!! Mac keeps needing to restart!!
I looked in console and its saying that it may be because of Sophos Anti-Virus, i deleted and uninstalled all traces of Sophos but looked in console and this is some of the lines coming up:
26/09/13 10:11:17.945 PM com.apple.launchd: (com.sophos.intercheck[6460]) posix_spawn("/Library/Sophos Anti-Virus/InterCheck.app/Contents/MacOS/InterCheck", ...): No such file or directory
26/09/13 10:11:17.945 PM com.apple.launchd: (com.sophos.autoupdate[6461]) posix_spawn("/Library/Sophos Anti-Virus/SophosAutoUpdate.app/Contents/MacOS/SophosAutoUpdate", ...): No such file or directory
26/09/13 10:11:17.945 PM com.apple.launchd: (com.sophos.notification[6462]) posix_spawn("/Library/Sophos Anti-Virus/SophosAntiVirus.app/Contents/MacOS/SophosAntiVirus", ...): No such file or directory
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.intercheck[6460]) Exited with code: 1
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.intercheck) Throttling respawn: Will start in 10 seconds
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.autoupdate[6461]) Exited with code: 1
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.autoupdate) Throttling respawn: Will start in 10 seconds
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.notification[6462]) Exited with code: 1
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.notification) Throttling respawn: Will start in 10 seconds
26/09/13 10:11:18.291 PM Safari: self <TabContentView: 0x7f8d5dd1aa50>
26/09/13 10:11:22.617 PM Safari: self <TabContentView: 0x7f8d5db7bb00>
26/09/13 10:11:27.866 PM Safari: self <TabContentView: 0x7f8d5c331a70>
26/09/13 10:12:19.939 PM com.apple.launchd.peruser.501: (com.sophos.uiserver[6487]) posix_spawn("/Library/Sophos Anti-Virus/SophosUIServer.app/Contents/MacOS/SophosUIServer", ...): No such file or directory
26/09/13 10:12:19.939 PM com.apple.launchd.peruser.501: (com.sophos.uiserver[6487]) Exited with code: 1
26/09/13 10:12:19.939 PM com.apple.launchd.peruser.501: (com.sophos.uiserver) Throttling respawn: Will start in 10 seconds"
Looked all over computer and cant find anything of Sophos please help very urgent!That was all that there was in the most recent one, how long do you think it could take to fix?
Here is the second most recent:
Wed Sep 25 15:39:39 2013
panic(cpu 0 caller 0xffffff80002c4794): Kernel trap at 0xffffff7f81757965, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0xffffff81acc397fe, CR3: 0x000000001e2b5025, CR4: 0x00000000000606e0
RAX: 0x000000001d31a000, RBX: 0x0000000000000000, RCX: 0x0000000000000000, RDX: 0x0000000000000000
RSP: 0xffffff80b0dbb710, RBP: 0xffffff80b0dbb820, RSI: 0x0000000000000000, RDI: 0x0000000000000001
R8: 0x000000000000000a, R9: 0x0000000000000378, R10: 0x0000000000000128, R11: 0x0000000000000378
R12: 0xffffff800c626400, R13: 0x0000000000000000, R14: 0x0000000000000000, R15: 0xffffff81acc39802
RFL: 0x0000000000010246, RIP: 0xffffff7f81757965, CS: 0x0000000000000008, SS: 0x0000000000000010
CR2: 0xffffff81acc397fe, Error code: 0x0000000000000000, Faulting CPU: 0x0
Backtrace (CPU 0), Frame : Return Address
0xffffff80b0dbb3c0 : 0xffffff8000220792
0xffffff80b0dbb440 : 0xffffff80002c4794
0xffffff80b0dbb5f0 : 0xffffff80002da55d
0xffffff80b0dbb610 : 0xffffff7f81757965
0xffffff80b0dbb820 : 0xffffff7f817667a0
0xffffff80b0dbb840 : 0xffffff7f8173a58e
0xffffff80b0dbb870 : 0xffffff7f8177fb6f
0xffffff80b0dbb8a0 : 0xffffff7f81779632
0xffffff80b0dbb8d0 : 0xffffff7f8177d7d5
0xffffff80b0dbb900 : 0xffffff7f8177c6db
0xffffff80b0dbb9e0 : 0xffffff7f817412b8
0xffffff80b0dbba10 : 0xffffff7f81778684
0xffffff80b0dbba30 : 0xffffff7f817449ce
0xffffff80b0dbbb60 : 0xffffff7f81741a4c
0xffffff80b0dbbbc0 : 0xffffff8000655f3e
0xffffff80b0dbbbe0 : 0xffffff800065681a
0xffffff80b0dbbc40 : 0xffffff8000656fbb
0xffffff80b0dbbd80 : 0xffffff80002a3f08
0xffffff80b0dbbe80 : 0xffffff8000223096
0xffffff80b0dbbeb0 : 0xffffff80002148a9
0xffffff80b0dbbf10 : 0xffffff800021bbd8
0xffffff80b0dbbf70 : 0xffffff80002aef10
0xffffff80b0dbbfb0 : 0xffffff80002daec3
Kernel Extensions in backtrace:
com.apple.driver.AppleIntelHD3000Graphics(7.3.2)[A2328231-E577-32FF-B20F-D08BDC FE9C51]@0xffffff7f81738000->0xffffff7f8179bfff
dependency: com.apple.iokit.IOPCIFamily(2.7)[5C23D598-58B2-3204-BC03-BC3C0F00BD32]@0xffffff 7f80889000
dependency: com.apple.iokit.IONDRVSupport(2.3.4)[7C8672C4-8B0D-3CCF-A79A-23C62E90F895]@0xff ffff7f80d2e000
dependency: com.apple.iokit.IOGraphicsFamily(2.3.4)[D0A1F6BD-E66E-3DD8-9913-A3AB8746F422]@0 xffffff7f80cf5000
BSD process name corresponding to current thread: WindowServer
Mac OS version:
11G63b
Kernel version:
Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64
Kernel UUID: FF3BB088-60A4-349C-92EA-CA649C698CE5
System model name: MacBookPro8,1 (Mac-94245B3640C91C81)
System uptime in nanoseconds: 1866666823698
last loaded kext at 480357661446: com.apple.filesystems.smbfs 1.7.2 (addr 0xffffff7f80795000, size 241664)
last unloaded kext at 303348424187: com.apple.driver.AppleUSBUHCI 5.1.0 (addr 0xffffff7f80af7000, size 65536)
loaded kexts:
com.sophos.kext.sav 8.0.14
org.virtualbox.kext.VBoxNetAdp 4.2.16
org.virtualbox.kext.VBoxNetFlt 4.2.16
org.virtualbox.kext.VBoxUSB 4.2.16
org.virtualbox.kext.VBoxDrv 4.2.16
com.logmein.driver.LogMeInSoundDriver 1.0.2
com.Greatdy.driver.SystemAudioCapture 1.0.0
com.apple.filesystems.smbfs 1.7.2
com.apple.driver.AppleHWSensor 1.9.5d0
com.apple.driver.AppleMikeyHIDDriver 122
com.apple.iokit.IOBluetoothSerialManager 4.0.8f17
com.apple.driver.AudioAUUC 1.59
com.apple.driver.AppleHDA 2.2.5a5
com.apple.driver.AppleMikeyDriver 2.2.5a5
com.apple.driver.AGPM 100.12.75
com.apple.driver.AppleUpstreamUserClient 3.5.9
com.apple.driver.SMCMotionSensor 3.0.2d6
com.apple.driver.AppleSMCPDRC 5.0.0d8
com.apple.iokit.IOUserEthernet 1.0.0d1
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.driver.AudioIPCDriver 1.2.3
com.apple.driver.AppleSMCLMU 2.0.1d2
com.apple.driver.ApplePolicyControl 3.1.33
com.apple.driver.ACPI_SMC_PlatformPlugin 5.0.0d8
com.apple.driver.AppleIntelHD3000Graphics 7.3.2
com.apple.driver.AppleBacklight 170.2.2
com.apple.driver.AppleLPC 1.6.0
com.apple.driver.AppleMCCSControl 1.0.33
com.apple.filesystems.autofs 3.0
com.apple.driver.AppleUSBTCButtons 227.6
com.apple.driver.BroadcomUSBBluetoothHCIController 4.0.8f17
com.apple.driver.AppleUSBTCKeyboard 227.6
com.apple.driver.AppleIRController 312
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
com.apple.BootCache 33
com.apple.iokit.SCSITaskUserClient 3.2.1
com.apple.driver.XsanFilter 404
com.apple.iokit.IOAHCISerialATAPI 2.0.3
com.apple.iokit.IOAHCIBlockStorage 2.1.0
com.apple.driver.AppleUSBHub 5.1.0
com.apple.driver.AppleFWOHCI 4.9.0
com.apple.driver.AirPort.Brcm4331 561.7.22
com.apple.driver.AppleSDXC 1.2.2
com.apple.iokit.AppleBCM5701Ethernet 3.2.4b8
com.apple.driver.AppleEFINVRAM 1.6.1
com.apple.driver.AppleSmartBatteryManager 161.0.0
com.apple.driver.AppleAHCIPort 2.3.1
com.apple.driver.AppleUSBEHCI 5.1.0
com.apple.driver.AppleACPIButtons 1.5
com.apple.driver.AppleRTC 1.5
com.apple.driver.AppleHPET 1.7
com.apple.driver.AppleSMBIOS 1.9
com.apple.driver.AppleACPIEC 1.5
com.apple.driver.AppleAPIC 1.6
com.apple.driver.AppleIntelCPUPowerManagementClient 195.0.0
com.apple.nke.applicationfirewall 3.2.30
com.apple.security.quarantine 1.4
com.apple.security.TMSafetyNet 8
com.apple.driver.AppleIntelCPUPowerManagement 195.0.0
com.apple.iokit.IOSerialFamily 10.0.5
com.apple.driver.DspFuncLib 2.2.5a5
com.apple.iokit.IOSurface 80.0.2
com.apple.iokit.IOFireWireIP 2.2.5
com.apple.driver.AppleHDAController 2.2.5a5
com.apple.iokit.IOHDAFamily 2.2.5a5
com.apple.iokit.IOAudioFamily 1.8.6fc18
com.apple.kext.OSvKernDSPLib 1.3
com.apple.driver.AppleGraphicsControl 3.1.33
com.apple.driver.AppleSMC 3.1.3d10
com.apple.driver.IOPlatformPluginLegacy 5.0.0d8
com.apple.driver.AppleSMBusPCI 1.0.10d0
com.apple.driver.AppleBacklightExpert 1.0.4
com.apple.driver.IOPlatformPluginFamily 5.1.1d6
com.apple.iokit.IONDRVSupport 2.3.4
com.apple.driver.AppleSMBusController 1.0.10d0
com.apple.driver.AppleIntelSNBGraphicsFB 7.3.2
com.apple.iokit.IOGraphicsFamily 2.3.4
com.apple.kext.triggers 1.0
com.apple.driver.AppleUSBBluetoothHCIController 4.0.8f17
com.apple.iokit.IOBluetoothFamily 4.0.8f17
com.apple.driver.AppleThunderboltDPInAdapter 1.8.5
com.apple.driver.AppleThunderboltDPAdapterFamily 1.8.5
com.apple.driver.AppleThunderboltPCIDownAdapter 1.2.5
com.apple.driver.AppleUSBMultitouch 230.5
com.apple.iokit.IOUSBHIDDriver 5.0.0
com.apple.driver.AppleUSBMergeNub 5.1.0
com.apple.driver.AppleUSBComposite 5.0.0
com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.2.1
com.apple.iokit.IOBDStorageFamily 1.7
com.apple.iokit.IODVDStorageFamily 1.7.1
com.apple.iokit.IOCDStorageFamily 1.7.1
com.apple.iokit.IOSCSIArchitectureModelFamily 3.2.1
com.apple.driver.AppleThunderboltNHI 1.6.0
com.apple.iokit.IOThunderboltFamily 2.0.3
com.apple.iokit.IOUSBUserClient 5.0.0
com.apple.iokit.IOFireWireFamily 4.4.8
com.apple.iokit.IO80211Family 420.3
com.apple.iokit.IOEthernetAVBController 1.0.1b1
com.apple.iokit.IONetworkingFamily 2.1
com.apple.iokit.IOAHCIFamily 2.0.8
com.apple.iokit.IOUSBFamily 5.1.0
com.apple.driver.AppleEFIRuntime 1.6.1
com.apple.iokit.IOHIDFamily 1.7.1
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.sandbox 177.11
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.DiskImages 331.7
com.apple.iokit.IOStorageFamily 1.7.2
com.apple.driver.AppleKeyStore 28.18
com.apple.driver.AppleACPIPlatform 1.5
com.apple.iokit.IOPCIFamily 2.7
com.apple.iokit.IOACPIFamily 1.4 -
Urgent please help, this program should work
Urgent please help.
I need to solve or I will be in big trouble.
This program works at my home computer which is not networked.
The hard disk was put onto another computer at another location whihc is networked. Here my program worked on Monday 14 october but since for the last two days it is not working without me changing any code. Why do I receive this error message???
Error: 500
Location: /myJSPs/jsp/portal-project2/processviewfiles_dir.jsp
Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:162)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)
Root cause:
java.lang.NullPointerException
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:132)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)foolishmatt,
The code is quit large.
to understand the program I think all the code needs to be examined.
I would need to send to you in an email.
Here is my e-mail
[email protected]
if you contact me than I can send the code to you.
Thank you in advance. -
Urgent, Please help me in this problem.I am getting problem while installation
I am using Windows 8 in my system. I am trying to install Sql Server in system . Everything is fine, but finally when i click on install button i am getting the following error .
please help me quickly. I well be thankful to you.Triple post meanwhile:
http://social.msdn.microsoft.com/Forums/en-US/7fafa499-ca1e-42f7-a117-73df924d9847/urgent-please-help-me-in-this-problemi-am-getting-problem-while-installation?forum=sqlsetupandupgrade
http://social.msdn.microsoft.com/Forums/en-US/a1c7978c-2f84-495f-a8b6-9e9fe46654d7/getting-problem-while-installing-sql-server-2012?forum=sqlsetupandupgrade
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Date format Problem in OAF R12 Urgent Please help!!!
We have acustom application in OAF which was developed in 11i. Now we migrated the same to R12.
In this there are two date fileds getting dispayed on the page and the query for the same is
SELECT TO_CHAR (SYSDATE, 'dd-mm-yyyy') AS CURRENT_DATE, UPPER (TO_CHAR (SYSDATE - 10, 'mon-yy')) AS g_period, UPPER (TO_CHAR (SYSDATE + 5, 'mon-yy')) AS gnext_period, TO_CHAR (sysdate,'dd-mon-yyyy') as today_date, TO_CHAR (sysdate - 1,'dd-mon-yyyy') as yesterday_date FROM DUAL
In 11i version the output is dispaying correctly but in R12 the current date is dispayed as
Start Date 04-Nov-5242
End Date 04-Nov-5241
As per logic it should be
Start Date 09-Feb-2012
End Date 10-Feb-2012
Please help..Urgent issue.Here are the answers to your problems :
1. Once u restart , the oracle services and the database is not mounting automatically.That is because, when you install the Oracle Oracle8i Standard Edition Release (8.1.7), the two key services namely
OracleOraHome81TNSListner and
OracleService<your SID name>
are configured as manual start ( check the NT --> start>setting>control panel>services. )
For the database to start automatically the next time you start your machine, these two services will have to be put into "Automatic Start" mode.
< for this double click on the respective service, select the "Automatic" radio button and click on ok>.
Now when you restart the machine, your database will be automatically mounted.
2. this as explained above is a corollory to the above problem. you can start or stop your database on NT using the "Services" window....
hope this helps.
bye.
Hi All,
I have installed Oracle Oracle8i Standard Edition Release (8.1.7) from technet site.
I have installed it on windows NT 4.0 .
Installation is fine.
I can access or get into SQL prompt .
I have created a database also.
1st problem
My problem is once I restart the Machine and try to access SQL plus .it gives me an error
ORA-01034: Oracle not available
ORA-27101: shared memory realm does not exist.
2nd problem
I dont know how to start and stop the database , as there is nothing to do that in the start menu of Oracle .
How do i do this .
This is very urgent please help.
regards,
Preeti -
I have a Mac OS 10.6.8. I want to change the apps that launch at start-up and can't find Library folder or StartUpItems folder. Tried the "Go To Folder" and "Find" functions. Please help.
Try double clicking your HD icon, then click on your HD Volume (under devices in the left side bar), then click on Library you should be able to find StartUpItems there.
-
hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode the problem is i cant even enter my passcode in my ipod touch cause its rebooting over and over again help please guys
- See if this program will place it in recovery mode since that erases the iPod and bypasses the passocode.
RecBoot: Easy Way to Put iPhone into Recovery Mode
- Next try letting the battery fully drain. The try again. -
Set Page "HEIGHT" ---Very Urgent, Please Help me on this issue. Please.
Hi all ,
Very Urgent, Please Help me on this issue.
when_now_form trigger i set set maximize the window and MDI. And my window and canvas is same height (1500). The formsweb.cfg also changed to 1500. But still I can not view full page on web. Where to I change the properties. Please help.
SelvamIs your form running inside the browser window (with SeparateFrame=False)? If the browser is maximized, and your form is maximized, yet you cannot see the entire screen, you can run with SeparateFrame=True. You can do that on the browser line.
-
How can i open my iMac with mountain lion in 32 bit. With the Mountain Lion, some important softwares are not functioning. Please help !
Thx for yr reply. maybe i don't express myself very well. i know ML is 64 bit system. and it does not open up my VPN connection (the VPN connection i am talking here is Cisco and it is only in 32 bits) . i was wondering is there a way my macbook air 11 inch first generation can turn back into its original operation system, so that i can use the VPN connection. THX
-
Jtable Update problem .. Please help !!!!!!!!
Hi ,
I am trying to get my updated Jtable, stored in a table of database over a previous table ......after updating it via drag n drop ....
But even after I change the cell position to make the changes ... it still takes up the old value of that cell and not the new one while writing the data in the database table...
Here is the code .... Please see it and tell me if it is possible :
package newpackage;
import java.sql.*;
import java.util.Vector;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;
import java.text.*;
import newpackage.ExcelExporter;
import java.awt.Dimension;
import javax.swing.border.*;
import javax.swing.table.*;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import java.awt.print.*;
import java.awt.*;
import java.io.*;
import java.util.Random.*;
import javax.swing.*;
import java.text.*;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
public class tab7le extends javax.swing.JFrame {
Vector columnNames = new Vector();
Vector data = new Vector();
Connection con;
Statement stat;
ResultSet rs;
int li_cols = 0;
Vector allRows;
Vector row;
Vector newRow;
Vector colNames;
String dbColNames[];
String pkValues[];
String tableName;
ResultSetMetaData myM;
String pKeyCol;
Vector deletedKeys;
Vector newRows;
boolean ibRowNew = false;
boolean ibRowInserted = false;
private Map<String, Color> colormap = new HashMap<String, Color>();
/** Creates new form tab7le */
public tab7le() {
populate();
initComponents();
public void updateDB(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch (ClassNotFoundException e){
System.out.println("Cannot Load Driver!");
try{
String url = "jdbc:odbc:FAMS";
con = DriverManager.getConnection(url);
stat = con.createStatement();
rs = stat.executeQuery("Select * from SubAllot");
deletedKeys = new Vector();
newRows = new Vector();
myM = rs.getMetaData();
tableName = myM.getTableName(1);
li_cols = myM.getColumnCount();
dbColNames = new String[li_cols];
for(int col = 0; col < li_cols; col ++){
dbColNames[col] = myM.getColumnName(col + 1);
allRows = new Vector();
while(rs.next()){
newRow = new Vector();
for(int i = 1; i <= li_cols; i++){
newRow.addElement(rs.getObject(i));
} // for
allRows.addElement(newRow);
} // while
catch(SQLException e){
System.out.println(e.getMessage());
String updateLine[] = new String[dbColNames.length];
try{
DatabaseMetaData dbData = con.getMetaData();
String catalog;
// Get the name of all of the columns for this table
String curCol;
colNames = new Vector();
ResultSet rset1 = dbData.getColumns(null,null,tableName,null);
while (rset1.next()) {
curCol = rset1.getString(4);
colNames.addElement(curCol);
rset1.close();
pKeyCol = colNames.firstElement().toString();
// Go through the rows and perform INSERTS/UPDATES/DELETES
int totalrows;
totalrows = allRows.size();
String dbValues[];
Vector currentRow = new Vector();
pkValues = new String[allRows.size()];
// Get column names and values
for(int i=0;i < totalrows;i++){
currentRow = (Vector) allRows.elementAt(i);
int numElements = currentRow.size();
dbValues = new String[numElements];
for(int x = 0; x < numElements; x++){
String classType = currentRow.elementAt(x).getClass().toString();
int pos = classType.indexOf("String");
if(pos > 0){ // we have a String
dbValues[x] = "'" + currentRow.elementAt(x) + "'";
updateLine[x] = dbColNames[x] + " = " + "'" + currentRow.elementAt(x) + "',";
if (dbColNames[x].toUpperCase().equals(pKeyCol.toUpperCase())){
pkValues[i] = currentRow.elementAt(x).toString() ;
pos = classType.indexOf("Integer");
if(pos > 0){ // we have an Integer
dbValues[x] = currentRow.elementAt(x).toString();
if (dbColNames[x].toUpperCase().equals(pKeyCol.toUpperCase())){
pkValues[i] = currentRow.elementAt(x).toString();
else{
updateLine[x] = dbColNames[x] + " = " + currentRow.elementAt(x).toString() + ",";
pos = classType.indexOf("Boolean");
if(pos > 0){ // we have a Boolean
dbValues[x] = currentRow.elementAt(x).toString();
updateLine[x] = dbColNames[x] + " = " + currentRow.elementAt(x).toString() + ",";
if (dbColNames[x].toUpperCase().equals(pKeyCol.toUpperCase())){
pkValues[i] = currentRow.elementAt(x).toString() ;
} // For Loop
// If we are here, we have read one entire row of data. Do an UPDATE or an INSERT
int numNewRows = newRows.size();
int insertRow = 0;
boolean newRowFound;
for (int z = 0;z < numNewRows;z++){
insertRow = ((Integer) newRows.get(z)).intValue();
if(insertRow == i+1){
StringBuffer InsertSQL = new StringBuffer();
InsertSQL.append("INSERT INTO " + tableName + " (");
for(int zz=0;zz<=dbColNames.length-1;zz++){
if (dbColNames[zz] != null){
InsertSQL.append(dbColNames[zz] + ",");
// Strip out last comma
InsertSQL.replace(InsertSQL.length()-1,InsertSQL.length(),")");
InsertSQL.append(" VALUES(" + pkValues[i] + ",");
for(int c=1;c < dbValues.length;c++){
InsertSQL.append(dbValues[c] + ",");
InsertSQL.replace(InsertSQL.length()-1,InsertSQL.length(),")");
System.out.println(InsertSQL.toString());
stat.executeUpdate(InsertSQL.toString());
ibRowInserted=true;
} // End of INSERT Logic
// If row has not been INSERTED perform an UPDATE
if(ibRowInserted == false){
StringBuffer updateSQL = new StringBuffer();
updateSQL.append("UPDATE " + tableName + " SET ");
for(int z=0;z<=updateLine.length-1;z++){
if (updateLine[z] != null){
updateSQL.append(updateLine[z]);
// Replace the last ',' in the SQL statement with a blank. Then add WHERE clause
updateSQL.replace(updateSQL.length()-1,updateSQL.length()," ");
updateSQL.append(" WHERE " + pKeyCol + " = " + pkValues[i] );
System.out.println(updateSQL.toString());
stat.executeUpdate(updateSQL.toString());
} //for
catch(Exception ex){
System.out.println("SQL Error! Cannot perform SQL UPDATE " + ex.getMessage());
// Delete records from the DB
try{
int numDeletes = deletedKeys.size();
String deleteSQL;
for(int i = 0; i < numDeletes;i++){
deleteSQL = "DELETE FROM " + tableName + " WHERE " + pKeyCol + " = " +
((Integer) deletedKeys.get(i)).toString();
System.out.println(deleteSQL);
stat.executeUpdate(deleteSQL);
// Assume deletes where successful. Recreate Vector holding PK Keys
deletedKeys = new Vector();
catch(Exception ex){
System.out.println(ex.getMessage());
public void populate()
try
// Connect to the Database
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("Jdbc:Odbc:FAMS"," "," ");
System.out.println("ok1");
// Read data from a table
String sql;
sql = "Select * from SubAllot";
System.out.println("ok1");
Statement stmt = con.createStatement();
System.out.println("ok1");
ResultSet rs = stmt.executeQuery( sql );
System.out.println("ok1");
ResultSetMetaData md = rs.getMetaData();
System.out.println("ok1");
int columns = md.getColumnCount();
for(int i = 0;i<columns;i++){
columnNames.addElement(md.getColumnName(i+1));
System.out.println("ok2");
while (rs.next())
Vector row = new Vector(columns);
for (int i = 1; i <columns+1; i++)
row.addElement( rs.getObject(i) );
data.addElement( row );
catch(Exception e){
e.printStackTrace();
public void dropmenu(JTable table,TableColumn subpref1) {
//Set up the editor for the sport cells.
JComboBox comboBox = new JComboBox();
for (int i = 0;i<=20;i++)
comboBox.addItem(i);
subpref1.setCellEditor(new DefaultCellEditor(comboBox));
//Set up tool tips for the sport cells.
DefaultTableCellRenderer renderer =
new DefaultTableCellRenderer();
renderer.setToolTipText("Click for combo box");
subpref1.setCellRenderer(renderer);
abstract class StringTransferHandler extends TransferHandler {
public int dropAction;
protected abstract String exportString(final JComponent c);
protected abstract void importString(final JComponent c, final String str);
@Override
protected Transferable createTransferable(final JComponent c) {
return new StringSelection(exportString(c));
@Override
public int getSourceActions(final JComponent c) {
return MOVE;
@Override
public boolean importData(final JComponent c, final Transferable t) {
if (canImport(c, t.getTransferDataFlavors())) {
try {
String str = (String) t.getTransferData(DataFlavor.stringFlavor);
importString(c, str);
return true;
} catch (UnsupportedFlavorException ufe) {
} catch (IOException ioe) {
return false;
@Override
public boolean canImport(final JComponent c, final DataFlavor[] flavors) {
for (int ndx = 0; ndx < flavors.length; ndx++) {
if (DataFlavor.stringFlavor.equals(flavors[ndx])) {
return true;
return false;
class TableTransferHandler extends StringTransferHandler {
private int dragRow;
private int[] dragColumns;
private BufferedImage[] image;
private int row;
private int[] columns;
public JTable target;
private Map<String, Color> colormap;
private TableTransferHandler(final Map<String, Color> colormap) {
this.colormap = colormap;
@Override
protected Transferable createTransferable(final JComponent c) {
JTable table = (JTable) c;
dragRow = table.getSelectedRow();
dragColumns = table.getSelectedColumns();
createDragImage(table);
return new StringSelection(exportString(c));
protected String exportString(final JComponent c) {
JTable table = (JTable) c;
row = table.getSelectedRow();
columns = table.getSelectedColumns();
StringBuffer buff = new StringBuffer();
colormap.clear();
for (int j = 0; j < columns.length; j++) {
Object val = table.getValueAt(row, columns[j]);
buff.append(val == null ? "" : val.toString());
if (j != columns.length - 1) {
buff.append(",");
colormap.put(row+","+columns[j], Color.LIGHT_GRAY);
table.repaint();
return buff.toString();
protected void importString(final JComponent c, final String str) {
target = (JTable) c;
DefaultTableModel model = (DefaultTableModel) target.getModel();
String[] values = str.split("\n");
int colCount = target.getSelectedColumn();
int max = target.getColumnCount();
for (int ndx = 0; ndx < values.length; ndx++) {
String[] data = values[ndx].split(",");
for (int i = 0; i < data.length; i++) {
String string = data;
if(colCount < max){
Object val = model.getValueAt(target.getSelectedRow(), colCount);
model.setValueAt(string, target.getSelectedRow(), colCount);
model.setValueAt(val, dragRow, dragColumns[i]);
colCount++;
public BufferedImage[] getDragImage() {
return image;
private void createDragImage(final JTable table) {
if (dragColumns != null) {
try {
image = new BufferedImage[dragColumns.length];
for (int i = 0; i < dragColumns.length; i++) {
Rectangle cellBounds = table.getCellRect(dragRow, i, true);
TableCellRenderer r = table.getCellRenderer(dragRow, i);
DefaultTableModel m = (DefaultTableModel) table.getModel();
JComponent lbl = (JComponent) r.getTableCellRendererComponent(table,
table.getValueAt(dragRow, dragColumns[i]), false, false, dragRow, i);
lbl.setBounds(cellBounds);
BufferedImage img = new BufferedImage(lbl.getWidth(), lbl.getHeight(),
BufferedImage.TYPE_INT_ARGB_PRE);
Graphics2D graphics = img.createGraphics();
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f));
lbl.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
lbl.paint(graphics);
graphics.dispose();
image[i] = img;
} catch (RuntimeException re) {
class TableDropTarget extends DropTarget {
private Insets autoscrollInsets = new Insets(20, 20, 20, 20);
private Rectangle rect2D = new Rectangle();
private TableTransferHandler handler;
public TableDropTarget(final TableTransferHandler h) {
super();
this.handler = h;
@Override
public void dragOver(final DropTargetDragEvent dtde) {
handler.dropAction = dtde.getDropAction();
JTable table = (JTable) dtde.getDropTargetContext().getComponent();
Point location = dtde.getLocation();
int row = table.rowAtPoint(location);
int column = table.columnAtPoint(location);
table.changeSelection(row, column, false, false);
paintImage(table, location);
autoscroll(table, location);
super.dragOver(dtde);
public void dragExit(final DropTargetDragEvent dtde) {
clearImage((JTable) dtde.getDropTargetContext().getComponent());
super.dragExit(dtde);
@Override
public void drop(final DropTargetDropEvent dtde) {
Transferable data = dtde.getTransferable();
JTable table = (JTable) dtde.getDropTargetContext().getComponent();
clearImage(table);
handler.importData(table, data);
super.drop(dtde);
private final void paintImage(final JTable table, final Point location) {
Point pt = new Point(location);
BufferedImage[] image = handler.getDragImage();
if (image != null) {
table.paintImmediately(rect2D.getBounds());
rect2D.setLocation(pt.x - 15, pt.y - 15);
int wRect2D = 0;
int hRect2D = 0;
for (int i = 0; i < image.length; i++) {
table.getGraphics().drawImage(image[i], pt.x - 15, pt.y - 15, table);
pt.x += image[i].getWidth();
if (hRect2D < image[i].getHeight()) {
hRect2D = image[i].getHeight();
wRect2D += image[i].getWidth();
rect2D.setSize(wRect2D, hRect2D);
private final void clearImage(final JTable table) {
table.paintImmediately(rect2D.getBounds());
private Insets getAutoscrollInsets() {
return autoscrollInsets;
private void autoscroll(final JTable table, final Point cursorLocation) {
Insets insets = getAutoscrollInsets();
Rectangle outer = table.getVisibleRect();
Rectangle inner = new Rectangle(outer.x + insets.left,
outer.y + insets.top,
outer.width - (insets.left + insets.right),
outer.height - (insets.top + insets.bottom));
if (!inner.contains(cursorLocation)) {
Rectangle scrollRect = new Rectangle(cursorLocation.x - insets.left,
cursorLocation.y - insets.top,
insets.left + insets.right,
insets.top + insets.bottom);
table.scrollRectToVisible(scrollRect);
/** 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">
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
table = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
table.setModel(new javax.swing.table.DefaultTableModel(
data, columnNames
jScrollPane1.setViewportView(table);
//populate();
table.getTableHeader().setReorderingAllowed(false);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setCellSelectionEnabled(true);
table.setDragEnabled(true);
TableTransferHandler th = new TableTransferHandler(colormap);
table.setTransferHandler(th);
table.setDropTarget(new TableDropTarget(th));
dropmenu(table, table.getColumnModel().getColumn(11));
jButton1.setText("Update");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jButton2.setText("Ex");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
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.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(92, 92, 92)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 605, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(347, 347, 347)
.addComponent(jButton1)
.addGap(115, 115, 115)
.addComponent(jButton2)))
.addContainerGap(73, Short.MAX_VALUE))
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(47, 47, 47)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(58, 58, 58)
.addComponent(jButton1)
.addContainerGap(83, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2)
.addGap(65, 65, 65))))
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
updateDB(); // TODO add your handling code here:
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try {
String pathToDesktop = System.getProperty("user.home")+File.separator+"Desktop";
pathToDesktop = pathToDesktop + "//Final Allotment.xls";
ExcelExporter exp = new ExcelExporter();
exp.exportTable(table, new File(pathToDesktop));
JOptionPane.showMessageDialog(this,"File exported and saved on desktop!");
catch (IOException ex) {
System.out.println(ex.getMessage());
ex.printStackTrace();
} // TODO add your handling code here:
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new tab7le().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable table;
// End of variables declaration
Please help !!!!!!!!
Thanks in advance.....Here is the code Do you expect people to read through 400 lines of code to understand what you are doing?
Why post code with access to a database? We can't access the database.
Search the forum for my "Database Information" (without the space) example class which shows you how to refresh a table with new data.
If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour. -
REPORT DOES NOT RUN CORRECTLY , URGENT PLEASE HELP
Hi,
I am trying to run a report from visul basic screen, but it does not run correctly. Here is how I am running the report. There is a screen developed in VB This screen prompts the user for user id and password. Once it gets that, it connects to the oracle database and pulls out a column from a table. And passes that value as a parameter to the report. Now I am calling the the report for each individual value . There are 21 value being pulled out of the database and it invokes the report 21 times. So there are 21 report engines gets started. Is there a better way to do that ? Secondly when I pass the parameter , some parameters does not pass correctly I guess , because its not generating any out put . Like out of 21 may be 10 or 11 reports gets generated correctly but rest of the reports are blank. I debug the screen i saw that the parameter value is correct, everything seems good. But still the reports are comming blank. Any Idea why it is so ? The command line that i am using in VB screen is
Shell "C:\progra~1\ora95_2\bin\rwrun60.exe P:\Business_Analysis_&_Reporting_Tool\Test_REPORT_Templates\STORE_TYPES\Baby_Distribution_Report.Rdf USERID=" & UID & "/" & PWD & "@cposp201 DESFORMAT=PDF DESTYPE=FILE DESNAME=" & txtPath.Text & Replace(strName, " ", "_") & ".PDF BRND='" & adoRecBrand!Brand & "' PRINTJOB=NO PARAMFORM=NO"
In the above command " adoRecBrand!Brand " is the parameter thats being passed. This is actually a recordset and brand is the column in it. When I debug the screen , I see the value also there. But the report comes out blank. Please help. This is urgent.
Thanks
FerozThe way you call reports is not scalable. If you have 100 records come back from database, you would end up launch 100 engines at the same times, which probably will blow up your machine. You should use oracle reports server to do that. You can either use rwcli60 to submit the job to reports server, or invoke rwcgi60 from URL.
I am afraid some of reports engine failed to start and you get nothing back in your case.
After switch to use reports server achitecture, if you still see some report is blank in your application, then you can run that report with that special set of parameters manually and see if any problem with the report itself.
Hope this helps.
Thanks,
-Shaun -
Ar aging report, need help urgent please help!
Hey All Gurus,
Im in a thick soup here. I am trying to do something like this -
if you see the selection screen i have rep and super rep, when a user enters a rep value --- it should use the same value to pull all open items for the super rep as well, since they are essentially the same. please help! this one needs to be done fast. i am pasting the code so that it will be easier ...
thanks a million!
*& Report ZFDOFW04_NEW
REPORT ZFDOFW04_NEW MESSAGE-ID FR
LINE-SIZE 132
LINE-COUNT 60.
*==================================================================
Program: ZFDOFW03 - Aged Trial Balance Report
This produces an Accounts Receivable Past Due Aging Report
in a more simplified/condensed format than the
SAP supplied aging report program - RFDOPR10.
This program is a modified copy of RFDOFW00, - a SAP
Future-Due Report.
This was a 'rush' job - program probably should be
rewritten someday not using logical databases as that
maybe why this runs so slowly!
Original: Feb 1997.
MAINTENANCE HISTORY:
NES071797 Copied from ZFDOFW03. Adding parameter for saeles rep.
JDEDERER - changed header text so it is differnet from ZFDORW03. 9/23
*TEXT SYMBOLS :
001 Open items per
002 O p e n
003 D u e o n
004 cc ba in total
005 until
006 Days until
007 Days over
008 Days
009 over
011 valid until........
012 Insurance limit.....
016 F u t u r e
017 + days
018 D u e
020 Last dunn.notice...
021 Dunning level....
030 S U M M A R Y S H E E T
031 =====================
050 Name Page
051 Burton Snowboard
SELECTION TEXTS:
SUMMEN Output totals only
TAGE1 Due date I until
TAGE2 Due date II until
TAGE3 Due date III until
TAGE4 Due date IV until
TABLES: T001, KNA1, KNB1, KNB5, BSID, BSEGA, RFPDO1, KNVP,
T014, "credit control areas JAM
KNVK, "cust master - contact partner JAM
T014T, "Credit control areas names
BKPF, "TONY ISSUE 4743
TVKO, "TONY ISSUE 4743
KNKK. "cust master - credit mgmt JAM
TYPES: BEGIN OF TOT_TYPE, "DEVK939546
BUKRS LIKE LFB1-BUKRS, "DEVK939546
GSBER LIKE BSIK-GSBER, "DEVK939546
KKBER LIKE BSID-KKBER,
RAST1 TYPE P, "DEVK939546
RAST2 TYPE P, "DEVK939546
RAST3 TYPE P, "DEVK939546
RAST4 TYPE P, "DEVK939546
RAST5 TYPE P, "DEVK939546
RAST6 TYPE P, "DEVK939546
RAST7 TYPE P, "DEVK939546
END OF TOT_TYPE, "DEVK939546
TOT_TAB TYPE TOT_TYPE OCCURS 0. "DEVK939546
CONSTANTS:
C_FALSE TYPE I VALUE 0, "JAM
C_TRUE TYPE I VALUE 1.
DATA: BEGIN OF GTAB OCCURS 1000,
SUPER(10) TYPE C, "TONYC
REP(10) TYPE C, "TONYC
FILKD(10), "tonyc show buying groups
LAND1 LIKE KNA1-LAND1,
GSBER LIKE BSIK-GSBER,
REGIO LIKE KNA1-REGIO,
NAME1 LIKE KNA1-NAME1,
NAME2 LIKE KNA1-NAME2,
ORT01 LIKE KNA1-ORT01,
TELF1 LIKE KNVK-TELF1, "telephone number JAM
CONT_NAME1 LIKE KNVK-NAME1, "contact name JAM
NAMEV LIKE KNVK-NAMEV, "contact name JAM
KUNNR LIKE KNA1-KUNNR, "TONYC
BUKRS LIKE LFB1-BUKRS, "TONYC
KKBER LIKE BSID-KKBER, "tonyc issue #2500
ZTERM LIKE KNB1-ZTERM, "tonyc issue #2500
KLIMK_TXT(22) TYPE C, "credit limit JAM
WAERS LIKE T014-WAERS, "currency JAM
SORT_GSB, "TONYC
RAST1 TYPE P,
RAST2 TYPE P,
RAST3 TYPE P,
RAST4 TYPE P,
RAST5 TYPE P,
RAST6 TYPE P,
RAST7 TYPE P,
T_IND,
END OF GTAB.
DATA HOLD_NAME(40).
DATA HOLD_BUKRS LIKE T001-BUKRS. "tonyc
DATA GOOD_SUPER_REP. "tonyc
DATA: HOLD_REP LIKE KNA1-KUNNR, "tonyc
SUPER_NAME LIKE KNA1-NAME1, "tonyc
REP_NAME LIKE KNA1-NAME1. "tonyc
DATA NAME_LENGTH(2) TYPE C. "tonyc
DATA BACKSLASH(3) VALUE ' / '. "tonyc
DATA REPS_INFO(70) TYPE C. "tonyc
DATA REPORT_TYPE(12) TYPE C.
DATA: C_CREDIT_ABTNR LIKE KNVK-ABTNR. "dept 003 = credit
DATA Z_HOLD_LIMIT(22) TYPE N. "tonyc issue#2216
DATA Z_DESCRIPTION(18). "tonyc issue#2216
DATA WRITE_TOTAL.
DATA HOLD_KLIMK LIKE KNKK-KLIMK.
DATA HOLD_KLIMK2(22) TYPE C.
DATA HOLD-CTLPC LIKE KNKK-CTLPC.
DATA HOLD-CTLPC-TEXT LIKE T691T-RTEXT.
DATA HOLD_ZTERM LIKE KNVV-ZTERM.
DATA TOTAL_RAST7 TYPE P.
DATA TOTAL_RAST2 TYPE P.
DATA TOTAL_RAST3 TYPE P.
DATA TOTAL_RAST4 TYPE P.
DATA TOTAL_RAST5 TYPE P.
DATA TOTAL_RAST6 TYPE P.
DATA TOTAL_RAST1 TYPE P.
DATA HOLD_BUKRS2 LIKE T001-BUKRS.
DATA HOLD_KKBER LIKE BSID-KKBER.
DATA HOLD_KKBER_DESC LIKE T014T-KKBTX.
DATA HOLD_KKBER_DESC2 LIKE T014T-KKBTX.
DATA HOLD_KUNNR2 LIKE KNA1-KUNNR.
DATA L_FIRST_DAY_OF_FISCAL LIKE SY-DATUM. "tonyc issue #3047
DATA: STAB TYPE TOT_TAB WITH HEADER LINE, "DEVK939546
RTOT TYPE TOT_TAB WITH HEADER LINE, "DEVK939546
STOT TYPE TOT_TAB WITH HEADER LINE, "DEVK939546
OP,
MAXMANDT LIKE DD_STIDA,
MAXMANST TYPE P,
SUMKLIMB TYPE P,
SUMVLIBB TYPE P,
VERZUG TYPE P,
OBAD TYPE P,
BLOCK_CNT TYPE P,
INTENS,
ONEBYTE(1) TYPE C,
TAGE1A LIKE RFPDO1-ALLGFAEL,
TAGE2A LIKE RFPDO1-ALLGFAEL,
TAGE3A LIKE RFPDO1-ALLGFAEL,
HOLD_KUNNR LIKE KNA1-KUNNR, "tonyc
HOLD_SUPER LIKE KNA1-KUNNR, "tonyc
HOLD_REP2 LIKE KNA1-KUNNR, "tonyc
SUPER_REP LIKE KNA1-KUNNR, "tonyc
TEMP_TELF1 LIKE KNA1-TELF1, "JAM
IT_T014 LIKE T014 OCCURS 0 WITH HEADER LINE, "JAM
G_KLIMK_TXT LIKE GTAB-KLIMK_TXT, "JAM
G_WAERS LIKE GTAB-WAERS, "JAM
G_CONT_NAME(50) TYPE C. "JA
DATA FILL_REP_INFO.
BC SUNILP 05/14/2007
DATA: BEGIN OF ITAB_VBRP OCCURS 0.
INCLUDE STRUCTURE VBRP.
DATA: END OF ITAB_VBRP.
DATA: T_PERC TYPE F,
SUM_NETWR LIKE VBRP-NETWR.
*DATA: GTAB_LINES LIKE GTAB OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF GTAB_LINES OCCURS 0.
INCLUDE STRUCTURE GTAB.
DATA: IND(1),
OBAD TYPE P.
DATA: END OF GTAB_LINES.
DATA: BEGIN OF ITAB_VBRP1 OCCURS 0,
VBELN LIKE VBRP-VBELN,
NETWR LIKE VBRP-NETWR,
ZZMREP LIKE VBRP-ZZMREP, "Super Rep
ZZLREP LIKE VBRP-ZZLREP, "Rep
PERC TYPE F,
END OF ITAB_VBRP1.
EC SUNILP 05/14/2007
BEGIN_OF_BLOCK 2.
PARAMETERS: REGIO LIKE KNA1-REGIO.
PARAMETERS: CONSOL AS CHECKBOX. "TONYC
PARAMETERS: P_KKBER AS CHECKBOX, "TONYC
P_CONV AS CHECKBOX. "tonyc issue #3047
PARAMETERS: SUMMEN LIKE RFPDO1-ALLGSUMM,
TAGE1 LIKE RFPDO1-ALLGFAEL DEFAULT '30',
TAGE2 LIKE RFPDO1-ALLGFAEL DEFAULT '60',
TAGE3 LIKE RFPDO1-ALLGFAEL DEFAULT '90',
TAGE4 LIKE RFPDO1-ALLGFAEL DEFAULT '120'.
END_OF_BLOCK 2.
BEGIN_OF_BLOCK 3.
SELECT-OPTIONS: P_SUPREP FOR KNVP-KUNNR, "Super REP "DEVK939546
P_REP FOR KNVP-KUNNR, "SALES REP "DEVK939546
P_VKORG FOR TVKO-VKORG, "TONYC ISSUE 4743
P_LOTKZ FOR BKPF-LOTKZ. "TONYC ISSUE 4743
END_OF_BLOCK 3.
INITIALIZATION. "JAM
PERFORM LOAD_T014. "JAM
refresh dd_augdt.
clear dd_augdt.
dd_augdt-option = 'EQ'.
dd_augdt-sign = 'I'.
dd_augdt-low = ' '.
append dd_augdt.
AT SELECTION-SCREEN.
IF CONSOL = 'X'.
IF NOT P_SUPREP[] IS INITIAL. "DEVK939546
MESSAGE E999 WITH 'Consolidated report not allowed w/ Super Rep'.
ENDIF.
ENDIF.
CHECK IF THE REP INFO IS ADDED OR NOT - VS
IF NOT P_SUPREP IS INITIAL OR"TONY ISSUE 4743
NOT P_REP IS INITIAL."TONY ISSUE 4743
FILL_REP_INFO = 'X'."TONY ISSUE 4743
ENDIF."TONY ISSUE 4743
START-OF-SELECTION.
get_frame_title 2.
add function module to track usage JD 10/13/98 *****
CALL FUNCTION 'Z_RUN_LOG'
EXCEPTIONS
OTHERS = 1.
*IF NOT P_SUPREP IS INITIAL AND NOT P_REP IS INITIAL.
P_SUPREP = ' '.
*ENDIF.
GET KNA1 FIELDS LAND1 REGIO KUNNR NAME1 NAME2 ORT01 TELF1. "JAM
new-page.
skip.
TEMP_TELF1 = KNA1-TELF1.
MAXMANDT = '19000101'.
MAXMANST = 0.
SUMVLIBB = 0.
PERFORM GET_CUST_CONTACT. "JAM
Check sales rep- NES071797
Get any valid record and exit.
IF NOT p_suprep[] IS INITIAL. "DEVK939546 "TONY ISSUE 4743 start
good_super_rep = ' '.
SELECT kunn2 INTO super_rep FROM knvp UP TO 1 ROWS
WHERE
kunnr = kna1-kunnr AND
parvw = 'ZS' AND
kunn2 IN p_suprep.
EXIT.
ENDSELECT.
IF sy-subrc = 0.
good_super_rep = 'X'.
gtab-super = super_rep.
super_rep = ' '.
ENDIF.
CHECK good_super_rep = 'X'.
SELECT kunn2 INTO gtab-rep FROM knvp UP TO 1 ROWS
WHERE
kunnr = kna1-kunnr AND
parvw = 'ZR' AND
kunn2 IN p_rep.
EXIT.
ENDSELECT.
CHECK sy-subrc = 0.
ELSEIF NOT p_rep[] IS INITIAL. "DEVK939546
SELECT kunn2 INTO gtab-rep FROM knvp UP TO 1 ROWS
WHERE
kunnr = kna1-kunnr AND
parvw = 'ZR' AND
kunn2 IN p_rep.
EXIT.
ENDSELECT.
CHECK sy-subrc = 0.
ENDIF. "TONY ISSUE 4743 end
GET KNB1 FIELDS BUKRS VLIBB ZTERM. "tonyc #2500
GTAB-BUKRS = KNB1-BUKRS.
GTAB-ZTERM = KNB1-ZTERM.
SUMVLIBB = SUMVLIBB + KNB1-VLIBB.
GET KNB5.
IF KNB5-MADAT > MAXMANDT.
MAXMANDT = KNB5-MADAT.
ENDIF.
IF KNB5-MAHNS > MAXMANST.
MAXMANST = KNB5-MAHNS.
ENDIF.
SUMKLIMB = SUMKLIMB + KLIMB.
GET BSID.
CHECK BSID-BSTAT = SPACE.
field was intended for Business Area, changed to use Currency
GTAB-GSBER = BSID-WAERS.
IF P_KKBER = 'X'. "TONYC ISSUE #2500
IF BSID-KKBER = ' '.
GTAB-KKBER = BSID-BUKRS.
ELSE.
GTAB-KKBER = BSID-KKBER. "TONYC ISSUE #2500
ENDIF.
ENDIF. "TONYC ISSUE #2500
SELECT SINGLE * FROM BKPF "TONY ISSUE 4743
WHERE BUKRS = BSID-BUKRS "TONY ISSUE 4743
AND BELNR = BSID-BELNR "TONY ISSUE 4743
AND GJAHR = BSID-GJAHR. "TONY ISSUE 4743
BC SUNILP 05/14/2007
IF BKPF-XREF2_HD IS NOT INITIAL.
CHECK BKPF-XREF2_HD IN P_SUPREP. "TONY ISSUE 4743
ELSE.
IF P_REP[] IS INITIAL.
REFRESH: ITAB_VBRP, ITAB_VBRP1.
IF NOT BKPF-XBLNR IS INITIAL.
SELECT * FROM VBRP INTO ITAB_VBRP WHERE VBELN = BKPF-XBLNR.
APPEND ITAB_VBRP. CLEAR ITAB_VBRP.
ENDSELECT.
CHECK ITAB_VBRP[] IS NOT INITIAL.
CLEAR: SUM_NETWR.
LOOP AT ITAB_VBRP.
CHECK ITAB_VBRP-ZZMREP IN P_SUPREP.
CHECK ITAB_VBRP-ZZLREP IN P_REP.
MOVE-CORRESPONDING ITAB_VBRP TO ITAB_VBRP1.
COLLECT: ITAB_VBRP1.
SUM_NETWR = SUM_NETWR + ITAB_VBRP-NETWR.
CLEAR ITAB_VBRP.
ENDLOOP.
CHECK ITAB_VBRP1[] IS NOT INITIAL.
LOOP AT ITAB_VBRP1.
CLEAR: T_PERC.
T_PERC = ( ITAB_VBRP1-NETWR / SUM_NETWR ).
ITAB_VBRP1-PERC = T_PERC.
MODIFY ITAB_VBRP1 INDEX SY-TABIX TRANSPORTING PERC.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
EC SUNILP 05/14/2007
IF FILL_REP_INFO = 'X'.
GTAB-SUPER = BKPF-XREF2_HD. "TONY ISSUE 4743 "MOVE THE CONTENTS OF XREF2_HD TO GTAB INTERNAL TABLE - VS
ENDIF.
BC SUNILP 05/14/2007
IF BKPF-XREF1_HD IS NOT INITIAL.
CHECK BKPF-XREF1_HD IN P_REP. "TONY ISSUE 4743 " ELSE MOVE THE CONTENTS OF - VS
ELSE.
REFRESH: ITAB_VBRP, ITAB_VBRP1.
IF NOT BKPF-XBLNR IS INITIAL.
SELECT * FROM VBRP INTO ITAB_VBRP WHERE VBELN = BKPF-XBLNR.
APPEND ITAB_VBRP. CLEAR ITAB_VBRP.
ENDSELECT.
CHECK ITAB_VBRP[] IS NOT INITIAL.
CLEAR: SUM_NETWR.
LOOP AT ITAB_VBRP.
CHECK ITAB_VBRP-ZZMREP IN P_SUPREP.
CHECK ITAB_VBRP-ZZLREP IN P_REP.
MOVE-CORRESPONDING ITAB_VBRP TO ITAB_VBRP1.
COLLECT: ITAB_VBRP1.
SUM_NETWR = SUM_NETWR + ITAB_VBRP-NETWR.
CLEAR ITAB_VBRP.
ENDLOOP.
CHECK ITAB_VBRP1[] IS NOT INITIAL.
LOOP AT ITAB_VBRP1.
CLEAR: T_PERC.
T_PERC = ( ITAB_VBRP1-NETWR / SUM_NETWR ).
ITAB_VBRP1-PERC = T_PERC.
MODIFY ITAB_VBRP1 INDEX SY-TABIX TRANSPORTING PERC.
ENDLOOP.
ENDIF.
ENDIF.
EC SUNILP 05/14/2007
IF FILL_REP_INFO = 'X'.
GTAB-REP = BKPF-XREF1_HD. "TONY ISSUE 4743
ENDIF.
CHECK BKPF-LOTKZ IN P_LOTKZ. "TONY ISSUE 4743
CHECK BKPF-BRNCH IN P_VKORG. "TONY ISSUE 4743
SELECT SINGLE FILKD INTO GTAB-FILKD FROM BSEG
WHERE BUKRS = BSID-BUKRS
AND BELNR = BSID-BELNR
AND GJAHR = BSID-GJAHR
AND BUZEI = BSID-BUZEI.
gtab-gsber = bsid-gsber.
get rep info for each bsid record
IF NOT P_SUPREP IS INITIAL. "tonyc
SELECT KUNNR FROM VBPA INTO HOLD_REP UP TO 1 ROWS "tonyc
WHERE VBELN = BSID-VBELN "tonyc
AND PARVW = 'ZR'. "tonyc
ENDSELECT. "tonyc
IF NOT P_REP IS INITIAL. "tonyc
CHECK HOLD_REP = P_REP. "tonyc
ENDIF. "tonyc
GTAB-REP = HOLD_REP. "tonyc
HOLD_REP = ' '. "tonyc
ENDIF. "tonyc
PERFORM GET_KNKK_INFO. "JAM
GTAB-KLIMK_TXT = G_KLIMK_TXT.
GTAB-WAERS = G_WAERS.
GTAB-LAND1 = KNA1-LAND1.
GTAB-REGIO = KNA1-REGIO.
GTAB-KUNNR = KNA1-KUNNR.
GTAB-NAME1 = KNA1-NAME1.
GTAB-NAME2 = KNA1-NAME2.
GTAB-ORT01 = KNA1-ORT01.
*if there is no phone number for the contact, pull the phone
*number from the sold-to
IF KNVK-TELF1 = ' '.
GTAB-TELF1 = TEMP_TELF1.
ELSE.
GTAB-TELF1 = KNVK-TELF1. "JAM
ENDIF.
GTAB-CONT_NAME1 = KNVK-NAME1.
GTAB-NAMEV = KNVK-NAMEV.
verzug = bsega-netdt - dd_stida.
VERZUG = DD_STIDA - BSEGA-NETDT. "days past due calculation
OP = 'X'.
GTAB-RAST2 = GTAB-RAST3 = GTAB-RAST4 = 0.
GTAB-RAST5 = GTAB-RAST6 = OBAD = GTAB-RAST7 = 0.
IF VERZUG LE 0. "future due
GTAB-RAST1 = BSEGA-WRSHB.
ELSE.
IF VERZUG LE TAGE1. "past due 1 to tage1 days
GTAB-RAST1 = BSEGA-WRSHB.
GTAB-RAST2 = BSEGA-WRSHB.
OBAD = BSEGA-WRSHB.
ELSE.
IF VERZUG LE TAGE2. "past due tage1 to tage2 days
GTAB-RAST1 = BSEGA-WRSHB.
GTAB-RAST3 = BSEGA-WRSHB.
OBAD = BSEGA-WRSHB.
ELSE.
IF VERZUG LE TAGE3. "past due tage2 to tage3 days
GTAB-RAST1 = BSEGA-WRSHB.
GTAB-RAST4 = BSEGA-WRSHB.
OBAD = BSEGA-WRSHB.
ELSE.
IF VERZUG LE TAGE4. "past due tage3 to tage4 days
GTAB-RAST1 = BSEGA-WRSHB.
GTAB-RAST5 = BSEGA-WRSHB.
OBAD = BSEGA-WRSHB.
ELSE.
IF VERZUG GT TAGE4. "past due > tage4 days
GTAB-RAST1 = BSEGA-WRSHB.
GTAB-RAST6 = BSEGA-WRSHB.
OBAD = BSEGA-WRSHB.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
GTAB-RAST7 = GTAB-RAST1 - OBAD.
stab = gtab.
MOVE-CORRESPONDING GTAB TO STAB.
BC SUNILP 05/15/2007
IF ITAB_VBRP1[] IS NOT INITIAL.
GTAB-T_IND = 'X'.
LOOP AT ITAB_VBRP1.
MOVE-CORRESPONDING GTAB TO GTAB_LINES.
GTAB_LINES-SORT_GSB = '1'.
GTAB_LINES-SUPER = ITAB_VBRP1-ZZMREP.
GTAB_LINES-REP = ITAB_VBRP1-ZZLREP.
GTAB_LINES-RAST1 = GTAB_LINES-RAST1 * ITAB_VBRP1-PERC.
GTAB_LINES-RAST2 = GTAB_LINES-RAST2 * ITAB_VBRP1-PERC.
GTAB_LINES-RAST3 = GTAB_LINES-RAST3 * ITAB_VBRP1-PERC.
GTAB_LINES-RAST4 = GTAB_LINES-RAST4 * ITAB_VBRP1-PERC.
GTAB_LINES-RAST5 = GTAB_LINES-RAST5 * ITAB_VBRP1-PERC.
GTAB_LINES-RAST6 = GTAB_LINES-RAST6 * ITAB_VBRP1-PERC.
GTAB_LINES-RAST7 = GTAB_LINES-RAST7 * ITAB_VBRP1-PERC.
GTAB_LINES-OBAD = GTAB_LINES-OBAD * ITAB_VBRP1-PERC.
COLLECT: GTAB_LINES.
ENDLOOP.
ELSE.
MOVE-CORRESPONDING GTAB TO GTAB_LINES.
GTAB_LINES-T_IND = 'X'.
GTAB_LINES-SORT_GSB = '1'.
IF GTAB_LINES-SUPER IN P_SUPREP OR GTAB_LINES-REP IN P_REP.
COLLECT: GTAB_LINES.
ENDIF.
ENDIF.
EC SUNILP 05/15/2007
gtab-sort_gsb = stab-sort_gsb = '0'.
collect: gtab, stab.
gtab-gsber = stab-gsber = '****'.
GTAB-SORT_GSB = '1'.
IF REGIO = SPACE OR REGIO = GTAB-REGIO.
IF GTAB_LINES-SUPER IN P_SUPREP OR GTAB_LINES-REP IN P_REP.
COLLECT: GTAB, STAB.
ENDIF.
ENDIF.
END-OF-SELECTION.
TAGE1A = TAGE1 + 1.
TAGE2A = TAGE2 + 1.
TAGE3A = TAGE3 + 1.
IF SUMMEN = ' '.
sort gtab by bukrs land1 regio kunnr gsber sort_gsb.
sort gtab by bukrs land1 regio name1 kunnr gsber sort_gsb. "JAM
IF CONSOL = 'X'.
SORT GTAB BY LAND1 REGIO NAME1 KUNNR BUKRS KKBER GSBER SORT_GSB.
"TONYC
REPORT_TYPE = 'consolidated'.
ELSEIF NOT P_SUPREP[] IS INITIAL. "DEVK939546
SORT GTAB
BY SUPER REP NAME1 BUKRS KKBER LAND1 REGIO NAME1 GSBER SORT_GSB.
BC SUNILP 05/15/2007
SORT GTAB_LINES
BY SUPER REP NAME1 BUKRS KKBER LAND1 REGIO NAME1 GSBER SORT_GSB.
EC SUNILP 05/15/2007
REPORT_TYPE = 'super rep'.
CLEAR STAB. "tonyc 03/06/2004
REFRESH STAB. "tonyc 03/06/2004
ELSEIF NOT P_REP[] IS INITIAL. "DEVK939546
SORT GTAB "DEVK939546
BY REP NAME1 BUKRS KKBER LAND1 REGIO NAME1 GSBER SORT_GSB.
"DEVK939546
BC SUNILP 05/15/2007
SORT GTAB_LINES
BY REP NAME1 BUKRS KKBER LAND1 REGIO NAME1 GSBER SORT_GSB.
EC SUNILP 05/15/2007
REPORT_TYPE = 'rep'. "DEVK939546
CLEAR STAB. "tonyc 03/06/2004
REFRESH STAB. "tonyc 03/06/2004
ELSE.
SORT GTAB BY BUKRS KKBER LAND1 REGIO NAME1 KUNNR GSBER SORT_GSB.
BC SUNILP 05/15/2007
SORT GTAB_LINES BY BUKRS KKBER LAND1 REGIO NAME1 KUNNR GSBER SORT_GSB.
EC SUNILP 05/15/2007
REPORT_TYPE = 'regular'.
ENDIF.
BC SUNILP 05/15/2007
DELETE ADJACENT DUPLICATES FROM GTAB COMPARING BUKRS NAME1.
LOOP AT GTAB_LINES.
IF P_REP[] IS INITIAL.
IF GTAB_LINES-SUPER NOT IN P_SUPREP.
DELETE GTAB_LINES.
ENDIF.
ELSE.
IF GTAB_LINES-SUPER NOT IN P_SUPREP OR GTAB_LINES-REP NOT IN P_REP.
DELETE GTAB_LINES.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT GTAB.
READ TABLE GTAB_LINES WITH KEY BUKRS = GTAB-BUKRS
NAME1 = GTAB-NAME1.
IF SY-SUBRC NE '0'.
DELETE GTAB.
ENDIF.
ENDLOOP.
EC SUNILP 05/15/2007
LOOP AT GTAB.
MOVE GTAB-BUKRS TO T001-BUKRS. READ TABLE T001.
RESERVE 5 LINES.
CASE REPORT_TYPE.
WHEN 'regular'.
IF HOLD_BUKRS <> GTAB-BUKRS.
IF SY-TABIX > 1. "TONYC
NEW-PAGE. SKIP. "TONYC
ENDIF. "TONYC
ENDIF.
PERFORM WRITE_CUST_INFO. "TONYC
PERFORM WRITE_DETAIL.
hold_bukrs = gtab-bukrs. "tonyc
WHEN 'consolidated'.
IF HOLD_KUNNR <> GTAB-KUNNR. "TONYC
PERFORM WRITE_CUST_INFO. "TONYC
ENDIF. "TONYC
HOLD_KUNNR = GTAB-KUNNR. "TONYC
PERFORM WRITE_DETAIL.
WHEN 'super rep'.
IF GTAB-T_IND NE 'X'.
BC SUNILP 05/22/2007
READ TABLE GTAB_LINES WITH KEY BUKRS = GTAB-BUKRS
NAME1 = GTAB-NAME1.
EC SUNILP 05/22/2007
IF ( HOLD_SUPER <> GTAB_LINES-SUPER ) OR
( HOLD_REP2 <> GTAB_LINES-REP ).
NEW-PAGE.
PERFORM GET_AND_WRITE_SUPERINFO.
ENDIF.
HOLD_REP2 = GTAB_LINES-REP.
HOLD_SUPER = GTAB_LINES-SUPER.
IF HOLD_KUNNR <> GTAB-KUNNR. "TONYC
WRITE :/. "TONYC
ULINE. "TONYC
PERFORM WRITE_CUST_INFO. "TONYC
ENDIF. "TONYC
HOLD_KUNNR = GTAB-KUNNR. "TONYC
PERFORM WRITE_DETAIL. "TONYC
AT END OF REP. "DEVK939546
SKIP. "DEVK939546
RESERVE 7 LINES. "DEVK939546
FORMAT COLOR COL_TOTAL INTENSIFIED. "DEVK939546
WRITE: / 'Summary for Rep:', "DEVK939546
GTAB-REP, '/', REP_NAME, 132 ONEBYTE."DEVK939546
PERFORM WRITE_TOTS TABLES RTOT. "DEVK939546
REFRESH RTOT. "DEVK939546
ENDAT. "DEVK939546
AT END OF SUPER. "DEVK939546
CLEAR STAB. "tonyc 03/06/2004
REFRESH STAB. "tonyc 03/06/2004
NEW-PAGE. SKIP. "DEVK939546
FORMAT COLOR COL_TOTAL INTENSIFIED. "DEVK939546
WRITE: / 'Summary for Super Rep:', "DEVK939546
GTAB-SUPER, '/', SUPER_NAME, 132 ONEBYTE."DEVK939546
PERFORM WRITE_TOTS TABLES STOT. "DEVK939546
REFRESH STOT. "DEVK939546
ENDAT. "DEVK939546
ELSE.
LOOP AT GTAB_LINES WHERE BUKRS = GTAB-BUKRS
AND NAME1 = GTAB-NAME1.
IF ( HOLD_SUPER <> GTAB_LINES-SUPER ) OR
( HOLD_REP2 <> GTAB_LINES-REP ).
NEW-PAGE.
PERFORM GET_AND_WRITE_SUPERINFO.
ENDIF.
HOLD_REP2 = GTAB_LINES-REP.
HOLD_SUPER = GTAB_LINES-SUPER.
IF HOLD_KUNNR <> GTAB_LINES-KUNNR.
WRITE :/.
ULINE.
PERFORM WRITE_CUST_INFO.
ENDIF.
HOLD_KUNNR = GTAB_LINES-KUNNR.
PERFORM WRITE_DETAIL.
AT END OF REP.
SKIP.
RESERVE 7 LINES.
FORMAT COLOR COL_TOTAL INTENSIFIED.
WRITE: / 'Summary for Rep:',
GTAB_LINES-REP, '/', REP_NAME, 132 ONEBYTE.
PERFORM WRITE_TOTS TABLES RTOT.
REFRESH RTOT.
ENDAT.
AT END OF SUPER.
CLEAR STAB. "tonyc 03/06/2004
REFRESH STAB. "tonyc 03/06/2004
NEW-PAGE. SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED.
WRITE: / 'Summary for Super Rep:',
GTAB_LINES-SUPER, '/', SUPER_NAME, 132 ONEBYTE.
PERFORM WRITE_TOTS TABLES STOT.
REFRESH STOT.
ENDAT.
ENDLOOP.
ENDIF.
WHEN 'rep'. "DEVK939546
LOOP AT GTAB_LINES WHERE BUKRS = GTAB-BUKRS
AND NAME1 = GTAB-NAME1.
IF HOLD_REP2 <> GTAB_LINES-REP. "DEVK939546
NEW-PAGE. "DEVK939546
PERFORM GET_AND_WRITE_REPINFO. "DEVK939546
ENDIF. "DEVK939546
HOLD_REP2 = GTAB_LINES-REP. "DEVK939546
IF HOLD_KUNNR <> GTAB_LINES-KUNNR. "DEVK939546
WRITE :/. "DEVK939546
ULINE. "DEVK939546
PERFORM WRITE_CUST_INFO. "DEVK939546
ENDIF. "DEVK939546
HOLD_KUNNR = GTAB_LINES-KUNNR. "DEVK939546
PERFORM WRITE_DETAIL. "DEVK939546
AT END OF REP. "DEVK939546
SKIP. "DEVK939546
RESERVE 7 LINES. "DEVK939546
FORMAT COLOR COL_TOTAL INTENSIFIED. "DEVK939546
WRITE: / 'Summary for Rep:', "DEVK939546
GTAB_LINES-REP, '/', REP_NAME, 132 ONEBYTE."DEVK939546
PERFORM WRITE_TOTS TABLES RTOT. "DEVK939546
REFRESH RTOT. "DEVK939546
ENDAT. "DEVK939546
ENDLOOP.
ENDCASE.
ENDLOOP.
ENDIF.
OP = ' '.
REFRESH GTAB.
IF NOT REPORT_TYPE = 'super rep'.
ULINE.
ENDIF.
SKIP 1.
IF SUMMEN = ' '. "if 'output totals only' bypass new-page
NEW-PAGE. SKIP.
ENDIF.
WRITE: /25 TEXT-030, 132 ONEBYTE, /25 TEXT-031, 132 ONEBYTE.
PERFORM WRITE_TOTS TABLES STAB. "DEVK939546
TOP-OF-PAGE.
INTENS = SPACE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE: / SY-VLINE, 1 TEXT-001, DD_STIDA, 75 TEXT-051, 132 SY-VLINE.
ULINE.
WRITE: / SY-VLINE, 13 SY-VLINE, 30 SY-VLINE,
47 SY-VLINE, 58 TEXT-003, 81 SY-VLINE,
92 TEXT-003, 115 SY-VLINE, 118 TEXT-003, 132 SY-VLINE,
/ SY-VLINE, 02 TEXT-004, 13 SY-VLINE, TEXT-002,
30 SY-VLINE, 32 TEXT-018, 47 SY-VLINE,
50 '1', 54 TEXT-040, 57 TAGE1, 64 SY-VLINE, " 65 tage2,
67 TAGE1A, 72 TEXT-040, 75 TAGE2,
81 SY-VLINE, 83 TAGE2A, 89 TEXT-040, 91 TAGE3, 98 SY-VLINE,
101 TAGE3A, 107 TEXT-040, 110 TAGE4, 115 SY-VLINE,
117 TAGE4, 123 TEXT-017, 132 SY-VLINE.
ULINE.
SKIP 1.
SUMMARY.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
FORM write_tots *
--> PTAB *
FORM WRITE_TOTS TABLES PTAB TYPE TOT_TAB. "DEVK939546
CLEAR INTENS. "DEVK939546
FORMAT COLOR COL_HEADING INTENSIFIED OFF. "DEVK939546
IF P_CONV = 'X'. "tonyc issue #3047 begin
WRITE /4 TEXT-101.
WRITE: /4 TEXT-102,
50 TEXT-100.
ENDIF. "tonyc issue #3047 end
ULINE. "DEVK939546
SORT PTAB BY BUKRS GSBER. "DEVK939546
LOOP AT PTAB. "DEVK939546
IF SY-TABIX > 1.
WRITE_TOTAL = 'X'.
ENDIF.
MOVE PTAB-BUKRS TO T001-BUKRS. READ TABLE T001. "DEVK939546
MOVE PTAB-GSBER TO T001-WAERS. "DEVK939546
IF P_CONV = 'X'. "tonyc issue #3047 begin
PERFORM CONVERT_VALUES USING STAB-RAST1
STAB-GSBER.
PERFORM CONVERT_VALUES USING STAB-RAST2
STAB-GSBER.
PERFORM CONVERT_VALUES USING STAB-RAST3
STAB-GSBER.
PERFORM CONVERT_VALUES USING STAB-RAST4
STAB-GSBER.
PERFORM CONVERT_VALUES USING STAB-RAST5
STAB-GSBER.
PERFORM CONVERT_VALUES USING STAB-RAST6
STAB-GSBER.
PERFORM CONVERT_VALUES USING STAB-RAST7
STAB-GSBER.
ENDIF. "TOnyc issue #3047 end
MOVE-CORRESPONDING PTAB TO STAB.
COLLECT STAB.
IF P_KKBER = 'X'. "TONYC ISSUE #2500
CLEAR HOLD_KKBER_DESC2.
SELECT SINGLE KKBTX INTO HOLD_KKBER_DESC2 FROM T014T
WHERE KKBER = STAB-KKBER AND
SPRAS = 'E'.
IF SY-SUBRC <> '0'.
HOLD_KKBER_DESC2 = 'Undetermined'.
ENDIF.
FORMAT COLOR OFF.
WRITE: / SY-VLINE.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
WRITE: 6 STAB-GSBER, HOLD_KKBER_DESC2, SY-VLINE.
ULINE.
FORMAT COLOR OFF.
WRITE: / SY-VLINE.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
IF P_CONV = 'X'. "tonyc issue #3047 begin
T001-WAERS = 'USD'.
ENDIF. "tonyc issue #3047 end
WRITE: 13 STAB-RAST1 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) STAB-RAST7 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) STAB-RAST2 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) STAB-RAST3 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) STAB-RAST4 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) STAB-RAST5 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) STAB-RAST6 NO-ZERO CURRENCY T001-WAERS, SY-VLINE.
HOLD_BUKRS2 = STAB-BUKRS. "TONYC ISSUE #2500
ULINE.
FORMAT COLOR OFF.
TOTAL_RAST1 = STAB-RAST1 + TOTAL_RAST1.
TOTAL_RAST2 = STAB-RAST2 + TOTAL_RAST2.
TOTAL_RAST3 = STAB-RAST3 + TOTAL_RAST3.
TOTAL_RAST4 = STAB-RAST4 + TOTAL_RAST4.
TOTAL_RAST5 = STAB-RAST5 + TOTAL_RAST5.
TOTAL_RAST6 = STAB-RAST6 + TOTAL_RAST6.
TOTAL_RAST7 = STAB-RAST7 + TOTAL_RAST7.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF. "DEVK939546
IF INTENS = SPACE. "DEVK939546
FORMAT COLOR COL_NORMAL INTENSIFIED OFF. "DEVK939546
INTENS = 'X'. "DEVK939546
ELSE. "DEVK939546
FORMAT COLOR COL_NORMAL INTENSIFIED ON. "DEVK939546
INTENS = SPACE. "DEVK939546
ENDIF. "DEVK939546
WRITE: / SY-VLINE, PTAB-BUKRS, PTAB-GSBER, SY-VLINE, "DEVK939546
(14) PTAB-RAST1 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,"DEVK939546
(14) PTAB-RAST7 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,"DEVK939546
(14) PTAB-RAST2 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,"DEVK939546
(14) PTAB-RAST3 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,"DEVK939546
(14) PTAB-RAST4 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,"DEVK939546
(14) PTAB-RAST5 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,"DEVK939546
(14) PTAB-RAST6 NO-ZERO CURRENCY T001-WAERS, SY-VLINE."DEVK939546
TOTAL_RAST1 = STAB-RAST1 + TOTAL_RAST1.
TOTAL_RAST2 = STAB-RAST2 + TOTAL_RAST2.
TOTAL_RAST3 = STAB-RAST3 + TOTAL_RAST3.
TOTAL_RAST4 = STAB-RAST4 + TOTAL_RAST4.
TOTAL_RAST5 = STAB-RAST5 + TOTAL_RAST5.
TOTAL_RAST6 = STAB-RAST6 + TOTAL_RAST6.
TOTAL_RAST7 = STAB-RAST7 + TOTAL_RAST7.
ENDIF.
ENDLOOP. "DEVK939546
ULINE. "DEVK939546
IF P_KKBER = 'X'. "TONYC ISSUE #2500
IF P_CONV = 'X'. "tonyc issue #3047 begin
FORMAT COLOR OFF.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
WRITE: SY-VLINE,
6 'TOTAL ', SY-VLINE.
ULINE.
FORMAT COLOR OFF.
WRITE: / SY-VLINE.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
WRITE: 13 TOTAL_RAST1 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST7 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST2 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST3 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST4 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST5 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST6 NO-ZERO CURRENCY T001-WAERS, SY-VLINE.
ULINE.
ENDIF. "tonyc issue #3047 end
ELSE.
IF P_CONV = 'X'.
FORMAT COLOR OFF.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
WRITE: SY-VLINE,
6 'TOTAL ', SY-VLINE.
ULINE.
FORMAT COLOR OFF.
WRITE: / SY-VLINE.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
WRITE: 13 TOTAL_RAST1 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST7 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST2 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST3 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST4 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST5 NO-ZERO CURRENCY T001-WAERS, SY-VLINE,
(14) TOTAL_RAST6 NO-ZERO CURRENCY T001-WAERS, SY-VLINE.
ULINE.
ENDIF.
ENDIF.
SKIP 1. "DEVK939546
ENDFORM. "DEVK939546
*& Form GET_KNKK_INFO
text
--> p1 text
<-- p2 text
FORM GET_KNKK_INFO.
CLEAR: G_WAERS,
G_KLIMK_TXT,
KNKK-KLIMK.
get credit control area (KKBER) for comp code (BUKRS)
SELECT SINGLE KLIMK
INTO KNKK-KLIMK
FROM KNKK
WHERE KUNNR = KNA1-KUNNR AND
KKBER = T001-KKBER.
IF SY-SUBRC = 0.
get currency for cred ctrl area
CLEAR IT_T014.
READ TABLE IT_T014 WITH KEY KKBER = T001-KKBER BINARY SEARCH.
G_WAERS = IT_T014-WAERS.
WRITE KNKK-KLIMK TO G_KLIMK_TXT CURRENCY G_WAERS.
ENDIF.
ENDFORM. " GET_KNKK_INFO
*& Form SELECT_KNKK
text
-->P_KKBER Credit Limit Controlling Area
<--P_FOUND_KNKK Indicates if record found
FORM SELECT_KNKK USING P_KKBER
CHANGING P_FOUND_KNKK.
CLEAR: G_WAERS,
G_KLIMK_TXT,
KNKK-KLIMK.
SELECT SINGLE KLIMK
INTO KNKK-KLIMK
FROM KNKK
WHERE KUNNR = KNA1-KUNNR AND
KKBER = P_KKBER.
IF SY-SUBRC = 0.
P_FOUND_KNKK = C_TRUE.
get currency for cred ctrl area
CLEAR IT_T014.
READ TABLE IT_T014 WITH KEY KKBER = P_KKBER BINARY SEARCH.
G_WAERS = IT_T014-WAERS.
WRITE KNKK-KLIMK TO G_KLIMK_TXT CURRENCY G_WAERS.
ELSE.
P_FOUND_KNKK = C_FALSE.
ENDIF.
ENDFORM. " SELECT_KNKK
*& Form GET_CUST_CONTACT & PHONE NUMBER
FORM GET_CUST_CONTACT.
CLEAR KNVK.
C_CREDIT_ABTNR = '0003'. "look for contact in credit dept
SELECT NAME1
NAMEV
TELF1
INTO (KNVK-NAME1,
KNVK-NAMEV,
KNVK-TELF1)
FROM KNVK
WHERE KUNNR = KNA1-KUNNR AND
ABTNR = C_CREDIT_ABTNR.
ENDSELECT.
If there wasn't a contact person for the credit dept, then just
pull up the first contact info we find regardless of dept
IF SY-SUBRC <> 0.
CLEAR KNVK.
SELECT NAME1
NAMEV
TELF1
INTO (KNVK-NAME1,
KNVK-NAMEV,
KNVK-TELF1)
FROM KNVK
WHERE KUNNR = KNA1-KUNNR.
IF SY-SUBRC = 0.
EXIT.
ENDIF.
ENDSELECT.
ELSE.
EXIT.
ENDIF. "not contact found in credit dept.
ENDFORM. " GET_CUST_CONTACT
*& Form LOAD_T014
FORM LOAD_T014.
SELECT *
INTO TABLE IT_T014
FROM T014.
SORT IT_T014.
ENDFORM. " LOAD_T014
*& Form WRITE_CUST_INFO "TONYC
text moved code and created a form. for cleaner code "TONYC
--> p1 text
<-- p2 text
FORM WRITE_CUST_INFO.
IF NOT REPORT_TYPE = 'super rep'.
IF SY-TABIX > 1.
ULINE.
ENDIF.
ENDIF.
CONCATENATE GTAB-NAMEV "JAM
GTAB-CONT_NAME1
INTO G_CONT_NAME
SEPARATED BY SPACE.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
IF REPORT_TYPE = 'super rep'.
IF GTAB-T_IND NE 'X'.
WRITE: / GTAB-KUNNR, GTAB-NAME1, GTAB-ORT01, GTAB-REGIO, GTAB-LAND1,
"g_cont_name,
132 ONEBYTE.
ELSE.
WRITE: / GTAB_LINES-KUNNR, GTAB_LINES-NAME1, GTAB_LINES-ORT01, GTAB_LINES-REGIO, GTAB_LINES-LAND1,
"g_cont_name,
132 ONEBYTE.
ENDIF.
WRITE: /21 onebyte, 12 gtab-name2, 45 gtab-ort01,
gtab-telf1, "gtab-klimk_txt, gtab-waers.
132 onebyte.
ELSE.
WRITE: / GTAB-KUNNR, GTAB-NAME1, GTAB-ORT01, GTAB-REGIO, GTAB-LAND1,
"g_cont_name, "JAM
132 ONEBYTE.
WRITE: /11 onebyte, 12 gtab-name2, 45 gtab-ort01,
gtab-telf1, "gtab-klimk_txt, gtab-waers, "JAM
132 onebyte.
ENDIF.
ENDFORM. " WRITE_CUST_INFO
*& Form GET_AND_WRITE_SUPERINFO
text
--> p1 text
<-- p2 text
FORM GET_AND_WRITE_SUPERINFO.
ULINE.
IF GTAB-T_IND NE 'X'.
SELECT SINGLE NAME1 FROM KNA1 INTO SUPER_NAME "TONYC
WHERE KUNNR = GTAB-SUPER. "TONYC
SELECT SINGLE NAME1 FROM KNA1 INTO REP_NAME "TONYC
WHERE KUNNR = GTAB-REP. "TONYC
CONCATENATE SUPER_NAME REP_NAME INTO REPS_INFO "TONYC
SEPARATED BY BACKSLASH. "TONYC
FORMAT COLOR COL_TOTAL INTENSIFIED. "TONYC
WRITE:/ GTAB-SUPER, '/', "TONYC
GTAB-REP, "TONYC
25 REPS_INFO, 132 ONEBYTE. "TONYC
ELSE.
SELECT SINGLE NAME1 FROM KNA1 INTO SUPER_NAME
WHERE KUNNR = GTAB_LINES-SUPER.
SELECT SINGLE NAME1 FROM KNA1 INTO REP_NAME
WHERE KUNNR = GTAB_LINES-REP.
CONCATENATE SUPER_NAME REP_NAME INTO REPS_INFO
SEPARATED BY BACKSLASH.
FORMAT COLOR COL_TOTAL INTENSIFIED.
WRITE:/ GTAB_LINES-SUPER, '/',
GTAB_LINES-REP,
25 REPS_INFO, 132 ONEBYTE.
ENDIF.
ENDFORM. " GET_AND_WRITE_SUPERINFO
*& Form GET_AND_WRITE_REPINFO
text
--> p1 text
<-- p2 text
FORM GET_AND_WRITE_REPINFO.
ULINE.
SELECT SINGLE NAME1 FROM KNA1 INTO REP_NAME
WHERE KUNNR = GTAB-REP.
FORMAT COLOR COL_TOTAL INTENSIFIED.
WRITE:/ GTAB-REP,
25 REP_NAME, 132 ONEBYTE.
ENDFORM. " GET_AND_WRITE_REPINFO
*& Form WRITE_DETAIL
text
--> p1 text
<-- p2 text
FORM WRITE_DETAIL.
clear z_description. "TONYC #2216
move GTAB-KLIMK_TXT to z_hold_limit.
IF z_hold_limit = 400.
z_description = 'COD/Check'.
elseif z_hold_limit = 500.
z_description = 'COD/Cash'.
elseif z_hold_limit = 600.
z_description = 'Need Dealer Agree'.
elseif z_hold_limit = 700.
z_description = 'Need PDCs'.
elseif z_hold_limit = 800.
z_description = 'Need Fin Statements'.
elseif z_hold_limit = 900.
z_description = 'Past Due Balance'.
elseif z_hold_limit = 1000.
z_description = 'Miracle?'.
endif. "TONYC #2216
MOVE GTAB-GSBER TO T001-WAERS.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
IF HOLD_KUNNR2 <> GTAB-KUNNR. "TONYC
IF REPORT_TYPE = 'super rep'.
WRITE: /3 ONEBYTE, GTAB-BUKRS.
WRITE: 92 gtab-klimk_txt, gtab-waers, 132 onebyte. "TONYC
WRITE: 92 gtab-klimk_txt, z_description,132 onebyte."TONYC #2500
ELSE.
WRITE: / ONEBYTE, GTAB-BUKRS.
WRITE: 92 gtab-klimk_txt, z_description,132 onebyte."TONYC #2500
WRITE: 92 gtab-klimk_txt, gtab-waers, 132 onebyte. "TONYC
ENDIF.
ENDIF.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
IF P_KKBER = 'X'. "TONYC ISSUE# 2500
CLEAR HOLD_KKBER_DESC.
SELECT SINGLE KKBTX INTO HOLD_KKBER_DESC FROM T014T
WHERE KKBER = GTAB-KKBER AND
SPRAS = 'E'.
IF SY-SUBRC <> '0'.
HOLD_KKBER_DESC = 'Undetermined'.
ENDIF.
SELECT SINGLE KLIMK CTLPC
INTO (HOLD_KLIMK, HOLD-CTLPC)
FROM KNKK
WHERE KUNNR = GTAB-KUNNR AND
KKBER = GTAB-KKBER.
SELECT SINGLE RTEXT INTO HOLD-CTLPC-TEXT FROM T691T
WHERE SPRAS = 'EN' AND
CTLPC = HOLD-CTLPC AND
KKBER = GTAB-KKBER.
WRITE HOLD_KLIMK TO HOLD_KLIMK2 CURRENCY GTAB-WAERS.
WRITE: /7 GTAB-KKBER,
12 HOLD_KKBER_DESC,
80 HOLD_KLIMK2,
103 GTAB-GSBER,
108 HOLD-CTLPC-TEXT.
ENDIF. "TONYC ISSUE# 2500
FORMAT COLOR COL_NORMAL INTENSIFIED ON. "TONYC
MOVE STAB-GSBER TO T001-WAERS.
CLEAR HOLD_NAME.
SELECT SINGLE NAME1 FROM KNA1 INTO HOLD_NAME
WHERE KUNNR = GTAB-FILKD.
WRITE: /15 GTAB-FILKD,
30 HOLD_NAME.
IF GTAB-T_IND NE 'X'.
WRITE: /15(14) GTAB-RAST1 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB-RAST7 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB-RAST2 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB-RAST3 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB-RAST4 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB-RAST5 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB-RAST6 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
132 ONEBYTE.
ELSE.
IF REPORT_TYPE NE 'super rep'.
LOOP AT GTAB_LINES WHERE KUNNR = GTAB-KUNNR.
WRITE: / GTAB_LINES-SUPER, ONEBYTE,
15(14) GTAB_LINES-RAST1 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST7 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST2 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST3 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST4 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST5 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST6 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
132 ONEBYTE.
ENDLOOP.
ELSE.
WRITE: / GTAB_LINES-SUPER, ONEBYTE,
15(14) GTAB_LINES-RAST1 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST7 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST2 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST3 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST4 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST5 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
(14) GTAB_LINES-RAST6 NO-ZERO CURRENCY T001-WAERS, ONEBYTE,
132 ONEBYTE.
ENDIF.
ENDIF.
HOLD_BUKRS = GTAB-BUKRS. "Tonyc
HOLD_KUNNR2 = GTAB-KUNNR. "TONYC
HOLD_KKBER = GTAB-KKBER. "TONYC ISSUE #2500
IF REPORT_TYPE = 'super rep' OR REPORT_TYPE = 'rep'. "DEVK939546
IF GTAB-T_IND NE 'X'.
MOVE-CORRESPONDING GTAB TO RTOT. "DEVK939546
COLLECT RTOT. "DEVK939546
ELSE.
MOVE-CORRESPONDING GTAB_LINES TO RTOT.
COLLECT RTOT.
ENDIF.
IF REPORT_TYPE = 'super rep'. "DEVK939546
IF GTAB-T_IND NE 'X'.
MOVE-CORRESPONDING GTAB TO STOT. "DEVK939546
COLLECT STOT. "DEVK939546
ELSE.
MOVE-CORRESPONDING GTAB_LINES TO STOT.
COLLECT STOT.
ENDIF.
ENDIF. "DEVK939546
ENDIF. "DEVK939546
ENDFORM. " WRITE_DETAIL
*& Form convert_values
text
-->P_STAB_RAST1 text
-->P_STAB_GSBER text
FORM CONVERT_VALUES USING P_STAB_RAST1 "tonyc issue #3047 begin
P_STAB-GSBER.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
CLIENT = SY-MANDT
DATE = SY-DATUM
FOREIGN_AMOUNT = P_STAB_RAST1
FOREIGN_CURRENCY = P_STAB-GSBER
LOCAL_CURRENCY = 'USD'
RATE = 0
TYPE_OF_RATE = 'M'
READ_TCURR = 'X'
IMPORTING
EXCHANGE_RATE =
FOREIGN_FACTOR =
LOCAL_AMOUNT = P_STAB_RAST1
LOCAL_FACTOR =
EXCHANGE_RATEX =
FIXED_RATE =
DERIVED_RATE_TYPE =
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " convert_valuessolved
-
URGENT PLEASE HELP - Source determination in Limits Carts not working
Dear all,
We have implemented SRM 4 on Server 5.0 and ECC 5 backend.
We have in our environment service masters that have been catalogued and linked to Contracts. When one raises a cart and selects one on these catalogue service items, a backend PO correctly creates and references the contract as specified in the catalog.
The problem we have discovered that if we raise a Limits order and specify the material group stipulated in the contract for a service, source determination fails to "pick up" this contract line. We are forced to enter a supplier all the time!
Also if we raise a text service line and select from "internal Goods/Services" a Service Master record and add it tothe cart, surce determination also does not pick up the R3 contract/line that matched this service. This means that when POs are created in the backend, they are not referencing any contract (no call-off)
Why is this happening? How come catalogue items linked to a service masters and contracts work and correctly and a Limits order do not?
Please help, we need to resolve this issue today.
Thanks,
Grace.Hi Grace,
The contracts that are created in SRM can only be refered as Source of supplies while creating shopping carts if your are working in Extended Classic scenario.
In case you want to refer the back end contracts, Info. records for creating shopping carts you have to implement classic scenario.
The standard SRM does not provide the functionality you needed where as if you want to use back end contracts for a particular product category you can implement "Controlled Extended Classic Scenario BADI " which makes the classic scenario active for that product category, there by a back end contract can be referred for that product category when ever a shopping cart is made.
Hope this makes you clear. Clarifications are welcome.
Award points for suitable replies.
Rgds,
Teja
Maybe you are looking for
-
Installation problem on windows 2000
Hi, Please help! I've been tring to install oracle on windows 2000 machine unsuccessfully. the setup program aborted without error message. I've tried many versions of oracle database, 8.1.7 all editions, 8.1.6ee, 9iAS. the only message error I got w
-
Hi, I have a question about the Sales Deals in SAP. When we create a sales deal and release this sales deal it is not possible to change this status. Is it normal that a Deal Status cannot be changed once it has ben released? Or is this a customizing
-
Can I set the iPad to use the same client certificate by default?
I have an ipad which has more than one client cert installed. is there a way to select one of the certificates as the default when visiting websites that require client cert auth? Thanks
-
Seperate Document Number Range
Hi all, I have created a new movement type called 901 and 902 which is nothing but replication of movement types 541 and 542. But I would like to know if its possible for the system to generate a new document number range for movement 901. Thanks Reg
-
Hi all, How to generate a spool number of a smartform. Remember in the condition for that output type i have marked Print Immediately. Regards, Rajeswara Rao.J