2016 Dec 16 3:31 PM
I am trying to Create a PO using the .NET Connector (C#) (Version 3.3) in SAP.
Delivery date field is optional in SAP but when trying to pass Blank/Space/Empty/NULL it fails.
Below mentioned is the code that im using for the Optional Field(Date Field)
IRfcStructure POItemSchedule = rfcRepository.GetStructureMetadata("BAPIEKET").CreateStructure(); POItemSchedule.SetValue("DELIV_DATE", "0000-00-00");
...
...
//Connect and create PO in SAP
BAPI_PO_CREATE_FuncOBJ.Invoke(rfcDestination); BAPI_TRANSACTION_COMMITOBJ.SetValue("WAIT", "X"); BAPI_TRANSACTION_COMMITOBJ.Invoke(rfcDestination);
I tried passing the following values.
"0000-00-00"
"000-00-00"
" "
"0"
String.Empty &
DBNULL
When trying these I get the below errors
"Cannot Convert String into Date" Or "Please enter a valid delivery date"
Please advise if there are any ways to overcome this error and pass the NULL/Empty Value.
Thanks in Advance.
2016 Dec 17 5:25 PM
Date in SAP is in format YYYYMMDD so try to pass for example '20161217'
2016 Dec 19 6:57 AM
2016 Dec 19 3:30 PM
Thank you for responding, I am able to save the date values. I need help on saving NULL/EMPTY in the Delivery Date Field as it is optional.
2016 Dec 20 5:28 AM