Sap scripts
Hi Experts.
I am having a problem with scripts.
In my output final internal table if i am getting 2 item data i must display the same in 2 diff pages with each item data. So in this case i will have 2 pages.
How do i do that.
I am looping inside my final internal table in my driver program.
use proper subject and post in correct forum
Hi,
You can use 'Control Form' .
before using 'control form' u can compare the work area value with the previous value.
Ex:
if gt_ouput is ur final table ,,then
let gs1 and gs2 ,,be ur workareas
loop at gt_ouptut into gs1.
lv_index = sy-tabix + 1.
READ TABLE gt_output INTO gs2 INDEX lv_index.
if gs1 NE gs2.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-PAGE'
EXCEPTIONS
unopened = 1
unstarted = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
endif.
Similar Messages
-
Hi All,
I have written the below If statement in SAP scripts but when i execute the same the controll doent check the second line entries. If firtst line doesnot satisfy it goes to the else part. Kindly suggest what is wrong in this..
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/: &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/: &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/: &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.Hi neha,
Try to use the '/E' fo rnext line
/E->Extended line
Here is a code:
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/E &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/E &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/E &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
Hope this helps you.
Regards,
Rajani -
How to print last page in sap script in ladscape format?
Hi all,
can any 1 tell me How to print last page in sap script in ladscape format?
Thanks In advance.
PravinHi Pravin Sherkar,
we can do this in SAP Scripts.
we need to create two pages, one of landscape and another of potrait.
now after filling the data at last we need to call the page which is of format landscape using START_FORM function module.
You can use condition &PAGE& = &FORMPAGES&.
Please check this link
Printing Portrait/Landscape in sapscript
Re: Landscape and potrait in same layout?
http://www.sap-img.com/ts013.htm
Best regards,
raam -
How to print the text in points wise in sap script
hi friends,
how to print the text in points wise in sap script.
ex: if suppose paragraph consists of 15 lines. then according to one sentence or one fullstop (.) it should give point 1. like that...
1. hai how ru.
2. what r u doing.
3.where r u.
like this i want numbering.. waiting for ur replys.
thanks,
kirandeclare a counter
data : cnt type char 4.
print :
cnt = cnt + 1.
&cnt& &text&
cnt = cnt + 1. and so on.
or.
if the data is in an internal table
loop at internal_table.
cnt = cnt + 1.
write form.
in script -&cnt& &text&
endloop.
Edited by: NIKHILKUMAR POOJARI on Nov 17, 2008 11:18 AM -
How to print Special Characters in Sap-Scripts
How to print Special Characters in Sap-Scripts
Thanks,
RaviHi
if u want print special characters we can use hot codes i.e ' ' (single inverted commas). in between these hot codes insert u r special characters.
write ' !@#$%^&*( ) '.
for the above write statement output is
output is !@#$%^&*( ) -
In SAP Script how to hard code my Company address in footer window
Hi All ,
In SAP Script how to hard code my Company address in footer window .
Ex : in YB_F140_ACC_STAT this script i want to keep my company address, i want to hard coad , i dont want to use any field from table.
Please give me step by step.
Thanks
SridharHi,
You can make use of standard text...
create a standard text in SO10 with your company address
and in the footer window of your script.. use include text and provide the name of the standard text you created in SO10.
In the text editor... goto insert > text> standard
You get popup give the name of the text name id and language
regards
padma -
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. -
521
- Heading for trans. w/out sp.G/L indicators (item sorting method 2)-
Transactions without special G/L indicators
522
- Heading for trans. with sp.G/L indicators (item sorting method 2)-
&T074T-LTEXT&
523
- Heading for open item list of line items -
&ULINE(71)&
<K>Invoice No,,Reference.,,Inv.Date,, Due date,,,,
Balance</>
&ULINE(71)&
PERFORM GET_DATE IN PROGRAM ZREPORT
USING &BSID-BELNR&
CHANGING &S_DATE&
ENDPERFORM.
530
- Line items Customer open items -
&BSID-BELNR&,,&RF140-BELEGNUM&,,&BSID-BLDAT&,,&S_DATE&,,
FORM get_date tables
int_cond structure itcsy
outt_cond structure itcsy.
BREAK SNAGI.
tables : bseg.
data : w_belnr type ITCSY-value.
DATA due_date TYPE rfpos-faedt.
READ TABLE OUTT_COND WITH KEY name = 'S_DATE'.
IF sy-subrc = 0.
outt_cond-value = S_itab11.
MODIFY outt_cond INDEX sy-tabix.
ENDIF.
SELECT SINGLE
shkzg zfbdt zbd1t zbd2t zbd3t rebzg
FROM bseg
INTO CORRESPONDING FIELDS OF bseg
WHERE
*bukrs = bukrs AND
belnr = int_cond-value.
*AND vbeln = belnr.
CALL FUNCTION 'NET_DUE_DATE_GET'
EXPORTING
i_zfbdt = bseg-zfbdt
i_zbd1t = bseg-zbd1t
i_zbd2t = bseg-zbd2t
i_zbd3t = bseg-zbd3t
i_shkzg = bseg-shkzg
i_rebzg = bseg-rebzg
I_KOART = 'D'
IMPORTING
e_faedt = due_date.
outt_cond-value = due_date.
MODIFY outt_cond INDEX sy-tabix.
ENDFORM.
Now the problem is that,it is int_cond-value is always picking up the first invoice number.
and the net due date is always same for all invoices..?
should I loop in the sap script or in the form..?Solved my self.
just placing the perform and endform in 530 -
Use of IF statement in SAP Scripts
Can u tell me how to use IF statement in SAP Scripts.
The problem is
if &sy-tabix& eq '1'
total
else
total1.
endif.
this sy-tabix is not workingi think sy-tabix will not work here....
do like this..
data : vtabix type i.
loop at itab.
vtabix = sy-tabix.
write_form...for the text element..
endloop.
in form layout
/: if &vtabix(c)& eq 1
/:endif
regards
shiba dutta -
Hello All ,
I have got a internal table with tracking numbers and I want to print all the numbers in that internal table on sap script.
Please advise.
Thanks
Moderator message: please search for available information before asking.
locked by: Thomas Zloch on Sep 13, 2010 1:09 PMHi,
You can create a sub-routine and pass all the table entries in variables and then you can print them. -
In sap scripts how to display the driver program
Hi,
I Want to know the sap scripts How to display the output to driver programHi,
Go to NACE Transaction.
Select application for ex: if sales V1.
Click on output types.
Select the output type for ex : BA00
Double click on Processing routines.
There you can find the Driver Program name and Script/smart form name.
Reward if useful.
Thanks,
Raju -
In SAP Scripts How to write the fields 90 Degrees to regular format
Hi ,
I am working with SAP Scripts . Sometimes you may want to print text vertically.
I have got a requiremnt in which there we have to write some data which is to be written 90 degres to regular output.
please let me know if there is any printer setting for that .
Regards.
Rohit.Dear friend,
For printing the text verticaly you need to made a
print controle at printer level.
select a command and in that you have to go in tab general
attribute.
and in front of :Include Printer Control: give the z print controle.
in my company basis people had made one print controle
ZR090.
YOU have to use this command two times between
the text .
first command will move the printer at 90 degree and then
write the text and second will move back to horizental.
I dont know how this ZR090 can be made.
rest wht i have written is very true and currently working.
hope this will solve your problem.
rewards are expected.
Thanks and Regards
vivek kumar srivastava -
In SAP Scripts MAIN procesed first?
Hi Experts,
I hv a small doubts in SAP Scripts, they r,
1- In SAP Scripts the MAIN window is procesed very first all over the SAP Script?
2- To debug the script, after activating the debugger in Script, Shall I go & debug the Print prog step by step or just run the Transaction, e.g.
say ME23?
ThanQ.Hi Srinivas,
The order in which the windows are triggered is determined by the print program.
The print program will call the WRITE_FORM function modules which will trigger the windiw that is passed to it.
You can see the example print program:
RSTXEXP1
The fm WRITE_FORM is called multiple times, and different windows get triggered as and when the control comes to the Function module.
And regarding your second question, in general you cannot run the print programs as stand alone(most cases) as the would not have and executable code outside the form-endform .So, to test the script, you must run the transaction after your activate the script debugging.
Regards,
Ravi -
In SAP Scripts /, /=, (BLANK)?
Hi Experts,
In SAP Scripts we use,
1) / means LINE FEED,
2) /= mean EXTENDED LINE ,
3) (BLANK) mean CONTINUOUS TEXT.
So, can u explain pls. with an example?
ThanQ.Hi Srinivas,
Let me share my ideas with you.
/ means LINE FEED: It means suppose if u want blank line betweeen 2 lines then u mention / between those.
e.g A3 &----
A3 &----
/= mean EXTENDED LINE :
This is for extended lines means suppose u mention one variable in one line and give tabs then ifu mention another varialble then automatically that variable will adjust the next line with this command
e.g. S1 &scsy-datum&,,,,,,,,,,,,,,,,,,,,,,,,,,
/= &itab-name1&.
It menas in the output date and name1 will be displayed in the same row.
(BLANK) mean CONTINUOUS TEXT:
Suppose u r writing the body of the script menas it is cintineous text. automatically it will adjust wiht the blank.
Hope this helps you. reply for queries.
Regards,
Kumar. -
How to use IF Conditon in SAP Scripts?
Hi Guys,
I am having adoubt how to use IF conditon with multiple variables in SAp Scripts
for ex If a>b and a>c and a>d
Elseif b>a and b>c and b> d.
Elseif .....
endif.
How to use above example in SAP Scripts.
thanks,
Gopi.hi Gopi,
it is almost the same as normal ABAP, you only have to use & before and after the variable and the variable has to be in capitals and you have to make the line as command ( /: before the line )
IF &A& > &B& AND ...
text to print
ELSEIF ...
text to print
ENDIF.
hope this helps
ec -
If condition in SAP Scripts?
Hi,
I have a SAP Script. In that i have one IF condition. I want to insert one more if condition in that IF condition.
If first IF condition is true then it has to check for second IF condition.
Can any one please help on this.syntax..
Thanks
Venkatesh PIt is same way you use in your ABAP programming.
EX:
/: IF <CONDITION1>
/: IF <CONDITION2>
***Statement***
/: ENDIF.
/: ENDIF
Regards,
SaiRam
Maybe you are looking for
-
Tried to download apps from App store, icon just says it is waiting.
-
Don't know where the error is!!!
hi again i wrote the code for the add button ,, but when i enter the path of the .au(eg a:\piano.au) in the text field and click add it will be added to my database and the .au file will be saved as a long binary data in the db,, when i come to searc
-
I' d like to use dynamic SQL in Form, but i'm attacking a access database(ODBC OCA). Is there any way to do that? Thanks. null
-
[solved] Removing the "tab" from Fluxbox windows
How would I remove these little tabs from Fluxbox? Last edited by synthead (2008-01-12 21:16:32)
-
Please help me with export settings and format
I'll try to explain my problem the best I can. I recently captured some footage from old VHS tapes to use in a Christmas video. I imported one of the MPGs that I captured to AE and applied a grain removal plus a couple other lighting effects to the v