/[sap_import]/call_rfc.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /call_rfc.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by dpavlin, Mon Nov 18 13:40:02 2002 UTC revision 1.3 by dpavlin, Tue Nov 19 18:16:58 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  use lib '../lib';  use strict;
3  use SAP::Rfc;  use SAP::Rfc;
4  use Data::Dumper;  use Data::Dumper;
5    use XML::Simple;
6    
7    if ($#ARGV < 0) {
8            print "usage: call_rfc.pl config.xml\n";
9            exit 1;
10    }
11    
12  $|++;  $|++;
 #   get a list of report names from table TRDIR and  
 #   then get the source code of each  
13    
14    my $config = XMLin(@ARGV[0]);
15    
16  my $rfc = new SAP::Rfc(  my $rfc = new SAP::Rfc(
17          ASHOST   => 'cipkg',          ASHOST  => $config->{sap}->{ashost},
18          USER     => 'rfctest',          USER    => $config->{sap}->{user},
19          PASSWD   => 'dinamo',          PASSWD  => $config->{sap}->{passwd},
20          LANG     => 'HR',          LANG    => $config->{sap}->{lang},
21          CLIENT   => '200',          CLIENT  => $config->{sap}->{client},
22          SYSNR    => '20',          SYSNR   => $config->{sap}->{sysnr},
23          TRACE    => '0'          TRACE   => $config->{sap}->{trace}
24          ) || die "new: $!";          ) || die "new: $!";
25    
26  $rfc->is_connected || die "not connected";  $rfc->is_connected || die "not connected";
27    
28  my $it = $rfc->discover("Z_ZDMM0123_SIGMA_RFC") || die "discover: $!";  my $it = $rfc->discover($config->{sap}->{discover}) || die "discover: $!";
   
 #%info = $rfc->sapinfo();  
 #map { print "key: $_ = ", $info{$_}, "\n" } sort keys %info;  
29    
30  $it->FILEPATH( "ZSIGMA" );  foreach my $p ($config->{sap}->{params}) {
31  #$it->FILENAME( "LC_Orders.edi" );          foreach my $p_name (keys %{$p}) {
32  $it->FILENAME( "orders2.edi" );                  print "$p_name --> ",$p->{$p_name},"\n";
33  $it->PORT( "ZIDOC" );                  $it->$p_name($p->{$p_name});
34            }
35    }
36    
37  $rfc->callrfc( $it );  $rfc->callrfc( $it );
38    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26