Perform statment in script
I have written form statment in subroutine program and calling in script layout using perform statment it is not calling in the script.
i written following code in the subroutine program .
PROGRAM ZWHDTAX.
form WHDTAX tables in_tab structure itcsy
out_tab structure itcsy.
data: A_SKFBT type regup-skfbt,
A_WRBTR type regud-wrbtr ,
C_WTAX TYPE regup-skfbt,
E_FLOAT TYPE F,
E_DEC TYPE ESECOMPAVG,
E_DECIMALS TYPE I,
TELNUMBER1(30) TYPE C.
read table in_tab WITH KEY NAME = 'REGUP-SKFBT'.
check sy-subrc = 0.
MOVE IN_TAB-VALUE TO TELNUMBER1.
CALL FUNCTION 'C14W_CHAR_NUMBER_CONVERSION'
EXPORTING
I_STRING = TELNUMBER1
IMPORTING
E_FLOAT = E_FLOAT
E_DEC = E_DEC
E_DECIMALS = E_DECIMALS
EXCEPTIONS
WRONG_CHARACTERS = 1
FIRST_CHARACTER_WRONG = 2
ARITHMETIC_SIGN = 3
MULTIPLE_DECIMAL_SEPARATOR = 4
THOUSANDSEP_IN_DECIMAL = 5
THOUSAND_SEPARATOR = 6
NUMBER_TOO_BIG = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
A_SKFBT = E_DEC.
CLEAR TELNUMBER1.
read table in_tab WITH KEY NAME = 'REGUD-WRBTR'.
check sy-subrc = 0.
MOVE IN_TAB-VALUE TO TELNUMBER1.
CALL FUNCTION 'C14W_CHAR_NUMBER_CONVERSION'
EXPORTING
I_STRING = TELNUMBER1
IMPORTING
E_FLOAT = E_FLOAT
E_DEC = E_DEC
E_DECIMALS = E_DECIMALS
EXCEPTIONS
WRONG_CHARACTERS = 1
FIRST_CHARACTER_WRONG = 2
ARITHMETIC_SIGN = 3
MULTIPLE_DECIMAL_SEPARATOR = 4
THOUSANDSEP_IN_DECIMAL = 5
THOUSAND_SEPARATOR = 6
NUMBER_TOO_BIG = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
A_WRBTR = E_DEC.
C_WTAX = A_SKFBT - A_WRBTR.
read table out_tab index 1.
check sy-subrc = 0.
out_tab-value = C_WTAX.
modify out_tab index 1.
*endif .
endform.
following code i written in script layout it is not calling in the script.
/:PERFORM WHDTAX IN PROGRAM ZWHDTAX
/:USING ®UP-SKFBT&
/:USING ®UD-WRBTR&
/:CHANGING &C_WTAX&
/:ENDPERFORM.
The modification of your table is not really clean.
here one of my example:
FORM P_GET_DATA_FEBCL *
Get data for the FORM ZF_M40S_CHEQUE of the table FEBCL *
FORM p_get_data_febcl TABLES it_in STRUCTURE itcsy
it_out STRUCTURE itcsy.
DATA : w_kukey TYPE kukey_eb ,
w_esnum TYPE esnum_eb ,
w_selvon TYPE sel01_f05a .
Get the value of the parameter KUKEY.
READ TABLE it_in
WITH KEY name = 'FEBEP-KUKEY'.
IF sy-subrc EQ space.
MOVE it_in-value TO w_kukey.
ENDIF.
Get the value of the parameter ESNUM.
READ TABLE it_in
WITH KEY name = 'FEBEP-ESNUM'.
IF sy-subrc EQ space.
MOVE it_in-value TO w_esnum.
ENDIF.
Select the value of ZUONR.
SELECT selvon
UP TO 1 ROWS
INTO w_selvon
FROM febcl
WHERE kukey EQ w_kukey
AND esnum EQ w_esnum
AND selfd EQ 'ZUONR'.
ENDSELECT.
Send back the value of the ZUONR field.
IF sy-subrc EQ space.
READ TABLE it_out
WITH KEY name = 'ZUONR'.
IF sy-subrc EQ space.
MOVE w_selvon TO it_out-value.
MODIFY it_out INDEX sy-tabix.
ENDIF.
ENDIF.
ENDFORM. " P_GET_DATA_FEBCL.
Similar Messages
-
How to write a perform in Sap Script
Hi Guys,
Can anyone let me know how to write a perform statement in Sap Script.
Thanks,
RameshI just took this example from SAP Help
=======================================
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM. -
Hi all,
I want to display user name using subroutines in script..my code is not working.. pls check and let me know the correct way.
/: PERFORM get_user IN PROGRAM ZTEST USING &UNAME&
/: ENDPERFORM.
/: &UNAME&.
REPORT ZTEST.
FORM GET_USER USING UNAME.
UNAME = SY-UNAME.
ENDFORM.
thanks
mallikaHi,
If FROM_OBJ is the form being called then it should look like:
FORM get_obj TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
Since you know the parameters you are passing, use that as an index to retrieve/update the corresponding value of the variable.
e..g READ TABLE in_tab Index 1.
Similarly use 'Modify' to update the value of the variable you are interested in out_tab.
I hope this helps,
Regards
Raju Chitale -
how should i call a perform statement in SAP script
I have been trying to use it in sap script but it is giving me a dump
the code extract looks as follows:
iN DRIVER'S PROGRAM
FORM POP_ADD USING V_parvw like vbpa-parvw.
READ TABLE i_addr WITH KEY WF_PARVW = 'WE'.
ENDFORM.
IN SAP SCRIPT
/: DEFINE &V_PARVW& = &VBPA-PARVW&
/: PERFORM POP_ADD IN PROGRAM ZSD_SCR_INVOICE
/: USING &V_PARVW&
/: ENDPERFORM
/ &i_addr-WF_PARVW&
IT IS GIVING SHORT DUMP SAYING
In a subroutine call, there were more parameters than in the
routine definition.
Error in ABAP application program.
The current ABAP program "ZSD_SCR_INVOICE " had to be terminated because one of
the
statements could not be executed.
This is probably due to an error in the ABAP program.Hi,
The PERFORM in your program should have the following syntax:
FORM POP_ADD TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
READ TABLE in_tab WITH KEY 'V_PARVW'.
CHECK sy-subrc EQ 0.
ENDFORM.
Take a look at http://www.sapfans.com/forums/viewtopic.php?t=131082&highlight=perform for an example of the required syntax.
Hope this helps.
Regards -
Please help for using perform in SAP script
As subject.
My sap script code as below:
/: PERFORM GET_CHAMT_DATE IN PROGRAM ZRAP004
/:USING &SPELL-WORD&
/:CHANGING &SPELL-WORD&
/:ENDPERFORM
My program ZRAP004 code as below:
FORM get_chamt_date USING u_iword TYPE spell-word
CHANGING u_oword TYPE spell-word.
CONCATENATE u_iword '元整'(t01) INTO u_oword.
endform.
This form is for check printing.
It's by standard function 'F110' to excute check printing.
But when i finished this transaction. System return error message as below:
<b>This routine contains 2 formal parameters, but the current call
contains 4 actual parameters.</b>
Please help. Thanks a lot!!Hiii
PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
/:USING &EKKO-EBELN&
/:CHANGING &CDECENT&
/:ENDPERFORM
The report :
REPORT zkrpmm_perform_z1medruck .
DATA : BEGIN OF it_input_table OCCURS 10.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_input_table.
déclaration de la table output_table contenant les
variables exportées
DATA : BEGIN OF it_output_table OCCURS 0.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_output_table.
DATA : w_ebeln LIKE ekko-ebeln,
w_vbeln LIKE vbak-vbeln,
w_zcdffa LIKE vbak-zcdffa.
FORM CDE_CENT
FORM cde_cent TABLES input output.
it_input_table[] = input[].
it_output_table[] = output[].
READ TABLE it_input_table INDEX 1.
MOVE it_input_table-value TO w_ebeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_ebeln
IMPORTING
output = w_ebeln.
SELECT SINGLE zcdffa FROM ekko
INTO w_zcdffa
WHERE ebeln = w_ebeln.
it_output_table-name = 'CDECENT'.
MOVE w_zcdffa TO it_output_table-value.
MODIFY it_output_table INDEX 1.
output[] = it_output_table[].
ENDFORM. -
Performance - SQL Statements- Script needed
Hi All
I am working on Performance Tuning on Oracle 10g/ Solaris environment.
I am looking for a shell script that gives top 10 Time Consuming SQL Statements...... My client does not want me to use statspack or OEM for somereasons which i dont know. I am wondering if any of you might help me out ....
thanks in advance
riah.>> My client does not want me to use statspack
Your client does not want you to use the scripts provided by Oracle that do exactly what you want but will allow you to run sripts that come from some unknown (to the client, at least) source???? -
Performance script (dangerous)
I have posted another topic about a quiet harddisk and better performance.
These settings are part of a script I am using at boot and shutdown.
The script is copying my home directory to a ramdisk, the same is done with /tmp.
This is ofcourse only possible when you have a separate /data directory, and not only a $USER where all your stuff is stored.
The result;
- almost no harddisk writes when browsing, reading mail, editing etc...
- almost quiet system
- better performance because most things are done from ram
Disadvantages:
- when your system is crashing, your changes are lost
- you do need more ram (advice 1G or more)
- your system is not standard anymore.
Before using the script, please try to understand what I am doing!
BTW; it is necessarry that the users are added to the group audio in /etc/group, because I am using that group to find out which users are available.
Here is the script (changes mentioned some posts below are added):
#!/bin/sh
# Performance script
# Maintainer: Lontronics, [email protected]
# Last modified: april 16th, 2007
action_start() {
# Change interval to 10 minutes for pdflush:
echo 60000 > /proc/sys/vm/dirty_expire_centisecs
# Let the harddisk spin down when not used for X * 5 seconds
# For example 12 will give a standby time of 24*5=120 seconds
# Also set read ahead to on
if [ -x /sbin/hdparm ]; then
/sbin/hdparm -S 24 -A 1 /dev/sda
fi
# Clean ramdisk directory and mount ramdisk for writing temporary information
if [ -d /mnt/ramdisk0 ]; then
rm -rf /mnt/ramdisk0/* > /dev/null
else
mkdir /mnt/ramdisk0
fi
mount -t tmpfs tmpfs /mnt/ramdisk0
# Check tmp directory...
if [ ! -d /tmp ]; then
rm -rf /tmp
mkdir /tmp
chmod 777 /tmp
fi
# Find available users and take action...
# We take the audio group in /etc/group, but you can take every group which is containing all normal users
NAME=($(grep ^audio /etc/group | cut -d: -f4 | tr "," " "))
count=0
while [ "x${NAME[count]}" != "x" ]
do
# If no user directory then extract the backup when available.
if [ ! -d /home/${NAME[$count]} ]; then
rm -rf /home/${NAME[$count]}
mkdir /home/${NAME[$count]}
chown -R ${NAME[$count]} /home/${NAME[$count]}
if [ -f /home/${NAME[$count]}.tar.gz ]; then
tar zPxvf /home/${NAME[$count]}.tar.gz --directory=/ > /dev/null
if [ -d /home/${NAME[$count]} ]; then
echo ""
echo "WARNING:"
echo "Extracted backup to /home/${NAME[$count]}"
echo "It is possible some data is lost..."
rm -rf /home/${NAME[$count]}.tar.gz
else
echo ""
echo "ERROR:"
echo "Error occured when extracting files from backup."
echo "Check backup with name /home/${NAME[$count]}.tar.gz and try to extract it yourself"
echo "with the command tar zxvf /home/${NAME[$count]}.tar.gz --directory=/"
echo "New but empty user directory for user ${NAME[$count]} made"
fi
else
echo ""
echo "ERROR:"
echo "Unfortunately there seems no backup available."
echo "New but empty user directory for user ${NAME[$count]} made"
fi
fi
# Make backup of user directory for when things are going wrong
tar -cPpz --file=/home/${NAME[$count]}.tar.gz /home/${NAME[$count]} > /dev/null
# Copy home directory information to the ramdisk for usage
mv /home/${NAME[$count]} /mnt/ramdisk0
ln -s /mnt/ramdisk0/${NAME[$count]} /home/${NAME[$count]}
echo "${NAME[$count]}"
count=$(( $count + 1 ))
done
# Copy tmp directory information to the ramdisk for usage
mv /tmp /mnt/ramdisk0/tmp
ln -s /mnt/ramdisk0/tmp /tmp
# Output
echo "Performance script started"
echo "Do not forget to run performance stop before shutdown,"
echo "otherwise it is possible you will loose your data!"
action_stop() {
ERROR=0
# Change interval for pdflush to normal:
echo 500 > /proc/sys/vm/dirty_expire_centisecs
# Disable standby (spindown)
if [ -x /sbin/hdparm ]; then
/sbin/hdparm -S 0 /dev/sda
fi
# Find available users and take action...
# We take the audio group in /etc/group, but you can take every group which is containing all normal users
NAME=($(grep ^audio /etc/group | cut -d: -f4 | tr "," " "))
count=0
while [ "x${NAME[count]}" != "x" ]
do
# If temporary user directory available then...
if [ -d /mnt/ramdisk0/${NAME[count]} ]; then
# Copy ramdisk information to real directory
rm -rf /home/${NAME[count]}
mv /mnt/ramdisk0/${NAME[count]} /home/${NAME[count]}
rm -rf /home/${NAME[count]}.tar.gz
else
ERROR=1
echo ""
echo "ERROR:"
echo "The temporary user directory seems not to be available on the ramdisk, probably the performance script was not running"
echo "Therefor the following actions are not performed:"
echo "- /home/${NAME[count]} is not replaced"
echo "- /mnt/ramdisk0 is not unmounted"
echo "Please check if everything is okay"
fi
count=$(( $count + 1 ))
done
# If tmp directory on ramdisk is available then...
if [ -d /mnt/ramdisk0/tmp ]; then
rm -rf /tmp
rm -rf /mnt/ramdisk0/tmp/*
mv /mnt/ramdisk0/tmp /tmp
else
ERROR=1
echo ""
echo "ERROR:"
echo "The tmp directory seems not to be available on the ramdisk, probably the performance script was not running"
echo "Therefor the following actions are not performed:"
echo "- /tmp is not replaced"
echo "- /mnt/ramdisk0 is not unmounted"
echo "Please check if everything is okay"
fi
# If no errors occured unmount the ramdisk to free memory
if [ $ERROR = 0 ]; then
umount -f /mnt/ramdisk0 2> /dev/null
rm -rf /mnt/ramdisk0 2> /dev/null
fi
# Output
echo "Performance script stopped"
case "$1" in
'start')
action_start
'stop')
action_stop
echo "usage $0 start|stop"
esac
To use the script:
in /etc/rc.sysinit find:
stat_busy "Removing Leftover Files"
/bin/rm -f /etc/nologin &>/dev/null
/bin/rm -f /etc/shutdownpid &>/dev/null
just above add:
# Activate the performance script
if [ -x /data/scripts/performance ]; then
/data/scripts/performance start
fi
Where ofcourse /data/scripts/performance is my path of the performance script, but you have to change this to where you have saved the script
in /etc/rc.shutdown find:
# avoid NIS hanging syslog-ng on shutdown by unsetting the domainname
if [ -x /bin/domainname ]; then
/bin/domainname ""
just above add:
# Stop the performance script
if [ -x /data/scripts/performance ]; then
/data/scripts/performance stop
fi
Where ofcourse /data/scripts/performance is my path of the performance script, but you have to change this to where you have saved the script
Have fun!
Jan
Last edited by Lontronics (2007-04-17 20:30:57)@drakosha;
Yes I did, but not for getting better performance. The noticable difference is less writing to the disk, especially with the other settings used in the script. But why not trying yourself with a /tmp ramdrive ?
@klixon;
Thanks for the compliment.
And about your line of script; thanks too, although you were forgotten one thing to make an array from it.
Will use cut though, simple indeed
Line is now:
NAME=($(grep ^audio /etc/group | cut -d: -f4 | tr "," " "))
I think it is not wise to run it from rc.conf because I make a new /<ramdrive>/tmp before something is done with it.
But I will see if it is possible; indeed neater.
Jan
Last edited by Lontronics (2007-04-16 19:58:01) -
Dear All,
I am using perform statement in script.
the code for subroutine in separate program type (e).
But unable to get the output.
Following is my code of subroutine & form.
Regards,
Dilip
Script code
/:PERFORM GET_VAL IN PROGRAM ZGET_VAL
/:USING &IT_MARA-MATNR&
/:CHANGING &DESCR&
/:ENDPERFORM
Subroutine code
Form get_val tables in_tab structure itcsy
out_tab structure itcsy.
select * from makt into table it_makt
where matnr = in_tab-value.
data temp(40).
loop at it_makt.
temp = it_makt-maktx.
out_tab-name = 'maktx'.
out_tab-value = temp.
append out_tab.
endloop.
endform.Hi Diliip,
The program I was referring to was the program that was calling the SAPSCRIPT.
The structure is like:
MAIN PROGRAM calls SAPSCRIPT
SAPSCRIPT calls ZGET_VAL.
When the MAIN PROGRAM calls the SAPSCRIPT it issues a WRITE_FORM function module call specifing the name of the paragraph to be printed. The data in IT_MARA must be populated from the MAIN PROGRAM (by use of LOOP AT, or READ TABLE) so that first it is available in the SAPSCRIPT, and thus available to ZGET_VAL when it is called from the SAPScript.
You can test whether the IT_MARA-MATNR has a value in the SAPScript by simply putting:
&'Material number is: 'IT_MARA-MATNR&
as a line in your SAPScript. If it comes out blank then you need to change the MAIN PROGRAM as I described in the last post.
If it has a value then we need to change the SAPScript.
Let me know how it goes.
Brad -
Standard text and perform in scripts
Hi guys,
can any body tell me how to use<b> perform</b> in scripts.
and how to include these statement it doesn't look like standard text
/: INCLUDE &ZTXTNAME& OBJECT BOM ID MZU
have a nice weekendHi Deepthi,
The syntax of Perform statement is
/: PERFORM <form_name> in PROGRAM <program_name>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM.
In the program <program_name> , you can write the form <form_name> as:
FORM <form_name> TABLES INTTAB STRUCTURE ITCSY
OUTTAB STRUCTURE ITCSY.
endform.
INTTAB will contain all the input parameters like INVAR1, INVAR2 etc and OUTTAB will contain all the output parameters like OUTVAR1, OUTVAR2 etc.
You can download a nice document on SAPScript from this link , but within 1 day.
https://www7.sendthisfile.com/d.jsp?t=asglGjpv25aba8T8sp2G1zyd
Regards,
Amit. -
In form i have given PERFORM form in PROGRAM prog
using &EKPO-BRTWR&
changing &GV_NETPR&
endperform
in prog
form prog TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
***calculated gv_netpr
out_par-name = 'GV_NETPR'.
out_par-value = gv_netpr. --> tried commenting this line ..adding below loop
APPEND out_par.
LOOP AT OUT_PAR WHERE NAME EQ 'GV_NETPR'.
MOVE gv_netpr TO OUT_PAR-VALUE.
MODIFY OUT_PAR.
endloop.
both times the out_par-value is not getting populated with value in gv_netpr ..Pls HelpHi,
First thing that i observed is, the name of the FORM given in program is wrong when i check in calling the PERFORM in ur script, also dont declare with standard names (FORM as form name).
I dont understand why did u LOOP OUT_PAR table. U can directly Modify the table once u get Net price value.
In Script:
PERFORM cal_net_price in PROGRAM prog
using &EKPO-BRTWR&
changing &GV_NETPR&
endperform
In Program:
form cal_net_price TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
***calculated gv_netpr
out_par-name = 'GV_NETPR'.
out_par-value = gv_netpr.
MODIFY out_par INDEX 1.
it will automatically updates the Internal table...
Hope it helps!! -
Will block size effect the calc script performance?
Hi Experts,
I have a cube called RCI_LA:RCI_LA, now I have created calc scripts and working fine. But those calc scripts are taking too much time than expected (normally it should not take more than 15 min but those are taking nearly 1 hr or more some calc scripts.)
In database properties I found that block size is 155896 B i.e. 152.KB but this size should be 8 to 100 KB & Block density is 0.72%
If block size exceeds more than 100 KB will it impact the performance of Calc scripts?
I think answer to the above question is “yes”. In this case what should I need to do to improve calc scripts performance?
Could you please share your experience here with me to come out of this problem?
Thanks in advance.
RamI believe Sandeep was trying to say "Dynamic" rather than "Intelligent".
The ideal block size is a factor in all calcs, but the contributing reasons are many (The main three are CPU caching, Data I/O overhead, Index I/O overhead).
Generally speaking, the ideal block size is achieved when you can minimize the combination of Data I/O overhead and Index I/O overhead. For this reason a block size that is too large will incur too much Data I/O, while a block size that is too small will incur too much Index I/O. If your Index file is small, increasing your block size may help, although the commonly acceptible block size is between 8K and 64K in size, this is just a guideline.
In other words, if you test it with something right in the middle and your index file is tiny, you might want to test it with a smaller block size. If your index file is very large (i.e. 400 MB or more), you may want to increase the block size and retest.
Ways to increase/decrease it are also many. Obviously, changing the dense/sparse settings is the main way, but there are some considerations that make this a touchy process. Other ways are to use dynamic calc in the dense dimensions. I say start at the top of your smallest dense dimension and keep the number of DIMENSIONS that you use D-C on limited. Using D-C members in a dense dimension does NOT increase the index file, so it could be considered a "free" reduction in block size -- the penulty is paid on the retrieve side (there is no free ride). -
SAP Scripts : Multiple Performs in same program
dear All,
I am working on SAP Script. I had user a perform statement and written a Code in Sub-routine. that works well, Now I have to use other perform to a carry other operation, Can I use same program, and Add new code to it or Create other program.
I will try to explain more clearly ..
PERFORM <b>GET_TEXT</b> IN <b>PROGRAM ZGET_STEXT</b>
Using var1
using Var2
Changing Var3.
Now if I tooo Add other perform to my Script.
Can I use
PERFORM <b>GET_STtext</b> IN PROGRAM <b>ZGET_STEXT</b>
Using var4
using Var5
Changing Var6.
and Add extra code to do extra operation for same ZGET_Stext program,
Please advice me.
Thanking you.
With kind regards
VenkatThanks Rich & Sandip,
I will get back if I have some problems,
As I am worried about Int_cond Value.
In first form I have assigned
text = Sgtext.
So I guess I have to clear int_cond and assign new value for second form .
Am I right ??
Thanks & Regards
Venkat -
How 2 debug a Perform subroutine in sap script
Hi,
I have a perform endperform in Script. But tht is not working in some case. i m trying to debug but i m not able to go inside the routine and see wht it is doing? . can any one help me how to debug a subroutine in sap script.Hi Panigrahi,
1) Put a break point in your perform.
2) YOu should change the dispatch option in your Output screen of the transaction which triggers your sap script. The dispatch option should be 1 (Send with a periodically scheduled job).
Then save your transaction.
3) Go to se38 and run the program RSNAST00.
Give the Object Key as the Document Number for which you are triggering the script output.
The control will stop in your perform.
Regards,
Ravi -
Hi All,
we are using a standard Print program for Delivery . Now i have to write a select query to fetch few more data which can't be done in the standard print program.
Can you guys throw some light on how to write query in the Script form itself ??
Thanks in advance,
Regards,
Leou can use the perform in script.
ex--
ou can call an ABAP subroutine from SapScript using the PERFORM statment. You can use this to get data without havning to cnahge the print program. In the examole below NAME is retreived from table SCUSTOM.
SapScript
/:DEFINE &CUST& = '00000021'.
/:PERFORM GET_NAME IN PROGRAM Z_BC460_EX4_HF
/: USING &CUST&
/: CHANGING &NAME&
/:ENDPERFORM.
Dear &NAME&
The ABAP routine
The ABAP routine could be defined as follows:
IMPORTANT: The structure itcsy must be used for the parameters.
REPORT Z_HENRIKF_SCRIPT_FORM .
TABLES scustom.
FORM get_name tables in_tab structure itcsy out_tab structure itcsy.
read table in_tab index 1.
select single * from scustom
where id = in_tab-value.
if sy-subrc = 0.
read table out_tab index 1.
move scustom-name to out_tab-value.
modify out_tab index sy-tabix.
else.
read table out_tab index 1.
move 'No name' to out_tab-value.
modify out_tab index sy-tabix.
endif.
You could also fill the ouput parameter table this way
READ TABLE out_par WITH KEY 'NAME1'.
out_par-value = l_name1.
MODIFY out_par INDEX sy-tabix.
ENDFORM.
Note that if you use more than one parameter you must use Using or Changing before every parameter !
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM -
Loop at internal Table inside Script
Hi
I am filling a table in a subroutine in a program and calling it through 'Perform' from my Script,now the main issue is , How to display the table in my script ?
I want to loop through an internal table & display its content on my script , but i can't make changes in the calling program by any means.Hi Ajitabh ,
With PERFORM inside SAPSCRIPT you can only pass individual fields and also get back individual fields .
Check This
http://help.sap.com//saphelp_470/helpdata/EN/d1/802fd3454211d189710000e8322d00/frameset.htm
Only "USING" and CHANGING" options are allowed and that too only symbols available / defined in sapscript can be passed .
Even if you populate an internal table in the program you are calling with "PERFORM" there is no way to pass this internal table back to sapscript , also in SAPSCRIPT there is no way to loop .
If you are sure about the no of lines you are going to populate and all lines have only one column ( only one field ) you can try something like this .
/: PERFORM GET_VALUE IN PROGRAM <ZNAME>
/: USING &VAR1&
/: USING &VAR2&
/: CHANGING &ITAB1&
/: CHANGING &ITAB2&
/: CHANGING &ITAB3&
/: CHANGING &ITAB4&
/: ENDPERFORM
Anothe way is to loop in the main print program and call WRITE_FORM . But I guess your main print program is a SAP std program which you dont want to copy and change.
Cheers.
Maybe you are looking for
-
HP Photosmart 7520 e-all-in-one Series, Product # CZ045A Printer Windows 7 64 bit
I have been setting up my new wireless printer for a couple of days. My printer is connected wirelessly to a network and printing well. I have been trying to set up my web services to e-print and am having some problems. I have a long printer e-m
-
HT1926 Service 'Apple Mobile Device' failed to start during install
Uninstalled iTunes.. new install of iTunes.. Installation fails with: Service "Apple Mobile Device' (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start system serves. Running installation with "Run as Adminis
-
Changing from "Pass Through" as Default in Blend Mode in a Group Folder Layer Set
Hello Forum gurus! Using a MacBook Pro, 10.5.4. Painting with CS2. My question is two-fold. When the Group layer folder in a layer set is selected, it is displaying the "Pass Through" blend mode by default. Is there a special convenience to this? (Be
-
Password Protect on Blackberry Curve 8350i
Good Morning, This is my first time posting, so please forgive me if I don't do this correctly. But I am trying to figure out how to password protect my Blackberry. I have googled it multiple times, but the answers I find don't seem to correlate wi
-
HP Pavilion DV6 Battery Issue.
Hello, I'm currently having a recent problem with my HP Pavilion DV6 (A8KO2EA#ABU) laptops battery stating (plugged in, charging) and being stuck on 8% and not charging whatsoever, if I remove the power cord, the laptop will instantly shut off. I'v