Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is BAPI_BATCH_CREATE updating blank date as Non-initial value in MCH1-VFDAT?

Former Member
0 Kudos

Hi Guys,

We have the BAPI_BATCH_CREATE call in a program to create material batches and everything is working fine except sometimes when it updates a blank date in the date fields MCH1-VFDAT / FVDT1 / FVDT2 as non-INITIAL value. When we check such a date field in SE16, it has   /  /     instead of 00/00/0000 (space character in place of 0). As a result, when we open the batch using transaction MSC3N, it throws an error message - "The format of internal date is /  /  is incorrect !"

I already checked the SAP Notes concerning BAPI_BATCH_CREATE but didn't find any info on date fields. Have you faced such a problem? Appreciate your answer 🙂 Thanks !

1 ACCEPTED SOLUTION

Former Member
0 Kudos

The issue is resolved. The field values in the incoming IDocs were coming as a string of space characters in case of blank date fields. The PI team recently changed the initial values (date type - 000000) for the affected fields  to a string of space characters as part of a project and the ABAP team was not aware of it.

Anyway...

Thanks for your inputs Sravan and Kim

4 REPLIES 4

former_member190103
Participant
0 Kudos

Hi Mukesh,

As per your analysis it seems that the value of MCH1-VFDAT / FVDT1 / FVDT2 is  / / this format.

so you can maintain a conditon when the date value is initial.

If sy-subrc eq 0

replace 'oo' with 'space'.

end if.

Regards,

Sravan

Former Member
0 Kudos

Hello Mukesh,

Is there any common factor on the times that this occurred? 

For example, are you populating an import parameter/table when the exception occurs,  that is different from the times when the dates do not get corrupted?

Are you moving any value into the dates? Such as a space or a 'null' field that is part of a structure?

Regards,

Kim

0 Kudos

Hey Kim,

It's an inbound IDoc which triggers a custom F/M calling this BAPI. It seems it was working fine earlier and stopped working for past few days. The IDoc has the field MCH1-VFDAT, so we can assume space character might be coming in but we don't have explanation for MCH1-FVDT2 which is not a part of IDoc and calculated within the F/M which was working fine till recently.

There was one more change recently - we moved from Unix to Linux OS but I think that should not have anything to do with this. Thanks !

Former Member
0 Kudos

The issue is resolved. The field values in the incoming IDocs were coming as a string of space characters in case of blank date fields. The PI team recently changed the initial values (date type - 000000) for the affected fields  to a string of space characters as part of a project and the ABAP team was not aware of it.

Anyway...

Thanks for your inputs Sravan and Kim