About smartforms loop
hi,
i am using an internal table importing from the program.
i have one main window and 2 windows.the windows are not nested into main window.all windows are seperated.this is my main page.
i have to insert this main page in a loop.how can i do this?
right click on the window ? here u will find options LOOP? pick this
and window format should be like this
---> window
>looop
>text
u have to call Loop within the WINDOW.
regards
Prabhu
Similar Messages
-
I want to know about smartforms
hi experts tell me
i want to know about smartforms
anybody have material pls send me
thanks in advanceSAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
also refer
http://www.erpgenie.com/abap/smartforms_detail.htm
http://www.sap-basis-abap.com/abphy.htm
<b>http://sap.ionelburlacu.ro/sap0/sapsf001.htm
http://www.ionutz.ro/sap/sapabap01.htm[very imp links]</b>
http://www.sap-basis-abap.com/sapsf001.htm
regards,
srinivas
<b>*reward for useful answers*</b> -
Que about smartform::::
Good Noon to my all ABAP Gurus And Gurumaiyas....
Here once again i came here to give some silly questions ( may be for u...)
" Could anyone tell me basics about smartforms executions i mean how does it execute??? How can i use two pages in smartforms??? What is need of loop in smart form??? and why, when and how can i use it??? "
I know basics about smartforms and i have also implemeneted it.... but i m not much aware of it.....i would be thankful to u if u take out 15 mins from ur busy schedule....
Waiting for ur reply.....
Warm Regards,
Nirav ParekhHi,
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
Here is the procidure
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
check this:
http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
check this linkls------>
https://www.sdn.sap.com/irj/sdn/collaboration
http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
reward if useful
regards,
ANJI -
Ask a question about smartform
Hi expert,
I have a question about smartform . Now I am doing a task about Purchase Order,
when I create a new Purchase Order in Transaction ME21N , before I saved , I click the button to preview how it looks .
as everyone knows , during that time , there is no Purchase Order created . So in the header text - > Price types , I write something in
the text . I know the data , I can get it from table STXH , then use the function 'READ_TEXT' to check if there is data in it according to
TDNAME (in this case the tdname is purchase order ), but I didn't save it , so there is no purchase order , how can I get the data .
I only want to get the data in type 'EKKO' , not 'EKPO'.
kind regards
NickHi...
use this code..
data : variable type c.
first concatenate ekko-name ekpo-ebelp into one variable.
and take one text element and give the name is variable
ok...
follow this steps..
i think this is help full for u...
thxs & regards,
rahul -
Smartforms Loop Calculation.
Hi xprts,
I'm trying to group and sum some fields of an internal table, the loop tool of the smartforms makes the agroupation well, but when it's time to sum the fields the result it's allways 0. Here's the structure of the IT :
Area Subarea Short Text Clasification Fund S1 S2 S3 S4 S5 Total
1 1 Vendors 23 2 2 2 2 2 8
1 1 Vendors 25 2 1 1 1 1 4
Then, when the tables arrives to the form, the loop structure do this :
Total
Area -> 1 Administration 0
Subarea-> 1 Office 0
Clasification 23 2 2 2 2 8
As you can see the agroupation it's well done, but not a sum by sort criteria. And i've defined variables to sum this field "Total". but Nothing works and i changed the target field name, the reset fiel too on the calculations tab and nothings works, any idea about it.
Tnxs for your help.I think you should explain better what you wean by "loop to loop calculation".
What are you trying to accomplish? -
Smartform loop into internal table problem
hello experts,
i am doing an example given in **************** regarding smartforms. I am getting problem which doing the smartforms . please help me.
http://****************/Tutorials/Smartforms/SFMain.htm
in that i am doing the program
Working with loop.
I have done exactly as the screen shots in the program.
Now in the main window i created a loop.
in that loop i am not getting the option internal table.
But it is showing as operand . It is in the data tab of the loop.
I searched the all the tabs in the loop but did not find the option internal table.
so then i ticked the operand and i did as speified in the screen shots.
it_tab into fs_tab
Then i created a text and then placed &fs_tab-vbeln& etc.
then i executed the smartform now in the output i am not getting the sales order number , item etc.
The output is showing like
&fs_tab-vbeln& &fs_tab-posnr& etc.
please guide me how to get the internal table option in the loop. And also tell me how to rectify this problemthanks for all the replies.
I will give all at the time of closing my thread.
Hi Sravanthi -> in loop node i am not getting the internal table insted of that i am getting operand in the data tab.
This is my main problem.I dont why operand is comming there.
my version is 4.7e
Hi Karthik and swati -> i simply hard coded the statements in the text as shown in the example.
Now i will try with the add field.
But please tell me why i am not getting internal table option in loop. -
Smartform - Loop issue not printing correctly
Hi,
In smartforms -Main Window - I created like this
1.Loop Statement - This will loop - ITAB1
TEXT statement - ITAB1-ADRNR - (prints the address)
within the loop
ITEM_DATA (item data) table. - This will Loop ITAB2 - where ADRNR = ITAB1-ADRNR
This supposed to put line items which are having ADRNR from ITAB1
But my program is printing in wrong way..
it is printing
ADDRESS1 - ITAB1-ADRNR - correct
ITEM DATA - from ITAB2- related to ADRNR (if it has only 1 record) - correct
ADDRESS2-ITAB1-ADRNR - correct
ITEM DATA - from ITAB2 - where ADRNR = ITAB1ADRNR - if this condition satisfies more than 1 record
supposed to print all the records - but instead it is printing always the first record - wrong
Ex- if 3 records has the same ADRNR of ITAB1 in ITAB2 - it is actually printing 3 times the first satisfying record - Wrong
Can anyone please tell me what is the issue?
Thanks for your time.
KevinHi,
I created like this..
ITAB1 - complete data
ITAB2 - unique records based on ADRNR
1. LOOP ITAB2
Print Address - ITAB2-ADRNR
ITEM DATA(header and line items)
I have given table name in DATA loop section
- loop ITAB1 - where ADRNR = ITAB2-ADRNR
But in item data it is printing the same line item repetedly .
Any comments?
Thanks for ur time. -
WHERE clause in a SMARTFORM loop, problems with parenthesis
Hi all gurus,
a simple question: I'm coding a LOOP in the form builder for a smartform ... this simple loop should bind text elements to every position of a purchase order. The WHERE clause should be as follows:
WHERE GUID = WA_ITEM-GUID
AND ( TDID EQ 'ZDES' OR TDID EQ 'ZDST' ).
Anyway, in the Form Builder I didn't find a way to add parenthesis; I workarounded the problem with the following query:
(conditions in lines are in AND conjunction)
GUID EQ WA_ITEM-GUID
TDID EQ 'ZDES'
OR
GUID EQ WA_ITEM-GUID
TDID EQ 'ZDST'.
It's quite a 'bad' way, but it works. I wonder if there's a way to express "complex" WHERE clauses (with addiction of parenthesis) in Form Builder.
Thanks in advanceIn this case, your solution is the one that works. However in more complex cases with more variables, this can proove difficult to make or mantain.
What I usually do is use the first part of the condition in the where and then add a condition to the printing area with the rest of the formula. Just remember to document this so that you'll find it easy and it's way more amintainable.
In this case the loop would contain WHERE GUID = WA_ITEM-GUID and the inside condition TDID EQ 'ZDES' OR TDID EQ 'ZDST. This creates the and between the two blocks. -
Hi All,
We are presently working with SRM 4.0 with extended classic scenario .
I want to know the following things about PO output smartforms.
1)Regarding PO output smartform : in u2018smartformsu2019 transciation system is showing many smartforms for PO output, In this regard , I want to know, which smartform system is calling when we click on PO print preview.
2)Where we can see that which smart form is linked to PO preview button ?
3)How to switchover to external de-bugging and how to debug smart form ?
Thanks in advance
Sachin.
Edited by: sachin patil on Feb 12, 2009 12:45 PMHi Sachin,
Please check the following documentation in IMG settings:
Supplier Relationship Management --> SRM Server --> Cross application basic settings --> set output actiona and output format --> define actions for document output.
Also see the implementation for the BAdI: BBP_OUTPUT_CHANGE_SF
Thanks,
Pradeep
Edited by: Pradeep Purushottam on Feb 12, 2009 5:24 PM -
How to write "Do 5 times" loop in smartforms.
Hi,
Whats sf_example ... where to search it.
Condition is working well , only problem i am facing is loop is not iterating if I dont take help of Internal Table.
I am looking is there any other option to run loop 5 times other than INTERNAL TABLE.
Thanks & Regards. -
Smartforms. loop count - next page.
Hi all,
i have created a smart form for voucher printing.
->MainWindow.
->loop1 itab into itab.
->Template
->Table itab1 into itab1 where belnr = itab-belnr.
->Text signature.
->Text pageno1.
above are the nodes in my smartforms.
while printing it prints all documents in one page.
but i need to print one document in one page second in next page
(means for itab first loop shoud be in first page. second loop in second page..)
for each page signature and pageno shoud appear.
expecting the reply.
regards
jai.Hi
the problm is with LOOP.
i have two internal tables one for header <b>itab</b>(data from BKPF) other for Line itms<b>(BSEG) itab1</b>
My form should Print First DOcuments Header And Line Items In First Page.
and the next document on next page. (means when the loop runs 2 nd time those data shoud print in a next page.) -
hi forks,
i have some doubts about the nest loop
when i write the code in this type
loop at itab1 into lfc_itab1.
loop at itab2 into lfc_itab2 where k1 = lfc_itab1-k1.
endloop.
endloop.
but my leader told me to write in this way
sort itab2 by k1 ascending.
loop at itab1 into lfc_itab1.
read table itab2 with key k1 = lfc_itab1-k1 binary seach.
li_tabix = sy-tabix.
loop at itab2 form li_tabix.
if lfc_itab1-k1 = lfc_itab2-k1.
endif.
endloop.
endloop.
i also agree with what he said,but i write test code
it return the opposite result .i use record (100100,10001000,10000*10000)
dose anyone tell which will be better
thanks in advanceHi,
In ur case second logic is better , first one is call as LINEAR SEARCH and asecond one is called as BINARY SEARCH.
in LINEAR search ALL entries of itab are processed where as in Binary search entries processaed are logrihtm in no.
Binary serach is like getting desired page in a book using index, say if u want to search 41st page in 100 page book so in binary seach, if u opeend first time at 50 then it will search first half only, in second pas if u opened 30 page then it iwll search second half and so on...
Jogdand M B -
Smartform: Loop to display data in window :
Dear experts,
I m facing a strange problem. its reagrding smartform.
i hv passed a internal table to smart form (having one header record only).
I want to display data into a window not a table.
but its displaying nothing. and if i use loop as we use to display data into table,
then its displaying data.
According to my knowledge abt smartform, we do not put internal table into loop if datais to be displayed into window.
if i insert a break-point into form and check internal table, data is there.
Can anyone helpin this.
Thanks in advance
RegardsHi Maverick
Please check if the following links give you some valid info:
http://www.erpgenie.com/sap-technical/abap/introduction-to-sap-smartforms
and
http://www.sap-img.com/smartforms/display-a-contents-of-a-table-on-smartform-with-loop.htm
Regards
Chen -
Some question about "Dual loop feedback"
http://zone.ni.com/devzone/conceptd.nsf/webmain/E7ABA6F4D569010A86256F5A005B64F3/
Switch Feedback on the Fly
Consider a heat-sink assembly application where a position sensor is the feedback device for the initial positioning along the Z axis. However, when the heat sink is pressed on to the PCB, a force sensor must be the feedback device for precise motion control in the latter part of the process. With NI motion controllers, you can switch feedback devices on the fly without reinitializing the controller. The new feedback device might require the system to have a new set of PID gains loaded immediately after the axis is reconfigured. To minimize the delay, you can configure an additional set of PID gains with the motion controllers.
anyone can give me some detailed materials about "switch Feedback on the Fly", for example, some programme,some words to explain it.
another question is that if i don't use the torque sensor, can i directly use the DAC to control the voltage to come true the torque control?
Thanks for your answeranyone can give me more suggestion about the Dual loop feedback?
I really know little.
Hope your suggestion.
Thanks a lot -
Question about Midi loops and Software Instruments
In past versions of Garage Band, I could take a Midi loop ("the green ones") and drag it onto a track with a different instrument and it would play with that instrument. For example, I could drag a loop of a piano melody onto a guitar track, and the melody would play on the guitar. In '08 though, if I drag the piano melody onto the guitar track, it changes the instrument for that track to the loop's instrument, in this case the piano. Is there any way to switch this function off? I find nothing in the preferences.
It's getting really annoying constantly dragging out loops and changing instruments to what I intend to have.not to dissuade you from trying, you could always find something that i missed, but i did test the modifier keys, none changed anything (and the shiftKey prevented a drag from occurring at all)
as i recall, no matter what i did, dropping into a blank track changed it, dropping into a track that already had a region in it tossed up a warning dialogBox (i think it allowed you to proceed, automatically create a new track, or cancel the operation)
this does seem like a behavior that should have a toggle in prefs
Maybe you are looking for
-
I have a problem with simulation in Matlab 6.5 and LabVIEW for PID controllers
I have a problem with simulation in Matlab 6.5 and LabVIEW. I have some methods for granting PID controllers in MATLAB to go but not LabVIEW. International Teams degree to transfer two but when I go past the fourth degree no longer work. We changed t
-
Attribute error while creating shopping cart in portal
Hi, We are using SRM 7.0 . While creating shopping cart in portal , I am getting error " the attribute of the user are inconsistent or not defined. See transaction ppoma_bbp " I have maintained attributes of ACS,BSA,BUK,BWA,CUR,KNT,WGR & WRK . Done a
-
IP Phone restart and reset issue
Dear All, Can someone help me here? Our IP phones are getting resetting and restarting frequently. Details are given below, but its not affecting our active calls. 9:38:38a 14: Name=SEPECC882B0AD77 Load= SCCP45.9-0-3S Last=UCM-closed-TCP 9:38:38a 18:
-
Hi, Does anyone know if Oracle 8i_lite supports "import"? I saw "imp80" in the Oracle8i_lite bin dir. But when I tried to do an import, I got: IMP-00003: ORACLE error 942 encountered OCA-30034: table not found [POL-5130] table or view not found IMP-0
-
Dynamically Loading a Class with Parameters
Hi, I'm working on small program during my spare time and I have run into a problem. I have one abstract class (Foo) which is extended by several other subclasses (subFoo1, subFoo2). I am trying to avoid making a whole host of if statements depending