2005 Dec 21 2:20 PM - last edited on 2024 Feb 04 1:07 AM by postmig_api_4
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
2005 Dec 21 2:43 PM
BAPI_USER_EXISTENCE_CHECK this is giving message if i enter some wrong user.
which version you are using..
vijay
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
2005 Dec 21 2:35 PM
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.
2005 Dec 22 10:16 AM
Hi Johan
Thanks for your thoughtful answer. I am not a BAPI programmer and I would prefer, if possible, to avoid the direction you are suggesting.
It is clear from other posts in this and other fora that BAPI_USER_EXISTENCE_CHECK returns information to the calling process. My project really requires that this returned information is written to STDOUT so that I can capture it in a unix shell script.
The source code for startrf is available as part of the SDK. Another way of dealing with this problem may be to write a small mod to the startrfc.c program. I am more comfortable in C than in ABAP.
Anyway, thanks once more for your suggestions.
Cheers
Stephen
2005 Dec 21 2:43 PM
BAPI_USER_EXISTENCE_CHECK this is giving message if i enter some wrong user.
which version you are using..
vijay
2005 Dec 22 10:25 AM
Hi Vjay
Thanks for your response. I assume you mean "which version" of SAP. R3 is the answer if I am right.
Cheers
Stephen
2005 Dec 22 10:32 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |