cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with RFC adapter

Former Member
0 Kudos

Hello all,

I have problem which drives me crazy... I set up processs with async file read (purchase order), sync BAPI call (BAPI_SALESORDER_CREATEFROMDAT2) and async message write to file.

Process as process works fine, file is read, bapi is called and respone is written in file.

Problem is that obviously, mapping inside RFC adapter does not work - transformed message which goes to RFC adapter looks like this:

<?xml version="1.0" encoding="utf-8" ?> 
- <p1:BAPI_SALESORDER_CREATEFROMDAT2 xmlns:p1="urn:sap-com:document:sap:rfc:functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <ORDER_HEADER_IN>
  <DOC_TYPE>ZPOR</DOC_TYPE> 
  <SALES_ORG>PH10</SALES_ORG> 
  <DISTR_CHAN>05</DISTR_CHAN> 
  <DIVISION>20</DIVISION> 
  <REQ_DATE_H>06-12-2006</REQ_DATE_H> 
  <PMNTTRMS>ID18</PMNTTRMS> 
  <PURCH_NO_C>0000197478</PURCH_NO_C> 
  <DOC_DATE>04-12-2006</DOC_DATE> 
  </ORDER_HEADER_IN>

--- the rest of the message is cut ---

and response is always the same:

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns1:SO_response_MT xmlns:ns1="http://gbs.com/PlivaItaly/LabSo">
  <SALESDOCUMENT /> 
- <RETURN>
- <item>
  <TYPE>E</TYPE> 
  <ID>V1</ID> 
  <NUMBER>312</NUMBER> 
  <MESSAGE>Sales document type is not defined</MESSAGE> 
  <LOG_NO /> 
  <LOG_MSG_NO>000000</LOG_MSG_NO> 
  <MESSAGE_V1 /> 
  <MESSAGE_V2 /> 
  <MESSAGE_V3 /> 
  <MESSAGE_V4 /> 
  <PARAMETER /> 
  <ROW>0</ROW> 
  <FIELD /> 
  <SYSTEM>QPWCLNT500</SYSTEM> 
  </item>
  </RETURN>
  </ns1:SO_response_MT>

Document type ZPOR exists, and BAPI works when called with SE37 from the R/3. Also, when I try to put some other document type in SE37, I get response 'Sales document type <wrong type> is not defined', and clearly, in the message from response, it's a blank field.

Does anyone knows what can it be?

Best regards,

Ivan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Pay attention, the field DOC_TYPE is based on data element AUART tha has a conversion exit!

You must to manage this with XI, the field is also Language Dependent. Check the table TAUUM in the back-end, and verify in with language the system user log-on to SAP to make the RFC.

Sandro

Former Member
0 Kudos

Hi,

in this case, conversion exit return same document type, in en and it language

Do I have to map whole BAPI structure and take care of order?

BR,

Ivan

Former Member
0 Kudos

Are you sure you point to QPWCLNT500 and you do the test with SE37 in QPWCLNT500 ?

You can try to trace the real data passed in the call with the SQL Trace, with transaction ST05 (always in the back-end system).

Regards,

Sandro

Former Member
0 Kudos

Yes, I'm using QPWCLNT500 for all tasks, I double-checked it.

I tried to use ST05 (select RFC trace, activate trace, run process, deactivate trace), but there's nothing in the log, when I select display trace...

Former Member
0 Kudos

1) Open ST05

2) flag "SQL Trace" only

3) select "Activate Trace with filter" and put the user that you have in the RFC receiver adapter.

4) send the XI message

5) press "Deativate Trace"

6) press "Display Trace"

Former Member
0 Kudos

Hi,

it worked... here is the output:

|hrpbfxi01 ? Server RFCPING

|hrpbfxi01 hrpbfse06_QPW_14 Server BAPI_SALESORDER_CREATEFROMDAT2

|hrpbfxi01 hrpbfse06_QPW_14 Server SYSTEM_RESET_RFC_SERVER

I don't see anything special here?

Former Member
0 Kudos

I proposed you to activate "SQL Trace", not the "RFC Trace".

Regards,

Sandro

Former Member
0 Kudos

I'm not getting anything with SQL trace, just one line

COMMIT WORK ON CONNECTION 0

I

Former Member
0 Kudos

Hi Ivan,

Is your problem Solved as we are facing the same issue for the RFC. Please let us know if you have found any solution

Thanks

Former Member
0 Kudos

Hi Ivan,

I have worked on similar type of requirement :

But we went for ABAP Proxy inside which we called the BAPI . a concept of wrapper bapi and writing back response in a file .

and it is running perfectly . 10 out of 10

Advantage we got :

1. Simple mapping

2. Any issues related to data we handled at BAP code level.

3. very easy in debugging.

Give a thought to this ...

Regards,

Former Member
0 Kudos

Our issue is resolved was due to an exception being raised in RFC

Answers (2)

Answers (2)

STALANKI
Active Contributor
0 Kudos

Try doing this for debugging the RFC call and tracing the actual values if you are sure the mapping is correct.

/people/michal.krawczyk2/blog/2006/01/17/xi-debugging-rfc-calls-from-the-xi-not-possible-who-said-that-

moorthy
Active Contributor
0 Kudos

Hi,

check out the RFC adapter metadata.. You can refresh this with Integration builder>Administration>XI Cache Overview-- and refresh all the caches

Also refresh the CPACache Refresh.

One more option is to restart the RFC adapter from the J2EE engine..

I think problem may be because of the Cache Refresh

Regards,

moorthy

Former Member
0 Kudos

It is a standard SAP object, "BAPI_SALESORDER_CREATEFROMDAT2", the metadata are loaded and not changed.

Regards,

Sandro