字段无法编辑,错误-5002

2020-09-15 09:53发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)你好 我试图在Produ...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


你好

我试图在Productionorder中更新Userfield,但该字段用于内部对行进行排序。

这是代码:

 SAPbobsCOM.Recordset oRSZeile = DB_Query.GetRecordset(_oCompany,string.Format("从WOR1 WHERE DocEntry ='{0}'和U_IntSortNum> {1}中选择LineNum,VisOrder,U_IntSortNum> {1}按Visorder排序",this._FA。  DocEntry,IntSortNumRP005));
                         oRSZeile.MoveFirst();

                         SAPbobsCOM.ProductionOrders oFA = _oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders);
                         如果(oFA.GetByKey(Convert.ToInt32(_FA.DocEntry)))
                         {
                             同时(!oRSZeile.EoF)
                             {
                                 int ISortNum = Convert.ToInt16(oRSZeile.Fields.Item(" U_IntSortNum")。Value);
                                 int LNum = Convert.ToInt16(oRSZeile.Fields.Item(" LineNum")。Value);
                                 int VisO =​​ Convert.ToInt16(oRSZeile.Fields.Item(" VisOrder")。Value);
                                 int ISortNum_Neu = _GetIntSortNum_Neu(Anzahl_Pigmente_Rezept,ISortNum); //ISortNum +(Anzahl_Pigmente_Rezept-1);

                                 oFA.Lines.SetCurrentLine(VisO);
                                //如果(oFA.Lines.ItemType == ProductionItemType.pit_Text)
                                //{
                                     oFA.Lines.UserFields.Fields.Item(" U_IntSortNum")。Value = ISortNum_Neu;
                                     int x = oFA.Update();
                                     如果(x!= 0)
                                     {
                                         int errCode;
                                         字符串错误
                                         _oCompany.GetLastError(out errCode,out errorMsg);
                                         _SBOApp.MessageBox(_oCompany.GetLastErrorDescription());
                                     }
                                 oRSZeile.MoveNext();

 }

 } 

此代码具有全部功能,除非"行"是文本行(项目类型-18; pit_text)

在这种情况下,将引发错误-5002。

我想在PO中的特定位置插入一些行,因此必须使用内部排序字段再次对行进行排序。

感谢您的任何建议

致谢

托马斯