What is control form function module.
hi
what is control form function module.
Hi Chaitanya,
The function module CONTROL_FORM can be used to pass the control
commands to FORM THROUGH ABAP/4 PROGRAM.
<b>Function Call</b>
CALL FUNCTION 'CONTROL_FORM'
EXPORTING COMMAND = ?...
EXCEPTIONS UNOPENED =
UNSTARTED =
<b>Export parameters:</b>
COMMAND
Enter the SAPscript statement you want to execute in ITF format, but without the statement paragraph attribute '/:'.
<b>Exceptions:</b>
UNOPENED
The current form function could not be executed, since the form output was no yet initialized using OPEN_FORM.
UNSTARTED
No form was opened yet.
Possible reasons:
>The form processing was started using OPEN_FORM without specifying a form name, but no form was opened yet using START_FORM.
>The last used form was closed using END_FORM, but no new form was opened using START_FORM.
>The last filled page of the current form has no subsequent page. In this case, the system automatically terminates form printing after this page. You need no explicit END_FORM call.
>In the current form, no page contains a main window, but a text element shall be output in the main window.
Regards,
Rajesh K Soman
<b>Please rewared points if found helpful.</b>
Similar Messages
-
Adobe Forms function module - downloading the xstring output in PDF file
Hi Guys,
I'm using Adobe forms and fetching its output in an XSTRING PDF format. How can I download this XSTRING output to a PDF file and store on the local file system?
I'm using the following approach to getting a PDF output:
ls_outputparams-getpdf = 'X'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams.
* Get the name of the generated function module
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZADOBEFORM'
IMPORTING
e_funcname = lv_fmname.
IF sy-subrc <> 0.
ELSE.
* Call the Adobe Form function module
CALL FUNCTION lv_fmname
EXPORTING
/1bcdwb/docparams = ls_docparams
IMPORTING
/1bcdwb/formoutput = ls_form_output
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
* Close the spool job
CALL FUNCTION 'FP_JOB_CLOSE'.
Now, the variable LS_FORM_OUTPUT-PDF contains the PDF output in XSTRING. My question is how can I download this as a PDF file to my local machine.
Kind Regards,
Shailesh.hi guys,
im using all FM to download my PDF adobe but in this part :
ls_spfli-carrid = 'AA'.
ls_spfli-connid = '0017'.
APPEND ls_spfli TO it_spfli.
flag = 'X'.
is_address_type = '1'.
is_address_number = '22515'.
is_person_number = '22517'.
is_country = 'IN'.
*&--- Call the generated function module
CALL FUNCTION '/1BCDWB/SM00000200'
EXPORTING
* /1BCDWB/DOCPARAMS =
it_spfli = it_spfli
flag = flag
is_address_type = is_address_type
is_address_number = is_address_number
is_person_number = is_person_number
is_country = is_country
IMPORTING
/1bcdwb/formoutput = fp_formoutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4
I have usage_error knowing that the execution of the function module in SE37 pass successfuly and also the execution of the forms .
in your opinion what can be the problem?
Kind Regards, -
Error while determining the form function module
Hi everyone,
We are experiencing problems while displaying one adobe form in ESS. Its the Travel Expense form (PTRV_EXPENSE_FORM). When pressing the button to Display/Print the form we get an error message: "Error while determining the form function module", and no form I shown. The ADS server is configured correctly and there are other forms that are actually working, for example the Travel Request form. We are running WAS 7.0 with SP12.
Anyone has an idea what can cause the problem? Any help is greatly appreciated.
Thanks in advance!
Regards,
SophieViktor,
Thank you for your answer, it solved our problem!
Regards,
Sophie -
Travel Display Form: Error while determining the form function module
Hi,
In Travel Reqeust (ECC6/ESS) when i click the Display Form after raising the Travel Request it shows the error
"Error while determining the form function module"
Can anyone have idea on this?
Regards,
BoobalanHi,
This error was due to Not supported platforms of ADS (Adobe Document services)
It was not supported on itanium64 bit processors.
Please check where the ADS is supported in service.sap.com/pam
You can use the ADS in the Non-Supported Server by linking it to Supported Platform Server using the SM59 link. This will make the ADS files to work.
Please refer the ADS Config Doc for details.
Hope you also solve this problem.
Regards,
Boobalan -
Cash book printout - forms & function module
Hi SAP Gurus,
Please provide me for cash book the function modules involved and standard sap forms for printout in the following-
1. cash receipt tab
2. cash payment tab
3. check receipt
4. check issued
I want to attach my own form for this functions.
THANKSHi....
go to FBCJ transaction and check for output type. then got to NACE and find out what are the forms assigned or go to NAST table find entries based on output type. there u can find form and program name.
Regards,
KP. -
hi all,
what is the function module to pass the print partamets in smartforms.Hi
the function module is SSF_FUNCTION_MODULE_NAME.
here is sample code....
in this vname is the function module which is generated when we execute the smartform.....it is declared as ...
vname type rs38l_fnam.
in the ssf_function_module_name...in exporting we need to pass the values which we want to pass ,from print program to form.
STRUCTURE DECLARATION
data : wa_lfa1 type z50875_lfa1,
wa_ekko type z50875_ekko,
wa_ekpo type z50875_ekpo,
it_ekpo type z50875it_ekpo,
vname type rs38l_fnam.
SELECTION-SCREEN
selection-screen begin of block b1 with frame title text-000.
parameter : p_no type ekko-ebeln obligatory.
selection-screen end of block b1.
at selection-screen on p_no.
perform validate.
START-OF-SELECTION
start-of-selection.
perform get_vendordata.
perform get_itemdata.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZMM_SMARTFORMS'
importing
fm_name = vname
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 vname
exporting
wa_lfa1 = wa_lfa1
wa_ekko = wa_ekko
wa_ekpo = wa_ekpo
tables
it_ekpo = it_ekpo
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.
*& Form GET_DATA
form get_data .
select single ebeln lifnr
from ekko
into wa_ekko
where ebeln = p_no.
endform. " GET_DATA
*& Form GET_VENDORDATA
form get_vendordata .
select single lifnr name1 land1 ort01 regio
from lfa1
into wa_lfa1
where lifnr = wa_ekko-lifnr.
endform. " GET_VENDORDATA
*& Form GET_ITEMDATA
form get_itemdata .
select ebelp ematn aedat mtart netwr
from ekpo
into table it_ekpo
where ebeln = wa_ekko-ebeln.
endform. " GET_ITEMDATA
*& Form validate
form validate .
perform get_data.
if sy-subrc ne 0.
message 'PURCHASE DOCUMENT DOES NOT EXISTS' type 'E'.
exit.
endif.
endform. " validate -
I have a smart form and executing it with standard tcode but I couldnt see the output. How could i view the generated function module and where to assign this. Help needed immediately.
JanelleIn your print program first call the following FM. Pass the name of your smartform. It will return the generated FM name.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = V_FORM_NAME
IMPORTING
FM_NAME = V_FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
Now call the returned FM name.
CALL FUNCTION V_FM_NAME -
hi ,
The code in program lines is stored in which part of the generated function module and belongs to which include.
Thank you.Hi ,
Try to locate the any variable u have written in the program line in se37 .
Regards -
Whats the use of function module RSAP_IDOC_SEND?
Hi Gurus,
Can anyone please let me know the use of Function Module - RSAP_IDOC_SEND.
Regards
Avi....Hi
Check this...
Send IDOC in parallel dialog process.
CALL FUNCTION 'RSAP_IDOC_SEND'
STARTING NEW TASK l_task
PERFORMING callback_parallel_idoc ON END OF TASK
EXPORTING
i_mestyp = p_mestyp
i_rcvprt = p_rcvprt
i_rcvprn = p_rcvprn
i_flag_commit_work = sbiwa_c_flag_on
i_s_rqstprms = l_s_rorqstprms
TABLES
i_t_idoc_data = p_t_idoc_data
EXCEPTIONS
system_failure = 1
communication_failure = 2.
<b>reward if Helpful</b> -
WHAT ARE THE UPDATED FUNCTION MODULES
Hi Friends,
Can anybody explain me about UPDATED FUNCTION MODULES (types of function modules)Hi
Update Function Module
Unlike transactions and executable programs, dialog modules do not start a new SAP LUW. Calls to update-task function modules from a dialog module use the same update key as the ones in the calling program. The result is that calls to update function modules from a dialog module are executed only if a COMMIT WORK statement occurs in the calling program.
If you place a COMMIT WORK in a dialog module, it does commit changes to the database (for example, with UPDATE).However, it does not start the update task. The function modules are not actually executed until a COMMIT WORK statement occurs in the calling program.
If you use dialog modules, try to avoid including calls to update function modules in subroutines called with PERFORM ON COMMIT. In general, any occurrence of PERFORM ON COMMIT(with or without update-task function calls) in a dialog module can be problematic.
This is because dialog modules have their own roll area, which disappears when the module finishes. Consequently, all local data (including data used for parameter values when calling an update function module) disappears as soon as the commit in the main program is reached.
If you must use this method in a dialog module (i.e. include the call to an update-task function in a subroutine), you must ensure that the values of the actual parameters still exist when the update-task function actually runs. To do this, you can store the required values with EXPORT TO MEMORY and then import them back into the main program (IMPORT FROM MEMORY) before the COMMIT WORK statement
Creating Update Function Modules
To create a function module, you first need to start the Function Builder. Choose Tools ® ABAP Workbench, Function Builder. For more information about creating function modules, refer to the ABAP Workbench Tools documentation.
To be able to call a function module in an update work process, you must flag it in the Function Builder. When you create the function module, set the Process Type attribute to one of the following values:
Update with immediate start
Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions can be restarted by the update task in case of errors.
Update w. imm. start, no restart
Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions may not be restarted by the update task.
Update with delayed start
Set this option for low priority ("V2") functions that run in their own update transactions. These functions can be restarted by the update task in case of errors.
To display the attributes screen in the Function Builder, choose Goto ® Administration.
Defining the Interface
Function modules that run in the update task have a limited interface:
Result parameters or exceptions are not allowed since update-task function modules cannot report on their results.
You must specify input parameters and tables with reference fields or reference structures defined in the ABAP Dictionary.
http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
Regards,
Harish -
What are campaigns related function modules ?
Hi,
I want to find out open campaigns and marketing attributes based on partner function i.e., owner responsible and these open documents I need assign to another owner responsible. Which function module I need to read the details and which fm is to change owner responsible. Please guide me which fm i need to use how I can change to another employee responsible partner function.Hi divya,
Check out the package CRM_MKTPL which will give you all the function modules of Marketing. -
Call Pop-up screen with I/O fields form function module.
Hello experts,
I have a Zfunction module with input paramteres i_matnr, i_posnr and i_kwmeng.
My requirement is to call a pop-up screen with following fields.
Material - Inputbox for material (Read Only) " v_matnr
Item - Inputbox for Item (Read Only) " v_posnr
Quantity - Inputbox for Qty (Read Only) " v_kwmwng
Price - Inputbox for Qty (Change only) " v_price
Submit button.
I created function ZSD_MAT_DATA.
Added statement CALL SCREEN 0005
In PBO_0005, (include Prog)
v_matnr = i_matnr
v_posnr = i_posnr
v_kwmeng = i_kwmeng
1. But it gives me error for not declaration i_matnr. What I am missing here?
2. Is there anything to make window as pop-up with some specific size?
Regards,
RHHi,
You can use the stanadard FM K_KKB_POPUP_RADIO3
else like same you can craete a new function accordind to your requirement.
Hope it helps you.
Reagrds
Arbind -
Error "Job already started" when calling a adobe form in Z function module
Hi All,
I have a error when calling a adobe form in a custom function module.
I am using FP_FUNCTION_MODULE_NAME to get the adobe form function module and then i am using FP_JOB_OPEN function module to control the printing parameters such as no print preview or no dialog ..etc.. I dont have any exceptions during the call of FP_JOB_OPEN function module ..
Later I am calling my function module which was generated for the adobe form and i am getting the error called " JOB ALREADY STARTED".
I tried executing the same function module in se37 and the PDF form output was generated, and also by commenting FP_JOB_OPEN function module the PDF form output was generated.
But i need the FP_JOB_OPEN function module to control the output based on the output type which triggers the form output such as the medium from nast record which says print or email or fax.. etc
Please let me know how to handling this error.Just as a followup note. If you are testing a function module from SE37 and the test button you will get a value in SY-CPROG. You must override this value for everything to work.
If you override the value of SY-CPROG with the main program that will be calling the function module you have no problem.
John W. -
What are different function modules used in alv?and their usage?
helo experts can u please explain what are the different function modules that are used in alv reports and what is the exact use of each and every function module?
Hi,
Well everybody gives good explanation to you.
The commonly used ALV functions used are;
1. REUSE_ALV_VARIANT_DEFAULT_GET
2. REUSE_ALV_VARIANT_F4
3. REUSE_ALV_VARIANT_EXISTENCE
4. REUSE_ALV_EVENTS_GET
5. REUSE_ALV_COMMENTARY_WRITE
6. REUSE_ALV_FIELDCATALOG_MERGE
7. REUSE_ALV_LIST_DISPLAY
8. REUSE_ALV_GRID_DISPLAY
9. REUSE_ALV_POPUP_TO_SELECT
Purpose of the above Functions are differ, not all the functions are required in all the ALV Report.
But either no.7 or No.8 is there in the Programs.
For further information, visit this link
http://www.abapcode.info/2007/06/alv-function-module.html
May this helps you.
Thanks.
Deepak Sharma -
What are the different functions used in sap script?
Hi,
What are the different functions used in sap script? What are the parameters used in each Function?
Regards,
Maheshhe print program is used to print forms. The program retieves the necesary data from datbase tables, defines the order of in which text elements are printed, chooses a form for printing and selects an output device and print options.
Function modules in a printprogram:
When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine forms into a single spool request use START_FORM and END_FORM.
To print textelements in a form use WRITE_FORM. The order in which the textelements are printed, is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you can also use the WRITE_FORM_LINES function module.
To transfer control command to a form use CONTROL_FORM.
Structure of a print program
Read data
Tables: xxx.
SELECT *
FROM xxx.
Open form printing - Must be called before working with any of the other form function modules.
Must be ended with function module CLOSE FORM
call function 'OPEN_FORM'.....
To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM
call funtion 'START_FORM'.....
Write text elements to a window of the form
call function 'WRITE_FORM'.....
Ends spool request started with START_FORM
call funtion 'END_FORM'.....
Closes form printing
call function 'CLOSE_FORM'...
OPEN_FORM function
Syntax:
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = ' '
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Some important parameters:
FORM Name of the form
DEVICE
PRINTER : Print output using spool
TELEFAX: Fax output
SCREEN: Output to screen
OPTIONS Used to control attrubutes for printing or faxing (Number of copies, immediate output....
The input for the parameter is structure ITCPO.
CLOSE_FORM function
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 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.
Paramerters:
RESULT Returns status information and print/fax parameters after the form has been printed. RESULT is of structure ITCPP.
WRITE_FORM function
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Some important parameters:
ELEMENT Specifies which textelement is printed
WINDOW Specifies which window is printed
TYPE Specifies the output area of the main window. This can be:
TOP - Used for headers
BODY
BOTTOM - Used for footers
FUNCTION Specifies whether text is to be appended, replaced or added
Example of how to use the WRITE_FORM function module together with a script.
Form layout of the MAIN window
/E INTRODUCTION
Dear Customer
/E ITEM_HEADER
IH Carrier, Departure
/E ITEM_LINE
IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
/E CLOSING_REMARK
The print program
Writing INTRODUCTION
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'INTRODUCTION'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Writing ITEM_HEADER
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Set ITEM_HEADER into TOP area of main window for subsequent pages
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'TOP'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Write ITEM_LINE
LOOP AT .....
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_LINE'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8.
ENDLOOP.
Delete ITEM_HEADER from TOP area of main window
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'DELETE'
TYPE = 'TOP'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Print CLOSING_REMARK
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'CLOSING_REMARK'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
START_FORM function
CALL FUNCTION 'START_FORM'
EXPORTING
ARCHIVE_INDEX =
FORM = ' '
LANGUAGE = ' '
STARTPAGE = ' '
PROGRAM = ' '
MAIL_APPL_OBJECT =
IMPORTING
LANGUAGE =
EXCEPTIONS
FORM = 1
FORMAT = 2
UNENDED = 3
UNOPENED = 4
UNUSED = 5
SPOOL_ERROR = 6
OTHERS = 7
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END_FORM function
CALL FUNCTION 'END_FORM'
IMPORTING
RESULT =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SPOOL_ERROR = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONTROL_FORM function
The CONTROL_FORM function module alows you to create SapScript control statements from within an APAB program.
Syntax:
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command =
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.
Example:
Protecting the text element ITEM_LINE
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'PROTECT'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
TEXELEMENT = 'ITEM_LINE'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'ENDPROTECT'.
Maybe you are looking for
-
Problem gui_download -Data looks messy without proper column header
Dear SDNers, Scenario: Using FM GUI_download to download excel file to Presentation server. Excel file downloads perfecly fine on presentation server with proper column headers when the OS is not XP/Vista. Issue: when i run this program on my system
-
Lost my e-mail setup icon, HELP!
My phone recently had an issue and would not load the address book. I had done my last backup on 1/24/10 and retored the phone. Now I have no e-mail setup icon to add another e-mail address. I also get e-mails but they go to Messages, not the specifi
-
Need help downloading software upgrade for iPad. Cannot connect with iTunes website.
-
New custom Template not using SRM theme when displayed
Hi All, I have built a custom ABAP screen for SRM and generated and published the new template. When it runs, though, it looks like an R/3 screen instead of the slick SRM Theme. I generated it as a WebGUI with the standard theme 99. Any ideas what I
-
Epson 4880 stopped printing after installing ver. 9.17
Epson 4880 stopped working after installing ver. 9.17 driver.