Purchase order in SmartForms
hi,
I am getting an error in ABAP program for smartform of Purchase order
In Purchase order screen (ME21N) for any field I Pressed F1 and from technical details I got the TABLE name and field name, but when I put in Smartform report it gives me the below error.....
"MEPO1211 is not define in ABAP Dictionary as a table, projection view or database view".
in SE16
"MEPO1211 is a strucute, not a table".
I wanna to know how to use structure in report instead of table.
like we use MARA table as
TABLES : MARA,
I need to print some data from the MEPO1211,
plz help me
Thanx in advance
Hi,
Goto form interface double click on it and you will
find
ZXEKKO TYPE EKKO
in tables tab strip you will get these itabs
L_XEKPO LIKE EKPO
L_XEKPA LIKE EKPA
L_XPEKPO LIKE PEKPO
L_XEKET LIKE EKET
L_XTKOMV LIKE KOMV
L_XEKKN LIKE EKKN
L_XEKEK LIKE EKEK
L_XKOMK LIKE KOMK
use these and dont use the fields which are used in ME21N or 22N or 23N. this is being handled by print program you are calling
Regards
Shiva
Similar Messages
-
How to take annexture [ long text ] in purchase order in smartforms
hi all expert's
[1] i printing P.O in smart form ....
can any body tell me how to take annexture [ long text ] into P.O layout....text will be a page or more pages...
[2] how to pass mumtiple line item on next susquent page .....
e.x suppose i having 10 line items for a P.O [ Purchase Order ]
on page first it should display 5 lines and on 2nd page it should display 5 lines .....
while i am printing it is showing all items on same page and breaking footer and printing on next line...
kindly suggest me ...
thanx in advance ...Hi,
The method is quite simple, i presume you're quite well versed with doing recording, so the key thing to keep in mind is how to prepare the input file.
At my end i had about 5 lines of data which needed to be uploaded, hence i had a tab-delimited file with the order nos. in the first column & the five lines of text in five different columns (Refer format below)
Order No.
Line - 1
Line - 2
Line - 3
Line - 4
Line - 5
12345
txt - 1
txt - 2
txt - 3
txt - 4
txt - 5
67890
txt - a
txt - b
txt - c
txt - d
txt - e
Now provide this input file for your lsmw or bdc program & it will work. You can work with your abaper if you're not so comfortable with LSMW or BDC programming he / she should be able to easily make it work for you.
Regards,
Vivek -
Gurus,
I need help in transforming the standard sapscript PO form into smartform.
I understand that the smartform for this is /SMB40/MMPO_L
What would be the print program for this?
If I use SAPFM06P, the print preview would display a message that says "Error in OPEN_FORM for document ...."
If possible, please guide me with the step by step process on how to do this.
Points will be rewarded.
ThanksIn researching this, it appears SAP realized they missed the print program /SMB40/FM06P for smartform /SMB40/MMPO_L. SAP has a note 968332 for patching the SAP best practices baseline package (US) V1.600 that includes these essential transports to get the missing PO print program installed and working:
RS5K908607, RS5K920133, RS5K942991, RS5K912175 and RS5K919363.
The next problem I ran into was trying to email the PO smartform. Next I found they had a bug in this new print program (or at least I perceive it as a bug) but could find no notes specific to this. That being said I made this change and now I can email the PO smart form.
The bug is within form get_addr_key where they move l_lfa1-adrnr to ls_addr_key. However the local changing parameter is named l_addr_key (not LS). So I made the following two enhancements:
Old: CHANGING l_addr_key.
New: CHANGING l_addr_key type addr_key.
Old: MOVE l_lfa1-adrnr TO ls_addr_key.
New: MOVE l_lfa1-adrnr TO l_addr_key-addrnumber.
Other than this everything else seems to be working as expected. Even updates to our document management system as expected (print and archive).
Tim -
Reg : Last Release Date In Purchase Order Output(Smartform
Dear gurus,
In PO output smart form the date of PO is the date on which PO is created which is internally taking system date on particular date which the PO is created.
PO consists the release strategy.
i want the date to be the Last Release codes Released date.
From which tables i need to fetch this Date of Last Release.
With Regards,
GMPCDHDR and CDPOS.
-
hi,
I want to do the purchase order in smartforms, i already tried to do the same and struggling to fullfil the same, kindly let me know the how to do and if it is possible please send me the screen short for the same by step by step.
thanks
sujathaHi
Use the Smartform: /SMB40/MMPO_L for purchase order and copy it and change it and assign in NACE tcode
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
Here is the procedure
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.
for Smartforms material
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sapgenie.com/abap/smartforms.htm
How to trace smartform
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
Re: Need FAQ's
check most imp link
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
<b>step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Reward points for useful Answers</b>
Regards
Anji -
hello,
i want to prepare purchase order in smartforms, first time i am doing the same, please let me know step by step and possible kindly send me the screenshort for one example of pur. order to understand the steps.
yours truly,
sujathaHi,
plz go through the following code....
*****************************DATA DECLERATION******************************
TABLES: EKKO.
PARAMETERS : P_EBELN LIKE EKKO-EBELN.
DATA : D_PO_HEADER LIKE BAPIEKKOL.
DATA : F_NAME TYPE TDSFNAME VALUE 'Z8VIJAY_PO_ASSIGNMENT'.
DATA : FUNC_NAME TYPE RS38L_FNAM.
**************************INTERNAL TABLE**********************************
DATA : IT_PO_HEADERTEXT LIKE BAPIEKKOTX OCCURS 0 WITH HEADER LINE.
DATA : IT_PO_DETAILS LIKE BAPIEKPO OCCURS 0 WITH HEADER LINE.
DATA : IT_PO_SCHEDULES LIKE BAPIEKET OCCURS 0 WITH HEADER LINE.
DATA: IT_DETAILS_TEXT1 LIKE BAPIEKPOTX OCCURS 0 WITH HEADER LINE.
*************************LOGIC***********************************************************
START-OF-SELECTION.
CALL FUNCTION 'BAPI_PO_GETDETAIL'
EXPORTING
purchaseorder = P_EBELN
ITEMS = 'X'
ACCOUNT_ASSIGNMENT = ' '
SCHEDULES = 'X'
HISTORY = ' '
ITEM_TEXTS = 'X'
HEADER_TEXTS = 'X'
SERVICES = ' '
CONFIRMATIONS = ' '
SERVICE_TEXTS = ' '
EXTENSIONS = ' '
IMPORTING
PO_HEADER = D_PO_HEADER
PO_ADDRESS =
TABLES
PO_HEADER_TEXTS = IT_PO_HEADERTEXT
PO_ITEMS = IT_PO_DETAILS
PO_ITEM_ACCOUNT_ASSIGNMENT =
PO_ITEM_SCHEDULES = IT_PO_SCHEDULES
PO_ITEM_CONFIRMATIONS =
PO_ITEM_TEXTS = IT_DETAILS_TEXT1
PO_ITEM_HISTORY =
PO_ITEM_HISTORY_TOTALS =
PO_ITEM_LIMITS =
PO_ITEM_CONTRACT_LIMITS =
PO_ITEM_SERVICES =
PO_ITEM_SRV_ACCASS_VALUES =
RETURN =
PO_SERVICES_TEXTS =
EXTENSIONOUT =
*****************PRINT THE HEADER ***********************************************
WRITE : 5 'PO NUM' , 20 'CO CODE' , 35 'DOCUMENT TYPE' , 55 'VENDER', 70 'PUR ORG'.
WRITE :/5 D_PO_HEADER-PO_NUMBER ,
20 D_PO_HEADER-CO_CODE,
35 D_PO_HEADER-DOC_TYPE,
55 D_PO_HEADER-VENDOR,
70 D_PO_HEADER-PURCH_ORG.
ULINE.
SKIP 1.
WRITE :/ ' PO HEADER TEXT'.
SKIP 2.
*****************PRINT THE HEADER TEXT******************************************
LOOP AT IT_PO_HEADERTEXT.
WRITE :/5 IT_PO_HEADERTEXT-TEXT_ID COLOR 6,
20 IT_PO_HEADERTEXT-TEXT_FORM COLOR 6,
50 IT_PO_HEADERTEXT-TEXT_LINE COLOR 6.
ENDLOOP.
ULINE.
SKIP 2.
**************PRINT THE DETAILS************************************************
WRITE:/ 'PO DETAILS'.
ULINE.
LOOP AT IT_PO_DETAILS.
WRITE :/5 IT_PO_DETAILS-PO_ITEM COLOR 3,
18 IT_PO_DETAILS-MATERIAL COLOR 3,
30 IT_PO_DETAILS-PLANT COLOR 3,
50 IT_PO_DETAILS-STORE_LOC COLOR 3,
60 IT_PO_DETAILS-QUANTITY COLOR 3,
85 IT_PO_DETAILS-UNIT COLOR 3,
100 IT_PO_DETAILS-NET_PRICE COLOR 3,
130 IT_PO_DETAILS-NET_VALUE COLOR 3.
ENDLOOP.
ULINE.
SKIP 2.
**************PRINT THE SCHEDULES***********************************************
WRITE:/ 'PO SCHEDULES '.
ULINE.
WRITE :/5 'Delivery Schedule' COLOR 2, 30 'DELV DAT' COLOR 2 , 50 'QUANTITY' COLOR 2.
ULINE.
LOOP AT IT_PO_SCHEDULES .
WRITE:/5 IT_PO_SCHEDULES-SERIAL_NO COLOR 2,
30 IT_PO_SCHEDULES-DELIV_DATE COLOR 2,
50 IT_PO_SCHEDULES-QUANTITY COLOR 2.
ENDLOOP.
ULINE.
************SMART FORM ***********************************************************
*******FATCH DATA FROM BDC THROUGH THIS FUNCTION *****
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = F_NAME
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FUNC_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
**********CALL FUNCTION USING SMARTFORM*****************************
*CALL FUNCTION FUNC_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
d_po_header = D_PO_HEADER
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
tables
it_po_details = IT_PO_DETAILS
it_po_headertext = IT_PO_HEADERTEXT
it_details_text = it_DETAILS_TEXT1
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.
CALL FUNCTION FUNC_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
d_po_header = D_PO_HEADER
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
tables
it_po_details = IT_PO_DETAILS
it_po_headertext = IT_PO_HEADERTEXT
IT_DETAILS_TEXT = IT_DETAILS_TEXT1
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.
****do reward if usefull
vijay -
Smartform in Purchase Order ME21N
Hi guys.
I'm working in SAP 6.0 ECC. I am developing a sapscript for purchase order and it is working well, but i wanna do the same in smartform, i checked on the web that sap 6.0 ecc has some standard smartform for Purchase Order, but mine doesnt have it. In addition, i tried to convert my sapscript to smartform, but the only thing that converts are the windows, no tables or variables, so it doesnt work.
how can i do it? somebody did a smartform for ME21N??? what are the parameters that i need to use? the idea is that this smartform will be trigged at the moment of release the purchase order throught ME29N.
Regards
it will be super usefull that somebody could send me a smartformSending attachments by mail is not really compliant with forum rules (because other people won't get the information).
The good answer would have been to look at SDN "smart forms" home page, then look at section "preconfigured smart forms".
It says that it must be downloaded from SWDC (SAP software download center), choose Installations and Upgrades -> ...Entry by Application Group -> SAP Best Practices -> SAP BP BASELINE PACKAGE ... -
Hi all,
I am having an issue in SRM 5.0.How to get the Purchase Order Amendment details in SRM Smartforms. In ECC we are using a function module to list the amendment details is there any function module in SRM which can do this. Please help me. This is a very very very urgent issue.
Sure points will be awarded
Thx in Adv...........
Regards
Pavan Kumarnever mind, went to wrong thread
Edited by: Rainer Hübenthal on Mar 17, 2010 12:26 PM -
How to display the smartform of a purchase order from EBP (its) into a BSP
Hello,
I'm trying to make a bsp which lists the purchase orders (PO) for a user, that is not a problem.
But I would like to open the smartform of a PO like in EBP (SRM) into my BSP.
In EBP with the ITS i use this function :
BBP_OUTPUT_PO_PREVIEW_SMART
I give in input of this function the GUID (number) of my PO and the name of smartform to use with.
I would like to reproduce this functionality in a BSP like on the ITS.
Can someone help me ?
Thanks a lot !
FrancoisIndeed with the example of the bsp sf_webform_04 i can display my smartform !
I have two choices : HTML or PDF.
You only have to choose OTF for PDF or XSF for HTML !
Thanks a lot !
Francois
Message was edited by: Francois Lavoissiere -
Purchase order-smartform issue
dear experts,
Here in purchase order import po printout one of the text field-AIR/OCEAN FREIGHT-VAL am getting the value like 560.00 but actually i should get 56,000. So i have changed my smartform declaration like JOFV TYPE KWERT. the earlier it was displayed like jofv like ps207-bgert. then the same in samrtforms form interface-->import paramter...where there given like jofv type ps207-bgert. then there i made a change like JOFV TYPE KWERT. once after this has done..when i save it doesn't ask for the request no...it directly saves...SO HERE MY PROBLEM IS NOW I HAVE TO GIVE THE REQUEST NO TO EDP THEN THEY WILL MOVE TO PRODUCTION TO SEE THE O/P.
here what can i do.....please help me out....
thanks & regards,
selva....
Moderator message: please use more descriptive subject lines for your posts, do not post in all upper case.
Edited by: Thomas Zloch on Jun 18, 2011 11:06 AMHi,
if its directly saved means already in some other request.
if you want to find SAP request in which your smart form is being saved then follow this
1) se03
2) Search for Objects in Requests/Tasks
3) Add in object selection blank box - SSFO and select checkbox
4) give smartform name
5) Execute
it will show request name details
Regards,
Dhina... -
Program to send Purchase Order SmartForm by e-mail
Hi,
I need a program to send my Purchase Order SmartForm by e-mail. With the program I use, the output keeps appearing in my spool list in stead of in SOST... Does anyone have a sample code that I can use?
I am working in a ECC 6.0 system. Package SMB40 is nog available in this system.
Thanks!
PatrickHi Patrick.
By a simple search on this forum i found this.
Maybe you can use it
check this code tutorial on how to send smartform output thru email.
https://wiki.sdn.sap.com/wiki/display/Snippets/emailsendthroughoutputcontrols
success., Gr., Frank -
For Purchase order, is any Smartform available
Hi,
for Purhcase order Medruck Script is available but I want a smart form for purchase
is there smart form available for purchase order if exists plz. give me the name.
it is very urgent.
GaneshHi Ganesh,
There is standard smartform for PO (pre-configured forms) but you have to import package :/SMB40
PO Form: /SMB40/MMPO_L
Print Program: /SMB40/FM06P
See the note 595812: it explain how to download the preconfigured smartforms.
Anyway this is an extract of that note:
Detailed information can be accessed at the site:
http://service.sap.com/preconfiguredforms OR
http://service.sap.com/smb/development/preconfiguredforms.
To download preconfigured smartform package, please:
1. Go to http://service.sap.com/installations, select tab "download".
2. On the right hand side screen, locate navigation tree node
SAP Software Distribution Center->Download->Installations and Upgrades->
Entry by Application Group.
3. In the main window (right hand side), follow the path
SAP Best Practices->Best Practices for mySAP All-in-One-> PRECONFIGURED
SMART FORMS, you can find available preconfigured smartform versions.
Here you can also download the PO smartform.
Hope this will help.
Regards,
Ferry Lianto -
Purchase Order Smartform as attachment in step mail through workflow
Whenever user create a PO, mail should trigger in Microsoft Outlook, with the purchase order form as attachment.
I am able to send mail to Microsoft Outlook whenever PO is created.
But kindly advice how to attach PO smartform in th mail.
Regards,
Rahul.Hello,
Please find below link. There is lot of stuff in google regarding this.
smartform as work item attachment
Re: PDF attachment in mail
Regards.
Edited by: vikram singh on Jan 30, 2012 2:00 PM -
Purchase Order History in smartform
Hi gr8 minds
I have developed smartform for purchase order .
now i wanna develop amendment purchse order .
any idea how to go for it .
thanks & regards
siddharthHi Siddharth,
As Samir has suggested you have to get this information from CDHRD and CDPOS. In one of the posts yesterday, Andreas and Rob have nicely mentioned how to fetch data from Change Document.
Updated record should come in txt file
CALL FUNCTION 'CHANGEDOCUMENT_READ'
EXPORTING
* ARCHIVE_HANDLE = 0
* CHANGENUMBER = ' '
* DATE_OF_CHANGE = '00000000'
objectclass = '<b>EINKBELEG</b>'
OBJECTID = EKKO-EBELN "PO Number
* TABLEKEY = ' '
* TABLENAME = ' '
* TIME_OF_CHANGE = '000000'
* USERNAME = ' '
* LOCAL_TIME = ' '
* TABLEKEY254 = ' '
* KEYGUID = ' '
* DATE_UNTIL = '99991231'
* TIME_UNTIL = '235959'
tables
editpos = editpos
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4
IF sy-subrc <> 0.
ENDIF.
Regards,
Subramanian V. -
Purchase order layout using Smartform
Hi All,
Can anyone let me know how to create Purchase order layout using smartforms and assigning it to output type.
Is there standard smartform for purchase order?http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
http://www.sap-basis-abap.com/sapsf001.htm
http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
http://www.esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartforms.doc
http://www.esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf
http://www.esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
Try this. A simple sample Smart Form.
SAP 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.
SMARTFORMS GENERATION: (calling internal table fields)
 Open a smartform using the tcode smartforms.
 Usually form attributes shows admn data.
 In the form interface declare import/export parameters if any. Else declare the tables in tables tab button.
 In the windows and pages expand and create a table. It automatically generates header, main area and footer for the table.
 In data tab button in the table we usually declare a work area to bring the data from se38. Like: ktab into wa. ( The purpose of declaring the wa is , to get the data of the ktab in to header from the body area of the internal table).
 And in the tablepainter pushbutton in table we can have any no of line types. Depending on the requirement. ( for ex: If we want to devide a row in to 4 columns, we can devide it as 4,4,4,4cm as line type 1, And usually for the footer we dont need no of columns, So, we declare it as one column with 16cm measure with the name line type 2.). We can use these line types in the tables.
 In the header right click>>create>>tableline. It asks for line type. Select one line type which is appropriate.
 Like same create a row2 in main area using right click. If we select the line type 1, it automatically generates 4 cells. We can create text in each cell as per requirement.
 We can generate general attributes using general attributes tab button in the text. Or in the other way. We can switch on the field list on/off button from the application tool bar. It displays all the attributes in the left down corner of the screen. We can drag and drop the required fields in the general attributes tab button of the text.
 We continue the same procedure for all the texts. The texts should be displayed in the gray color. Then only it can collects the data from the abap editor fields.
 If it wont turns gray, we can check the fields in the editor by changing it to the line editor. The best thing is to drag the fields from the list, rather than declaring like &wa-matnr&
 In the footer also we create a line type and in that table line we create text.
