Bhupesh Gupta,

You may want to check the value of $ars_errstr after the ars_Export
function. I hope it will give you a good error message about what is
wrong with your current code.


However, to take a guess without seeing the error message.

If I am reading your code correctly then you are seeing run time
values like this:
$type = "Schema"
$name = "A_correct_form_name_for_your_server"
and you are not getting any returned any value from the AR System server.


If that is the case then I think you have two problems in your code.
Your answer can be found here: http://arsperl.org/manual/ars_Export.html

The function signature is as follows:
 ars_Export(ctrl, displayTag, vuiType, type1, name1, type2, name2, ...)

And it returns this:
 On success
    returns a scalar string
 On failure
    returns undef

( Your getting the undef value back. )


You are calling it with values like this:
 ars_Export($ctrl, "", "Schema", $name1);
 ( That looks wrong to me. )

I do not see one of the displayTag or vuiType values in call that you
are making.
I think the type1 value that you are passing is also wrong.
"
Valid types are:
    * "schema"
    * "schema_defn"
    * "schema_view"
    * "schema_mail"
    * "filter"
    * "active_link"
    * "admin_ext"
    * "char_menu"
    * "escalation"
    * "dist_map"
    * "schema_view_min"
    * "container"
    * "dist_pool"
    * "schema_view_2"
    * "vui"
    * "field"
    * "xml_schema"
    * "xml_filter"
    * "xml_active_link"
    * "xml_char_menu"
    * "xml_escalation"
    * "xml_dist_map"
    * "xml_container"
    * "xml_dist_pool"
    * "xml_vui"
    * "xml_field"
"

In Perl ("Schema" ne "schema").  ( ne means, "not equals in a string sense")

I think you need to do these two things:

# note the change in case from Schema --> schema
dump_type("$path/schema", "schema", \...@schema);

And then also do this...

# added a vuiType  constant value from the ARS module
my $val = ars_Export($c,"", &ARS::AR_VUI_TYPE_NONE, $type,$name);


I think that might work.

-- 
Carey Matthew Black
BMC Remedy AR System Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Love, then teach
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.



On Wed, Mar 18, 2009 at 12:53 PM, Bhupesh Gupta
<gupta.bhupesh3...@gmail.com> wrote:
> **
>
> ---------- Forwarded message ----------
> From: Bhupesh Gupta <gupta.bhupesh3...@gmail.com>
> Date: Sat, Mar 7, 2009 at 8:18 PM
> Subject: ars_export not returning expected output
> To: arsl...@listserv.rbugs.com
> Cc: Bhupesh Gupta <gupta.bhupesh3...@gmail.com>
>
>
> ($ACCOUNT, $PASSWORD, $path) = @ARGV;
> #chomp($path = `pwd`) if (!$path);
> $c = ars_Login("BHUPESH-GUPTA",$ACCOUNT,$PASSWORD);
> die "login error: $ars_errstr\n" unless defined($c);
>
> @schema = ars_GetListSchema($c, 0, 1024);
> @active = ars_GetListActiveLink($c);
> @filter = ars_GetListFilter($c);
> @escal = ars_GetListEscalation($c);
> @menu = ars_GetListCharMenu($c);
> @admin_ext = ars_GetListAdminExtension($c);
>
> sub dump_type {
>    my ($path, $type, $names) = @_;
>
>    if (! -d "$path") {
>  mkdir "$path" || die "can't create directory $path";
>  mkdir "$path/RCS" || die "can't create directory $path/RCS";
>    }
>    foreach $name (@$names) {
>  my $val = ars_Export($c,"",$type,$name);
>  print "$type\n";
>  print "$name\n";
>  print "$val\n";
>     }
> }
>
> dump_type("$path/schema", "Schema", \...@schema);
>
> Dear friends : Please suggest.
>
> when i am executing this small programm, the print $val statement not
> printing anything. the syntax looks ok. Please help
>
> --
> Regards,
> Bhupesh Gupta

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: RMI Solutions ARSlist: "Where the Answers Are"

Reply via email to