Skip to Content
0
Former Member
Jul 15, 2008 at 02:01 PM

Cannot Record Material Inspection Results as per wiki use case * SOLVED *

69 Views

=== EDIT ===

Playing around, I solved my issue.

I did not realize that I needed to set both flags

CloseIndicatorSpecified  = true;
CloseIndicator = false;

Adding that fixed it; I suspect I cannot set them to null even if the WSDL allows it.

Michel.

=== ORIGINAL POST ===

Hi,

I have a project to integrate SAP and our LIMS using the SAP web services with the Material Inspection business object.

In the Wiki, there are a few [use cases|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/ESpackages/IntegrationofQualityManagementSystems] on the subject.

Following that, I successfully retrieve all the required data using the following web services:

[Find Material Inspection Basic Data by Elements|https://wiki.sdn.sap.com/wiki/display/ESpackages/FindMaterialInspectionBasicDatabyElements]

[Find Material Inspection Subset Operation by Elements|https://wiki.sdn.sap.com/wiki/display/ESpackages/FindMaterialInspectionSubsetOperationbyElements]

[Find Subset Operation Inspection Activity Basic Data by Elements|https://wiki.sdn.sap.com/wiki/display/ESpackages/FindSubsetOperationInspectionActivityBasicDatabyElements]

[Read Subset Operation Inspection Activity|https://wiki.sdn.sap.com/wiki/display/ESpackages/ReadSubsetOperationInspectionActivity]

From there, I want to record results. According to the Wiki , I should use

[Record Subset Operation Inspection Activity Result|https://wiki.sdn.sap.com/wiki/display/ESpackages/RecordSubsetOperationInspectionActivity+Result]

I tried directly through the [WS Navigator|http://sr.esworkplace.sap.com/webdynpro/dispatcher/sap.com/tcesiespwsnavui/WSNavigator] to test web services. Whenever go through that tho, I get the following error:

Conversion Error: Invalid Input Format (701 SFB)

Obviously, I get the exact same error using c# (at least I'm consistent!)

Below is the code (some is truncated because it is too long but I think you can get the idea).

The question: Can anyone help me understand why I am getting that error? Maybe there is one or more property I don't understand... It would be practical if the actual failing property was identified in the LogItem, but it is not.

Some things I tried (to no avail):

1. Tried all sort of combination for actionCode

2. Removed actionCode and set actionCodeSpecified = false

3. Removed the Measure property

4. Removed the Text property

5. Removed the ChangeStateID

Thanks in advance!

Michel

 

...RequestMessage_sync messageIn = new ...RequestMessage_sync(); 
messageIn.MaterialInspection = new u2026RequestMessage_syncMaterialInspection(); 
messageIn.MaterialInspection.ID = new MaterialInspectionID(); 
messageIn.MaterialInspection.ID.Value = "3265"; 
messageIn.MaterialInspection.ChangeStateID = "1"; 
messageIn.MaterialInspection.Subset = new u2026RequestMessage_syncMaterialInspectionSubset(); 
messageIn.MaterialInspection.Subset.ID = new InspectionSubsetID(); 
messageIn.MaterialInspection.Subset.ID.Value = "0"; 
messageIn.MaterialInspection.Subset.Operation = new u2026RequestMessage_syncMaterialInspectionSubsetOperation(); 
messageIn.MaterialInspection.Subset.Operation.ID = "0300"; 
u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivity activity = new u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivity(); 

activity.ID = "0010"; 
activity.CloseIndicatorSpecified = false; 
activity.Result = new u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivityResult[1]; 
activity.Result[0] = new u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivityResult(); 
activity.Result[0].ID = "0001"; 
activity.Result[0].AcceptanceStatusCodeSpecified = false; 
activity.Result[0].DefectNumberValueSpecified = false; 
activity.Result[0].ExceptionIndicatorSpecified = false; 
activity.Result[0].InspectedNumberValueSpecified = false; 
activity.Result[0].Comment = string.Empty; 
activity.Result[0].NonConformingUnitNumberValue = 0; 
activity.Result[0].Measure = new Measure(); 
activity.Result[0].Measure.Value = decimal.Parse("4.15";); 
activity.Result[0].Measure.unitCode = "AMP"; 
activity.Result[0].Text = new Text(); 
activity.Result[0].Text.Value = "Some Text Here"; 
activity.Result[0].actionCode = ActionCode.Item01 |ActionCode.Item02 | ActionCode.Item03; 
activity.Result[0].actionCodeSpecified = true; 
activity.CloseIndicatorSpecified = false; 

messageIn.MaterialInspection.Subset.Operation.InspectionActivity = activity; 

messageIn.MessageHeader = new BasicBusinessDocumentMessageHeader(); 
messageIn.MessageHeader.ID = new BusinessDocumentMessageID(); 
messageIn.MessageHeader.ID.Value = "starlims_update"; 

try 
{ 
      u2026ConfirmationMessage_sync messageOut = ws.MaterialInspectionSubsetOperationInspectionActivityResultRecordingRequestConfirmation_In(messageIn); 
      if (messageOut.Log.Item != null) 
      { 
            string message = String.Empty; 
            foreach (LogItem item in messageOut.Log.Item) 
                  message += (item.Note + "\n"); 
            MessageBox.Show(message); 
      } 
} 
catch (Exception ex) 
{ 
      MessageBox.Show(ex.Message); 
} 

Edited by: Michel Roberge on Jul 16, 2008 2:38 PM