on 03-19-2010 5:27 AM
Hi All,
My scenario is like this:
I have the external defintion structure containing the node which will have the set of fields selected in its external format as shown below:-
<records>
<acc_no>123</acc_no>
<comp_code>450</comp_code>
</records>
I need to serach for the field name and then map it to the corresponding field of the BAPI.
i,e my UDF should return multiple outputs which will be assigned to my BAPI interface.
Can this be done through UDF or is there any other better way of getting things done.
Please advise.
Thanks in advance,
Sai
Hi Sai,
What is the source and target structure?
If your input is xml and you need to search for a specific field, you can write an UDF.
Can you provide some more details
Best Regards,
Lakshmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Lakshmi,
Yes my source is in XML format.
My XML structure looks like this:
<records>
<fields>
</records>
The <fields> node gets replaced with the fields that i select. lets say i select account no ; comp code and plant
and the no. of entries that satisfies the select query be 2 then,
At run time the structure will look some thing similar to this :-
<records>
<acc_no>123</acc_no>
<comp_code>450</comp_code>
<plant>10</plant>
</records>
<records>
<acc_no>456</acc_no>
<comp_code>230</comp_code>
<plant>10</plant>
</records>
As we can see above the records tag gets repeated as many no of times the rows selected and the 'fields' tag gets replaced by the fields that i select.
Now, I need to search for each field name and then map their values to the corresponding fields of BAPI which will have the Acc_no, Comp_code and plant fields in it.
Thanks,
Sai
At run time the structure will look some thing similar to this :-
<records>
<acc_no>123</acc_no>
<comp_code>450</comp_code>
<plant>10</plant>
</records>
<records>
<acc_no>456</acc_no>
<comp_code>230</comp_code>
<plant>10</plant>
</records>
When the above is the actual payload structure that you will be getting, why have this as structure:
My XML structure looks like this:
<records>
<fields>
</records>
Why not have the runtime structure itself defined in IR (as DT) or is there any restriction on it?
Hi Abhishek,
I tried creating the structure but the problem here is the structure created does not seem to be compatible to the XML data passed in to this. More over we have similar scenarios where in i will have to build structures for differnt XML data which has the similar kind of mapping to be done. Hence if i go for an UDF i can make use of the same of all the scenarios.
Is it possible to achieve this through an UDF.
Thanks,
Sai
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
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.