Paso 3 tablas a una IRfcFunction que crea una orden en SAP. Cuando intento depurar este programa, no aparece ningún mensaje de error, , pero esto no crea ningún orden en SAP.Cómo pasar varias tablas a SAP utilizando funciones IRFC de .Net
Estoy buscando cualquier tipo de ayuda o consejos para resolver este problema. Gracias por su tiempo.
IRfcFunction orderDetails = _rfcDest.Repository.CreateFunction(strBapi);
RfcStructureMetadata metaData = _rfcDest.Repository.GetStructureMetadata("ZBAPI_A_STRU_ORDER_CREATE_PART");
IRfcStructure structPartners = metaData.CreateStructure();
structPartners.SetValue("PARTN_ROLE", "SP");
structPartners.SetValue("PARTN_NUMB", "110024");
IRfcTable tblPartner = orderDetails.GetTable("PARTNERS");
tblPartner.Append(structPartners);
structPartners = metaData.CreateStructure();
structPartners.SetValue("PARTN_ROLE", "SH");
structPartners.SetValue("PARTN_NUMB", "110005");
tblPartner.Append(structPartners);
orderDetails.SetValue("PARTNERS", tblPartner);
metaData = _rfcDest.Repository.GetStructureMetadata("ZBAPI_A_STRU_ORDER_CREATE_COND");
IRfcStructure structConditions = metaData.CreateStructure();
structConditions.SetValue("ITM_NUMBER", "10");
structConditions.SetValue("COND_TYPE", "PR00");
structConditions.SetValue("COND_VALUE", "30");
structConditions.SetValue("CURRENCY", "USD");
IRfcTable tblConditions = orderDetails.GetTable("CONDITIONS");
tblConditions.Append(structConditions);
orderDetails.SetValue("CONDITIONS", tblConditions);
metaData = _rfcDest.Repository.GetStructureMetadata("ZBAPI_A_STRU_ORDER_CREATE_ITEM");
IRfcStructure structItems = metaData.CreateStructure();
structItems.SetValue("MATERIAL", "F500");
structItems.SetValue("TARGET_QTY", "3");
IRfcTable tblItems = orderDetails.GetTable("ITEMS");
tblItems.Append(structItems);
orderDetails.SetValue("ITEMS", tblItems);
RfcSessionManager.BeginContext(_rfcDest);
orderDetails.Invoke(_rfcDest);
IRfcStructure bapiTable = orderDetails.GetStructure("RETURN");
RfcSessionManager.EndContext(_rfcDest);
Gracias. Tengo este problema resuelto. Tuve que pasar PARTN_NUMB como 10 caracteres con los primeros 0 segundos. – Venky
+1 por proporcionar un ejemplo de cómo obtener metadatos de estructura Rfc, ¡que era mi problema! – Gareth
@Venky: De hecho, puede escribir su solución en detalles aquí y marcarla como una respuesta para cerrar el problema;) –