cancel
Showing results for 
Search instead for 
Did you mean: 

Error in generic sync

Former Member
0 Kudos

Hi,

I am trying to invoke a BAPI wrapper in a R3 backend using Generic sync. When I display the inbound container i get a message "EV1 312Sales document type is not defined". As I understand this happens when the input parameters to BAPI call are null.

I am not sure how null values are being posted.

The code where is fill Outbound Container looks like :


			OutboundContainer out = outfactory.createOutboundContainer(VisibilityType.SEPARATED, "MOBILE_SALESORDERCREATE", OutboundContainer.TYPE_OUTBOUND);
			out.addItem(FIELDNAME, "ORDER_HEADER_IN");
			out.addItem(LINENUMBER, "1");
			out.addItem(FIELDVALUE, "YYYYYYYYYYYYYYYYYYYYY");
			out.addItem(FIELDNAME, "ORDER_PARTNERS");
			out.addItem(LINENUMBER, "2");
			out.addItem(FIELDVALUE, "XXXXXXXXXXXXXXXXXXXXX");
			out.close();

			SyncManager sm = SyncManager.getInstance(); 
			if (sm.isSyncCredentialAvailable() == false) {
				System.out.println("Sync password not set yet. Set Sync password");
				sm.setSyncPasswordOfCurrentUser("password");
			}
			sm.synchronizeWithBackend();

Can any one throw any light on this?

Any kind of help on this will be appreciated.

Regards,

Nakul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hello nakul,

i have no idea what your application is. for the sake

of the doubt, just would like to ask if you are trying

to add an items for the following name/value pairs?

ORDER_HEADER_IN=YYYYYYYYYYYYYYYYYYYYY

ORDER_PARTNERS=XXXXXXXXXXXXXXXXXXXXX

are ORDER_HEADER_IN and ORDER_PARTNERS the names of your

fields? if this is the case, then your code should be

//out.addItem(fieldName,fieldValue)

out.addItem("ORDER_HEADER_IN","YYYYYYYYYYYYYYYYYYYYY");

out.addItem("ORDER_PARTNERS","XXXXXXXXXXXXXXXXXXXXX");

there's also a method for

out.addItem(fieldName:String,lineNumber:int,fieldValue:String)

but is already deprecated. for the method above, the line

numbers are automatically incremented and set.

regards

jo

Former Member
0 Kudos

Hi Jo,

When I test the BAPI wrapper through se37 transaction, the test data is

Line 1:

FIELDNAME = ORDER_PARTNERS

FIELDVALUE = XXXXXXXXXXXXXXXXXXXXX

Line 2:

FIELDNAME = ORDER_HEADER_IN

FIELDVALUE = YYYYYYYYYYYYYYYYYYYYY

and then I execute to create a sales order.


			out.addItem(FIELDNAME, "ORDER_HEADER_IN");
			out.addItem(FIELDVALUE, bufferToString);
			out.addItem(FIELDNAME, "ORDER_PARTNERS");
			out.addItem(FIELDVALUE, "AG0000000046000000");

My Constants file has following entries:


   String FIELDNAME = "FIELDNAME";
   String FIELDVALUE = "FIELDVALUE";

I hope I am doing it right.

Regards,

Nakul

Former Member
0 Kudos

hello nakul,

>When I test the BAPI wrapper through se37 transaction,

>the test data is

>Line 1:

>FIELDNAME = ORDER_PARTNERS

>FIELDVALUE = XXXXXXXXXXXXXXXXXXXXX

then you should use the coding which i told you about.

out.addItem("ORDER_PARTNERS", "XXXXXXXXXXXXXXXXXXXX");

if you want to specify the linenumber, you can still use

the deprecated method. but i will recommend to use the one

above.

out.addItem("ORDER_PARTNERS",1,"XXXXXXXXXXXXXXXXXXXX");

regards

jo

Former Member
0 Kudos

Hi Jo,

This works! Thanks a ton!

Regards,

Nakul

Answers (1)

Answers (1)

Former Member
0 Kudos

hello nakul,

there's nothing wrong with your code. i think the message

"EV1 312Sales document type is not defined"

is returned by your backend's BAPI. something related

to the business logic itself.

from the message, it states that such document type is

not defined. you might need to send a valid field value

instead of "XXX" or "YYY" strings... depending on how your

BAPI behave for these kind of inputs.

you can try setting a default values for those parameters

which are required by your backend BAPIs but are not sent

from your client app.

regards

jo

Former Member
0 Kudos

Hi Jo,

I checked out with the SAP guys over here. They say that the Outbound Container I am sending is null somehow. They say if some value say XXXX would have been delivered the message would have been "<b>EV1 312Sales document type XXXX is not defined</b>".

Any solution as to why the container is delivering null?

Regards,

Nakul