将项目添加到IRfcTable

编程入门 行业动态 更新时间:2024-10-25 01:28:49
本文介绍了将项目添加到IRfcTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个功能,它的一个参数是一个表(T_ITEMS)。

I have a function and one of it's parameter is a table (T_ITEMS).

表项的类型/结构Z_ITEM与两个字段:值,数量;

Item of tables is of type/structure Z_ITEM with two fields: Value, Quantity;

我如何添加到类型Z_ITEM这个表的项目?

How can I add to this table items of type Z_ITEM?

我所做的是下面的code:

What I have done is following code:

IRfcFunction fnct = repo.CreateFunction( "MY_FUNCTION" ); IRfcTable t_items = fnct.GetTable( "T_ITEMS" ); foreach( XmlNode oneNode in postdata.Items.SelectNodes( "//articles/article" ) ) { IRfcStructure articol = repo.GetStructureMetadata("Z_ITEMS") as IRfcStructure; articol.SetValue( "Value", oneNode.Attributes[ "value" ].Value ); articol.SetValue( "Quantity", oneNode.Attributes[ "quantity" ].Value ); t_items.Append( articol ); }

在repo.GetStructureMetadata(Z_ITEMS)我有结构的,但是当我投来 IRfcStructure变量articol为空。

In repo.GetStructureMetadata("Z_ITEMS") I have the structure but when I cast to IRfcStructure variable articol is null.

推荐答案

解决。

IRfcStructure articol = repo.GetStructureMetadata("Z_ITEMS") as IRfcStructure;

RfcStructureMetadata am = repo.GetStructureMetadata( "Z_ITEMS" ); IRfcStructure articol = am.CreateStructure();

更多推荐

将项目添加到IRfcTable

本文发布于:2023-11-13 14:20:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584556.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   IRfcTable

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!