cancel
Showing results for 
Search instead for 
Did you mean: 

Proxy to file scenario

Former Member
0 Kudos

I have a proxy to file scenario.

I have an abap program say PROG1 which calls the proxy and then PI does the file transfer.

Is there any way that the PROG1 gets notified with a return code whether PI was successful in its file transfer?

All I want to do is, PROG1 should be able to know if the file was actually transferred by PI or not.

Thanks

MLS

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Sarvesh, thanks for all your help.

For now, we will rely on the PI alerts to report the failed messages.

--MLS

Former Member
0 Kudos

Sarvesh,

Thanks for your reply.

I have been using async O/B proxy as you mentioned above. But the issue is, the sending program doesn't know if the PI has actually done the file transfer or not.

When you said, you cannot use synchronous O/B proxy...why is that?

Thanks

MLS

Former Member
0 Kudos

> When you said, you cannot use synchronous O/B proxy...why is that?

I mean for synchronous Out Bound Proxy the receiving system should be synchronous, since you are using Receiver File Adapter which doesn't support sysnchonous communication, so you will not be able to get any response back from file system.

If you want you get the response back in R3 system then you have to create another scenario which will check the status of file system (first sccnario) and if the file has been delivered by File adapter then your new scenario will send a message to your R3 system, but this will be completely asynchronous scenario.

I will say again, with File adapter it is not possible to have synchronous communication (At least till now).

Regards,

Sarvesh

Former Member
0 Kudos

Sarvesh,

Another question:

CALL METHOD CL_OS_PRUCHASE_DATA->EXECUTE_SYNCHRONOUS

EXPORTING

OUTPUT = OUTPUT

IMPORTING

INPUT = INPUT

In the above code, what will be the structure of the message type INPUT? All I want is a return code of 0 for success and -1 for failure. And also, where will these values be set in PI for this message type?

Thanks for your help.

Former Member
0 Kudos

In case of synchronous communication, the structure of request & response are always same.

But since your case is Proxy to file then it is not possible to go with Synchronous Proxy. Other solution can be as mentioned below.

Use Asynchronous O/B Proxy and after sending the data to proxy check if fault is initial that means no exception occurred during sending the data to proxy then you can simply populate on message of type ' S' or 'I' with text "Data sent to Proxy Successfully". See the below code....

DATA prxy TYPE REF TO zblogco_proxy_interface_ob.
*
CREATE OBJECT prxy.
DATA it TYPE zblogemp_profile_msg.
TRY.
it-emp_profile_msg-emp_name = 'Sarvesh'.
it-emp_profile_msg-empno = '01212'.
it-emp_profile_msg-DEPARTMENT_NAME = 'NetWeaver'.

CALL METHOD prxy->execute_asynchronous
EXPORTING
output = it.
commit work.

CATCH cx_ai_system_fault .
DATA fault TYPE REF TO cx_ai_system_fault .
CREATE OBJECT fault.

        IF fault IS INITIAL.
          MESSAGE I000(0k) WITH 'Data has been sent to XI Successfully'.
        ENDIF.

ENDTRY.

Former Member
0 Kudos

Sarvesh,

I will try this out and let you know. Stay tuned for more questions on this as I try.

Thanks

MLS

Former Member
0 Kudos

For now Good Night from my side... I will see tomorrow if you have something.

Best of Luck!

Sarvesh

Former Member
0 Kudos

Thanks for the replies.

I have already configured alerts to notify the users of the failure(in our case its basis team). But in this scenario my ABAP program should get a return code of success or failure so that the functional team knows if the file was written or not.

By using synchronous outbound proxy, will PI be able to send the ABAP program the return code of success or failure?

Former Member
0 Kudos

I think you can set an alert for successfull message as well.

Former Member
0 Kudos

> By using synchronous outbound proxy, will PI be able to send the ABAP program the return code of success or failure?

Yes, but the receiving system should be capable of sending the response. I mean receiving system should be synchronous.

See the code example from the link given above in my first reply.

CALL METHOD CL_OS_PRUCHASE_DATA->EXECUTE_SYNCHRONOUS
      EXPORTING
        OUTPUT = OUTPUT
      IMPORTING
        INPUT  = INPUT

Here INPUT will bring the data from PI after you send the data from R3 to PI using OUTPUT.

Regards,

Sarvesh

Former Member
0 Kudos

Hi,

Go for synchronous outbound proxy to achieve this.

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/abap%2bproxy%2boutbound%2bprogram%2b-%2bp...

In case of Proxy to file, since file adapter in not sychronous therefore you can not use the synchronous proxy here. If the receiving system is capabile of sending the response back in other words if it is synchronous then only you can use.

For example if you use R3 to webservices scenario (to calculate the numbers) then in that case when you send the data from R3 to webservice using synchronous proxy then it will do the calculation and return the response to XI and XI will send it to R3.

Regards,

Sarvesh

Edited by: Sarvesh Singh on Mar 13, 2009 8:03 PM

Former Member
0 Kudos

Laxmi,

Can you give us more details about your interface. What would be next step if assume you get an positive / negative ack of creating file. Do you want to intimate user that file is created or failed?

You can set alert for successfull as well as fail messages and configure them to send an email to user with details.

Give us some more details....may be we can help or can find round-way.

Hope this will help.

Nilesh