What are the difference between Interactive and Drill Down
Reports?
Answers were Sorted based on User's Feedback
Answer / guest
ABAP/4 provides some interactive events on lists such as AT
LINE-SELECTION (double click) or AT USER-COMMAND (pressing a
button). You can use these events to move through layers of
information about individual items in a list.
Drill down report is nothing but interactive
report...drilldown means above paragraph only.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / varun
Perl - Test
1.Write a perl script to display command line arguments
separated by new line
foreach $arg (@ARGV) {
print $arg . "\n";
}
2.Write a perl script to Store and retrieve records in a
plain text file
store
#Copying contents of one file into another file
# If another files exists, then its overwritten if not
exists then created
unless (open(INFILE, "file1.txt")) {
die ("cannot open input file file1\n");
}
unless (open(OUTFILE, ">outfile.txt")) {
die ("cannot open output file outfile\n");
}
$line = <INFILE>;
while ($line ne "") {
print OUTFILE ($line);
$line = <INFILE>;
}
retrieve
if (open(MYFILE, "file1.txt")) {
$line = <MYFILE>;
while ($line ne "") {
print ($line);
$line = <MYFILE>;
}
}
3.Illustrate the passing by reference and passing by value
with separate examples each.
$value = 10;
print " passing by value: $value \n";
$pointer = \$value;
print " Pointer Address is $pointer of value $value \n";
print " passing by reference: $$pointer \n";
4.Show use of typeglob with a example
sub generate_greeting {
my ($greeting) = @_;
sub { print "$greeting world\n";}
}
$rs = generate_greeting("hello");
&$rs();
# Instead of invoking it as &$rs(), give it your own name.
*greet = $rs;
greet(); # Equivalent to calling &$rs(). Prints "hello
world\n"
#Typeglobs are used to create alises of symbols.
# They are easy to use, they can be alised to ordinary
references. See above code
5.Describe the use of bless() in constructors
bless function is same like a fork function,that si it
creats a copy of the instance of the class and returns
the reference of that obj. its mandatory for a constructor
to have a bless function.
package Animal;
sub new{
my $class = shift;
my $self = {};
$self->{NAME} = undef;
bless($self,$class);
return $self;
}
sub eat{
return "Eats animal food\n";
}
6.Show an example of reusable object in Perl with a short script
use person;
use Employee;
my $empl = Employee->new();
$empl->name("Jason Bourn");
$empl->age(25);
$empl->salary(40);
printf "%s is age %d. Salary %d\n", $empl->name,
$empl->age,$empl->salary;
7.Write a small object oriented application to read and
write text files.
8.Write a script to store web page from a given Internet
location.
# Get and print out the headers and body of the CPAN homepage
use HTTP::Lite;
$http = new HTTP::Lite;
$req = $http->request("http://www.cpan.org/")
or die "Unable to get document: $!";
die "Request failed ($req): ".$http->status_message()
if $req ne "200";
@headers = $http->headers_array();
$body = $http->body();
foreach $header (@headers)
{
print OUTFILE("$header$CRLF");
print OUTFILE("$CRLF");
print OUTFILE("$body$CRLF");
}
# POST a query to the dejanews USENET search engine
use HTTP::Lite;
$http = new HTTP::Lite;
%vars = (
"QRY" => "perl",
"ST" => "MS",
"svcclass" => "dncurrent",
"DBS" => "2"
);
$http->prepare_post(\%vars);
$req = $http->request("http://www.deja.com/dnquery.xp")
or die "Unable to get document: $!";
print "req: $req\n";
print $http->body();
9.Illustrate a simple http auth with a working example.
10.Write a script to read and show a XML file with nodes.
#!/usr/bin/perl
# use module
use XML::Simple;
# create object
$xml = new XML::Simple;
# read XML file
$data = $xml->XMLin("data.xml");
# access XML data
print "$data->{name} is $data->{age} years old and works in
the $data->{department} section\n";
11.Describe use of ^ and $ pattern matching charectors.
beginning of string ^
end of string $
^abc
abc at the beginning of the string
abc$
abc at the end of the string
12.Write a script to print a hash with keys
#!/usr/bin/perl
print "Hash \n\n";
# DEFINE A HASH
%coins = ("Quarter", 25, "Dime", 10, "Nickel", 5);
# PRINT THE HASH
print %coins , "\n"; #See how it prints
13.Write a script to add user entered values to a array
#!/usr/bin/perl
1.$total = 0;
2.
3.@numbers=&getnumbers;
4.foreach $number (@numbers) {
5. $total += $number;
6.}
7.print ("the total is $total\n");
8.
9.sub getnumbers {
10. $line = <STDIN>;
11. $line =~ s/^\s+|\s*\n$//g;
12. @numbers = split(/\s+/, $line);
13.}
14.write a script to make sum of a numeric array elements
@array =(1,2,3,4,5);
$total=0;
foreach $array(@array){
$total+=$array;
}
print $total;
15.Describe and write foreach loop with example.
foreach $arg (@ARGV) {
print $arg . "\n";
}
Is This Answer Correct ? | 1 Yes | 5 No |
Answer / varun
Mini Project (Case study)
1) Name: Displaying of Analog, Digital Signals, testing of
LEDs, CAN communication and read/write EEPROM on the hyper
terminal based on the user selection.
Project: The following peripherals are used based on the
user input.
1) Read ADC Values
2) LED Test
3) EEPROM Test
4) CAN Communication Test
Architecture:
Description:
The following menu shall be displayed on the hyper-terminal
of PC
l
Main Menu:
1) Read ADC Values
2) LED Test
3) EEPROM Test
4) CAN Communication Test
5) Reset the system
6) Stop
Enter the Choice:
The user shall select the option, based on the selection
respective peripheral shall be tested and result shall be
displayed on the hyper-terminal. For CAN, the message shall
be received on the trace window of CANalyzer or CANoe.
The menu and the result shall be displayed on the hyper-
terminal with the help of UART communications.
For selection 1 (Read ADC Values):
After selecting this option, the ADC shall be read every
500ms and the result shall be displayed on the hyper-
terminal along with the time stamps.
For selection 2 (LED Test):
When this option is selected then following LED menu shall
be displayed and based on the input value respective LED
shall be switched on with 50% duty cycle (200Hz frequency).
The position of the LED shall be remembered and after
reset, the same LED shall be switched on.
LED Menu:
Enter LED number to switch on [1-8]:
For selection 3 (EEPROM Test):
When this option is selected, following sub menu shall be
displayed,
EEPROM Menu:
1) EEPROM Write Data
2) EEPROM Read Data
Enter the choice:
1) After selecting the ‘EEPROM Write Data’ option, the
software shall prompt for the data from user (10 bytes) as
shown below and it shall be written in to the 10-succesive
location of EEPROM. After writing it to EEPROM, checksum
(16 bit checksum) shall be calculated for the written data
and it shall be displayed on the hyper-terminal as Checksum
Result: 0xXXXX. It shall store the checksum in the EEPROM.
Enter Data:
2) After selecting the ‘EEPROM Read Data’ option, the
software shall read the written data and checksum from
EEPROM. The read data shall be displayed on the hyper-
terminal along with the memory address as shown below
Memory Address: 0xXXXX
Data: 0xXX
And checksum as
Memory Address: 0xXXXX
Checksum: 0xXXXX
For selection 4 (CAN Communication Test):
After selecting this option, following sub menu shall be
displayed.
CAN Menu:
1) CAN Transmit
2) CAN Reception
Enter the choice:
Based on the above selection following functionality shall
be implemented
CAN Transmit:
When this option is selected, following CAN frame shall be
transmitted periodically (500ms) with the standard frame id
and 8 bytes of data. The frame id and data shall start from
zero and shall be incremented for each message.
For 1st message:
Message Id (standard id): 0x00
Data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
For 2nd message:
Message Id (standard id): 0x01
Data: 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
….
….
For Nth message:
Message Id (standard id): 0x0N
Data: 0x0N 0x0N 0x0N 0x0N 0x0N 0x0N 0x0N 0x0N
CAN Reception:
Whenever the data is transmitted from the host (PC) with
the help of CANalyzer or CANoe, the received message shall
be displayed on the hyper-terminal with time stamp along
with frame id and data.
If the following message is received from the host then
corresponding LED’s shall be switched on.
The frame id, data and other details as given below,
Frame Id: 0xFF
Data: 0xXX 0x0 0x0 0x0 0x0 0x0 0x0 0x0
This message shall override the previous status of the LEDs.
Details of first byte:
Each bit of first data byte represent the corresponding LED
and it’s status.
i.e.
Bit0 corresponds to LED0
Bit1 corresponds to LED1
Bit2 corresponds to LED2
Bit3 corresponds to LED3
Bit4 corresponds to LED4
Bit5 corresponds to LED5
Bit6 corresponds to LED6
Bit7 corresponds to LED7
MSB
LSB
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit
0
LED7
0 – Off
1 – On LED6
0 – Off
1 – On LED5
0 – Off
1 – On LED4
0 – Off
1 – On LED3
0 – Off
1 – On LED2
0 – Off
1 – On LED1
0 – Off
1 – On LED0
0 – Off
1 – On
If the particular bit is ‘1’ then switch on the
corresponding LED, if it is ‘0’ then switch off the
corresponding LED.
For e.g: For the message id: 0xFF and Data: 0x05 0x0 0x0
0x0 0x0 0x0 0x0 0x0
The software shall switch on LED2 and LED0.
For selection 5 (Reset the system):
After selecting this option, the system shall reset and
after reset it shall display the Main Menu again.
For selection 6 (Stop):
After selecting this option, the system shall do nothing
and it shall wait for the next options.
Is This Answer Correct ? | 1 Yes | 6 No |
Is der any other criteria for using For All Entries except if not itab is initial?
6. what are the differences between scripts & smart forms?
In material report output,if i click on any material i have to open MM01 with that material in the field how?and from mm01 screen i have to come out what i have to do?
how to write a Classical batch input program using transaction FK01 to create vendor/change the vendor address into R/3 system. (Call Transaction Method) plz mention the detail coding Tahnks, Rahul
Does the external program run in the same sap luw as the caller, or in a separate one?
i want 2 join as a abap consultant what is most important
Explain the sequences of event block?
I have one selection screen field which is meant for only display what will you do
dear friends, do you know how to configure web dynpro and adobe into ECC6.0 IDES?
hoe can we write the include programs in reports
What is ITS? What are the merits of ITS?
what is the difference b/w database and data dictionary?