Capturing return status from a call to STARTRFC from a shell script.
Hi All
I am trying to use startrfc to integrate a Unix (Solaris) batch process with SAP. I want to determine whether an SAP user exists.
Here is the command as run in the Unix shell: -
startrfc -t -3 -h ourHost -s 01 -c 550 -l EN -u SAPuser -p secret -F BAPI_USER_EXISTENCE_CHECK -E USERNAME=testSAPuser
This command always exits with a status of zero, whether or not the user exists. (With the -t flag) It creates a file, dev_rfc and a second file of the form CPICTRCnnnnn. However there is no output to stdout, irrespective of whether testSAPuser exists.
Can I force this utility program to write its output to stdout instesd of writing it to a file? How?
Alternatively can I force the utility to write its output to a specific (named) file instead of writing to dev_rfc?
Thank you for your attention
Stephen Broadbridge
Hi,
You could create an RFC in SAP and put your BAPI function, an the result into a table parameters:
- use -T parameter to get the table
- use w to set your file
<b>Example:</b>
startrfc -E PEBELP=00010 -t -d AR1 -h S01AZ03A01 -s 10 -g S01AZ03A01 -x sapgw10 -u LOLA -p flores -c 130 -l EN -F Y_RFC_EXAMPLE2 <b>-T RESULTADO,250,w=outputname.txt</b>
<b>Explanation of parameters:</b>
-T <table name>,<width>,[r=<file>][,w=<file>]
Where <file> is a path name to read from (r) or write to (w) the internal table. If <file> is -, stdin or stdout is used.
<b>Example of Y_RFC_EXAMPLE2</b>
FUNCTION Y_RFC_EXAMPLE2.
""Local interface:
*" IMPORTING
*" VALUE(PEBELP) TYPE EBELP
*" TABLES
*" RESULTADO STRUCTURE TAB512
DATA fecha(10).
DATA wa TYPE string.
WRITE sy-datum TO fecha.
CONCATENATE pebelp fecha INTO wa SEPARATED BY '/'.
ds_rec 'sample' wa.
append wa to resultado.
ENDFUNCTION.
Similar Messages
-
I am creating an operating system print command string on a Sun Unix box
using enscript. When I submit the print string using RunCommand it works
fine. However, if I specify a non-existant printer the RunCommand does
not seem to provide any feedback to the TOOL code. I am using the
ExitStatus attribute in OperatingSystem object to check. Is this a
valid method for checking OS status?
task.Part.OperatingSystem.RunCommand(command = runCommand, isSynchronous
= TRUE);
exitStatus = task.Part.OperatingSystem.ExitStatus;
I have also added an exception handler to try to catch the condition. I
am currently handling SystemException, FIleResourceException, and
UsageException. None of these seem to get triggered when specifing an
invalid printer name to the OS.
Questions: (1) How can I return a status code from the OS to TOOL or at
least detect the appropriate exception?
(2) Is it possible to test for the existance of a network
printer via tool code? For example could I ping the
device and return a result?
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Gary
I believe that the RunCommand does not return the OS Exitstatus to
Forte. Attached to the RunCommand there are two parameters being
stdfileout and errfileout. These files will capture the contents of
stdout and stderr. When I call the OS via RunCommand, I append the
following onto my command:
lp fred;echo =$?=
I then open and read the stdfileout and look for the string EOT =0=. If
it is not there then my lp command did not terminate properly.
This is not the cleanest thing in the world to do, but I know that it
works. If anyone does know if you can trap the existstatus from
RunCommand then I'd be really happy to find out about it.
Michael Strauss
Mazda Australia Pty Limited
-----Original Message-----
From: Gary Maxwell [mailto:[email protected]]
Sent: Friday, 15 May 1998 1:00
To: Eric Forte; [email protected]
Subject: Return Status from RunCommand
I am creating an operating system print command string on a Sun Unix box
using enscript. When I submit the print string using RunCommand it works
fine. However, if I specify a non-existant printer the RunCommand does
not seem to provide any feedback to the TOOL code. I am using the
ExitStatus attribute in OperatingSystem object to check. Is this a
valid method for checking OS status?
task.Part.OperatingSystem.RunCommand(command = runCommand, isSynchronous
= TRUE);
exitStatus = task.Part.OperatingSystem.ExitStatus;
I have also added an exception handler to try to catch the condition. I
am currently handling SystemException, FIleResourceException, and
UsageException. None of these seem to get triggered when specifing an
invalid printer name to the OS.
Questions: (1) How can I return a status code from the OS to TOOL or at
least detect the appropriate exception?
(2) Is it possible to test for the existance of a network
printer via tool code? For example could I ping the
device and return a result?
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
This message has successfully passed virus checking.
Mazda Australia takes every precaution to ensure email messages are virus free. For complete protection, you should virus test this message.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
Calling stored procedure from unix shell script
Hello,
I am facing a problem while calling a stored procedure from UNIX shell script. I want to return a output variable from the stored procedure to the UNIX environment.
Here is the code-
#!/bin/sh
OUTPUT=`sqlplus cmag/magnum@dw <<ENDOFSQL
set serveroutput on;
var prd_out varchar2(100);
exec create_pm_window(:prd_out);
exit;
ENDOFSQL`
echo " output is - $OUTPUT"
The problem is :prd_out is not getting copied to shell variable OUTPUT.
I have a dbms_output.put_line in the stored proc create_pm_window and I can see that prd_out is getting populated.
Any help is really appreciated.
Thanks'
RakheeFirst step :
make sure the PL/SQL works as expected.
Does the following display the expected output executed from SQL*Plus ?
set serverout on
declare
prd_out varchar2(100);
begin
create_pm_window(prd_out);
dbms_output.put_line('output is '||prd_out);
end;
I don't have your procedure, but using a dummy procedure like :
Scott@my10g SQL>create procedure foo(p_out in out varchar2)
2 is
3 begin
4 select 'Hello '||instance_name into p_out from v$instance;
5 end;
6 /
Procedure created. and a toto.sh script as :OUTPUT=`sqlplus -s scott/tiger <<EOF
set pages 0 lines 120 trimout on trimspool on tab off echo off verify off feed off serverout on
var mavar varchar2(100);
exec foo(:mavar);
print mavar;
exit;
EOF`
echo "OUT = ${OUTPUT}"
exitIt works fine :[oracle@Nicosa-oel ~]$ ./toto.sh
OUT = Hello my10g -
Return codes from sqlldr command from unix shell script
I am trying to capture error code from sql loader from unix shell script and display proper messages.
sqlldr parfile=sdb.par control=$cntlfile data=$infile bad=$badFile log=$logFile rows=10000
rows=10000
retcode=`echo $?`
case "$retcode" in
0) echo "SQL*Loader execution successful" ;;
1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
2) echo "SQL*Loader execution exited with EX_WARN, see logfile" ;;
3) echo "SQL*Loader execution encountered a fatal error" ;;
*) echo "unknown return code";;
esac
Eventhough, there are errors while executing sqlldr, it is always returing recode zero. What could be the possible reason
Please adviceIs there a typo in your code ?
sqlldr parfile=sdb.par control=$cntlfile data=$infile bad=$badFile log=$logFile rows=10000
rows=10000
retcode=`echo $?` In this code, you get the return code of the statement in bold which is not the sqlldr statement ... -
Calling a report from unix shell script
Hi,
I had to call a report from unix shell script.
May i know the procedure to accomplish this
Thanks in Advance
A.GopalFirst you should not include the whole path to your report in the call ...
Use like this:
/ora/u01/oracle/v101/as2/bin/rwrun.sh report=an_stati destype=file desname=/ora/u01/oracle/v101/as2/test.pdf desformat=pdf
In $ORACLE_HOME/bin/reports.sh:
1) Verify that you have updated the REPORTS_PATH variable to include your folder where you have the report in question
REPORTS_PATH=/ora/u20/app/qits/env1/run:$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo: ....
2) Verify that the REPORTS_TMP variable is pointing to a valid location and that the oracle user has access to write on it.
After that, post the content of the tracefile located at $ORACLE_HOME/reports/logs/{in-process report server name folder}/rwserver.trc
If no file is present then it means that you need to enable trace in your reports's conf file.... go to the $ORACLE_HOME/reports/conf folder and and locate the .conf file that correspond to your in-process reports server name (as specified in the rwservelet.properties file)... open/edit the file to enable trace logs ..
i.e.
Change the following line:
<!--trace traceOpts="trace_all"/-->
to <trace traceOpts="trace_all"/>
Bounce the reports server and try to run the report again, this time the .trc file should be generated, post the content so that we can take a look. -
Debugging a program being called from a shell script
hi All,
i want to know how debug a C program being called from A Shell Script,
my script looks like the following :
ecReqProcMain $Cfg/ecReq.g $TotCnt 2>> $ErrFilei also have to pass some arguments to the script itsellft, which in trun going to pass it to the program,
also in some cases i may be required to Pipe some data to the program, like the folowing
cat DataFile | myProgramThanks ,You can also use ss_attach with the scheme that Anton
suggested above. Instead of inserting "dbx" into your
script, insert "ss_attach" into your script.
It's also possible to change your script to something like this:
cat DataFile | ${DEBUG} myProgram
Then you can run your script like this:
setenv DEBUG ss_attach
ecReqProcMain $Cfg/ecReq.g $TotCnt 2>> $ErrFile
--chris -
Error when running the OWB process flow from the shell script
Hi,
I am able to deploy the process flow succesfully but when I execute the process flow from the shell script,I am getting the following error.Previously it worked fine.
I had to make some chnage in the IP address,so i had to deploy again.
Connected.
SQL> @/oracle/product/owb92028/owb/rtp/sql/oem_exec_template.sql OWB_RTR LOC_P_REL PROCESS P_W_SOURCE "," ","
Elapsed: 00:00:00.00
Elapsed: 00:00:00.01
Stage 1: Decoding Parameters
| location_name=LOC_P_REL
| task_type=ProcessFlow
| task_name=P_W_SOURCE
Stage 2: Opening Task
declare
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 17
ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 137
ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 164
ORA-06512: at line 205
Thanks in advance.
VinayHi Kamal and kanakam kolla,
This is just to let you know that,I solved my problem little differently by creating a new location and deployed the process flow.Now my process flow is working fine when i call from the shell script.What i see is that, it does not update properly when we update and redeploy the process flow.So far this is the work arround i could think off and i succesfully tested this.
Thank you Kamal and kanakam kolla,for giving a thought towards my problem.
Thanks
Vinay -
Passing Multiple Parameters to SQL Script from a Shell Script
Hi Friends,
I have SQL script which accepts 6 parameters.
I am calling this from a shell script as shown below:
sqlplus -s ${ORACLE_ID} @${SQLPATH}KORONT_041.sql ${USER_ID} ${PDC} ${item_number} ${KORDC} ${PDCSET} ${last_Updated_in_hours} Out of the six parameters, item_number is not a mandatory parameter.
When i pass all six parameters, there is no issue.
But when i leave item_number blank, i am getting the below error
Enter value for 6:
User requested Interrupt or EOF detected.Based on the error, it seems that the NULL values for item_number is ignored and SQL*PLUS is waiting for one more input from user.
How can i overcome this issue?
Regards,
SreekanthHi,
I am calling the shell script from concurrent program and below is the log file of the concurrent program.
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
KORONT_041_SH module: KORONT - Daily Item Master Update
+---------------------------------------------------------------------------+
Current system time is 29-JUN-2011 10:09:35
+---------------------------------------------------------------------------+
REQUEST_ID: 68510795
USER_ID: 4219
PDC: 85
Item Number:
KORDC: 124
PDCSET: 1100000003
last_updated_in_hours: 24
EMAIL_ID: [email protected],[email protected]
SQLPATH: /e381/oracle/asodev01appl/custom/motont/1.0.0/sql/
RPTDIR: /e381/oracle/asodev01comn/admin/out/ASODEV01_asoprdb2
RPTFILE: o68510795.out
Table truncated.
*Enter value for 6: User requested Interrupt or EOF detected.*
Table truncated.
old 15: AND ic.organization_id = &&4
new 15: AND ic.organization_id = 1100000003
0 rows created.
Input truncated to 9 characters
old 8: AND organization_id = &&4
new 8: AND organization_id = 1100000003
0 rows created.
End of SQL
No record.
+---------------------------------------------------------------------------+
Executing request completion options...
+------------- 1) PRINT -------------+
Printing output file.
Request ID : 68510795
Number of copies : 0
Printer : noprint
+--------------------------------------+
Finished executing request completion options.
+---------------------------------------------------------------------------+
Concurrent request completed successfully
Current system time is 29-JUN-2011 10:09:38
+---------------------------------------------------------------------------+Regards,
Sreekanth -
Is it possible to pass a variable from a shell script back to an Automator action?
Is it possible to pass a variable from a shell script back to an Automator action?
For instance, if I assign a value of foo to $var1 in my shell script how would I retrieve/pass that value in the next Automator action. I see that there is a variable called "Shell Script" but I can't any information on how to use it.red_menace,
Thanks but I still don't understand how to pass a single value that was set in the UNIX scipt back to Automator has a variable. Take the example below, I write 4 varables to STDOUT and all 4 are stored in a variable named "storage". How do I assign 1 of these values to the Automator "storage" variable? For instance if I wanted to assign the value of $var2 to "storage" , how would I do that? -
Starting tomcat from a shell script
Hello-
I want to start Tomcat from a shell script that is called by an application on a web page. Problem is, the app that calls the script runs as user nobody.
I'm a permissions noob, so any suggestions as to how I could get this working are appreciated.
WillTomcat should be running if you intend to use it as a service.
You don't want people to be able to start (or.. stop !) services on your server from a web page... That would present a gaping security hole. -
How to check from a shell script that a particular software is installed
Hai friends
I want to write a shell script which has to check whether a particular software is installed on the machine, or not. If installed, then what version is it using and the get the version number and which type of installer is it? i mean is it a .rpm installation or a tar.gz installation.
how can i check this from a shell script. If any of you have any idea please give me a sample script to check this
Thank you@Raja_Abilash
I don't think this is a right thread & right forum to POST this question.
better go ahead with forums related to LINUX. -
How to Reset dbid from a Shell Script
I would like to use a shell script to:
1) Automate the restore of our Produciton backups to a different server
2) Reset the dbid prior to exiting the script
Is there a way to reset the dbid from a shell script?
When I use the following, it has an interactive prompt in the middle of it, and I don't see anything in the syntax diagram found in the "Oracle Database Utilities" manual that will let me get around this.
nid target =/
DBNEWID: Release 10.2.0.3.0 - Production on Fri Aug 8 09:37:04 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database DRTEST (DBID=3725550444)
Connected to server version 10.2.0
Control Files in database:
/s01/oradata/drtest/control01.ctl
/s01/oradata/drtest/control02.ctl
/u01/oradata/drtest/control03.ctl
Change database ID of database DRTEST? (Y/[N]) => y
Proceeding with operation
Changing database ID from 3725550444 to 3752603328
Control File /s01/oradata/drtest/control01.ctl - modified
Control File /s01/oradata/drtest/control02.ctl - modified
Control File /u01/oradata/drtest/control03.ctl - modified
Datafile /s01/oradata/drtest/system01.dbf - dbid changed
Datafile /s01/oradata/drtest/undotbs01.dbf - dbid changed
Datafile /s01/oradata/drtest/sysaux01.dbf - dbid changed
Datafile /s01/oradata/drtest/users01.dbf - dbid changed
Datafile /s01/oradata/drtest/rman.dbf - dbid changed
Datafile /s01/oradata/drtest/temp01.dbf - dbid changed
Control File /s01/oradata/drtest/control01.ctl - dbid changed
Control File /s01/oradata/drtest/control02.ctl - dbid changed
Control File /u01/oradata/drtest/control03.ctl - dbid changed
Instance shut down
Database ID for database DRTEST changed to 3752603328.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.... When I use the following, it has an interactive
prompt in the middle of it, ...You may want to try out "Expect" for automating any interactive script.
isotope -
Reading variables from a shell script
i was wondering if it is possible to enter variables from a shell script that an sql file can use:
ex:
shell script file
#!/bin/ksh
stty -echo
read pwd?"Enter password for user: "
echo
stty echo
read var?"Please enter value for variable: "
echo
$ORACLE_HOME/bin/sqlplus user/$pwd @TEST.sql
sql file TEST.sql
set serveroutput on
set verify off
spool out.log
update table set parameter_value = '$var' where parameter_name = 'X';
commit;
exit;
spool off;
i tried that and it seems its updating my table with "var" and not what the user entered that is the bind variable $var
am i missing something?if user hits enter (which means null) can the program
not end and ask the user to enter another value?Try this way :
while :
do
echo -n "Please enter value for variable: "
read VAR
if [ "$VAR" ]; then
break
else
continue
fi
done -
Capture Return Value from Contextual Events Subscriber Method
Hi
I was wondering if anyone knew whether you could capture the return value from a method exposed as a subscriber for a contextual event?
Requirement: We have 2 bounded task flows (parent-child) with the child task flow embedded as a region in a view activity in the parent task flow. Based on an action in the parent task flow we raise a contextual event which calls an application module method exposed as a data control within the child task flow. We need to be able to capture the return value from the method on the managed bean.
Example method within child task flow application module:
public String contextualEventSub(){
Return "Y";
So here we would like to capture String value when the event is raised by the event producer (parent task flow action).
Within the Event Map on the page definition of the parent task flow view activity it is possible to set parameters to pass to the subscriber but it’s not obvious where you can capture the return value.
Many thanks!
Technology:
ADF 11.1.1.7 – ADFbc with ADF task flows and page fragmentsCheck this URL it may help you
One size doesn't fit all: JDev 11g: Programmatic Contextual Events -
Re: Return Status from RunCommand
Hi,
You should try the optional files to redirect output and error channels.
Here is a part of the help :
"You can optionally specify the inputFile, outputFile, or errorFile
parameters as text to redirect standard input, output, or error. To get
input commands on Windows or Macintosh, you must specify an alternate
input file.
If you specify an output file that already exists, you can use the
appendOutput parameter to indicate whether any command output should
overwrite the existing file, or be appended to it. "
I have used it on VMS in R2 and it worked well. It may depend on the OS.
You can also gerenate a shell script which makes the print command and
writes the result in a file.
A more sophisticated solution would be to use system call integration
(R3)
which should be OS specific.
Hope this helps,
Daniel Nguyen
Freelance Forte Consultant
Gary Maxwell wrote:
>
I am creating an operating system print command string on a Sun Unix box
using enscript. When I submit the print string using RunCommand it works
fine. However, if I specify a non-existant printer the RunCommand does
not seem to provide any feedback to the TOOL code. I am using the
ExitStatus attribute in OperatingSystem object to check. Is this a
valid method for checking OS status?
task.Part.OperatingSystem.RunCommand(command = runCommand, isSynchronous
= TRUE);
exitStatus = task.Part.OperatingSystem.ExitStatus;
I have also added an exception handler to try to catch the condition. I
am currently handling SystemException, FIleResourceException, and
UsageException. None of these seem to get triggered when specifing an
invalid printer name to the OS.
Questions: (1) How can I return a status code from the OS to TOOL or at
least detect the appropriate exception?
(2) Is it possible to test for the existance of a network
printer via tool code? For example could I ping the
device and return a result?
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Hi,
You should try the optional files to redirect output and error channels.
Here is a part of the help :
"You can optionally specify the inputFile, outputFile, or errorFile
parameters as text to redirect standard input, output, or error. To get
input commands on Windows or Macintosh, you must specify an alternate
input file.
If you specify an output file that already exists, you can use the
appendOutput parameter to indicate whether any command output should
overwrite the existing file, or be appended to it. "
I have used it on VMS in R2 and it worked well. It may depend on the OS.
You can also gerenate a shell script which makes the print command and
writes the result in a file.
A more sophisticated solution would be to use system call integration
(R3)
which should be OS specific.
Hope this helps,
Daniel Nguyen
Freelance Forte Consultant
Gary Maxwell wrote:
>
I am creating an operating system print command string on a Sun Unix box
using enscript. When I submit the print string using RunCommand it works
fine. However, if I specify a non-existant printer the RunCommand does
not seem to provide any feedback to the TOOL code. I am using the
ExitStatus attribute in OperatingSystem object to check. Is this a
valid method for checking OS status?
task.Part.OperatingSystem.RunCommand(command = runCommand, isSynchronous
= TRUE);
exitStatus = task.Part.OperatingSystem.ExitStatus;
I have also added an exception handler to try to catch the condition. I
am currently handling SystemException, FIleResourceException, and
UsageException. None of these seem to get triggered when specifing an
invalid printer name to the OS.
Questions: (1) How can I return a status code from the OS to TOOL or at
least detect the appropriate exception?
(2) Is it possible to test for the existance of a network
printer via tool code? For example could I ping the
device and return a result?
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
Maybe you are looking for
-
PPro CC crashes when using Track Select tool
This is probaby the most bizzare bug i have encountered so far - everythig works - i can scub, play and adjust footage, apply effects, titles and time remapping, but when i select Treack Select tool and click on the timeline, Premiere Pro crashes. Th
-
I tried transforming the following XSL but the characters <, @amp never gets transformed as < , & respectively instead the output has their equivalent character codes. Is there something I am missing ? Sample XSl: <?xml version = '1.0'?> <xsl:stylesh
-
Netegrity - Portal 7 integration
I have a requirement where the WLP 7 is behind a Netergrity SSO enabled IPlanet WebServer. Need to automatically log the users in to WLP 7. BEA Portal support mentioned CCE has developed a beta BEA supported integration between WLP 7.0 and Siteminder
-
Hay all :-) Had a quick search and couldn't find an answer to this so asking the question :-) It looks like i'm going to have to use Premier Pro to convert all my R3D files to mov because *Another Piece of Software ;-)* just doesn't recognise them :-
-
Database open error -214746725
I continually get the following error: NI_Database_API.lvlibB Tools Open Connec (String).vi->Get DB Columns.vi->GSEDB.vi<ERR>ADO Error: 0x80004005 Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] Data