cancel
Showing results for 
Search instead for 
Did you mean: 

How to change Date convertion pattern in SAP JCo?

Former Member
0 Kudos

Hi again!

I've come across with this issue and it's driving me crazy...

As you may know, SAP JCo maps automatically Java Object Types with ABAP Types as followshttp://help.sap.com/saphelp_nw04/helpdata/en/9a/20e23d44d48e5be10000000a114084/h-00100100000_image002.gif

[Source: http://help.sap.com/saphelp_nw04/helpdata/en/9a/20e23d44d48e5be10000000a114084/content.htm]

When it's time to convert a Java Date object to insert it in a parameter or a table field, is using the format 'yyyymmdd'. However, the BAPI itself is expecting the format 'ddmmyyyy'.

i.e.: Date 04/01/2010 is passed to the BAPI as '20100104', and is interpreted by SAP as 20/10/0104, which obviously causes an error on the record processing.

Is there any way to change this behaviour from Java side?

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Sharathmg
Active Contributor
0 Kudos

Hello Bruno,

The RFC which accepts the date has to perform a conversion routine to determine date in the format yyyymmdd.

Pass to RFC is the usual ddmmyyyy. Its the duty of the RFC and JCo to perform the conversion to its suitable format.

Note 1: yyyymmdd is the format used within SAP-ABAP.

Note 2: As an option to debug try to set an external debug point in the rFC called to check the date passed to the import parameter of the RFC. Accordingly alter your input and test.

Regards,

Sharath

Former Member
0 Kudos

Thanks, Sharath!

Sharathmg
Active Contributor
0 Kudos

Happy to have helped you.

Regards,

Sharath

Answers (0)