Error in creating Alternative BOM using IDOC_INPUT_BOMMAT
Hi all,
I am trying to create an Alternative BOM using IDoc BOMMAT03.I have checked this IDoc will use FM IDOC_INPUT_BOMMAT inside.
In this function module, it is using FM CSAP_MAT_BOM_CREATE and CSAP_MAT_BOM_MAINTAIN to create and change.
This FM is allowing to create an Alterative BOM = '01' but it is not creating for Alt BOM = '02'.
Can anyone provide inputs on this .
Regards
Sathibabu
Hai Guy,
use below code for Alternate BOM with sub item .
Part 1.
DATA: bom_header LIKE cad_bicsk,
bom_item type table of cad_bom_item WITH HEADER LINE,
bom_sub_item type table of cssubitem WITH HEADER LINE,
dms_class_data type table of cls_charac WITH HEADER LINE,
sap_field_data type table of rfcdmsdata WITH HEADER LINE,
e_return LIKE cad_return-value,
e_message LIKE message-msgtx,
e_message_len LIKE cad_return-message_len.
DATA v_ITEM TYPE I.
TYPES : BEGIN OF ty_data,
level TYPE i,
matnr TYPE cad_bicsk-matnr,
werks TYPE werks_d,
usage TYPE stlan,
qty TYPE cad_bom_item-menge,
fqty type fmeng, " Quantity is Fixed
sub_upmng type upmng,
text type cad_bicsk-ztext,
END OF ty_data.
DATA : it_data TYPE TABLE OF ty_data ,
wa_data TYPE ty_data.
**---selection screen
PARAMETERS:p_file TYPE ibipparms-path OBLIGATORY.
**---f4 help for the file from PC
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM get_f4help.
*--start-of-selection .
START-OF-SELECTION.
PERFORM upload_file_itab.
CLEAR: bom_header, bom_item, bom_sub_item.
REFRESH: bom_item, bom_sub_item.
data : v_lineitem type SPOSN value '0000',
v_slineitem type SPOSN value '0'.
LOOP AT it_data INTO wa_data.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_data-matnr
IMPORTING
output = wa_data-matnr.
IF wa_data-level = 0.
* fill BOM header
clear bom_header.
bom_header-matnr = wa_data-matnr. "'000000000200000016'.
* bom_header-stlal = '1'. " Alternative Bom
bom_header-werks = wa_data-werks. "'1000'.
bom_header-stlan = wa_data-usage."'3'.
bom_header-bmeng = wa_data-qty.
bom_header-cadkz = 'X'.
bom_header-stktx = wa_data-text.
* bom_header-ztext = wa_data-text.
bom_header-datuv = '01.10.2010'.
ELSEIF wa_data-level = 1.
* fill item
v_lineitem = v_lineitem + 10.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_lineitem
IMPORTING
output = v_lineitem.
* bom_item-upskz = 'X'. " If We hav the Sub items Enable it.
bom_item-idnrk = wa_data-matnr. "'000000000200000017'.
bom_item-posnr = v_lineitem.
bom_item-postp = 'L'.
bom_item-menge = wa_data-qty. "'1'.
bom_item-fmeng = wa_data-fqty.
APPEND bom_item.
CLEAR: bom_item.
*** fill sub item
CLEAR V_ITEM .
v_slineitem = v_slineitem + 1.
ELSEIF wa_data-level = 2.
* V_ITEM = V_ITEM + 1.
* bom_sub_item-posid = v_slineitem.
* bom_sub_item-ebort = 'test'.
* bom_sub_item-upmng = wa_data-sub_upmng.
* bom_sub_item-uposz = V_ITEM.
* bom_sub_item-uptxt = 'test'.
* append bom_sub_item.
* clear bom_sub_item.
ENDIF.
if wa_data-level = 0.
else.
at END OF LEVEL.
* Call function
CALL FUNCTION 'CAD_CREATE_BOM_WITH_SUB_ITEMS'
EXPORTING
i_bom_header = bom_header
i_auto_posnr = ''
IMPORTING
e_return = e_return
e_message = e_message
e_message_len = e_message_len
e_bom_header = bom_header
TABLES
bom_item = bom_item
bom_sub_item = bom_sub_item
dms_class_data = dms_class_data
sap_field_data = sap_field_data
EXCEPTIONS
OTHERS = 1.
refresh bom_item.
write : e_message.
ENDAT.
ENDIF.
CLEAR wa_data.
endloop.
Similar Messages
-
How to create Alternative Bom by given inputs
Hi to all,
I need to create BOM with alternative number.
my inputs are
BOM Header
Material, plant, BOM usage, Alternate BOM, BOM status, Base Qty, Valid From, valid to
BOM Item
Item number, item category, component, component description, UOM, valid from, valid to, item ID, QTY
if i use CSAP_MAT_BOM_CREATE to create BOM , it will not create alternative number
if i use BAPI_MATERIAL_BOM_GROUP_CREATE , does my input value are enough to create alternative bom.
please can any one, put some light on it, i search SDN ,but i dont know how to create alternative bom with input provided.
i shall be thankful to you for this.
Regards
Pavneet RanaTry the program-RCSBI010
-
Error while creating resource group using non-globalzones.
Dear all,
Hi techs please guide me how to create failover resource group in nongloablzones.
I'm getting error while creating resource group using non-globalzones.
My setup:
I have two node cluster running sun cluster 3.2 configured and running properly.
node1: sun5
nide2: sun8
I have create non-globalzone "zone1" in node:sun5
I have create non-globalzone "zone2" in node:sun8
node:sun5# clrg create -n sun5:zone1,sun8:zone2 zonerg
*(C160082) WARNING: one or more zones in the node list have never been fully booted in the cluster mode,verify that correct zone name was entered.*
kindly guide me how to create Apache resource group using non-glabalzones, i'm new to sun cluster 3.2. please guide me step by step information.
Thanks in advance,
veera
Edited by: veeraa on Dec 19, 2008 1:54 AMHi Veera,
Actually you are getting a warning message where one of two things could have happened. Either you specified an incorrect zone name or one of the zones has not been fully booted. It's likely that you haven't booted the zones, so please follow this:
zoneadm list -iv
If zone1 or zone2 are not running then boot and configure them
zoneadm -z <zone> boot
zlogin -C <zone>
After that you can continue to follow the step by step instructions at
http://docs.sun.com/app/docs/doc/819-2975/chddadaa?a=view
These may also help
http://blogs.sun.com/Jacky/entry/a_simple_expample_about_how
http://blogs.sun.com/SC/en_US/entry/sun_cluster_and_solaris_zones
Regards
Neil -
Error in Creating a BOM / CSAP_MAT_BOM_MAINTAIN
hi,
i need to create multiple bom alternatives in my development. i try using CSAP_MAT_BOM_MAINTAIN for this purpose.
even after i give all the inputs and flags necessary for creating a new bom, i am getting an error stating that bom already exist for....when i go and check MAST table, for the same material, plant and bom usage... no such alternative exist.
i am unable to proceed further. can anyone help me in this regard? thanks in advance.friend... you are right.
CSAP_MAT_BOM_MAINTAIN is used to create only one alternative bom. but this can be any number from 01 to 99. if any alternative bom exist for the same combination of material, plant and bom usage... then you cannot create any more alternative bom for the above mentioned combination. this is because... this function module checks MAST table before proceeding with creation. while checking MAST, it considers only material, plant and bom usage. alternative bom is left out here. but the real fact is... alternative bom should be also considered for uniqueness of bom while checking MAST. all these issues are only during bom creation, but the same function module works perfect during bom maintenance.
CSAP_MAT_BOM_CREATE is also used to create only one alternative bom. but this can be only one number - 01 (default). but, you cannot maintain a bom using this function module. you need to use CSAP_MAT_BOM_MAINTAIN for bom maintenance.
to create any number of alternative bom for a material, plant and bom usage combination... you need to use the function module BAPI_MATERIAL_BOM_GROUP_CREATE. but... you cannot maintain any bom or create object dependencies for line items using this function module.
summary:
to create a bom.. use BAPI_MATERIAL_BOM_GROUP_CREATE
to read a bom.. use CSAP_MAT_BOM_READ
to maintain a bom.. use CSAP_MAT_BOM_MAINTAIN.
to create object dependency.. use CSAP_MAT_BOM_OPEN , CSAP_BOM_ITEM_MAINTAIN , CSAP_MAT_BOM_CLOSE. -
Error while creating new crosstab using
I am getting the following error while creating a new crosstab object within Swing application. This error has started coming after we applied Oracle patch 9206 on database. The error originates from one of the classes in the olap_api_92.jar.
==========================================================
Wed Feb 02 09:13:51 CST 2005 In BuilderWizardValidateAdapter::wizardValidatePage
oracle.express.idl.util.OlapiException: No more data to read from socket
at oracle.express.idl.ExpressOlapiDataSourceModule.DefinitionManagerInterfaceStub.crtCurMgrs2(DefinitionManagerInterfaceStub.java:927)
at oracle.express.olapi.data.full.DefinitionManagerSince9202.createOLAPICursorManagers(DefinitionManagerSince9202.java:611)
at oracle.express.olapi.data.full.ExpressDataProvider.createCursorManagers(ExpressDataProvider.java:1325)
=========================================================
Please check the BIcheckconfig output. It does not show any errors.
=========================================================
<?xml version="1.0" encoding="UTF-8" ?>
<BICheckConfig version="1.0.2.0">
<Check key="JDEV_ORACLE_HOME" value="C:\Mohan\Installs\Jdev904"/>
<Check key="JAVA_HOME" value="C:\Mohan\Installs\Jdev904\jdk"/>
<Check key="JDeveloper version" value="9.0.4.0.1419"/>
<Check key="BI Beans release description" value="BI Beans 9.0.4 Production Release"/>
<Check key="BI Beans component number" value="9.0.4.23.0"/>
<Check key="BI Beans internal version" value="2.7.5.32"/>
<Check key="host" value="db03schgefage"/>
<Check key="port" value="1521"/>
<Check key="sid" value="biolapp"/>
<Check key="user" value="nairs5"/>
<Check key="Connecting to the database" value="Successful"/>
<Check key="JDBC driver version" value="9.2.0.4.0"/>
<Check key="JDBC JAR file location" value="C:\Mohan\Installs\Jdev904\jdev\lib\patches"/>
<Check key="Database version" value="9.2.0.6.0"/>
<Check key="OLAP Catalog version" value="9.2.0.6.0"/>
<Check key="OLAP AW Engine version" value="9.2.0.6.0"/>
<Check key="OLAP API Server version" value="9.2.0.6.0"/>
<Check key="BI Beans Catalog version" value="N/A; not installed in nairs5"/>
<Check key="OLAP API JAR file version" value="9.2"/>
<Check key="OLAP API JAR file location" value="C:\Mohan\Installs\Jdev904\jdev\lib\ext"/>
<Check key="OLAP API Metadata Load" value="Successful"/>
<Check key="Number of metadata folders" value="3"/>
<Check key="Number of metadata measures" value="569"/>
<Check key="Number of metadata dimensions" value="5"/>
<Check key="OLAP API Metadata">
<![CDATA[==============================================================================
Type Name (S=Schema, C=Cube, M=Measure, D=Dimension)
========= ====================================================================
Folder... ROOT
Folder... Auto Claim Measures
Folder... Service Measures
Folder... Claim Counts
Folder... Cell Summary Cube
Folder... Actual Measures
Measure.. Actual Acceptance Rate
Measure.. Actual Annualized Bill amt
Measure.. Actual Application Count
Measure.. Actual Avg Annual Billing
Measure.. Actual Contacts Count
Measure.. Actual Commission Amt
at oracle.express.olapi.data.full.ExpressDataProvider.internalCreateCursorManager(ExpressDataProvider.java:680)
at oracle.express.olapi.data.full.ExpressDataProvider.createCursorManager(ExpressDataProvider.java:586)
at oracle.olapi.data.source.DataProvider.createCursorManager(DataProvider.java:268)
at oracle.dss.dataSource.QueryUtilities.setUpCursors(QueryUtilities.java:559)
at oracle.dss.dataSource.QueryServer._setUpCursorsForMainQuery(QueryServer.java:7039)
at oracle.dss.dataSource.QueryServer._getCursorForCube(QueryServer.java:4098)
at oracle.dss.dataSource.QueryServer._updateCube(QueryServer.java:4055)
at oracle.dss.dataSource.QueryServer._applySelections(QueryServer.java:2661)
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:324)
at oracle.dss.util.Operation.execute(Operation.java:69)
at oracle.dss.dataSource.OperationQueue.update(OperationQueue.java:68)
at oracle.dss.dataSource.common.BaseOperationQueue.addOperation(BaseOperationQueue.java:176)
at oracle.dss.dataSource.common.BaseOperationQueue.addOperation(BaseOperationQueue.java:146)
at oracle.dss.dataSource.QueryServer.queueOperation(QueryServer.java:7076)
at oracle.dss.dataSource.QueryServer.applySelection(QueryServer.java:2192)
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:324)
at oracle.dss.util.Operation.execute(Operation.java:69)
at oracle.dss.dataSource.QueryManagerServer.sendQueue(QueryManagerServer.java:1549)
at oracle.dss.dataSource.common.OperationQueue.update(OperationQueue.java:198)
at oracle.dss.dataSource.common.BaseOperationQueue.addOperation(BaseOperationQueue.java:176)
at oracle.dss.dataSource.common.BaseOperationQueue.addOperation(BaseOperationQueue.java:146)
at oracle.dss.dataSource.common.OperationQueue.addOperation(OperationQueue.java:127)
at oracle.dss.dataSource.client.QueryClient.applySelection(QueryClient.java:970)
at oracle.dss.dataSource.common.QueryQueryAccess$SelCursor.getDataAccess(QueryQueryAccess.java:1133)
at oracle.dss.dataSource.common.QueryQueryAccess.getDataAccess(QueryQueryAccess.java:278)
at oracle.dss.datautil.QueryAccessUtilities._getValues(QueryAccessUtilities.java:639)
at oracle.dss.datautil.QueryAccessUtilities._getValues(QueryAccessUtilities.java:705)
at oracle.dss.datautil.QueryAccessUtilities.getValues(QueryAccessUtilities.java:608)
at oracle.dss.queryBuilder.QueryBuilderUtils.getSelectedMeasures(QueryBuilderUtils.java:623)
at oracle.dss.queryBuilder.SelectedItemsPanel.populateTree(SelectedItemsPanel.java:298)
at oracle.dss.queryBuilder.SelectedItemsPanel.refreshTree(SelectedItemsPanel.java:333)
at oracle.dss.queryBuilder.SelectedItemsPanel.setActive(SelectedItemsPanel.java:366)
at oracle.dss.queryBuilder.ItemsPanel.setActive(ItemsPanel.java:251)
at oracle.dss.datautil.gui.DefaultBuilderDialog.setActive(DefaultBuilderDialog.java:1072)
at oracle.dss.datautil.gui.DefaultBuilderDialog.validateNextPreviousEvent(DefaultBuilderDialog.java:1396)
at oracle.dss.datautil.gui.DefaultBuilderDialog$BuilderWizardValidateAdapter.wizardValidatePage(DefaultBuilderDialog.java:2113)
at oracle.bali.ewt.wizard.WizardPage.processWizardValidateEvent(Unknown Source)
at oracle.bali.ewt.wizard.WizardPage.validatePage(Unknown Source)
at oracle.dss.datautil.gui.CustomImageWizardPage.validatePage(CustomImageWizardPage.java:81)
at oracle.bali.ewt.wizard.BaseWizard.validateSelectedPage(Unknown Source)
at oracle.bali.ewt.wizard.BaseWizard.doNext(Unknown Source)
at oracle.dss.datautil.gui.CustomWizard.doNext(CustomWizard.java:415)
at oracle.bali.ewt.wizard.BaseWizard$Action.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
at java.awt.Dialog$1.run(Dialog.java:540)
at java.awt.Dialog.show(Dialog.java:561)
at java.awt.Component.show(Component.java:1133)
at java.awt.Component.setVisible(Component.java:1088)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(Unknown Source)
at oracle.dss.datautil.gui.DefaultBuilderDialog.runDialog(DefaultBuilderDialog.java:489)
at oracle.dss.datautil.gui.DefaultBuilderDialog.run(DefaultBuilderDialog.java:466)
at oracle.dss.queryBuilder.QueryBuilder.run(QueryBuilder.java:2401)
at gecf.pmg.PmgBiOlapApp.newCrosstabWiz(PmgBiOlapApp.java:1622)
at gecf.pmg.PmgBiOlapApp.mNewCrosstab_ActionPerformed(PmgBiOlapApp.java:1563)
at gecf.pmg.PmgBiOlapApp$5.actionPerformed(PmgBiOlapApp.java:696)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)I suspect that you have either not fully applied the patch or alternatively the patching process did not complete.
If you are using an analytic workspace, connect as OLAPSYS account and run the following commands:
exec CWM2_OLAP_METADATA_REFRESH.MR_REFRESH
exec CWM2_OLAP_METADATA_REFRESH.MR_AC_REFRESH
If this does not resolve the error, and assuming your system worked prior to applying the 9206 patch, then the patch may need to be reapplied.
Hope this helps
Business Intelligence Beans Product Management Team
Oracle Corporation -
Error while creating equipment BOM (IB01)
hi guys,
while creating equipment BOM (IB01) i am getting this error, while adding components.
'Material type NLAG cannot be used with item category (plant 1000)'.
regards
chintaHI Chinta,
I understood ur problem IB01-give the equipment number which is generated by the system and give plant name in which you have created the equipment and bom usage as 4 (plant maintenance) and press enter.
Then you will get the components list give the description,quantity and item category as:
as you gave it as L it is throwing an error give it as N(Non stock item), then you wont get the error.while selecting the item cat. you will get differnet components and you select the appropriate one based on you equipment.Hope you issue is resolved.
Regards,
Bharat -
How to Create Fixed Bom using BAPI
Hi all,
Iam using the BAPI "BAPI_BOM_UPLOAD_SAVE" for creation of Fixed BOM of Materials.
I don't know how that is used,I mean i don't know the inputs,
Pls can any one Provide me TEST DATA for this Bapi.
or a sample Program how fixed bom is created.and how can we know thet bom has been created.
for e.g if we create super bom ,the Bom links are stored in cs41,so we are able to know super bom has been created but how to check for fixed bom.is that the same for fixed also.
i have some inputs and with that inputs ,BOM is not being created and the BAPI return table type was E.Hi,
The FM BAPI_BOM_UPLOAD_SAVE is using CSAP_MAT_BOM_CREATE to create the BOM but it does not have any option to specify the alternative to be created.Look for some other FM if you need to create an alternative BOM.Check if the FM BAPI_MATERIAL_BOM_GROUP_CREATE can be used as an alternative
also check this FM.
CS_BI_BOM_CREATE_BATCH_INPUT1 - Create a new BOM or New Alt. BOM.
CS_BC_BOM_CHANGE_BATCH_INPUT - Maintain the BOM.
<b>Reward points</b>
Regards -
Error in creating a process using runtime class - please help
Hi,
I am experimenting with the following piece of code. I tried to run it in one windows machine and it works fine. But i tried to run it in a different windows machine i get error in creating a process. The error is attached below the code. I don't understand why i couldn't create a process with the 'exec' command in the second machine. Can anyone please help?
CODE:
import java.io.*;
class test{
public static void main(String[] args){
try{
Runtime r = Runtime.getRuntime();
Process p = null;
p= r.exec("dir");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
System.out.println(br.readLine());
catch(Exception e){e.printStackTrace();}
ERROR (when run in the dos prompt):
java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:550)
at java.lang.Runtime.exec(Runtime.java:416)
at java.lang.Runtime.exec(Runtime.java:358)
at java.lang.Runtime.exec(Runtime.java:322)
at test.main(test.java:16)
thanks,
DivyaAs much as I understand from the readings in the forums, Runtime.exec can only run commands that are in files, not native commands.
Hmm how do I explain that again?
Here:
Assuming a command is an executable program
Under the Windows operating system, many new programmers stumble upon Runtime.exec() when trying to use it for nonexecutable commands like dir and copy. Subsequently, they run into Runtime.exec()'s third pitfall. Listing 4.4 demonstrates exactly that:
Listing 4.4 BadExecWinDir.java
import java.util.*;
import java.io.*;
public class BadExecWinDir
public static void main(String args[])
try
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("dir");
InputStream stdin = proc.getInputStream();
InputStreamReader isr = new InputStreamReader(stdin);
BufferedReader br = new BufferedReader(isr);
String line = null;
System.out.println("<OUTPUT>");
while ( (line = br.readLine()) != null)
System.out.println(line);
System.out.println("</OUTPUT>");
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
} catch (Throwable t)
t.printStackTrace();
A run of BadExecWinDir produces:
E:\classes\com\javaworld\jpitfalls\article2>java BadExecWinDir
java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at BadExecWinDir.main(BadExecWinDir.java:12)
As stated earlier, the error value of 2 means "file not found," which, in this case, means that the executable named dir.exe could not be found. That's because the directory command is part of the Windows command interpreter and not a separate executable. To run the Windows command interpreter, execute either command.com or cmd.exe, depending on the Windows operating system you use. Listing 4.5 runs a copy of the Windows command interpreter and then executes the user-supplied command (e.g., dir).
Taken from:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html -
Error while creating new projects using api
Hello,
I am having error while creating projects using standard api, PA_PROJECT_PUB.CREATE_PROJECTS. The error I am having is as follow.
Source template ID is invalid.
===
My code is as follow:
SET SERVEROUTPUT ON SIZE 1000000
SET VERIFY OFF
define no=&amg_number
DECLARE
-- Variables used to initialize the session
l_user_id NUMBER;
l_responsibility_id NUMBER;
cursor get_key_members is
select person_id, project_role_type, rownum
from pa_project_players
where project_id = 1;
-- Counter variables
a NUMBER := 0;
m NUMBER := 0;
-- Variables needed for API standard parameters
l_commit VARCHAR2(1) := 'F';
l_init_msg_list VARCHAR2(1) := 'T';
l_api_version_number NUMBER :=1.0;
l_return_status VARCHAR2(1);
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);
-- Variables used specifically in error message retrieval
l_encoded VARCHAR2(1) := 'F';
l_data VARCHAR2(2000);
l_msg_index NUMBER;
l_msg_index_out NUMBER;
-- Variables needed for Oracle Project specific parameters
-- Input variables
l_pm_product_code VARCHAR2(30);
l_project_in pa_project_pub.project_in_rec_type;
l_key_members pa_project_pub.project_role_tbl_type;
l_class_categories pa_project_pub.class_category_tbl_type;
l_tasks_in pa_project_pub.task_in_tbl_type;
-- Record variables for loading table variables above
l_key_member_rec pa_project_pub.project_role_rec_type;
l_class_category_rec pa_project_pub.class_category_rec_type;
l_task_rec pa_project_pub.task_in_rec_type;
-- Output variables
l_workflow_started VARCHAR2(100);
l_project_out pa_project_pub.project_out_rec_type;
l_tasks_out pa_project_pub.task_out_tbl_type;
-- Exception to call messag handlers if API returns an error.
API_ERROR EXCEPTION;
BEGIN
-- Initialize the session with my user id and Projects, Vision Serves (USA0
-- responsibility:
select user_id into l_user_id
from fnd_user
where user_name = 'SSHAH';
select responsibility_id into l_responsibility_id
from fnd_responsibility_tl
where responsibility_name = 'Projects Implementation Superuser';
pa_interface_utils_pub.set_global_info(
p_api_version_number => l_api_version_number,
p_responsibility_id => l_responsibility_id,
p_user_id => l_user_id,
p_msg_count => l_msg_count,
p_msg_data => l_msg_data,
p_return_status => l_return_status);
if l_return_status != 'S' then
raise API_ERROR;
end if;
-- Provide values for input variables
-- L_PM_PRODUCT_CODE: These are stored in pa_lookups and can be defined
-- by the user. In this case we select a pre-defined one.
select lookup_code into l_pm_product_code
from pa_lookups
where lookup_type = 'PM_PRODUCT_CODE'
and meaning = 'Conversion';
-- L_PROJECT_IN: We have to provide values for all required elements
-- of this record (see p 5-13, 5-14 for the definition of the record).
-- Customers will normally select this information from some external
-- source
l_project_in.pm_project_reference := 'AGL-AMG Project &no';
l_project_in.project_name := 'AGL-AMG Project &no';
l_project_in.created_from_project_id := 1;
l_project_in.carrying_out_organization_id := 2864; /*Cons. West*/
l_project_in.project_status_code := 'UNAPPROVED';
l_project_in.start_date := '01-JAN-11';
l_project_in.completion_date := '31-DEC-11';
l_project_in.description := 'Trying Hard';
l_project_in.project_relationship_code := 'Primary';
-- L_KEY_MEMBERS: To load the key member table we load individual
-- key member records and assign them to the key member table. In
-- the example below I am selecting all of the key member setup
-- from an existing project with 4 key members ('EE-Proj-01'):
for km in get_key_members loop
-- Get the next record and load into key members record:
l_key_member_rec.person_id := km.person_id;
l_key_member_rec.project_role_type := km.project_role_type;
-- Assign this record to the table (array)
l_key_members(km.rownum) := l_key_member_rec;
end loop;
-- L_CLASS_CATEGORIES: commented out below should fix the error we get
-- because the template does not have an assigment for the mandatory class
-- 'BAS Test'
l_class_category_rec.class_category := 'Product';
l_class_category_rec.class_code := 'Non-classified';
-- Assign the record to the table (array)
l_class_categories(1) := l_class_category_rec;
-- L_TASKS_IN: We will load in a single task and a subtask providing only
-- the basic fields (see pp. 5-16,5-17,5-18 for the definition of
-- the task record)
l_task_rec.pm_task_reference := '1';
l_task_rec.pa_task_number := '1';
l_task_rec.task_name := 'Construction';
l_task_rec.pm_parent_task_reference := '' ;
l_task_rec.task_description := 'Plant function';
-- Assign the top task to the table.
l_taskS_in(1) := l_task_rec;
-- Assign values for the sub task
l_task_rec.pm_task_reference := '1.1';
l_task_rec.pa_task_number := '1.1';
l_task_rec.task_name := 'Brick laying';
l_task_rec.pm_parent_task_reference := '1' ;
l_task_rec.task_description := 'Plant building';
-- Assign the subtask to the task table.
l_tasks_in(2) := l_task_rec;
-- All inputs are assigned, so call the API:
pa_project_pub.create_project
(p_api_version_number => l_api_version_number,
p_commit => l_commit,
p_init_msg_list => l_init_msg_list,
p_msg_count => l_msg_count,
p_msg_data => l_msg_data,
p_return_status => l_return_status,
p_workflow_started => l_workflow_started,
p_pm_product_code => l_pm_product_code,
p_project_in => l_project_in,
p_project_out => l_project_out,
p_key_members => l_key_members,
p_class_categories => l_class_categories,
p_tasks_in => l_tasks_in,
p_tasks_out => l_tasks_out);
-- Check the return status, if it is not success, then raise message handling
-- exception.
IF l_return_status != 'S' THEN
dbms_output.put_line('Msg_count: '||to_char(l_msg_count));
dbms_output.put_line('Error: ret status: '||l_return_status);
RAISE API_ERROR;
END IF;
-- perform manual commit since p_commit was set to False.
COMMIT;
--HANDLE EXCEPTIONS
EXCEPTION
WHEN API_ERROR THEN
FOR i IN 1..l_msg_count LOOP
pa_interface_utils_pub.get_messages(
p_msg_count => l_msg_count,
p_encoded => l_encoded,
p_msg_index => i,
p_msg_data => l_msg_data,
p_data => l_data,
p_msg_index_out => l_msg_index_out);
dbms_output.put_line('ERROR: '||to_char(l_msg_index_out)||': '||l_data);
END LOOP;
rollback;
WHEN OTHERS THEN
dbms_output.put_line('Error: '||sqlerrm);
FOR i IN 1..l_msg_count LOOP
pa_interface_utils_pub.get_messages(
p_msg_count => l_msg_count,
p_encoded => l_encoded,
p_msg_index => i,
p_msg_data => l_msg_data,
p_data => l_data,
p_msg_index_out => l_msg_index_out);
dbms_output.put_line('ERROR: '||to_char(l_msg_index_out)||': '||l_data);
END LOOP;
rollback;
END;
===
Msg_count: 1
Error: ret status: E
ERROR: 1: Project: 'AGL-AMG Project 1123'
Source template ID is invalid.
PL/SQL procedure successfully completed.I was using a custom Application, which had a id other then 275 (which belongs to Oracle projects)
-
Error while creating a material using Bapi_material_savedata
Hi,
there is an error encountered while creating a material using BAPI_MATERIAL_SAVEDATA..
The Error description is " Material description is not transfered " even after supplying the Material description and other mandatory field information like industrial sector, material type ,basic view indicator,Base UOM,Base UOM ISO code.
Please let me know the solution, if you know.Hi,
Please search the SCN for the answers
https://www.sdn.sap.com/irj/scn/advancedsearch?query=errorinBAPI_MATERIAL_SAVEDATA+&cat=sdn_all -
Error while Creating WBS element using BAPI 'BAPI_BUS2054_CREATE_MULTI'
Hi Expert,
I've a requirement to create WBS elements using BAPI. And I am using BAPIs in the following manner.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = g_pdwbs
TABLES
it_wbs_element = it_wbs_element
et_return = it_return
EXTENSIONIN =
EXTENSIONOUT =
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
When I do so I am getting the below errors. Please suggest.
"Individual check for creating the object WBS Element C-497082 required ".
"Individual check for creating the object WBS Element C-497082-0001 required".
Please suggest how to correct this error.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Aug 18, 2008 5:25 PMI am getting the same error, but I cannot figure it out how to detect it and fix it. Will you please share your solution?
Thanks, -
Error while creating activity by using BAPI
Hi,
While creating activity by using BAPI Im getting error as follows,
Start processing of refference object handle generated.
Integrity rule a d0008 broken
business partner with function from vbkakom not vbpakom
Integrity rule a d0008 broken
edit all incomplete field .
Please help me for solving this issue.
Regards,
SureshNot received any proper reply Closing the issue.
-
Error while creating logical file using transaction FILE
Hello there,
I am facing an error while creating Logical File name definition using transaction FILE
This is the input which I'm trying to give
Logical file name: ZTEST
Name : ZTEST
Physical file : ZTEST_1<DATE><TIME>.csv
Data format: ASC
Application area: BW
Logical path:ZTEST_1_DATAOUT
when I tried to save it throws me an error like ASSIGN_SUBSTRING_NOT_ALLOWED
Please help.Hi,
Please check the OSS Notes :
Note 792061 - SP Case Locator: Dump: ASSIGN to a substring isn't allowed.
SAP Note 1297989 - Short dump ASSIGN_SUBSTRING_NOT_ALLOWED
Hope this solves the problem.
-Vikram -
Error while creating Legacy Asset using AS91
Error is as follows
E698 SYST: Abnormal termination (ANLB-LGJAN 1 not equal to ANLC-GJAHR
In 2008 during implementation, there was a mis match between FI & AA.
In AA Takeover values were not updated but GL entry was made. Now since depreciation is run, it is not allowing to update takeover values in AS92.
Now the i have planned to follow this procedure
Firstly Reset Depreciation
Then to create new Assets in AA copying previous assets without Takeover values using AS 91 & update those takeover values in new assets.
Then FI & AA values would match & then i can run depreciation.
But in 2nd step i am stucked, as when i try creating new asset using AS91 it is giving above error.
What should be date of legacy data transfer in spro? i have maintained 30.09.2008
In OAAQ i have maintained closed FY =2007
In OB52 i have Opened both 2008 & 2009 posting periods.
What more has to be done?Hi Paul
I have taken a production copy in different client & have done all these with the client's permission.
Following are the reasons with example
suppose these are 4 assets at the time of implementation
1 Asset A Acquisition value 100000/- Accumulated Depreciation 20000/-
2 Asset B Acquisition value 200000/- Accumulated Depreciation 30000/-
3 Asset C Acquisition value 300000/- Accumulated Depreciation 40000/-
4 Asset D Acquisition value 400000/- Accumulated Depreciation 50000/-
In implementation following happened by mistakenly
Asset A & B were properly created using AS91 & in GL also entry properly made using OASV
but for Asset C, entry was made using OASV but in AA Tcode AS91 Asset Master was created but Takeover values were not updated.
for Asset D entry was made in OASV but in AA Asset number was not at all created.
so when you see asset master C in AW01N acquisition value is blank & planned depreciation is also missing.
i think individually all data was not cross tallyied.
So the Balance sheet is tallyied with entry in FI
but
in AA there are 100 assets without takeover values & 300 assets for which Asset Masters are not at all created in AA.
& depreciation for 2008 has been run on other assets excluding these 400 assets.
So now AA closing cannot be done as the FI & AA balances are not reconciled.
& now we have to update takeover values creating new asset masters using AS91 but system is not allowing us.
Could you suggest some solution for these problems
Thanks in Advance -
Error when creating Oracle12c PDB using DBCA response file in silent mode
I am getting an Oracle dbca NullPointerException when trying to create a PDB (Pluggable Database) usingdbca response file in silent mode.
I have a Oracle 12c CDB up and running, listener is also up, $ORACLE_HOME and $ORACLE_SID are also set correctly.
After database install and creating CDB using response files, I am now trying to create a PDB using dbca response file. Contents of dbca.rsp -
[GENERAL]
RESPONSEFILE_VERSION = "12.1.0"
OPERATION_TYPE = "createPluggableDatabase"
[CREATEPLUGGABLEDATABASE]
SOURCEDB = "orcl"
PDBNAME = "dev"
CREATEPDBFROM = "DEFAULT"
PDBADMINUSERNAME = "oracle"
PDBADMINPASSWORD = "oracle"
CREATEUSERTABLESPACE = "true"
I tried following commands:
dbca -silent -responseFile /<file path>/dbca.rsp dbca -silent -createPluggableDatabase -responseFile /<file path>/dbca.rsp
Both give same error:
---- Begin output of /u01/app/oracle/product/12c/db_1/bin/dbca -silent -responseFile /<file path>/dbca.rsp
STDOUT:
STDERR: Exception in thread "main" java.lang.NullPointerException
at oracle.sysman.assistants.dbca.backend.CommandLineArguments.processResponseFile(CommandLineArguments.java:6885)
at oracle.sysman.assistants.dbca.backend.CommandLineArguments.process(CommandLineArguments.java:4544)
at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:110) at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:184)
However when I pass exact same parameters as command line arguments, dbca works absolutely fine and PDB is created: Following command runs succefully.
dbca -silent -createPluggableDatabase -sourceDB orcl -pdbName dev -createPDBFrom default -pdbAdminUserName oracle -pdbAdminPassword oracle -createUserTableSpace true
My environment need installation using response files only. I had used a dbca response file with "createDatabase" option for CDB and it worked fine. Error is observed only when I run it with OPERATION_TYPE as "createPluggableDatabase".
There is an option to create PDBs along with CDB creation when OPERATION_TYPE is "createDatabase". But Oracle does not give flexibility to name PDBs in this option. If I ask Oracle to create 3 PDBs, it will name them itself like PDB01, PDB02, PDB03 and so on. This doesn't work in my deployment because of applications compile time dependencies on specific PDB names.Yes, I am pointing to correct response file. I have two of these. One for "createDatabase" and another one for "createPluggableDatabase".
While the first one works absolutely fine, the one which creates PDBs always gives error.
I tried renaming the response file like dbca_dev.rsp for PDB install but same error message. I read in another forum that rename dbca.rsp is not a good idea.
So I kept it as dbca.rsp but built it using PDB template.
When I try after removing -silent, it tries to launch a UI installer. Since I am in Amazon AWS platform, my instance is CentOS based which doesn't support Xwindows display.
I am stuck with -silent install only. When I try with -progressOnly, I get exactly same error.
Also tried removing some parameters but still get exact same error message.
Tried same trick with "createDatabase" response file, now I see parameters missing error message.
It seems like Oracle doesn't like response file install for "createPluggableDatabase".
Maybe you are looking for
-
I am running an HP Pavilion dv7 Notebook PC, Windows 7 Home Premium, with an HP SimplePass for security and password storage. With the previous Firefox, when I would open a website that had sign in and password information, the fingerprint icon would
-
Need to post my songs (song/list) on website for customers. I'm a DJ
Hi! I was browsing the net the other day and I came across this site: http://www.occasionsdjs.com/schoolsongs.html I have a mobile DJ company and would like to add my playlist to my website similar to something like this... anyone have an idea of how
-
Can anybody help me to move setup data (Table and text edit boxes) from a dialog box in VIEW to the data Portal (Group/Channel) Thanks David Solved! Go to Solution.
-
SOAP response without envelope
Hi!!! Anybody can help me please? I send a SOAP message to a WebService and I receive a reply message. The problem is that I can see correctly the answer using replyMessage.writeTo(System.out); but if I call SOAPBody body = reply.getSOAPBody(); I hav
-
Determine rows based on their 'grouping'
Ok assume there is a table (TableA) in this format col1 col2 col3 col4 col5 col6 R1 route1 route1Description1 AA BB CC R1 route1 route1Description1 AA CC R1 route1 r