Workcenter in MSEG or some other table
Dear All,
In our industry, we are creating a single production order for one month production of that material. Now at the time of Confirmation we can change the Workcenter as per our requirement and do the confirmation. In AUFM & MSEG tables I am not able to find this Workcenter Field. And my management require report as workcenter-wise.
I can get the data from AFRU Table as workcenter is maintained there. But the main problem in it is we have a process of partial cancellation also. (e.g I have confirmed Material X = 100 NO [some qty. of X material say 40 NO has been issued to some other order. So net remaining qty of X = 60 NO]. But after one or two days we get to know that confirmation of Material X was wrong and actual entry is of only 50 NO. Now we do the partial cancellation through MB31 transaction [102 Mvt.]. Now this partial cancellation is not getting updated in AFRU Table). So I can not pick the data from AFRU Table also.
So the only way (as per my knowledge) is to get the data from MSEG Table but no workcenter is there in this table.
So please suggest a solution.
Regards,
Vishal
+91 9812335975
Dear Vishal,
1) if Your using ECC 6.0, then u can get work center wise confirmation report
2) Go to COOIS, i list input confirmations, then input plant and Execute
3) after executing, just Go to Change Layout & add Work center
4) Now System will show the confirmations Against which work centers carried out
Hope this Helps
Regards
kumar
Similar Messages
-
How to insert this date colum into some other table
Hi all,
I have to write a procedure to select the data from one table & insert date column data into another table,the data is in different date formats,but in the second table date column format should be (mm/dd/yyyy) .
example:
if the date in first table is 1992 it should be modify to "01-01-1992" & insert into the second table.But the values should be different(below are the different types).
RELEASE_DATE
1992
1962
July 1987
Aug 1968
10/30/06
6/1/2005
2004
7.25.1951
12/12/2006
12/1/2005
1992
2003
2005
1958
2002
11/11/03
1/1/91
50-21-2001
10.28.1991
Please any body can help.<FONT FACE="Arial" size=2 color="2D0000">
Thanks..! for giving the data type..
Here is an example..
SQL> desc atestdate
Name Null? Type
CHARDATE VARCHAR2(10)
ACTDATE DATE
SQL> select * from atestdate;
1992
July 1987
Aug 1968
10/30/06
6/1/2005
2004
7.25.1951
12/12/2006
12/1/2005
1992
2003
2005
1958
2002
11/11/03
1/1/91
50-21-2001
10.28.1991
18 rows selected.
SQL> select <font color="#0000ff">char_trim_x</font>(chardate) from atestdate;
1992
July-1987
Aug-1968
10-30-06
6-1-2005
2004
7-25-1951
12-12-2006
12-1-2005
1992
2003
2005
1958
2002
11-11-03
1-1-91
50-21-2001<font color="#8000ff">--? 50 can not be a month nor a date do not give junk values</font>
10-28-1991
18 rows selected.
<font color="#0000ff">char_trim_x</font> This is a function which I have created with REPLACE function
this brings to some extent of an orderly format..
<font color="#008000">But you have not yet posted your work ..</font>
-SK
</FONT> -
How to display records from base table as well as some other table?
Hello expert,
I have a requirement to develope a form described below:
One control block and database block.
DB block is based on table T1 (USER, Table_name, Column_name, ACCESS);
In control block, there are three fields,
User, Table user will enter , and DB block will query based on control block fields(user, table_name).
In table it is not necessary that all the columns of any table will be given.
suppose there is a Table X consist of 10 column.
Initially user give access for all the 10 columns through this form.
if we query for user , table, all the record will come from table T1.
now consider the case, when access given to table X number of columns were 10. after that 2 new columns added later.
now there is no info of added column in table T1. i want if user query DB block, these newly added column must display in DB Block.
Please help me out.
Thanks
Dhirender>i want if user query DB block, these newly added column must display in DB Block.
You need to modify your form and add the two columns as base table items. Forms does not add two base table items by itself. -
Join EQUI table with other table so as get address detail.
Hi All,
Can any one help me in the following case :
I have to pass Equipment No. EQUNR on the selection screen and get Address detail (city, region, state, country, zipcode )
now I am getting all this address related field in KNA1 table. Also I am able to join this two table with
KNA1-KUNNR join EQUI-KUNDE as common field.
Turning point
when I am passing test data of Equipment No. EQUNR 60099204 I am not getting the address detail,
because after passing EQUNR I am not getting KUNNR.
So can any one please help me in joining EQUI table to some other table with field name so that I can get the address detail.
ThanksHi,
The join between the table EQUI-kunde join KNA1-kunnr is ok but it not working for every value.
Example :-
In EQUI table when we pass Equnr - 60099204 we need to get some value in KUNDE field, then only it will join to KNA1 table. But this is not happening, I am not getting value for KUNDE, hence join is not performing.
So I need some other solution so that when we pass EQunr we can get the address details
one thing more equnr 60099204 is having address detail, if we'll check IE03 (transaction by clicking address envelop)
Thx. -
Insert into other table from form
Hi All,
I have created a data block with view as a data source. I need to save the data from a form to some other table.
I have tried using INSTEAD OF Trigger. howeverwhen I try to save, getting an error : ORA-01445 cannot select ROWID from a join view without a key-preserved table.
I appreciate any suggestions on it.
Thanks and Regards
SaiSorry, it looked at first as if you wanted help on the problem you encountered. After reading again your response to Zaibiman I see that you were just tricking us with the detailed explanation of the error.
To insert into a table other than the one you queried, use the on-insert trigger.
However, an Instead Of trigger on the view is usually the best method. If you have set the key mode, defined a primary key item and removed any references to rowid, as per Zaibiman, then it should work. You'll need your own locking method if the view uses Group By or Distinct. -
How to store report data in some other tale
Hi All,
I have one requirement from client but i don't know whether it is possible or not?
Any one give me an idea if it is possible.
EX:
I run the report with EMP table with SCOTT schema.i got the output.Now i want that output to be stored in some other table called TEST_EMP.
how i can store data from the report.I have to write any PL/SQL code in AFTER REPORT TRIGGER.
Please give me reply ASAP.Hi,
I would do this in group filter (in the lowest group of the query)
Regards
Rainer -
Reconciliation to other tables (than USR)
Hello,
I am using Database Tables Connector to reconcile data from HR system to OIM, the connector reconciles data from table e.g. USERS in HR system to OIM (USR table - it is hard-coded in the connector) - this mechanism works really fine...
...but...
...in the HR system I have some other tables that store data about organizational structure and I would like to create some new tables in OIM schema (regarding organizational structure) and reconcile also this data, so my question is: Is it possible to do that using Database Tables Connector? Maybe through come customization of this connector, because as I have mentioned the connector reconciles data to USR table (in OIM) by default. Did anybody face similar scenario?
Thanks in advance!
Maciej.Hi,
I have a scenario like yours. Here is what I am doing:
- Cretead lookups to store the lists of my target system;
Lookups.HR.ModelTypes
- Created an IT Resource of Database to connect to the database of my target system;
Resource Name = DBHR
DatabaseName = DBHR
Driver = oracle.jdbc.driver.OracleDriver
Password = *******
URL = jdbc:oracle:thin:@win2k3base:1521:orcl
UserID = DBHR_User
- Created a schedule task to reconcile the lookups. Below are the parameters of this task;
package scheduler.tasks;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Hashtable;
import com.thortech.xl.util.adapters.tcUtilXellerateOperations;
public class TaskLoadLookupFromDatabase extends SchedulerBaseTask {
* Definitions of the task parameters
private String strLookupCodeName;
private String strITResourceName;
private String strTableName;
private String strFieldNameForCodeKey;
private String strFieldNameForDecode;
private String strFieldNameForCountryCode;
private String strFieldNameForLanguageCode;
private String strSQLForFilter;
protected tcLookupOperationsIntf xlLookupOpIntf = null;
protected Logger logger = Logger.getLogger("log4j.logger.BAT.OIM.SCHEDULER_TASKS");
protected String CLASS_NAME = this.getClass().getName();
* ITResource parameters
private String strDriver = null;
private String strDbURL = null;
private String strAdminId = null;
private String strAdminPwd = null;
public TaskLoadLookupFromDatabase() {
super();
protected void addLookupItem(String lookupCodeName, String codeKey,
String decodedValue, String languageCode, String countryCode){
logger.debug(String.format("CODEKEY = %s DECODE = %s", codeKey, decodedValue));
try {
xlLookupOpIntf.addLookupValue(lookupCodeName, codeKey, decodedValue,
languageCode, countryCode);
} catch (tcInvalidValueException dupValEx) {
try {
HashMap<String, String> decodedMap = new HashMap<String, String>();
decodedMap.put("LKV_DECODED", decodedValue);
// Updates the Decode value of an existent CodeKey
xlLookupOpIntf.updateLookupValue(lookupCodeName, codeKey, decodedMap);
} catch (tcAPIException apiEx) {
logger.debug("New value is same as existing value.");
} catch (Exception ex) {
logger.error("Error Updating Lookup: " + ex.toString(), ex);
} catch (tcAPIException apiEx) {
logger.error("Error Adding Lookup: " + apiEx.toString(), apiEx);
} catch (Exception ex) {
logger.error("Error Adding Lookup: " + ex.toString(), ex);
public boolean stop() {
logger.debug("Entering stop() for " + CLASS_NAME);
return true;
public void init() {
logger.debug("Entering init() method : " + CLASS_NAME);
try {
// LookupCodeName, ITResourceName, TableName, FieldNameForCodeKey,
// FieldNameForDecode, SQLForFilter
strLookupCodeName = this.getAttribute("LookupCodeName");
strITResourceName = getAttribute("ITResourceName");
strTableName = this.getAttribute("TableName");
strFieldNameForCodeKey = this.getAttribute("FieldNameForCodeKey");
strFieldNameForDecode = this.getAttribute("FieldNameForDecode");
try{
strFieldNameForCountryCode = this.getAttribute("FieldNameForCountryCode");
strFieldNameForLanguageCode = this.getAttribute("FieldNameForLanguageCode");
}catch(Exception ex){}
strSQLForFilter = this.getAttribute("SQLForFilter");
logger.debug("###########################");
logger.debug("LookupCodeName: " + strLookupCodeName);
logger.debug("ITResourceName: " + strITResourceName);
logger.debug("TableName: " + strTableName);
logger.debug("FieldNameForCodeKey: " + strFieldNameForCodeKey);
logger.debug("FieldNameForDecode: " + strFieldNameForDecode);
logger.debug("FieldNameForCountryCode: " + strFieldNameForCountryCode);
logger.debug("FieldNameForLanguageCode: " + strFieldNameForLanguageCode);
logger.debug("SQLForFilter: " + strSQLForFilter);
logger.debug("###########################");
this.validateString(strLookupCodeName,
"The parameter LookupCodeName can not be null.");
this.validateString(strITResourceName,
"The parameter ITResourceName can not be null.");
this.validateString(strTableName,
"The parameter TableName can not be null.");
this.validateString(strFieldNameForCodeKey,
"The parameter FieldNameForCodeKey can not be null.");
this.validateString(strFieldNameForDecode,
"The parameter FieldNameForDecode can not be null.");
xlLookupOpIntf = (Thor.API.Operations.tcLookupOperationsIntf) getUtility("Thor.API.Operations.tcLookupOperationsIntf");
} catch (Exception ex) {
logger.error("Error in init() method : " + ex.toString());
this.setResult(ex);
this.stopExecution();
return;
logger.debug("Exiting init() method: " + CLASS_NAME);
* Method : execute Description : overridden execute() method of
* BaseScheduleTask; Establishes a connection to the database and execute a
* SQL statement based on the parameters
public void execute() {
logger.debug("Entering execute() method: " + CLASS_NAME);
Connection con = null;
ResultSet rset = null;
if (this.isStopped()) return;
Hashtable htITResDetails = null;
try {
// Loads the IT Resource parameters
htITResDetails = tcUtilXellerateOperations.getITAssetProperties(this
.getDataBase(), strITResourceName);
// get connection details from IT resource
strDriver = (String) htITResDetails.get("Driver");
strDbURL = (String) htITResDetails.get("URL");
strAdminId = (String) htITResDetails.get("UserID");
strAdminPwd = (String) htITResDetails.get("Password");
Class.forName(this.strDriver);
con = DriverManager.getConnection(this.strDbURL, this.strAdminId,
this.strAdminPwd);
Statement stmt = con.createStatement();
// Builds the SQL Statement
StringBuffer strSQLStmt = new StringBuffer();
strSQLStmt.append(" SELECT ");
strSQLStmt.append(strFieldNameForCodeKey + ", "
+ strFieldNameForDecode);
if((strFieldNameForCountryCode != null) && (!strFieldNameForCountryCode.equals(""))){
strSQLStmt.append(", " + strFieldNameForCountryCode);
if((strFieldNameForLanguageCode != null) && (!strFieldNameForLanguageCode.equals(""))){
strSQLStmt.append(", " + strFieldNameForLanguageCode);
strSQLStmt.append(" FROM ");
strSQLStmt.append(strTableName);
if (strSQLForFilter != null && !strSQLForFilter.trim().equals("")) {
strSQLStmt.append(" WHERE ");
strSQLStmt.append(strSQLForFilter);
rset = stmt.executeQuery(strSQLStmt.toString());
logger.debug("#########################################");
String strCountryCode = "";
String strLanguageCode = "";
while (rset.next()&& (this.isStopped() == false)) {
strCountryCode = "";
strLanguageCode = "";
String strCodeKey = rset.getString(strFieldNameForCodeKey);
String strDecode = rset.getString(strFieldNameForDecode);
if((strFieldNameForCountryCode != null) && (!strFieldNameForCountryCode.equals(""))){
strCountryCode = rset.getString(strFieldNameForCountryCode);
if((strFieldNameForLanguageCode != null) && (!strFieldNameForLanguageCode.equals(""))){
strLanguageCode = rset.getString(strFieldNameForLanguageCode);
this.addLookupItem(strLookupCodeName, strCodeKey, strDecode, strCountryCode, strLanguageCode);
logger.debug("#########################################");
} catch (Exception ex) {
logger.error("Error in execute() method: " + ex.toString());
this.setResult(ex);
this.stopExecution();
return;
logger.debug("Exiting execute() method: " + CLASS_NAME);
public void validateString(String str, String errorMessage)
throws Exception {
if ((str == null) || str.trim().equals("")) {
throw new Exception(errorMessage);
- Created a schedule task of TaskLoadLookupFromDatabase and set the parameters below:
LookupCodeName= Lookups.HR.ModelTypes;
ITResourceName = DBHR;
TableName = Model
FieldNameForCodeKey = Model_Code
FieldNameForDecode = Model_Name
FieldNameForCountryCode =
FieldNameForLanguageCode =
SQLForFilter = Model_Type = 'P' and Model_Active = 'Y'
Thanks,
Renato. -
How to get selected records from an ALV Grid in some other internal table
I am using a standard SAP program (RFKKMA02) in a Z program. Now i want to select some rows in ALV and after doing some modification, i want to store those records in some other internal table. I am not using OO concept.
Thanks in advance.u create first internal table of structur of fields that u want to copy and then move taht values to internal table
-
Error while updating a task - Task acquired by some other user
Hi,
I have a task assigned to a Group (AdminGroup). To update the outcome of task ie to approve task i am first acquiring the task and then updating the task outcome.
But while doing so i am getting following error:
Invalid action on workflow task.
Action OUTCOME_UPDATE on task 101d12624092f7d9:-1f79044d:124e34e8057:-7b4e is not valid because of The task has been acquired by some other user..
Contact oracle support if error is not fixable.
at oracle.bpel.services.workflow.task.impl.TaskService.performPreActionValidation(TaskService.java:3408)
at oracle.bpel.services.workflow.task.impl.TaskService.updateTaskOutcomeAndEvaluateRoutingSlip(TaskService.java:1074)
at oracle.bpel.services.workflow.task.impl.TaskService.updateTaskOutcome(TaskService.java:941)
at oracle.bpel.services.workflow.task.impl.TaskService.updateTaskOutcome(TaskService.java:920)
at oracle.bpel.services.workflow.task.ejb.TaskServiceBean.updateTaskOutcome(TaskServiceBean.java:410)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at com.evermind.server.ThreadState.runAs(ThreadState.java:622)
at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.TxRequiresNewInterceptor.invoke(TxRequiresNewInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
at TaskServiceBean_RemoteProxy_68d4144.updateTaskOutcome(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
The code that i am using for updating the task outcome is as follows:
The error should not come as the context of user is same for acquiring and updating.
IWorkflowContext wfCtx=wfSvcClient.getTaskQueryService().authenticate("oc4jadmin", "oc4jadmin",
"jazn.com", "admin");
ITaskService objITaskService=wfSvcClient.getTaskService();
objITaskService.acquireTask(wfCtx, strTaskID);
objITaskService.updateTaskOutcome(wfCtx, strTaskID, "APPROVE");
Here admin is the user that belongs to group AdminGroup and the task is assigned to AdminGroup.
It was working fine a week ago on the same enviornment but from past few days am getting this error.
The BPEL version is 10.1.3.0.
Help appreciated!!
Regards,
Bhavikhi,
Thanks Marc for the reply.
Before acquiring the task , I have checked the acquiredby column in wftask table in orable schema and its value is null.
So it allows me to acquire the task. The error that i am getting is on updating the task outcome.
While updating it is giving error as: task already acquired by some other user.
This should not happen as the workflow context that i am using for acquiring the task and updating the task is same.
Regards,
Bhavik -
Confused about wheather to use session or some other technology
i have two jsp pages one is index.jsp and other one is display.jsp,from index.jsp i am passing a string value and collecting it in display.jsp ,after collecting it i am making use of that value in a sql query to display the result from the data base,and i am getting one line (row) of display ,when i repeat the process again that row is over written which i do not want , what i want is as long as i keep sending strings from index.jsp tp disply.jsp the number of rows should be added (as a display in display.jsp)
and i wanted to do that in jsp environment only as i am not aware of struts and some other technology.some sample code of display.jsp is as follows
String INDENT_NUMBER = request.getParameter("indent_number");
query1="select some data from some tables where a.INDENT_NUMBER = '"+INDENT_NUMBER+"'";
while(rs.next){
get some values here to display
like
String item_name =rs1.getString("item_name");
String INDENT_QUANTITY=rs1.getString("INDENT_QUANTITY");
here i want to display row wise data
and now close the while loop
please get me the idea if possible with sample code,i'll be greatfull to u,
thanxI would add the String you get from the DB to an ArrayList, and store that ArrayList in the session. Then, at time of display, just iterate over the List. I would also look into putting the SQL into a JavaBean that does the work. Take as much of that code out of the JSP as possible.
-
When configuring a new Unity Voicemail Account I receive this message : The phone number or extension has already been assigned to some other object. I understand that this means that the 10 digit number I am trying to configure as the alternate extension for this user is already configured for another object with Unity.
I need to search by the 10 digit number and determine where it is configured so I can change it and map to the correct end user.
I have attempted to to search Users via DTMF Access ID using the 10 digit number with nothing being returned via that search.
How do I Search all of the copnfigured Alternate Extensions within our Unity Server?A subscriber info dump is likely the fastest way. If you're curious regarding other methods, you can also use the Data Link Explorer (CUDLE) tool which is in the Cisco Unity Tools Depot. All extensions for all objects are referenced in the "DTMFAccessId" table. The View menu has a Query Builder which you can use to compile a SQL query that searches for a digit string. It's best to search for both the 10 digit string as well as an abbreviated string as Unity sees them essentially the same and they are usually should be associated with a single subscriber. Once you find a match, you can use the "ParentObjectId" value associated with the DTMF access ID to look for a matching owner in the "GlobalSubscriber" table. The ParentObjectId should match the SubscriberObjectId for a subscriber (assuming the DTMF access ID is assigned to a subscriber). This is the same thing as looking at SQL; however, you are not directly accessing the DB so this is generally considered the safest way to browse and get a feel for where things are.
Hailey -
Creating a new schema or adding some more tables in existing schema ??
Hi All,
We have a new requirement from the client asking us to include a few new functionalities(pages--- all together a new application has to be embedded into our application) in our application. By adding these new functionalities, the number of hits to our application can be doubled.
As per the above requirement, I would like to know that whether to create a new schema or to create some new tables in the existing database for the new functionalities.
By what way, can I handle the number of requests in a better way? by creating the new schema or by creating the new tables for the new functionalities.
Also I would like like to know what kind of factors will differ between creating a new schema or creating new tables for the new functionalities in the existing schema.
FYI... We are using Cold Fusion as front-end and Oracle 9i for back-endThis the forum for Oracle's SQL Developer tool. You will get better answers in the Database - General forum.
The short answer is that from a performance point of view there will be no difference. The issues are more to do with maintenance. -
How to populate rows from another table in new blank rows of other table
I have to convert an oracle form 6i to Jdeveloper application. In forms 6i we use create a cursor for other table and then populate the current table data block row using create record and assigning its values from cursor and then issuing next record until all cursor records are written in data block. After some manual editing we save the whole form and then all block records are saved as new rows in table.
Now how to create this functionality in jdeveloper application.
Kindly help.two steps-
1. get row from first VO.iterate them - like below -
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("ViewObj1Iterator");
HSSFRow excelrow = null;
// Get all the rows of a iterator
oracle.jbo.Row[] rows = dcIteratorBindings.getAllRowsInRange();
int i = 0;
for (oracle.jbo.Row row : rows) {
row.getAttribute(colName).toString()); // by this you can get row attribute value..
2. inside iteration create row for VO 2 for example-
ViewObject employee= findViewObject("EmployeeVO");
// Create a row and fill in the columns.
Row row = employee.createRow();
row.setAttribute("Name", "Vinay");
row.setAttribute("EmpId", 1);
//Insert row in to the default row set
employee.insertRow(row);
Read more: http://www.techartifact.com/blogs/2012/12/creating-new-row-of-view-object-in-adf-techartifact.html#ixzz2iL978UOD
http://www.techartifact.com/blogs/2012/12/creating-new-row-of-view-object-in-adf-techartifact.html -
How to read internal table data and use to retrive from other table.
Hi all,
I am trying to generate a report using ooabap.
In this scenario, I retrieved data from one standard table (zcust) and successfully displayed using structure 'i_zcust_final' ( i_zcust_final is similar structure of zcust).
Now I want to get some other data from other standard table (zpurch) using the data in i_zcust_final. How....???? I am unable to read data from i_zcust_final even i kept in loop.
I am attaching the code here.. even it too long, please look at the code and suggest me what to do.
code **************************
REPORT ZBAT_OOPS_REPORT1.
TABLES: ZCUST.
D E F I N I T I O N *****
CLASS BATLANKI_CLS DEFINITION.
PUBLIC SECTION.
DATA : ITAB_ZCUST TYPE STANDARD TABLE OF ZCUST,
I_ZCUST_FINAL LIKE LINE OF ITAB_ZCUST,
ITAB_ZCUST1 TYPE STANDARD TABLE OF ZCUST.
TYPES: BEGIN OF IT_ZPURCH,
CUSTNUM TYPE ZPURCH-CUSTNUM,
PURC_DOC TYPE ZPURCH-PURC_DOC,
VENDOR TYPE ZPURCH-VENDOR,
STATUS TYPE ZPURCH-STATUS,
PURC_ORG TYPE ZPURCH-PURC_ORG,
END OF IT_ZPURCH.
DATA : ITAB_ZPURCH TYPE TABLE OF IT_ZPURCH,
I_ZPURCH_FINAL LIKE LINE OF ITAB_ZPURCH.
METHODS: GET_ZCUST,
PRINT_ZCUST,
GET_ZPURCH.
ENDCLASS.
I N I T I A L I Z T I O N *****
SELECT-OPTIONS:S_CUSNUM FOR ZCUST-CUSTNUM.
INITIALIZATION.
S_CUSNUM-LOW = '0100'.
S_CUSNUM-HIGH = '9999'.
S_CUSNUM-OPTION = 'BT'.
S_CUSNUM-SIGN = 'I'.
APPEND S_CUSNUM.
CLEAR S_CUSNUM.
I M P L E M E N T A T I O N *****
CLASS BATLANKI_CLS IMPLEMENTATION.
METHOD GET_ZCUST.
SELECT * FROM ZCUST
INTO TABLE ITAB_ZCUST
WHERE CUSTNUM IN S_CUSNUM.
ENDMETHOD.
METHOD PRINT_ZCUST.
LOOP AT ITAB_ZCUST INTO I_ZCUST_FINAL.
WRITE:/ I_ZCUST_FINAL-CUSTNUM,
I_ZCUST_FINAL-CUSTNAME,
I_ZCUST_FINAL-CITY,
I_ZCUST_FINAL-EMAIL.
ENDLOOP.
ENDMETHOD.
METHOD GET_ZPURCH.
LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
SELECT CUSTNUM
PURC_DOC
VENDOR
STATUS
PURC_ORG
FROM ZPURCH
INTO CORRESPONDING FIELDS OF TABLE ITAB_ZPURCH
WHERE CUSTNUM EQ I_ZCUST_FINAL-CUSTNUM.
ENDLOOP.
LOOP AT ITAB_ZPURCH INTO I_ZPURCH_FINAL.
WRITE:/ I_ZPURCH_FINAL-CUSTNUM,
I_ZPURCH_FINAL-PURC_DOC,
I_ZPURCH_FINAL-VENDOR,
I_ZPURCH_FINAL-STATUS,
I_ZPURCH_FINAL-PURC_ORG.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
O B J E C T *****
DATA: BATLANKI_OBJ TYPE REF TO BATLANKI_CLS.
START-OF-SELECTION.
CREATE OBJECT BATLANKI_OBJ.
CALL METHOD:
BATLANKI_OBJ->GET_ZCUST,
BATLANKI_OBJ->PRINT_ZCUST,
BATLANKI_OBJ->GET_ZPURCH.
Can anyone suggest me..
Thanks in advance,
Surender.Hi Surendar..
There is mistake in the Work area specification in this method.
METHOD GET_ZPURCH.
LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
SELECT CUSTNUM
PURC_DOC
VENDOR
STATUS
PURC_ORG
FROM ZPURCH
INTO CORRESPONDING FIELDS OF TABLE ITAB_ZPURCH
<b>WHERE CUSTNUM EQ ITAB_ZCUST1-CUSTNUM.</b>
"Instead of I_ZCUST_FINAL-CUSTNUM.
ENDLOOP.
LOOP AT ITAB_ZPURCH INTO I_ZPURCH_FINAL.
WRITE:/ I_ZPURCH_FINAL-CUSTNUM,
I_ZPURCH_FINAL-PURC_DOC,
I_ZPURCH_FINAL-VENDOR,
I_ZPURCH_FINAL-STATUS,
I_ZPURCH_FINAL-PURC_ORG.
ENDLOOP.
ENDMETHOD.
Now it should work..
One more thing : From performance point of view you have to Replace that loop using FOR ALL ENTRIES . And avoid CORRESPONDING FIELDS. it will be slow.
This is the code.
LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
if ITAB_ZCUST[] IS NOT INITIAL.
SELECT CUSTNUM
PURC_DOC
VENDOR
STATUS
PURC_ORG
FROM ZPURCH
INTO TABLE ITAB_ZPURCH
<b>for all entries in ITAB_ZCUST1</b>
<b>WHERE CUSTNUM EQ ITAB_ZCUST1-CUSTNUM.</b>
"Instead of I_ZCUST_FINAL-CUSTNUM.
ENDIF.
ENDLOOP.
<b>Reward if Helpful.</b> -
Help on triggers needed-update other tables
Hi,
I am using 10g and is very new to triggers and I hope I can gain some advises here.
I have the following 3 tables. MainInterfaceTable is a table where it stores records of values which are to be updated to tables: log1 and log2 respectively. One application will insert record into MainInterfaceTable and the inserted record contains only values for columns which are to be updated into tables: log1 and log2 respectively. Columns which contain null values are not to be updated into log1 and log2 tables.
I can only think of using many "if" statements in my trigger to concatenate the UPDATE DML to update log1 and log2 tables. But if the MainInterfaceTable table contains many columns, it is not very efficient. {color:#800080}Is there any built in oracle functions or a more efficient to perform this task??{color}
{color:#800080}Any advises are greaatly appreciated. Thanks{color}
For E.g. In the below MainInterfaceTable record, I only update table log1 with txt1A column values. And update log2 table with col1 and col2B column values.
Column Values
txt1 null
txt1A 6
txt1B null
col1 ‘new orders'
col2A null
col2B ‘new purchase'
------------------------------my trigger -------------------------------------
CREATE TRIGGER TRG_MainInterfaceTable
AFTER INSERT ON MainInterfaceTable
FOR EACH ROW
DECLARE
sqlStmt VARCHAR2(2000); -- the SQL statement
BEGIN
sqlStmt := 'UPDATE log1 a SET 1=1 ';
if :*new*.txt1 is not null then
sqlStmt := sqlStmt || ' ,a.txt1 = ' || :*new*.txt1;
END IF
if :*new*.txt1A is not null then
sqlStmt := sqlStmt || ' ,a.txt1A = ' || :*new*.txt1A;
END IF
if :*new*.txt1B is not null then
sqlStmt := sqlStmt || ' ,a.txt1B = ' || :*new*.txt1B;
END IF
prc_run_update_sql_log1(sqlStmt);
------repeat more IF THEN for other tables
EXCEPTION
WHEN
-- exception handling
end TRG_MainInterfaceTable
--------------------------------------Table Structure------------------------------------------------------------------
create table MainInterfaceTable (
statuscol char(1),
txt1 varchar2(20),
txt1A number(6),
txt1B varchar2(20),
col1 varchar2(20),
col2A number(6),
col2B varchar2(20),
create table log1 (
txt1 varchar2(20),
txt1A number(6),
txt1B varchar2(20),
create table log2 (
col1 varchar2(20),
col2A number(6),
col2B varchar2(20),Thanks. I put the IF ELSE.. into a function and my codes looks neater. However I encounter a error when i try to pass in a DATE value.
ORA_06502 numeric or value error: host bind array too small
The error occur at the line in bold .
I try to run
Select TO_CHAR(sysdate, 'DD-MON-YYYY HH24:MI') from dual
in PL/SQL screen and it works.
Why the same TO_CHAR() syntax doesn't work in a function????
FUNCTION concatupdatequery(pVal IN DATE, pCol IN VARCHAR2, pSql IN VARCHAR2) RETURN VARCHAR2 IS
lvQueryStr VARCHAR2(30000);
lvTempDate VARCHAR2(100);
BEGIN
lvQueryStr := pSql;
IF pVal IS NOT NULL THEN
dbms_output.put_line('pVal = ' || pVal);
lvTempDate := TO_CHAR(pVal, 'DD-MON-YYYY HH24:MI:SS');
lvQueryStr:=pSql||','||pCol||'=TO_DATE('''||lvTempDate||''',''DD-MON-YYYY HH24:MI'')'; -- DATE data type
dbms_output.put_line('lvTempDate = ' || lvTempDate);
END IF;
RETURN lvQueryStr;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('concatupdatequery (DATE) :pCol:'||pCol||' ,pVal:'||pVal||' ,pSql:'||pSql);
dbms_output.put_line(SQLCODE||' - '||SQLERRM);
RAISE;
END concatupdatequery;
Maybe you are looking for
-
Hi, I have a small app where I register clients for demo. After I register them, I need to send them a registration confirmation with all the details (Location address, and details of demo) The process is: 1) I use a form to enter their registration
-
[SOLVED] NFS in fstab doesn't work
Hi, after reading the wiki for several hours I am stuck: etc/fstab: 192.168.0.233:/mnt/z1 /mnt nfs user 0 0 Note that file system is nsf, not nfs4 because the server doesn't support it. I also tried the server name instead of the IP and options like
-
The iTunes store does not load when I open it
So I recently had to install the latest version of iTunes after I upgraded to the newest version of iOS on my iPhone 4 (iOS 6.0.1) because the older iTunes version wasn't compatable with the newest iOS version. I had been using a much older version o
-
I have bought the download and backup disk online to put windows on my computer, but it keeps saying please put disk in and wait a few seconds for your computer to open it. There has to be away to put this on my computer from a download....
-
Hi, I am trying to create an ibook in Pages. My document has quite a few images which show up in the pages document and also when I export to PDF, However when I export to Epub some of my images disappear. I have checked that they are all inline and