cancel
Showing results for 
Search instead for 
Did you mean: 

Perl tables hash structures confusion

Former Member
0 Kudos

Well as you probably can tell I am a little wet behind the ears when it comes to Perl and ABAP. I have read a lot of documents and looked at as many examples as possible and this seems so easy but for some reason I just can not get it to work for me. I have tried using the following code snippets to get data returned to me(from BAPI_SYSTEM_MTE_GETPERFCURVAL where $it is the interface and I have already done a $rfc->call($it)) :

#1

print "straight through datadumper: ".Dumper($it->CURRENT_VALUE);

#2

print join("\n",( $it->CURRENT_VALUE ));

#3

for my $row ( $it->tab('CURRENT_VALUE')->hashRows )

{

print "ROW: ".Dumper($row)."\n";

}

Ok my results very a LOT and I really can not work with any of the results. Here are the results:

#1

straight through datadumper: $VAR1 = {

'ALRELEVVAL' => 1593835520,

'AVG15PVAL' => 0,

'ALRELVALTI' => '185811',

'AVG05PVAL' => 0,

'MAXPFDATE' => '20070320',

'ALRELVALDT' => '20070329',

'MINPFDATE' => '20070326',

'LASTPERVAL' => 1593835520,

'MAXPFTIME' => '170257',

'AVG15SVAL' => 0,

'AVG15CVAL' => 0,

'MAXPFVALUE' => 1644167168,

'AVG01PVAL' => 0,

'AVG01SVAL' => 0,

'MINPFVALUE' => 67108864,

'LASTALSTAT' => 16777216,

'AVG01CVAL' => 0,

'AVG05CVAL' => 0,

'MINPFTIME' => '121903',

'AVG05SVAL' => 0

};

#2

HASH(0x192cb70)just after join

#3

Table CURRENT_VALUE Does not exist in interface ! at c:/perl/site/lib/SAP/Iface

.pm line 233.

Ok so how do I get #1 into a hash or a has_ref where I can pull data from it. Am I missing something? I have also tried to just save the output to a hash (my @hash = Dumper($it->CURRENT_VALUE)) but all I get is another HASH(0x171cc42). Please help if you can.

Best Regards,

Paul Ksobiech

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Piers,

Thank you again for your quick response. I truly appreciate your help. I looked into using sapnwrfc but I am trying to run this on activestate perl on windows. I could not find version .11 of sapnwrfc for Activestat perl on the web anywhere. I am running this on a corporate supplied laptop and they do not allow linux or personal laptops on there network. Is there any way to view the structure with SAP::RFC or do you know someone that can compile sapnwrfc for ActiveState perl?

Thanks again,

Paul

Former Member
0 Kudos

Hi Paul -

If this is work related, then it sounds like you have plenty of justification for getting work to spring for a compiler, and build it yourself.

If not - look into the free compilers - you can compile Perl too:

http://www.mingw.org/

Cheers.

Answers (1)

Answers (1)

Former Member
0 Kudos

CURRENT_VALUE is not a table - it is a structure parameter, so there are no rows.

Why not try it in the new sapnwrfc:

[code]

use sapnwrfc;

use Data::Dumper;

SAPNW::Rfc->load_config;

print "Testing SAPNW::Rfc-$SAPNW::Rfc::VERSION\n";

my $conn = SAPNW::Rfc->rfc_connect;

...

my $rd = $conn->function_lookup("BAPI_SYSTEM_MTE_GETPERFCURVAL");

my $rc = $rd->create_function_call;

$rc->EXTERNAL_USER_NAME("BIGBROTHER");

$rc->invoke;

print "CURRENT_VALUE: ".Dumper($rc->CURRENT_VALUE);

...

[/code]