What is sub routine pool in sap script? when it is used?
hi ,
i am new to sap-abap can any one clarify my doubt .
Hi Praveen,
If you modify the sap standard script according to that you have to modify the print program also....
But its not advisable to modify the print program directly so, for the changes what ever u have made in the scripts you have to write the logic in a subroutine with in report program and you have to call this subroutine with PERFORM statement in the scripts.....
Reward points if it is helpful..
Regards,
Omkar.
Similar Messages
-
How to on Debugging Mode for T-Code F110 from Script in Sub routine Pool Pr
Hi Every one....
I have done SAP-Script for Payment Vocher for T-code F110 ..I have a Sub Routine Program where I have few Form statements which is called by SAP - Script using Perform Statements, But my problem is when I set a break point in Sub Routine pool program, the out put is issuing with out Debugger ...
Could any one plz suggest me wht to do???
Help ful answers will be rewarded....
Regards,
sgHi,
First see if the 'Perform' statement is getting triggered in Script. To put a breakpoint in any script ( even if you do not know the form name, that is the best part ) is se38---->RSTXDBUG --->F8 & execute your pgm/Transaction. The control will wait in the form-debugger.
I hope this helps,
Regards
Raju Chitale -
Perform a form routine within a sap script form
Hi!
How can I
perform a form routine within a sap script form.
Regards
sasOK,
many thanks for your kindly reply.
But basically there is a matter which I don't understand.
Which way is the better way to loop at internal table:
Solution1:
FORM xxx.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = 'PRINTER'
FORM = 'ZSD_PACKING_LIST'
LANGUAGE = SY-LANGU .
LOOP AT gt_versand_plan INTO gw_versand_plan.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'SHELEM'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN' .
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'.
ENDFORM.
Solution 2:
Having the LOOP within the sapscript form -> 'ZSD_PACKING_LIST'
Regards
sas -
Finding last page in SAP Script when there are multiple layouts involved?
Hi,
I want to find out the last page in the SAP script. I have used &NEXTPAGE& = '0', this is finding the last page of a one layout however I do have three layouts in my script. I have also used the &SAPSCRIPT-JOBPAGES(3ZC)& and I have taken one counter and comapred as follows-
If &SAPSCRIPT-COUNTER_1(+)& = &SAPSCRIPT-JOBPAGES(3ZC)&
LAST PAGE.
endif.
This is also not working. Please advise if there is anyway to find out the last page from print program.
Thanks,
JyotiHi,
U can do like this, Set a flag in ur driver program when u reach to print the last layout then pass this flag value to Script. In script check when this FLAG = 'X' & &NEXTPAGE& = 0 then u print the required in ur last page.
Eg:
define a FLAG in ur driver program and make the value as 'X' when it reach the last layout.
in script, write the condition like:
/: IF &FLAG& = 'X' AND &NEXTPAGE& = 0
write text.
/: ENDIF.
Hope it helps!!
Rgds,
Pavan -
What is the diff b/w Sap Scripts and Smart Forms
Hi,
Whats the diff b/w SAP Scripts and Smart Forms..
I need the internal explanation for both Smart Forms and SAP Scripts mean when we execute what happens whether Print Program r Forms starts execution 1st and SIMILARLY FOR SMARTFORMS WHETHER FM'S R FORMS.
Thanks & Regards,
Gopi.Hi
Difference with SMARTFORMS vs. SapScript(SE71)
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated.
f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
check out this link:
http://www.sap-img.com/smartforms/sap-smart-forms.htm
Reward points if helpful.
Regards,
Swathi. -
Dispaly standard text in SAP SCRIPT which content saved using SAVE_TEXT FM
I want to display one standard text content in SAP SCRIPT and want to store content of it during run time.
For that, first I have created one standard text using SO10.Named the standard text as Z_TEST_WRITE. Initially it was empty.
In my SAP SCRIPT, I try to display the content of the standard text using below given SAP SCRIPT code and report program. Although I am able to store text in Standard text
Z_TEST_WRITE but in first display of the SCRIPT it is not displaying against the include command of SAP SCRIPT. But when I see the content of Z_TEST_WRITE through SO10 transaction, I can see the content with new text which was previously empty.
Now if I do the same transaction newly (suppose second time), then text stored in standard text Z_TEST_WRITE is displaid against includes command of SAP SCRIPT.
My print program is a SAP STANDARD which one can be changed.
/: DEFINE &NAME& = ''
/: PERFORM TEST IN PROGRAM Z_SAVE_TEXT
/: CHANGING &NAME&
/: ENDPERFORM
<B>&NAME&</>
/: INCLUDE Z_TEST_WRITE OBJECT TEXT ID ST
REPORT Z_SAVE_TEXT.
FORM TEST TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA IT_HEADER LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA: LS_HEADER LIKE THEAD,
LT_LINES TYPE STANDARD TABLE OF TLINE WITH HEADER LINE.
OUT_PAR-NAME = 'NAME'.
OUT_PAR-VALUE = 'Sample text for Test'.
APPEND OUT_PAR.
*-Populate Header Text details
LS_HEADER-TDOBJECT = 'TEXT'.
LS_HEADER-TDNAME = 'Z_TEST_WRITE'.
LS_HEADER-TDID = 'ST'.
LS_HEADER-TDSPRAS = SY-LANGU.
*-Populate details of Text
CONCATENATE 'Shipment No :' 'RM Ship No' INTO LT_LINES-TDLINE
SEPARATED BY SPACE.
LT_LINES-TDFORMAT = '*'.
APPEND LT_LINES.
CONCATENATE 'Bill of Lading:' '1234567' INTO LT_LINES-TDLINE
SEPARATED BY SPACE.
APPEND LT_LINES.
*-Save Text
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = LS_HEADER
SAVEMODE_DIRECT = 'V'
TABLES
LINES = LT_LINES
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
COMMIT WORK and WAIT.
ENDFORM. "TESTHi,
If the text is getting displayed the second time, then this should be due to delay in saving the text.
After your COMMIT WORK AND WAIT in your report program, just put a WAIT FOR 2 SECS and check again.
Regards,
Suganya -
I'm using a view and am able to create a grid that allows editing of one of the columns. Let's call the table where the column is updated "DepartmentFeeDetail." The view has several joins but up till now the column was editable.
Today I needed to join DepartmentFeeDetail with itself to pick up the debit side of a debit/credit pair. I want to show the gl account number for both
the debit and credit on the same row. I also need to update the value for both debit and credit.
I can no longer edit the column to no surprise. When updating using MSSQLMS I get the following error:
View or function 'MyTestView' is not updatable because the modification affects multiple base tables.
What should my strategy be in lightswitch? The grid is populated by a query that includes my lynq expressions in DepartmentFeeRateQuery_PreprocessQuery. The query may return 1000+ rows. I need to allow the accountant to edit either a single row's column
or enter a value in a field outside the grid and click a button "Apply fee rate to entire page."
All this was working fine until the requirement to show the debit side gl account number and to change the debit side value somehow.
I've tried adding a property to DepartmentFeeDetail but the "Is Computed" property wouldn't allow me to uncheck it. Is there a way to add an editable property for each grid row and initialize it to the
current value of the column returned by the view? I could then update a collection when one of the fields changes. If they change the global value and press "Apply fee rate to entire page"
I can update the collection as well.
Scott MitchellWhat I do is instead of using a View I use a updatable
WCF RIA Service.
This is an example of an updateable method:
public void UpdateQuestionDetailForUser(QuestionDetailForUser objQuestionDetailForUser)
// Get the current user
string strCurrentUserName = System.Web.HttpContext.Current.User.Identity.Name;
// We are under Forms Authentication so if user is blank then we
// are debugging and we are TestUser
if (strCurrentUserName == "")
strCurrentUserName = "TestUser";
// Check for an existing Answer for this Question for this User
var objSurveyAnswer = (from SurveyAnswers in this.Context.SurveyAnswers
where SurveyAnswers.SurveyQuestion.Id == objQuestionDetailForUser.QuestionId
where SurveyAnswers.UserName == strCurrentUserName
select SurveyAnswers).FirstOrDefault();
if (objSurveyAnswer != null)
try // This is an update ****
// Set values
objSurveyAnswer.Choice = Convert.ToInt32(objQuestionDetailForUser.SelectedChoice);
objSurveyAnswer.Comment = objQuestionDetailForUser.Comments;
// Update LightSwitch Database
this.Context.SaveChanges(
System.Data.Objects.SaveOptions.DetectChangesBeforeSave);
catch (Exception ex)
throw new Exception("Error inserting QuestionId " + objQuestionDetailForUser.QuestionId, ex);
else // This is an Insert ****
// Query the GetAllQuestionsForUser method because it calculates if a Question
// is Active or not for the QuestionId being inserted
// If it is not in the collection, do not allow the insert
var objUserQuestion = (from QuestionForUser in this.GetAllQuestionsForUser()
where QuestionForUser.UserName == strCurrentUserName
where QuestionForUser.QuestionId == objQuestionDetailForUser.QuestionId
select QuestionForUser).FirstOrDefault();
if (objUserQuestion != null)
try
// Get the Survey Question
var objSurveyQuestion = (from SurveyQuestions in this.Context.SurveyQuestions
where SurveyQuestions.Id == objQuestionDetailForUser.QuestionId
select SurveyQuestions).FirstOrDefault();
// Create a SurveyAnswer object
SurveyAnswer objNewSurveyAnswer = this.Context.CreateObject<SurveyAnswer>();
// Set values
objNewSurveyAnswer.UserName = strCurrentUserName;
objNewSurveyAnswer.Choice = Convert.ToInt32(objQuestionDetailForUser.SelectedChoice);
objNewSurveyAnswer.Comment = objQuestionDetailForUser.Comments;
objNewSurveyAnswer.SurveyQuestion = objSurveyQuestion;
// Update LightSwitch Database
this.Context.SurveyAnswers.AddObject(objNewSurveyAnswer);
this.Context.SaveChanges(
System.Data.Objects.SaveOptions.DetectChangesBeforeSave);
catch (Exception ex)
throw new Exception("Error inserting QuestionId " + objQuestionDetailForUser.QuestionId, ex);
else
throw new Exception("Error inserting Answer. Answer is not marked Active.");
Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book
http://LightSwitchHelpWebsite.com -
This is regarding totals and sub totals in sap-scripts
Hi to all...............
1...How to print totals and subtotals in sap-scripts? where we have to code the logic.what sort of logic is needed to print the same?
regards,
swaminath.Hi
HI,
To calculate totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly it will be in footer window)
Then create subroutine pool program and you have to write the code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy. data : value type kbert.
statics value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
To know more, have a look at this thread ..
Re: SAP Script: Display Total calculated on page 2 in page 1
<b>Reward if usefull</b> -
Calculate sub totals in SAP Script
Hi Friends, In Sapscript, I want to print as follows. Please help.
Empno Name Dept. Salary
A1 AAAA DP01 1000.00
A2 BBBB DP01 1500.00
2500.00
A3 CCCC DP02 2000.00
A4 DDDD DP02 2200.00
4200.00Hi
To calculate totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly it will be in footer window)
Then create subroutine pool program and you have to write the code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy. data : value type kbert.
statics value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
PLZ REWARD POINTS -
Hi All,
I am modifying a sap script.
when i open the PC editor in sap script (where i can find PERFORM statements), i dont find the page with signs " /: ".
Instead i am observing plane white screen with PERFORM statements.
what might be the reason for this..????
PavanHi,
You have to WRITE PERFORM statements in the script explicitley for your requirement, when you wants to get some extra data displayed on your script output.
They are not predefined in script.
To calculate totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly it will be in footer window)
Then create subroutine pool program and you have to write the code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy. data : value type kbert.
statics value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
regards,
Anji -
PO Print SAP scripts:Grand total field -- High priority
Hi experts
In a PO print out, For example in one line item ,I have conditions printed as below
Line iem 1.
Gross price -- 1000
VAT% 40
Service Tax -
123.36
Net. Incl. Disc. 1163.36
Line iem 2.
Gross price -- 500
VAT% 20
Service Tax -
61.8
Net. Incl. Disc. 581.8
Grand total----
1500
(desired tgrand total 1163.36+581.8)
I have many line items like this and the total of all conditions at individual line item printed is correct.
But at the bottom of the PO print, in the "Grand Total" the sum of only the Gross values is printed (Not the total of the Net. Incl. vlaues of line items).
I got info from our developer that we are using SAP scripts (not smart forms).
Please guide me if anyone has come accros a issue like this and got the answer. This is urgent.
Thank you
MRaoTo calculate grand totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window where ever that value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name>
/:USING &KOMVD-KBERT&
/:CHANGING &TOT_PRICE&
/:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly grant total will be in footer window)
Then create subroutine pool program and you have to write the following code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy.
data : value type kbert.
statics value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
I have given a rough example,
Note:Int_cond-value and outt_cond-value are characters.
Close the thread once your question is answered.
Regards,
SaiRam -
Missing fields in the output while using SAP SCRIPT
Hi,
I am working on an issue where we are using F110 to print some checks, and for this we have created a custom sap script and we are using a std driver program RFFOUS_C, we have also maintianed a custom subroutine pool ZRFFOUS which will retrieve the missing data for the sap script which was not there in the std. program. Now we have applied a SP to our system and since then we are having a problem...when we are printing the chechks its missing some fields.
Surpisingly, it is happening for all scripts like Dunning, invoice......
These scripts are working good in production which is not applied patches.
I have tried in all ways, did debug, data is there in tables and scripts are exactly same as in production.
Could you please share any ideas regarding this? What would be the effect of patches?
Thanks
ShaHi ,
I think u r printing the Check through the Tr Code F110.
In that program u r using the Standard Driver Program RFFOUS_C and u create a New Sap script.
and also u also mantained the custom subroutine pool ZRFFOUS . when ru giving printing u are not able to print some field.
In this case when u using the Standard driver Program RFFOUS_C in that program there is a Include Progran * RFFORI01---- check ,
in this program it is calling the Standard Form (F110PRENUM_CHCK) i--e t042e-zforn .as shown in the below and it is calling the function module 'OPEN_FORM'._
Please copy the form asZF110_PRENUM_CHCK and and do the changes in that form . and we need to maintained the Form as Company code level -- and it will shown this Table T042E (Company Code-Specific Specifications for Payment Methods)
Please go to Transaction Code FBZP and U can maitained the New Sap Script Form Company Code Level.
one thing while u calling your new subroutine pool ZRFFOUS Please call this subroutine in your Sap Script form then only u can see all values in your Check. and Actvate the Sap script .
Like U can call your new subroutine ZRFFOUS in your New Sap script Program.
/E CHECK
/: PERFORM XXXXXXX IN PROGRAM XXXXXX''
/: PERFORM CHECK_NAME IN PROGRAM ZRFFOUS
/: USING &XXXXXXX&
/: CHANGING &XXXXXX&
/: ENDPERFORM
In the subroutine pool ZRFFOUS u have to call as
FORM CHECK_NAME TABLES t_data_in STRUCTURE itcsy
t_data_out STRUCTURE itcsy.
xxxxx
xxxxx
xxxxx
ENDFORM.
In this case when u using the Standard driver Program RFFOUS_C in that program there is a Include Progran * RFFORI01---- check ,
in this program it is calling the Standard Form (F110_PRENUM_CHCK) i--e t042e-zforn .
open check form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = t042e-zforn
device = 'PRINTER'
language = t001-spras
options = itcpo
dialog = space
EXCEPTIONS
form = 1.
IF sy-subrc EQ 1. "abend:
IF sy-batch EQ space. "form is not active
MESSAGE a069 WITH t042e-zforn.
ELSE.
MESSAGE s069 WITH t042e-zforn.
MESSAGE s094.
STOP.
ENDIF.
ENDIF.
I thing it will help u to solve this issue.
Thanks.
Gagan -
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 -
Not able to Export sap script with RSTXSCRP in different languages IT,ES
Hi all,
I am trying to export sap script to local file using this program RSTXSCRP, but it's working fine for English but not other languages like IT,ES and DA. Even if i specify parameter in selection screen Language vector as IT. It's not exporting code from sap script for IT language. By default it's exporting only EN.
Can you please tell me what I have to do to export sap script from different language.
Thank you.Hi!
For Translating you can do it by
Going in transaction SE63 -> Translation -> Abap objects -> Other Long Texts -> FS Forms and Styles.
There you have to enter client and form name source lang. and target lang.
Then you export it with the program RSTXSCRP in the language u have translated....
As you have form created in English and you can download and upload it in only English .
Regards. -
hi guys,
if i need to develop a report for purchase order using SAP script..how can that be possible???what is the name of the SAP script and how can we find that script???
regards
kalpanaHi Kalpana,
The standard SAP Script form for PO is MEDRUCK,
If You want to modify that form means take a copy of that form and modify it.
The print program for MEDRUCK is SAPFM06P.
You can get this Print programs from TNAPR table.
Have you ever worked in VK01 transaction or created an IDOC. If Yes,it will be easy to print the form.
with regards,
Kalpanashri Rajendran
Maybe you are looking for
-
Bug in IE6 afecting Log on page of EP
Hi all, I don't know if this is the best forum to post this, but let's try I thought you might know something about a bug I've discovered in IE6 with Autocomplete in forms, and appears in the Logon Page of my Enterprise Portal. The Logon page of the
-
How do I Move Music from iPod Nano(2nd Gen) to Computer with Windows Vista?
I just got a new computer due to my old computer crashing so I'd like to transfer my music from my iPod Nano 2nd Generation to my new computer so I'll have a backup. I followed the directions listed below but they didn't work. Is it possible that it
-
Vendor invoice - Profit Center not being pulled from cost-center
Hi Guys, Please help me out with this: On the vendor expense line item, i am using an account which has a Field status group which is cost center - optional, business area - required and profit center - required. The cost center master has the profit
-
Not be able to login in Administration Console....
Hey everyone i am not be able to login in my Administration Console, First of all i thought that i have forgot my password so i have reinstalled Adobe Flash Media Server 4.5 but that problem is still there. What to do? RP
-
HT204394 how can i hide sheets in iCloud Numbers file?
I have several files with multiple sheets. Some of the sheets are old revisions to a specific analysis that I do not want to delete but do not need to see them. In EXCEL you can hide sheets. Is there a way to hide sheets in my Numbers files save i