2012 Jun 14 1:41 PM
HI Folks,
I had created a method with import parameter type any , here i'll be exporting internal table with different structures when i call this method. can any body explain how to read the data from this internal table which is dynamically passed while calling the method.
Thanks
Sindu
2012 Jun 14 1:48 PM
Hi,
Your ideal logic in this case would be to pass another internal table (parameter) to the method which would contain the type.
Eg:
Int Table A
VBELN
POSNR
Int Table B
1000000001 000010
Based on this you should have the logic in the method. You can do this entirely with dnamic fields and field symbols. If required you can also pass table names /FM/BAPI and call them dynamically from your method.
Cheers
Arnab
HI Folks,
I had created a method with import parameter type any , here i'll be exporting internal table with different structures when i call this method. can any body explain how to read the data from this internal table which is dynamically passed while calling the method.
Thanks
Sindu
2012 Jun 14 1:48 PM
Hi,
Your ideal logic in this case would be to pass another internal table (parameter) to the method which would contain the type.
Eg:
Int Table A
VBELN
POSNR
Int Table B
1000000001 000010
Based on this you should have the logic in the method. You can do this entirely with dnamic fields and field symbols. If required you can also pass table names /FM/BAPI and call them dynamically from your method.
Cheers
Arnab
2012 Jun 14 2:16 PM
Hi Arnab,
Thanks for your reply.
I understod what you said and i'm able to build the internal table of type the intrnal table that i got through import parameter, the problem is how to get read the data from Table B (table which contains data). for example if say ITABB[] = ITABC[](internal table which is built in the method) it is throughing an erorr saying ITABB is not table. can you please be more specific hoe to read the data from ITABB
Thanks
Sindu
2012 Jun 14 2:50 PM
Hello Sindu,
Instead of TYPE ANY, you've to use TYPE ANY TABLE.
I prefer to use more specific types: TYPE STANDARD/SORTED/HASHED TABLE (use the one as required).
BR,
Suhas