Hi All,
I have written a "Z" function moudle which uses API_DOCUMENT_MAINTAIN2 to attach a docoment to a WBS element and CVAPI_DOC_CHECKIN to check in the same document in one of our IXOS Server. This "Z" BAPI/Function module is getting called from a VB code. When this function module is getting executed via SE37 transaction it works fine no errors.
When I run this from a VB code I get the error "RFC Partner does not allow to start the required P", The last "P" I think is "program".
But the stange thing is, When I debug the VB Code (With ABAP Debug On - I.e from VB it open a new abap window - This I achived by setting RFC_DEBUG = 1 in the Environment variables) it works fine no erros are reported. I am not sure why the same function module call from VB is behaving differently in Debug mode and Normal Mode.
Kindly help.
Here is the ABAP Code which calles these 2 APIs
CALL FUNCTION 'API_DOCUMENT_MAINTAIN2'
EXPORTING
PF_TRANSACTION = 'CV01'
PS_API_CONTROL = LIT_API_CONTROL
DOCUMENTDATA = LIT_DOCUMENTDATA
IMPORTING
DOCUMENTNUMBER = LV_DOC_NUMBER
DOCUMENTPART = LV_DOC_PART
DOCUMENTVERSION = LV_DOC_VERSION
RETURN = LIT_RETURN2
TABLES
OBJECTLINKS = LIT_OBJECTLINKS
DOCUMENTFILES = LIT_DOCUMENTFILES.
LIT_PT_FILES-APPNR = '1'.
LIT_PT_FILES-STORAGE_CAT = LV_STORAGECATEGORY.
LIT_PT_FILES-PATHNAME = LV_CVPATHNAME.
LIT_PT_FILES-FILENAME = LV_FILENAME.
APPEND LIT_PT_FILES.
CALL FUNCTION 'CVAPI_DOC_CHECKIN'
EXPORTING
PF_DOKAR = LV_DOKAR
PF_DOKNR = LV_DOC_NUMBER
PF_DOKVR = LV_DOC_VERSION
PF_DOKTL = LV_DOC_PART
PS_API_CONTROL = LIT_API_CONTROL
PF_FTP_DEST = 'SAPFTPA'
PF_HTTP_DEST = 'SAPHTTPA'
IMPORTING
PSX_MESSAGE = LIT_PSX_MESSAGE_1
TABLES
PT_FILES_X = LIT_PT_FILES.
I have read other postings which tells that SAPFTP.exe and SAPHTTP.exe should be placed in WINDOWS/SYSTEM32 folder. I have done that as well.
Another Post tells about putting
ReturnCode = RfcAllowStartProgram("sapftp;saphttp") in the VB code I have done this as well.
Kindly help me out in resolving this issue as to why in Debug mode the Document is getting attached and Archived. But in normal mode it is failing in Checkin BAPI.