T-code for smart form is SMARTFORMS. Various
business processes need a standard form by which the business can be run.
Example of this kind of form is invoice, purchase orders, sales order details,
delivery notes etc. We see that there are various formats of invoices between
various retail shops. It means each and every organization uses a unique format
of forms. Smart Form is one of the tools of SAP which fulfils this requirement.
There is another tool for this and that is SAP Script. SAP script was the only
one tool before release 4.6 and now from that release we have two options for
the forms.
In the following example we have demonstrated a
simple smart form which prints Purchase Order list based on the creation date
at the selection screen. We can write a complete program inside a smart form.
But in this example we have created a driver program for that.
Smart form always generates a function module
while activating into the system. Now this system generated function module is
dependent on the system. It means if we transport the form into development to
quality system then the name of the function module gets changed. So to avoid naming
conflict we can produce the name at run time and then we can call that by a
variable. To achieve this we have function module SSF_FUNCTION_MODULE_NAME. It
produces the FM for the form into a variable. After that we call that variable
as FM.
We are passing an internal table from the
driver program to the form. To do this we need to create a custom structure in
DDIC. The internal table for the program and smart form will hold this DB structure.
The driver program is as follows.
REPORT zsr_test.
TABLES: ekko.
TYPES:
BEGIN OF ty_ekko,
ebeln TYPE ekko-ebeln,
aedat TYPE ekko-aedat,
END OF ty_ekko.
DATA:
wa_ekko TYPE ty_ekko,
it_ekko TYPE TABLE OF ty_ekko,
lw_ekpo TYPE zsr_test,
lt_ekpo TYPE TABLE OF zsr_test,
wa_ekpo TYPE zsr_test,
it_ekpo TYPE TABLE OF zsr_test,
date_low TYPE sy-datum,
date_high TYPE sy-datum.
INITIALIZATION.
SELECT-OPTIONS: s_date FOR ekko-aedat.
START-OF-SELECTION.
PERFORM get_po_details.
PERFORM call_smart_form.
*&---------------------------------------------------------------------*
*& Form GET_PO_DETAILS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_po_details .
SELECT ebeln aedat
FROM ekko INTO TABLE it_ekko
WHERE aedat IN s_date.
IF sy-subrc = 0.
date_low = s_date-low.
date_high = s_date-high.
SORT it_ekko BY aedat.
SELECT ebeln ebelp txz01
matnr menge meins
FROM ekpo INTO TABLE lt_ekpo
FOR ALL ENTRIES IN it_ekko
WHERE ebeln = it_ekko-ebeln
AND menge NE 0.
IF sy-subrc = 0.
LOOP AT lt_ekpo INTO lw_ekpo.
AT NEW ebeln.
wa_ekpo-ebeln = lw_ekpo-ebeln.
ENDAT.
wa_ekpo-ebelp = lw_ekpo-ebelp.
wa_ekpo-txz01 = lw_ekpo-txz01.
wa_ekpo-menge = lw_ekpo-menge.
wa_ekpo-meins = lw_ekpo-meins.
IF lw_ekpo-matnr IS NOT INITIAL.
wa_ekpo-matnr = lw_ekpo-matnr.
ELSE.
wa_ekpo-matnr = '<Service PO>'.
ENDIF.
APPEND wa_ekpo TO it_ekpo.
CLEAR: wa_ekpo, lw_ekpo.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form CALL_SMART_FORM
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM call_smart_form .
DATA: lv_form_name TYPE rs38l_fnam.
IF it_ekpo IS NOT INITIAL.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST'
IMPORTING
fm_name = lv_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION lv_form_name
EXPORTING
date_low = date_low
date_high = date_high
TABLES
it_ekpo = it_ekpo
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
ENDIF.
ENDFORM.
TABLES: ekko.
TYPES:
BEGIN OF ty_ekko,
ebeln TYPE ekko-ebeln,
aedat TYPE ekko-aedat,
END OF ty_ekko.
DATA:
wa_ekko TYPE ty_ekko,
it_ekko TYPE TABLE OF ty_ekko,
lw_ekpo TYPE zsr_test,
lt_ekpo TYPE TABLE OF zsr_test,
wa_ekpo TYPE zsr_test,
it_ekpo TYPE TABLE OF zsr_test,
date_low TYPE sy-datum,
date_high TYPE sy-datum.
INITIALIZATION.
SELECT-OPTIONS: s_date FOR ekko-aedat.
START-OF-SELECTION.
PERFORM get_po_details.
PERFORM call_smart_form.
*&---------------------------------------------------------------------*
*& Form GET_PO_DETAILS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_po_details .
SELECT ebeln aedat
FROM ekko INTO TABLE it_ekko
WHERE aedat IN s_date.
IF sy-subrc = 0.
date_low = s_date-low.
date_high = s_date-high.
SORT it_ekko BY aedat.
SELECT ebeln ebelp txz01
matnr menge meins
FROM ekpo INTO TABLE lt_ekpo
FOR ALL ENTRIES IN it_ekko
WHERE ebeln = it_ekko-ebeln
AND menge NE 0.
IF sy-subrc = 0.
LOOP AT lt_ekpo INTO lw_ekpo.
AT NEW ebeln.
wa_ekpo-ebeln = lw_ekpo-ebeln.
ENDAT.
wa_ekpo-ebelp = lw_ekpo-ebelp.
wa_ekpo-txz01 = lw_ekpo-txz01.
wa_ekpo-menge = lw_ekpo-menge.
wa_ekpo-meins = lw_ekpo-meins.
IF lw_ekpo-matnr IS NOT INITIAL.
wa_ekpo-matnr = lw_ekpo-matnr.
ELSE.
wa_ekpo-matnr = '<Service PO>'.
ENDIF.
APPEND wa_ekpo TO it_ekpo.
CLEAR: wa_ekpo, lw_ekpo.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form CALL_SMART_FORM
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM call_smart_form .
DATA: lv_form_name TYPE rs38l_fnam.
IF it_ekpo IS NOT INITIAL.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST'
IMPORTING
fm_name = lv_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION lv_form_name
EXPORTING
date_low = date_low
date_high = date_high
TABLES
it_ekpo = it_ekpo
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
ENDIF.
ENDFORM.
Now go to SMARTFORMS and create a simple form
step by step. At first we import all the variables, structure & table into
Form Interface.
Now we create the nodes one by one at first page. The first page
will contain a header window, main window & a footer window. The header
will be a secondary window which holds the condition of displaying at first
page. The main is the main window which is mandatory for any page. The footer
will be the final window which comes after finishing of every window.
The HEADER Part which holds the Condition - Only first page:
Now we create Logo, Header & body text by right clicking on the template.
Here we have to mention the position in Output Structure. (1,1) means 1st row & 1st column. Similarly (2,1) means 2nd row & 1st column. Similarly we are creating the following.
The MAIN Part:
In the main part we have to create a table to
display item wise PO details.
Table contains a structure which needs to be designed at
table painter.
Now table always has a loop so we need to loop into work area
in the data section.
The header must come each and every page.
In the main the serial number will not come for different
line items of same PO. So we have created code inside the loop and also we are changing the format of Item numbers.
Based on this condition the text will come.
All of the texts are populated by hard coded text or variable
text. Since table contains different variable texts which are populated by
clicking Field List (mark in red) and then drag and drop the particular field.
Now the Total calculation will be done at footer level of the
table. This footer will come only at the end of the table.
In this way we create a table inside the main window. Now it’s
time to create a footer window. Right click on the page and create a window
named Footer Window.
The FOOTER Part:
We have created the footer window as a final window.
It has a condition that it will trigger at the last page
after the end of main.
We create a template here by which the footer information
will be displayed.
Now we create another small window which will display only
Page number. The window is at the right last location of any page. So it will
be a Secondary window which contains only one text field.
The page number is populated by system fields. Current page =
SFSY-PAGE & Total page = SFSY-FORMPAGES. Just drag and drop to populate the
text.
Now we need to create a second page which holds the copy of
Main, Footer & Page number window. If the line item exceeds the first page
then it will come at second page. The main window of second page will start
from the top of the page.
Now execute the report and mention the date range. It will
generate the following Smart form.
The output comes by one page. Now we are going to generate more
than one page by expanding the date range.
The problem is that the Footer window always captures a fixed
height in every page. We shall sort out this by next article.
132 comments:
Great Blog... Thank you sharing your knowledge !!!
Well it Was Very Good Information. Thanks for sharing this Information. sap training videos
Thank you for giving this best information. It’s a very nice topic.sap video tutorials
Hi, This is shalini from Chennai learned SAP Training in Chennai from mr.karthick. The training really was good and i got selected in leading mnc company as SAP Consultant.
You can contact 8122241286 for Best SAP Training in Chennai or reach www.thecreatingexperts.com
Thankyou for wonderful article. It has more Information in Your Website sapvideos.
Thanks for the great information in your blog on It was so nice article sap video
Thank you sir.It was so nice article Thank you for valuable information sap video
Thank you sir.Thanks for Nice and Informative Post onsap video tutorials
Thank you for giving this best information. It’s a very nice topic.sap video tutorials
Thank you sir.I am very greatful to you that you share very informative post with ussap video tutorials
Thank you sir.It was so nice article.I was really satisified by seeing this article.sap video
It was so nice article.I was really satisified by seeing this article. sap video
Kindly share more knowledge on Smartforms
Excellent blog you've got here on sap abap online training in hyderabad.
Best SAP ABAP online training
SAP ABAP Course in Hyderabad
This article is really contains lot more information about This Topic on. Sap videos
Well it Was Very Good Information. Thanks for sharing this Information.Sap videos
It was so nice article.I was really satisified by seeing this article.Sap videos
SAP SuccessFactors Training in Chennai
Best SAP Success Factors Training Institutes in Chennai by Leading HR Company.Real Time SAP SF
Training by Mr.Karthick.
Contact No: 9003085882
http://thecreatingexperts.com/sap-successfactors-training-in-chennai/
We also provide this SAP Successfactors Training in Vadapalani,Velachery,ECR,Adyar,Chromepet,Pallavaram & Guindy.
Class Room / Online Training Availabale!
Fabulous..!!! The information you Provided is much useful. Sap videos
Thank you sir.Thanks for Nice and Informative Post on sap video
all the contents you mentioned in this post.its too good and can be very useful.
sap abap online training in hyderabad
sap abap online course in hyderabad
Thanks for Sharing this Information.You are providing very valuable information.Sap videos
This blog is very useful to us. Thank You so much for sharing on sap abap online training in hyderabad.
sap abap online training in hyderabad
sap abap online course
Thanks for Sharing this Information.You are providing very valuable information.Sap videos
Thank you sir.I get a lot of great information from this blog on sap video
The information you posted here is useful to make my career better keep updates. sap video
I feel happy to read your post, thanks for sharing your knowledge of sap with us keep posting with new concepts. sap video tutorials
SAP Success Factors Real Time Hands on Training in Chennai...
Don't always Depend on Training Institute Alone and so please aware of Best Trainers too..
http://thecreatingexperts.com/sap-successfactors-training-in-chennai/
If You need a Best Trainer over SAP Success Factors Means??? Please ready for an DEMO From the Trainer MR.Karthick
CONTACT:8122241286
Both Classroom/Online Training is Available!!!!!!
Thankyou for information excellent blog have a great possible. Sap videos
Thank you sir.It was so nice article Thank you for valuable information sap video tutorials
This article is really contains lot more information about This Topic on. Sap videos
Thanks for sharing this informative blog..Your blog is really useful for me. sap video
Thank you sir.Thankyou for information excellent blog have a great possible. sap video tutorials
Thankyou for Sharing Great Information. It is Very Helpful Information on. sap video tutorials
Thank you. sir, Really I like your post on. Sap videos
The information you posted here is useful to make my career better keep updates..Sap videos
Thankyou for Sharing Great Information. It is Very Helpful Information on.Sap videos
It was so nice article Thank you for valuable information. Sap videos
The information you have posted here is really useful and interesting too & here. sap video
Thank you. sir, Really I like your post on. sap video tutorials
hello! I was working in a Workflow of SAP video and I want to know if is ok.... Thanks!!!
https://www.youtube.com/watch?v=icNzOOVyY_g
https://www.youtube.com/watch?v=icNzOOVyY_g
Well, I found this information really useful. Thanks a ton for this.
.Sap videos
The information you have given here is truly helpful to me. sap video
Thank you. It is such a wonderful post. it has great information it is very useful Post. sap video tutorials
It was so nice article Thank you for valuable information. sap video tutorials
I am very greatful to you that you share very informative post with us. sap video
Thank you. It is such a wonderful post. Sap videos
Thankyou for Sharing Great Information. It is Very Helpful Information on. sap video
Thanks for the interesting information. sap video tutorials
This article is really contains lot more information about This Topic on. sap video
I am very greatful to you that you share very informative post with us. sap video tutorials
Fabulous..!!! The information you Provided is much useful..Sap videos
I get a lot of great information from this blog. Thank you for your sharing this informative blog. sap video tutorials
Fabulous..!!! The information you Provided is much useful..Sap videos
Well, I found this information really useful. sap video tutorials
Incredible posting this is from you. I am really and truly thrilled to read this marvelous post. You've really impressed me today. I hope you'll continue to do so sap cloud computing
Thankyou for Sharing Great Information. It is Very Helpful Information on. Sap videos
Fabulous..!!! The information you Provided is much useful. sap video tutorials
Thanks for valuable information. sap video
I am very greatful to you that you share very informative post with us. sap video
Thanks for the interesting information.sap video tutorials
Thanks for Nice and Informative Post on. sap video tutorials
Thanks for the interesting information. Sap videos
Thanks for Nice and Informative Post on.sap video tutorials
The information you have posted here is really useful and interesting too & here. sap video tutorials
Thanks for the great information in your blog on.Sap videos
I am very greatful to you that you share very informative post with us. Sap videos
Good post! Thanks for sharing this Information.The information you Provided is much useful on sap video
Thanks for the great information in your blog on It was so nice article. Sap videos
Thanks for the great information in your blog on It was so nice article. Sap videos
Thank you for giving this best information. It’s a very nice topic. sap video
Well it Was Very Good Information. sap video tutorials
Thanks for Sharing this Information.You are providing very valuable information. Sap videos
Well, I found this information really useful. Thanks a ton for this..Sap videos
Thanks for the great information in your blog on. Sap videos
Well, I found this information really useful. Thanks a ton for this. sap video
It has great information it is very useful Post. sap video tutorials
The information you have given here is truly helpful to me. sap video tutorials
Thanks for the interesting information. Sap videos
This website is providing the lot of topics .Sap videos
Thanks for the interesting information. sap video
I get a lot of great information from this blog on .Sap videos
It is very useful information on sap video
thank you sir,you sharing sap vedio is goodand share more vediossap abap online training in hyderabad
EXCELLENT COMMENT IN YOUR BLOG THANK YOU FOR INFROMATION
SAP ABAP ONLINE TRAINING IN HYDERABAD. SAP ABAP TRAINING IN HYDERABAD. SAP ABAP TRAINING ONLINE IN USA
Well, I found this information really useful. Thanks a ton for this. Sap videos
Thank you. It is such a wonderful post. sap video tutorials
This article is really contains lot more information about This Topic on. Sap videos
Nice page and usefull information
http://thecreatingexperts.com/sap-hr-training-in-chennai/
It was so nice article.I was really satisified by seeing this article. sap video
This article is really contains lot more information. Sap videos
Thanks for providing this information. Sap videos
This website is providing the lot of topics. sap video
good blog ,thank you for sharing information. sap abap online training in hyderabad>
excellent blog,thank you for sharing a informatiom about sap abap online sap abap training in hyderabad
Thanks for the interesting information. sap video
Well, I found this information really useful. Thanks a ton for this..Sap videos
The information you have posted here is really useful and interesting too & here. sap video
Thanks for providing this information. sapvideos
Thanks for providing this information. sap video
Hi, I learned SAP Training in Chennai from THE CREATING EXPERTS. The training was good and i got selected in leading MNC company as SAP Consultant.
contact 8122241286
www.thecreatingexperts.com
Hi, I learned SAP Training in Chennai from THE CREATING EXPERTS. The training was good and i got selected in leading MNC company as SAP Consultant.
contact 8122241286
www.thecreatingexperts.com
Thanks for providing this information. sap video
Good post! Thanks for sharing this Information.The information you Provided is much useful on sap video
Thanks for the detailed info about SAP. sap video tutorials
Best sap MM and SD training with placement chennai
http://thecreatingexperts.com/sap-mm-training-in-chennai/
Thanks for Nice and Informative Post on. Sap videos
Thanks for Nice and Informative Post on. Sap videos
I am very grateful to you that you share very informative post with us sap video
Very informative blog...SAP ABAP real Time Hands on Training in Chennai…
http://thecreatingexperts.com/sap-abap-training-in-chennai/
CONTACT:8122241286
Both Classroom/Online Training is Available.
Thanks for the detailed info about SAP. sap video
Fabulous..!!! The information you Provided is much useful..Sap videos
This article is really contains lot more information. sap video
I am very greatful to you that you share very informative post with us. Sap videos
Best SAP HANA Training in Chennai by leading HANA Consultant.
Reach at 9003085882
Superb i really enjoyed very much with this article here. Really its a amazing article i had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.
ABAP Training in Chennai
SAP FICO Training in Chennai
Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care.As always, we appreciate you confidence and trust in us.
SAP Training in Chennai
ABAP Training in Chennai
These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post. Your articles really impressed for me,because of all information so nice.
SAP Training in Chennai
SAP ABAP Training in Chennai
thanku......thanku....thanku sir,,,,
sir we learnt lot of things from you..please always be with us... i need your help sir
SAP Online Training
hi your blog Article is very nice & thanks for sharing the information.
sap sucess factor coaching in hyderabad
Nice blog..! I really loved reading through this article. Thanks for sharing such
a amazing post with us and keep blogging...
sap mm training in hyderabad
Thanks for sharing nice information do visit us at
SAP HR ABAP Training in Texas>
Thanks for sharing nice information do visit us at
SAP HR ABAP Training in Texas>
SAP FIORI Training in Chennai from the best and experienced SAP Consultants get trained and become the expert in SAP FIORI training in Chennai
Reach us@08122241286 & 9003085882
Great information. the information provided is of great
use as i got to learn new things. If you are looking for
real time training by industry experts with live projects
and placement support.kindly contact the creating experts
Reach our Technical Experts @ 8122241286 / 9003085882.
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Data Science training in Chennai
Data science training in Bangalore
Data science training in pune
Data science online training
Data Science Interview questions and answers
Data Science Tutorial
I appreciate that you produced this wonderful article to help us get more knowledge about this topic. I know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!
Data Science course in Chennai
Data science course in bangalore
Data science course in pune
Data science online course
Data Science Interview questions and answers
Data Science Tutorial
Data science course in bangalore
I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
Data Science training in chennai
Data Science training in OMR
Data Science training in chennai
Data Science Training in Chennai
Data Science training in Chennai
Data science training in bangalore
Post a Comment