cancel
Showing results for 
Search instead for 
Did you mean: 

FM execution through xi

Former Member
0 Kudos

Hi Everbody,

Am using the FM "BAPI_DOCUMENT_CHECKIN2" to checkin the file in to DMS system.

Backend Systen ERP is configured with DMS system , When FM of above is executed from backendsystem file gets attached.

But Scenario gets different when i use this FM in external system (Ex. XI system).The FM is executed b y specifying the destination but file is not getting attached even though there is no error.

Here in FM i found a parameter : Hostname -- which describes :::: Computer name of the frontend computer used to call BAPI. Only necessary if the call of the function module is executed from an external system. The frontend type is deteremined using the computer name from DMS customizing.

Did anyone get of any kind prob ??

kindly advice .. i need to execute this FM using XI (Receiver RFC Adapter) ;;; Adapter status is green saying no error ::: but n ofile is getting attached.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189354
Contributor
0 Kudos

Hi,

I think "BAPI_DOCUMENT_CHECKIN2" uses sapftp prtocol to attach file. Usually sapftp sits in SAPGUI software. This is usually works when u test it from R3 because of SAPGUI. When u try to run this rfc through XI it will not work. There is a SAPNote on this. SAP says that u need to keep the file on application in particular folder to get the file attach.

Regards,

Rao.Mallikarjuna

Former Member
0 Kudos

Hi Can you give the SAP note number ,

So placing the file in a particular application folder it would work ??

Here : When i run the FM from the SAP Backend System : i give the Docpath parameter as the : XI Folder or the Application Sytem (SAP Backend System) or local , where ever i place the file it works, attaching the file to the DMS.

All problem starts when i use this FM in different system , execution is happening with no error but no checkin of file happening

Would it go ahead

With regards

Srini

former_member189354
Contributor
0 Kudos

Note No 796709 might be useful.

Regards,

Rao.Mallikarjuna

Former Member
0 Kudos

Hi ,

We are having "SAP ECC 6.0".

I understand that those two parameters SAPFTP SAPHTTP has to be passed when we use this BAPI in different system

And one more thing , they say that file should be pointing the application System , which means , Here DMS is on ECC system , now SRM is the system where this BAPI is being executed, should i maintain the file in the SRM system , r ECC system

kindly advice

srini

former_member189354
Contributor
0 Kudos

Hi,

SRM System Application server level.

Regards,

Rao.Mallikarjuna

Former Member
0 Kudos

Hi I use the

as advice and still see no File checked in to the DMS

Below is the CODE

&----


*& Report YTEST

*&

&----


*&

*&

&----


REPORT ytest.

DATA: lf_doctype(003), "LIKE bapi_doc_draw-documenttype,

lf_docnumber(025), "LIKE bapi_doc_draw-documentnumber,

lf_docpart(003), "LIKE bapi_doc_draw-documenttype,

lf_docversion(002), "LIKE bapi_doc_draw-documentversion,

lf_status(002). "LIKE bapi_doc_draw-statusextern.

*//DATA STRUCTURE FOR BAPI RETURN

DATA: BEGIN OF ls_return,

type(001),

id(002),

number(003),

message(220),

log_no(020),

log_msg_no(006),

message_v1(050),

message_v2(050),

message_v3(050),

message_v4(050),

parameter(032),

row(010),

field(030),

system(010),

END OF ls_return.

*//DATA STRUCTURE FOR DOCUMENT ORGINALS

DATA:BEGIN OF lt_files,

deletevalue(001),

documenttype(003),

documentnumber(025),

documentpart(003),

documentversion(002),

originaltype(005),

sourcedatacarrier(010),

storagecategory(010),

wsapplication(003),

docpath(255),

docfile(255),

statusintern(002),

statusextern(002),

statuslog(020),

application_id(032),

file_id(032),

description(040),

language(001),

checkedin(001),

active_version(001),

created_at(014),

changed_at(014),

created_by(012),

changed_by(012),

content_description(050),

END OF lt_files.

**.... Bapi-Return structure

DATA : pr_ls_return LIKE ls_return .

**.... Originals

DATA: pr_lt_files LIKE lt_files OCCURS 0 WITH HEADER LINE.

lf_doctype = 'STD'.

lf_docnumber = '296501'.

lf_docversion = '00'.

lf_docpart = '000'.

lf_status = 'CT'.

    • Check in original 1 into SAP Database

REFRESH pr_lt_files.

CLEAR pr_lt_files.

PR_lt_files-storagecategory = 'Z_BHEL_HYD'. " Storage = SAP-DB

PR_lt_files-docfile = '
10.x.x.xxx\sapmnt\trans\abcd1.txt'. ".SRM System

APPEND PR_lt_files.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lf_docnumber

IMPORTING

output = lf_docnumber.

break-point.

call function 'BAPI_DOCUMENT_CHECKIN2' DESTINATION 'SNDCLNT100' EXPORTING: documentnumber = lf_docnumber

documenttype = lf_doctype

documentpart = lf_docpart

documentversion = lf_docversion

  • hostname = 'SNDCLNT100'

statusintern = ''

statusextern = lf_status

PF_HTTP_DEST = 'SAPHTTP'

  • PF_FTP_DEST = 'SAPFTP'

statuslog = ''

IMPORTING: return = pr_ls_return

TABLES: documentfiles = pr_lt_files.

break-point.

*if sy-subrc eq 0.

**commit work.

*else.

*message 'error' type 'E'.

*

*endif.