on 09-15-2007 2:56 AM
Greetings all - I am attempting to master this BAPI to return F4 help values for a field in PM transaction IW42 (Confirmations.)
Everything is going smoothly - I am able to return the help values for the field 'D_CODE' in the attribute 'Values', I can get the data from the node Description_For_Helpvalues and display it nicely into a table so I can view the column descriptions, and I can view the structured text returned in the Char255 attribute Helpvalues.
My next task is to parse this structured data into a form that ultimately I will use to populate a treeset. One very nice feature I have found is that this particular field will return values for both 'D_CODE' and 'D_CODEGRP', and I need both for my treeset while maintaining the relationships between the two fields.
Is there any alternative to iterating through this structured text and stripping out substrings by char offset? For example, can I cast (or copy) this data into a custom structure that I have created with the necessary column definitions? I have seen references to the WDCopyService, but it seems that the nodes have to have identical attributes for that to work.
Has anyone else been faced with this scenario? I'd really appreciate some wisdom.
Hi Jennifer,
Yes, you can define the structure in the node for tree as you want and you need to manually assign values to that node reading from the values being returned from the BAPI.
If my understanding is not wrong then your BAPI has a structure like this
node1-->values(the value you need to break into 2).
Create a value node node2-->value1,value2
Now loop at the node1 and read the attribute values
for(int i=0; i<wdContext.nodeNode1().size())
{
String str1 = wdContext.nodeNode1().getNode1ElementAt(i).getValues().subString(0,5);
String str2 = wdContext.nodeNode1().getNode1ElementAt(i).getValues.subString(6,wdContext.wdContext.nodeNode1().getNode1ElementAt(i).getValues().length());
IPrivate<viewname>.INode1Element ele = wdContext.nodeNode1().createNode1Element();
ele.setValue1(str1);
ele.setValue2(str2);
wdContext.nodeNode1().addElement(ele);
}
Hope, this is your requirement.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you - I was hoping for an alternative that wouldn't require iterating through the returned values (for performance reasons) but this seems like a reasonable solution. I very much appreciate your assistance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.