SE38 PROGRAM(method I):
REPORT Z_CALLING_SMARTFORM2 .
tables: mara.
select-options: S_MATNR for MARA-MATNR.
DATA: kTAB LIKE MARA OCCURS 1 WITH HEADER LINE.
data: FM_NAME TYPE RS38L_FNAM.
SELECT * FROM MARA INTO TABLE kTAB WHERE MATNR in
S_MATNR.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_MYFIRST_FORM2'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
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
ktab = ktab
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.
IN THE OTHER WAY(method II):
REPORT Z_CALLING_SMARTFORM2 .
tables: mara.
select-options: S_MATNR for MARA-MATNR.
DATA: kTAB LIKE MARA OCCURS 1 WITH HEADER LINE.
SELECT * FROM MARA INTO TABLE kTAB WHERE MATNR in S_MATNR.
CALL FUNCTION '/1BCDWB/SF00000199'
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
ktab = ktab
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.
In the method I we are calling the amartform dynamically using the function module 'SSF_FUNCTION_MODULE_NAME'.
Here we are exporting form name and importing fm_name.
So we need to declare the variable fm_name as
data: FM_NAME TYPE RS38L_FNAM.
We can have the type of the fm_name in the function module 'SSF_FUNCTION_MODULE_NAME' (in the export tab button).
Since we are passin the name of the Function module generated by the smart form in to the fm_name variable. We run the function module with the name fm_name, but not the FM generated by the smartform(like /1BCDWB/SF00000199)¬¬¬¬¬¬.
In the method II we directly call the smartform generated function module (i.e, /1BCDWB/SF00000199).
But the method I is recommended. In the method I, The fm_name is a variable we dont put it in the quotes while calling.
In the both methods we declare the internal table using the like option, but not begin of . end of. And in select statement we select *, But not individual fields.
EX2:
SMART FORM NAME: ZGITI_FORM1.
SE38:
REPORT Z_CALL_GIRI_FORM1 .
TABLES: VBRK.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE T1.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
SELECTION-SCREEN END OF BLOCK B1.
*INITIALIZATION.
*T1 = 'SELECTION-CRIETERIA'.
DATA: BEGIN OF I_INVOICE OCCURS 1.
INCLUDE STRUCTURE ZSTR_INVOICE.
DATA: END OF I_INVOICE.
DATA: VAR1 LIKE VBRP-NETWR.
DATA: BEGIN OF I_ADDRESS OCCURS 1.
INCLUDE STRUCTURE ZSTR_ADDRESS.
DATA: END OF I_ADDRESS.
DATA: BEGIN OF I_ORDER OCCURS 1.
INCLUDE STRUCTURE ZSTR_ORDER.
DATA: END OF I_ORDER.
DATA: BEGIN OF I_ITEM OCCURS 1.
INCLUDE STRUCTURE ZSTR_ITEM.
DATA: END OF I_ITEM.
DATA: BEGIN OF I_VBFA OCCURS 1,
VBELV LIKE VBFA-VBELV,
VBELN LIKE VBFA-VBELN,
END OF I_VBFA.
SELECT KUNAG VBELN VKORG VTWEG SPART FROM VBRK INTO TABLE I_INVOICE
WHERE VBELN IN S_VBELN.
IF I_INVOICE[] IS NOT INITIAL.
SELECT KUNNR LAND1 NAME1 NAME2 ORT01 PSTLZ REGIO FROM
KNA1 INTO CORRESPONDING FIELDS OF TABLE I_ADDRESS FOR ALL ENTRIES IN
I_INVOICE WHERE KUNNR = I_INVOICE-KUNAG.
ENDIF.
IF I_INVOICE[] IS NOT INITIAL.
SELECT VBELV VBELN FROM VBFA INTO TABLE I_VBFA FOR ALL ENTRIES IN
I_INVOICE WHERE VBELN = I_INVOICE-VBELN.
ENDIF.
IF I_VBFA[] IS NOT INITIAL.
SELECT VBELN BSTNK FROM VBAK INTO CORRESPONDING FIELDS OF TABLE I_ORDER
FOR ALL ENTRIES IN I_VBFA WHERE VBELN = I_VBFA-VBELV.
ENDIF.
IF I_INVOICE[] IS NOT INITIAL.
SELECT POSNR MATNR ARKTX FKIMG NETWR FROM VBRP INTO TABLE I_ITEM FOR ALL
ENTRIES IN I_INVOICE WHERE VBELN = I_INVOICE-VBELN.
ENDIF.
LOOP AT I_ITEM.
AT LAST.
SUM.
VAR1 = I_ITEM-NETWR.
ENDAT.
ENDLOOP.
CALL FUNCTION '/1BCDWB/SF00000223'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
var = VAR1
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
tables
i_vbrk = I_INVOICE
i_vbak = I_ORDER
i_vbrp = I_ITEM
i_kna1 = I_ADDRESS
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.
Maybe you are looking for
-
Some time ago my ipad 4 screen slowly began forming a long hairline crack at one corner and near the home button for some reason, perhaps daily rough and tumble taking it to class and whatnot. The crack is not very noticeable so I have delayed getti
-
Use of FOR Cursor and BULK COLLECT INTO
Dear all, in which case we prefer to use FOR cursor and cursor with BULK COLLECT INTO? The following contains two block that query identically where one is using FOR cursor, the other is using BULK COLLECT INTO . Which one that performs better given
-
Dear reader, I am facing this grave problem while using the 9iAS. My Forms server is running perfect when started but the Report server is showing an error while starting and is showing the error "Service returned service specific error 186". I am un
-
Did adobe remove the option to use your second monitor for preview? I don't see it as an option and wanted to make sure there was'nt something I was missing.
-
Adding actual signatures to email
This question is directed to FrankBe specifically, or to anyone who has personalized mail. How did you create your signature? thanks.