on 07-06-2005 3:32 PM
Hi everyone,
I am trying (without success) to call the BAPI_DOCUMENT_CHECKOUT2.
I fill all the parameters but get an "Error Start_PROG...".
I think it is because of RfcAllowStartProgram.
What should I do to solve the problem ?
Thanks a lot.
Regards.
Hi
Is it BAPI_DOCUMENT_CHECKOUT2 or BAPI_DOCUMENT_CHECKOUTSET2. Well if you see the documentation of the function module you have a sample which is given below. This is just a abap program that calls the function module BAPI_DOCUMENT_CHECKOUTSET2. The idea is what parameters you need to pass to the function module. Maybe you are not passing the correct parameters.
Sample Code of calling the FM from Abap
** Document key
DATA: lf_doctype LIKE bapi_doc_draw-documenttype,
lf_docnumber LIKE bapi_doc_draw-documentnumber,
lf_docpart LIKE bapi_doc_draw-documentpart,
lf_docversion LIKE bapi_doc_draw-documentversion,
ls_documentfile LIKE bapi_doc_files2,
ls_checkedoutfile LIKE bapi_doc_files2,
lf_status LIKE bapi_doc_draw-statusextern,
** Bapi Return structure
ls_return LIKE bapiret2.
***************************************************************
** Assign document data
lf_doctype = 'DRW'.
lf_docnumber = '4711'.
lf_docversion = '00'.
lf_docpart = '000'.
REFRESH lt_files.
CLEAR lt_files.
** Define path shown by original
ls_documentfile-docfile = 'c:tempwork.dwg'.
** Set new status for document
lf_status = 'IA'.
** Check out original for change
CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTSET2'
EXPORTING: documenttype = lf_doctype
documentnumber = lf_docnumber
documentpart = lf_docpart
documentversion = lf_docversion
documentfile = ls_documentfile
statusextern = lf_status
IMPORTING: return = ls_return
checkedoutfile = ls_checkedoutfile.
** Errors ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
Well from the above just check if you are filling in the relevant values. It seems to work for me if i just give in the values mentioned above. But just ensure that you do have the directory say "C:\temp\work.dbg" file path at the server. I dont seem to get the error that you have mentioned. I am using 4.7. That should not be a problem i guess.
Try giving the parameters similar to the sample given.
See if that helps you else tell me the steps so that i can try to reproduce the error at my end and then we can check to see what the problem might be.
regards
ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is in fact BAPI_DOCUMENT_CHECKOUTVIEW2. Sorry for the mistake.
I read that .Net programmers add a call to a function
RfcAllowStartProgram.
Do I have to do the same thing with the WebDynPro ?
By the way, I read that with old portal components like DynPAge, the way to call the RfcAllowStartProgram is like this : JCO.setMiddlewareProperty().
Thanks,
Regards
Hi,
wdDoInit() {
Bapi_Document_Checkoutview2 input = new Bapi_Document_Checkoutview2();
wdContext.nodeBapi_Document_Checkoutview2.bind(input);
input.setDocumenttype(new String());
input.setDocumentnumber(new String());
input.setDocumentpart(new String());
input.setDocumentversion(new String());
input.setDocumentfile(new Bapi_Doc_Files2());
}
executeRFC {
input.setDocumenttype("ZL0");
input.setDocumentnumber("12345678");
input.setDocumentpart("000");
input.setDocumentversion("00");
try {
wdContext.currentBapi_Document_Checkoutview2_InputElement().modelObject().execute();
} catch(Exception e) {
}
wdContext.nodeOutput().invalidate();
}
Message was edited by: David Fryda
hi
In the code snippet
input.setDocumenttype(new String());
input.setDocumentnumber(new String());
input.setDocumentpart(new String());
input.setDocumentversion(new String());
input.setDocumentfile(new Bapi_Doc_Files2());
The above lines of code will create empty lines when they go to the backend structure. This will not give you proper output and you will also not get a error.
If they are not mandatory leave it else you will have to pass the required values alrite.
If you need to pass values to the above structures then
write code like
For eg
Bapi_Doc_Files2 test = new Bapi_Doc_Files2();
test.setDocPath("C:\temp\");
input.setDocumentFile(test);
Hope that helps you.
Change the steps like i had mentioned and let me know. The remaining is ok :).
regards
ravi
Hi David
Modify the code snippet as below
wdDoInit() {
Bapi_Document_Checkoutview2 input = new Bapi_Document_Checkoutview2();
wdContext.nodeBapi_Document_Checkoutview2.bind(input);
input.setDocumenttype("ZL0");
input.setDocumentnumber("12345678");
input.setDocumentpart("000");
input.setDocumentversion("00");
try {
wdContext.currentBapi_Document_Checkoutview2_InputElement().modelObject().execute();
} catch(Exception e) {
}
}
Dont invalidate the output node until you want to clear the data in the node
Kishore
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.