‎2005 Sep 14 10:14 AM
Hi,
I have a PDF document stored on my C: drive. I want to attach it to a RFQ in background.
RFQ is getting created by a RFC which is called from a third party(Non SAP) system.After the RFQ is created, the file in C: drive should automatically get attached to the created rFQ.
I have seen that the function module SO_DOCUMENTS_NAMAGER can be used to read and create a document in SAP. Later we can use BINARY_RELATION_CREATE to create the link between invoice and the document.Problem is these use Frontennd Services.
If I execute these function modules in SAP GUI, it works fine. But when the call is made from a third part system in background, these functions give a DUMP "CNTL_ERROR" in CL_GUI_FRONTEND_SERVICES->CONSTRUCTOR.
Any one has any idea of how a document can be read in background without using Frontend services.
Thanks,
Prasanna
‎2005 Sep 14 10:26 AM
Prasanna,
The GUI CONTROL used by the Class CL_GUI_FRONTEND_SERVICES is SAP GUI dependent. Since you making a Call from the Third Party system, you cannot use the Services available in the CL_GUI_FRONTEND_SERVICES.
Please look out for the other options.
Thanks
Kam
‎2005 Sep 14 10:28 AM
Hi Kam,
Do you have any idea of other options available.
Thanks,
Prasanna
‎2005 Sep 14 10:55 AM
you can use the following function module
BDS_BUSINESSDOCUMENT_CREATEF
Regards
Raja
‎2005 Sep 14 11:01 AM
use the following paramters:
Logical system = <logical system>
Class name = 'BUS2105'
Class type = 'BO'
Client = <client no>
object key = <RFQ Number> " network no. is 12 char long so the number has to be passed with leading zeros
and for the FILES table
directory = "d:\Documents and Settings\user\Desktop\"
(please note that this is case sensitive"
filename = <fielanme.txt> "with extension"
Regards
Raja
‎2005 Sep 14 11:55 AM
HI Raja,
I tried this and I got a dump
"CALL_XMLRFC_BACK_REJECTED "
ShortText RFC callback calls are not allowed in the current ABAP program
What hapenned?
The function module "RFC_START_PROGRAM" is to be called as Remote Function Call with destination 'BACK' (RFC Callback) in the ABAP context "SAPMHTTP ", but an RFC callback from the program "SAPMHTTP " was prevented explicitly.This is due to an application problem. The active transaction was " ".
Error in the ABAP application program.
The running ABAP program "SAPLSYSE" had to be terminated because a statement cannot be executed.
Erroranalysis In the main program "SAPMHTTP ", it was determined that no RFC callbacks are to be called in its ABAP context. Now, a function module was called that has executed an RFC callback via the ABAP statement CALL FUNCTION 'RFC_START_PROGRAM' DESTINATION 'BACK'
This action was explicitly executed by the application in the transaction " " and in the ABAP main program "SAPMHTTP ". This is due to an application problem.
Do you have any idea of why this dump is coming.
I am calling BDS_BUSINESSDOCUMENT_CREATEF in a Custom RFC Z_RFQ_CHANGE. This Z_RFQ_CHANGE is called from a third party system.
Thanks,
Prasanna
‎2006 Sep 21 2:25 PM
Hello dear all,
thanks to Raja I checked BAPI BDS_BUSINESSDOCUMENT_CREATEF which upload and store files to SAP objects. So, I sucessed to attach the file while testing the BAPI in our SAP system (these are my paramaters):
Import parameters Value
LOGICAL_SYSTEM <our system>
CLASSNAME BKPF
CLASSTYPE BO
CLIENT 020
OBJECT_KEY 024550100042102006
Tables Value
FILES 1 Entry
DOC_COUNT 00000001
COMP_COUNT 00000001
DIRECTORY C:\ZERP
FILENAME BOOK1.XLS
SIGNATURE
DOC_COUNT PROP_NAME PROP_VALUE
00000001 BDS_DOCUMENTTYPE ZFI3S_XLS
00000001 BDS_CONTREP SD
But we would like to call this BAPI from VBA (visual basic) program (we use the same parameters as the ones above) but we recieve :ERROR_KPRO and we do not have the message number in the log file of VBA , so we are not able to understand where can be the problem. My question is can we use this BAPI from external application like VBA and if yes what can be our problems . Because in the same VBA we call BAPI_ACC_DOCUMENT_POST and we do not have any problem.
Thansk a lot for any help
Best regards
Sabina
‎2013 Mar 07 9:46 AM
Hello,
sry for unearth this old thread.
I got similiar error when calling the bapi BDS_BUSINESSDOCUMENT_CREATEF via RFC.
"RFC_START_PROGRAM" doesn't work.
Have you found a solution for this?
Regards,