Hi!
I am trying to materialize a new patient in our system via a small C# .net Connector application.
The problem is, that the patient data gets written to the database, but no address information can be seen!
The following code snippet shows my current work; can anybody tell me, what i am doing wrong here? The program compiles and runs without any errors, even no SAP return message is given in the return table! But, there is no address information when saving the patient, only name, birth date, etc. can be seen after inserting!
BR, Elmar
IRfcFunction func = custom.Repository.CreateFunction("BAPI_PATIENT_CREATE");
IRfcFunction commit = custom.Repository.CreateFunction("BAPI_TRANSACTION_COMMIT");
func.SetValue("CLIENT", "100");
func.SetValue("INSTITUTION", "123");
IRfcTable impAddressTable = func.GetTable("I_ADDRESSES");
RfcStructureMetadata meta = custom.Repository.GetStructureMetadata("BAPINADDR");
IRfcStructure addrData = meta.CreateStructure();
addrData.SetValue("COUNTRY_ISO", pData.country);
addrData.SetValue("STR_NO", pData.street);
addrData.SetValue("CITY", pData.city);
addrData.SetValue("PCD", pData.postalCode);
addrData.SetValue("GEOGR_AREA", pData.geogArea);
impAddressTable.Append(addrData);
IRfcStructure impStruct = func.GetStructure("PATIENT_DATA");
impStruct.SetValue("LAST_NAME_PAT", pData.lastName);
impStruct.SetValue("FRST_NAME_PAT", pData.firstName);
impStruct.SetValue("BIRTH_NAME", pData.birthName);
impStruct.SetValue("DOB", pData.birthDate);
impStruct.SetValue("***_EXT", pData.***);
impStruct.SetValue("TITLE", pData.acadTitle);
impStruct.SetValue("OCCUPATION", pData.occupation);
RfcSessionManager.BeginContext(custom); // Preserve RFC state
func.Invoke(custom);
IRfcTable rfcTable = func.GetTable("RETURN");
commit.Invoke(custom);
RfcSessionManager.EndContext(custom);