on 06-23-2009 9:40 AM
Hi Gurus,
i need your help. i've implemented RFC in Sap that's called by JCO. When i want to create a new version, i do two calls to bapis:
1. CALL FUNCTION 'BAPI_DOCUMENT_CREATENEWVERSION'
EXPORTING
REFDOCUMENTVERSION = old_version
and copying object links from version.
2. CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
EXPORTING
documenttype = DOCUMENTTYPE
documentnumber = DOCUMENTNUMBER
documentpart = DOCUMENTPART
documentversion = new_version
documentdata = gt_documentdata
documentdatax = gt_documentdatax
IMPORTING
return = gt_return
TABLES
objectlinks = gt_objectlinks
documentfiles = gt_documentfiles.
In table gt_return appears the following error: Document with new_version does not exist.
This only happens when i call RFC from JCO. If i call RFC in Sap, everything works perfectly.
Will I need SAP NOTE?
Thank you very much in advance. Regards,
Almudena
hi,
try like this, please enter what u configured parameters.
IMPORTING: return = ls_return
TABLES: objectlinks = lt_drad.
Did an error occur ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
Benakaraja
??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Almudena,
regarding the BAPI call from JCO maybe the information at http://wiki.sdn.sap.com/wiki/display/PLM/BAPI_DOCUMENT_CHECKOUTVIEW2+in+JCO+environment could be useful for you.
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you please tell me what are the mandatory parameters and the values we need to pass in BAPI_DOCUMENT_CREATENEWVRS2.
Shilpa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please check your logic .
you are trying to get teh object links of the old version and then passing data to BAPI_DOCUMENT_CHANGE2 which will throw error .BAPI_DOCUMENT_CHANGE2 is used only for changing an existing document .
So, instead of doing this ,you can call BAPI_DOCUMENT_CREATENEWVRS2
with refdocument number/type/part/version and with new document version to be created.
Please do pass the object type (eg : MARA , AENR etc ) you want to copy in COPYOBJECTLINKS table .Otherwise it won't work.
Or else, if you don't know which all object types to copy,then get the details of old document version via BAPI_DOCUMENT_GETDETAIL2 and pass the object links to BAPI_DOCUMENT_CREATE2.
This will work .
Best Rgds,
Roopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.