cancel
Showing results for 
Search instead for 
Did you mean: 

RfcAllowStartProgram problem....

david_fryda2
Participant
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

david_fryda2
Participant
0 Kudos

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

Former Member
0 Kudos

Hi

No you dont have to do anything like that. You are using WebDynpro right. Ok can you give me the code snippet that you use when you pass data to the particular Bapi. I will tell see if i get the same error.

You dont have to do anything special to make it work

regards

ravi

david_fryda2
Participant
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

david_fryda2
Participant
0 Kudos

Hi everyone,

I think I have to get those 2 files : sapftp and saphttp.

In DynPage applications, you have to get them and to specify the use in the code.

What about WebDynPro ?

Regards.

Former Member
0 Kudos

Hi

I dont think you will have to do that here. Wondering what would be the purpose of the Function module. But as far as i know i can tell you, you dont have to do anything like that.

regards

ravi