How to use parameters in smartform genrated  function module

i executed smartform one functional module is genrated  '/1BCDWB/SF00000002'
now the problem is that  i want to send  output of this smartform through email
now how to use ' MAIL_RECIPIENT   '      and  ' MAIL_SENDER   ' to send smartform output through email .
please check following module which generated by smartform.
plz suggest me  .
CALL FUNCTION '/1BCDWB/SF00000002'
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
    ITAB_PA0001                =   ITAB_PA0001
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.

Hi
You can do it while passing these parameters in the CONTROL_PARAMETERS.
data: ls_CONTROL_PARAMETERS type SSFCTRLOP.
ls_CONTROL_PARAMETERS-DEVICE  = 'LOCL'.
ls_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
ls_CONTROL_PARAMETERS-PREVIEW = ' '.
Pass this ls_CONTROL_PARAMETERS to the importing parameter of the FM .
     CALL FUNCTION LF_FM_NAME
           EXPORTING
                      CONTROL_PARAMETERS   = LS_CONTROL_PARAM
In addition to this, you might also want to set the print immediately field on the same structure to 'X'.
Generally you leave the device field empty, the user master record default printer will be used

Similar Messages

  • How to use a Logical Database in Function Module.

    Hi Experts,
    I want to use a logical database in a Function Module to fetch data from a standard SAP table into a Internal table for certain filter conditions.
    How can I get get this done????
    I called LDB_PROCESS FM in my FM, but I could not figure out how to store the extract in my IT table since we cant use GET in FM.
    Please provide me a sample code if possible.
    Thanks in Advance,
    Alex.

    Hi,
    i had an example program like this ,in this i want to get the data using pnp logical database with 5 fields in an interface program.
    data: begin of it_final occurs 0,
            pernr like pa0002-pernr,
            vorna like pa0002-vorna,
            nachn like pa0002-nachn,
           usrid like pa0105-usrid,
           usrid_long like pa0105-usrid_long,
           end of it_final.
    get pernr.
      clear : p0000,p0002,p0105.
      rp-provide-from-last p0000 space p_date p_date.
      if p0000-stat2 = '3'.
        v_pernr = pnppernr-low.
      else.
        reject.
      endif.
    *---Get employee pernr, First name ,Last name into final table
      rp-provide-from-last p0002 space p_date p_date.
      if pnp-sw-found = '1'.
       it_final-pernr = p0002-pernr.
       it_final-vorna = p0002-vorna.
       it_final-nachn = p0002-nachn.
      else.
    *---Error message if not infotype 0002 maintained
      T_ERROR-PERNR   = pnppernr-low.
      CONCATENATE TEXT-EMI '0002'
      INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
      APPEND T_ERROR.
      CLEAR T_ERROR.
      endif.
    **--Get SYSTEM USERNAME to final table
      rp-provide-from-last p0105 0001 p_date p_date.
      if pnp-sw-found = '1'.
        it_final-usrid = p0105-usrid.
      else.
    *---Error message if not SYSTEM USERNAME maintained
        T_ERROR-PERNR   = pnppernr-low.
        CONCATENATE TEXT-003 '0105'
        INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
        APPEND T_ERROR.
        CLEAR T_ERROR.
      endif.
    **--Get Email ID to final table
      rp-provide-from-last p0105 0010 p_date p_date.
      if pnp-sw-found = '1'.
        it_final-usrid_long = p0105-usrid_long.
      else.
    *---Error message if not Email ID maintained
        T_ERROR-PERNR   = pnppernr-low.
        CONCATENATE TEXT-004 '0105'
        INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
        APPEND T_ERROR.
        CLEAR T_ERROR.
      endif.
       append it_final.
        clear it_final.
    reward points if useful,
    venkat.

  • How to use select-options in the function module of import parameter ?

    Hi ...
       I have created a BAPI and tested in SWO1 tcode , by giving the single value for an company code ( BUKRS ) , it executed properly .
    Same thing is working after implementing in a program .
    so now it is working for fetching a single company code details .
    My requirement is : I want to use select-options in program as well as in function module IN IMPORT PARAMETER.
    Program :
    REPORT  ZTEST.
    TABLES : T001 , ZBAPI_STR .
    TYPES : BEGIN OF TY_ITEM  .
              INCLUDE STRUCTURE ZBAPI_STR .
    TYPES : END OF TY_ITEM .
    DATA :WA_ITEM TYPE TY_ITEM ,
          ITEM LIKE STANDARD TABLE OF WA_ITEM INITIAL SIZE 0 .
    PARAMETER : BUKRS TYPE ZBAPI_STR-BUKRS.
    call function 'ZBAPI_FMT001'
      exporting
        bukrs         =  BUKRS
    IMPORTING
      RETURN        =
      tables
        itemtab       = ITEM
    IF ITEM IS NOT INITIAL .
      LOOP AT ITEM INTO WA_ITEM .
        WRITE : / WA_ITEM-BUKRS , WA_ITEM-BUTXT , WA_ITEM-ORT01 , WA_ITEM-LAND1 .
      ENDLOOP.
    ENDIF.
    FUNCTION MODULE :
    FUNCTION ZBAPI_FMT001.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(BUKRS) TYPE  EFG_TAB_RANGES
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRET2
    *"  TABLES
    *"      ITEMTAB STRUCTURE  ZBAPI_STR
    SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE ITEMTAB WHERE BUKRS = BUKRS .
    ENDFUNCTION.
    Regards
    Deepa.

    I have given a similiar example which i did
    Declare a
    Table type:Z_TT_PONUM             
    Short text  :  Select options  PO Number
    in SE11 tcode with row type eg: Z_ST_PONUM
    create a structure (this will be the row type)
    Structure          Z_ST_PONUM            
    Short text         Select Options Field PO number
    Compenent  Compent type
    SIGN       BAPISIGN      Inclusion/exclusion criterion SIGN for range tables
    OPTION       BAPIOPTION      Selection operator OPTION for range tables
    LOW       EBELN                      Purchasing Document Number
    HIGH       EBELN                      Purchasing Document Number
    In the function module import
    give as
    I_PO_NUM     TYPE     Z_TT_PONUM     opt  pass value Select options  PO Number
    Hope this is exactly what you want to know.
    So you create a structure simliar to mine but the low an high whould be your component
    then a table type  and then include that in the BAPI.
    Then pass your select-option value to this BAPI when you call this BAPI in the program

  • How to use multiple models in one Function module?

    Hi,
    In my FM i am using 2 models and if i dont completely exit the Function and use the same fm for another query based on another
    model it is giving error saying invalid type.
    if iv_type_of_search = 'A'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BP_APPL' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
    Contact Search
      elseif iv_type_of_search = 'C'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BP_APPL' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilContactAdvancedSearch' ).
    *Opportunity Search
      elseif iv_type_of_search = 'O'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BT' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQOpp' ).
      endif.
    Any idea how to over come this or remove the instance of the old query and model every time its run?
    it looks like the object of the last run is still there and i cant find any destructor method or way and
    if i exit se37 it works fine....

    Hi George,
    You can also set up your model (component set) with the components you need.
    Check it on:
    SPRO->CRM->CRM Cross-Application Components->Generic Interaction Layer/Object Layer->Basic Settings
    Kind regards,
    Garcia

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Need an example how to use SCAN_Start with a callback function

    I would appreciate if someone helps me with a working example of how to use SCAN_Start with a callback function. I need just a basic functionality: to specify a channel list (with gains probably), to start a data acquisition task and to receive data buffers utilizing a callback function. t this time whatever I was trying to do caused computer hangups, though it is supposed to be one of the most regular tasks to perform.
    Thank you in advance,
    Mike

    Hello Mike,
    Thank you for contacting National Instruments.
    Attached is an example project which uses a callback function to begin analog acquisition (AI) by calling SCAN_Start. This project acquires from the first 2 channels on your DAQ device. Make sure to modify the device number in the code to match the number of your card.
    Let me know if you have any further questions...
    Sincerely,
    Sean C.
    Applcications Engineer
    National Instruments
    Attachments:
    Acquire_multichannel_61xx.zip ‏11 KB

  • New in NW04s: FL069 TABLES parameters are obsolete (in function modules)

    Can somebody explain what is the fundamental reason for this behaviour in NW04s?
    In Netweaver 2004s system (like ERP2005 ) you get a warning message in SE37:
    FL069 TABLES parameters are obsolete! when defining quite ordinary tables parameter using LIKE and reference to a structure in ddic.
    I now speak normal function modules, not RFC enabled.
    This example of tables parameter definition will cause the warning message:
    return LIKE BAPIRET2
    I of course looked the additional help provided by this message FL069. I understood it as following:
    you should stop using TABLES parameter and more often use CHANGING parameter by referring a TABLE TYPE defined in dictionary.
    if using CHANGING parameter and still want to pass the header line of your internal table you should use a separate parameter (EXPORT or CHANGING parameter)
    Developers have too much used TABLES parameters for passing internal tables for reading (by value) rather than to be modified (by reference). As a consequence, fm could have change the header line without caller to know it.
    in my opinion the message help is missleadingly telling that header line is no longer passed to function module if TABLES parameter is used. I made a small test program and fm (with TABLES paramerer), and everything worked as before.
    The warning message can be ignored by pressing Enter a few times and your fm with TABLES parameter works as it had in older versions of Netweaver.
    SAP is still using a lot of TABLES parameters in their own function modules. For example SD_SALES_HEADER_MAINTAIN.
    So what is the point of this warning message while everything still works as it used to be and SAP uses this same "OBSOLETE" feature itself? Is there anything more fundamental behind this message? Like TABLES paremeters will no longer work in future versions of ABAP (or header line passing will be ignored in future versions) and therefore developers should switch to CHANGING/EXPORT parameters with TABLE TYPES as soon as possible??
    Please understand that I don't need any assistance how to avoid this message, just interested to share your opinions what is the purpose of this warning message.
    That is why I did not marked this thread as a question.
    Br: Kimmo

    Hello,
    This is the view under Tables tab in my function builder:
    I_T_SELECT     TYPE     SRSC_S_IF_SIMPLE-T_SELECT
    I_T_FIELDS     TYPE     SRSC_S_IF_SIMPLE-T_FIELDS
    E_T_DATA     LIKE     SFLIGHT (which I change to YBWxxxx)
    The moment I change to YBWxxxxx it gives me that error '"TABLES parameters are obsolete! "'
    and unfortunately hitting enter several times is not helping  either
    Thanks!

  • Wt parameters to pass in  function module for particular kunnr fld

    wt parameters to pass in  function module f4if_int_table_value_request which is mostly preferred in reports instead of search help
    for eg i use select-options s_kunnr for kna1-kunnr & prepare i internal table it_kna1.
    den how 2 pass s_kunnr fld & it_kna1 in dat above FM for creating f4 functionality for particular s_kunnr fld on selection-screen.
    plz send me d code urgently

    Check below code....
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.

  • How do we trap exception inside the function module?

    How do we trap exception inside the function module?

    Use ABAP Help - CATCH, RAISE for starters. Or take a look at an existing function module, for example.

  • How to get sysnr value in a Function Module

    Hi all,
    I need to get the sysnr(system number) value of the R/3 system. I execute a RFC function module and need to get the value of sysnr of the system it executes in as a return parameter. Can somebody tell me how to get this value in the function module and return it.
    Thanks and Regards,
    Pratik

    Hello Pratik
    The system number has to be defined in the RFC destination. Thus, select on your local system (where you call the RFC function module) the corresponding RFC destination from table <b>RFCDES</b>. In field RFCDES-RFCOPTIONS you will find a string like this:
    H=<ip address>,S=21,R=N, ...
    S=system number
    Regards
      Uwe

  • Can i  use Two DSO 's in Function module

    hi experts,
    Can i  use Two DSO 's in Function module  .That FM is used for Layout
    I actually  want to  fill one DSO Refering the Data in Another DSO.
    Regard
    Naresh.

    In the first way the DSO's are usually called shared libraries or DSO libraries and named libfoo.so or libfoo.so.1.2. They reside in a system directory (usually /usr/lib) and the link to the executable program is established at build-time by specifying -lfoo to the linker command. In the second way the DSO's are usually called shared objects or DSO files and can be named with an arbitrary extension

  • Why we should use Macros if we have function Module

    Why we should use Macros if we have function Module and what is the Advantage of Macros than function Module
    Moderator Message: Interview-type questions are not allowed.
    Edited by: kishan P on Oct 7, 2010 2:22 PM

    Put it this way... if you have blueprints for a car you wouldn't want to produce only one car, would you? You would want to produce as many as needed. In another example, you don't want to be able to use only 1 window in Windows. Each window has common features but have different values. That's the purpose of non-static entities
    However, there are instances that you want to have only one value for something. That's when you use static entities.
    Get it? =)

  • How to pass select-option filed to Function Module Exporting Parameter

    Hi,
        How to pass select-option filed to Function Module Exporting Parameter.
    Thanks

    Hi,
    DATA: BEGIN OF ITAB5_WRK OCCURS 0,
            KUNNR     TYPE KNKK-KUNNR,  "CUSTOMER #
            SBGRP     TYPE KNKK-SBGRP,  "CREDIT REP
            KLIMK     TYPE KNKK-KLIMK,  "CREDIT LIMIT
            NAME1     TYPE KNA1-NAME1,  "CUSTOMER NAME
            SKFOR     TYPE KNKK-SKFOR,  "TOTAL A/R
            AMT1      TYPE KNKK-SKFOR,  "CURRENT
            AMT2      TYPE KNKK-SKFOR,                          "01-30
            AMT3      TYPE KNKK-SKFOR,                          "31-60
            AMT4      TYPE KNKK-SKFOR,                          "61-90
            AMT5      TYPE KNKK-SKFOR,                          "91-120
            AMT6      TYPE KNKK-SKFOR,                          "OVR 120
            BZIRK     TYPE KNVV-BZIRK,
          END OF ITAB5_WRK.
    SELECT-OPTIONS P_COMP     FOR  T001-BUKRS
      SELECT KUNNR SBGRP  FROM KNKK
             INTO TABLE ITAB5_WRK
             WHERE SBGRP IN P_REP
               AND KUNNR GE '0001000000'
               AND SKFOR NE 0.
      LOOP AT ITAB5_WRK.
        DELETE ADJACENT DUPLICATES FROM ITAB5_WRK COMPARING KUNNR.
      ENDLOOP.
      PERFORM GET_CREDIT_LIMITS.
    *=======================================================================
      IF P_DIST NE SPACE.
        LOOP AT ITAB5_WRK.
          SELECT SINGLE * FROM KNVV WHERE KUNNR EQ ITAB5_WRK-KUNNR
                                      AND VKORG EQ P_COMP
                                      AND VTWEG EQ '20'
                                      AND SPART EQ '10'
                                      AND BZIRK IN P_DIST.
          IF SY-SUBRC EQ 0.
            MOVE KNVV-BZIRK TO ITAB5_WRK-BZIRK.
            MODIFY ITAB5_WRK.
          ELSE.
            DELETE ITAB5_WRK.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *==============================================================
      LOOP AT ITAB5_WRK.
        MOVE: 'F/S'            TO WRK-KKBER,
               ITAB5_WRK-KUNNR TO WRK-KUNNR.
        PERFORM AGING.
        ADD: W_SNFAE  TO ITAB5_WRK-AMT1,
             W_SFAE1  TO ITAB5_WRK-AMT2,
             W_SFAE2  TO ITAB5_WRK-AMT3,
             W_SFAE3  TO ITAB5_WRK-AMT4,
             W_SFAE4  TO ITAB5_WRK-AMT5,
             W_SFAE5  TO ITAB5_WRK-AMT6,
             W_SFAEL  TO ITAB5_WRK-SKFOR,
             W_SNFAE  TO ITAB5_WRK-SKFOR.
        MOVE: 'SPEC'            TO WRK-KKBER,
               ITAB5_WRK-KUNNR TO WRK-KUNNR.
        *PERFORM AGING.*
        ADD: W_SNFAE  TO ITAB5_WRK-AMT1,
             W_SFAE1  TO ITAB5_WRK-AMT2,
             W_SFAE2  TO ITAB5_WRK-AMT3,
             W_SFAE3  TO ITAB5_WRK-AMT4,
             W_SFAE4  TO ITAB5_WRK-AMT5,
             W_SFAE5  TO ITAB5_WRK-AMT6,
             W_SFAEL  TO ITAB5_WRK-SKFOR,
             W_SNFAE  TO ITAB5_WRK-SKFOR.
        MODIFY ITAB5_WRK.
      ENDLOOP.
    FORM AGING.
      *CALL FUNCTION 'CUSTOMER_DUE_DATE_ANALYSIS'* 
      EXPORTING
          BUKRS             = P_COMP           
          KKBER             = WRK-KKBER
          KUNNR             = WRK-KUNNR
          RASID             = 'FEND'
          KLIMP             = 'X'
        IMPORTING
          SFAE1             = W_SFAE1
          SFAE2             = W_SFAE2
          SFAE3             = W_SFAE3
          SFAE4             = W_SFAE4
          SFAE5             = W_SFAE5
          SFAE6             = W_SFAE6
          SFAEL             = W_SFAEL
          SNFA1             = W_SNFA1
          SNFA2             = W_SNFA2
          SNFA3             = W_SNFA3
          SNFA4             = W_SNFA4
          SNFA5             = W_SNFA5
          SNFA6             = W_SNFA6
          SNFAE             = W_SNFAE
        EXCEPTIONS
          NO-AGING_SCHEDULE = 1
          NO_TABLE_INPUT    = 2.
      CASE SY-SUBRC.
        WHEN 1.
          MESSAGE E999 WITH 'PLEASE ENTER AGING SCHEDULE'.
        WHEN 2.
          MESSAGE E999 WITH 'DO NOTHING ??'.
      ENDCASE.
    ENDFORM.                    "AGING
    Thanks

  • How to read current line number in function module sourrce code?

    Hi All,
    How to read current line number in function module sourrce code?
    regards,
    Anuj

    If you have new editor you would be able to see the line number. 
    Or in the Dump screen - there is a button called Debugger - click that you would be able to see the code where dump has occured..  you would be able to find the line number from there.
    To get the new editor with line number , you need to change the settingsin SE38.
    Regards
    Vivek

  • Pls explain me the use and purpose of following Function modules

    pls explain me the use and purpose of following Function modules
    1. G_MAX_PERIOD_AND_OFFSET_GET
    2.  DEQUEUE_E_TABLE
    3. FI_COMPANY_CODE_CHECK
    4. G_PERIOD_GET
    5. alv_display_function
    6. G_SET_GET_ID_FROM_NAME
    thanks ,
    phyrose

    1. <b>G_MAX_PERIOD_AND_OFFSET_GET</b>
    For given No. of period & periods it gives the offset
    <b>2. DEQUEUE_E_TABLE</b>
    To Unlock the table records
    <b>3. FI_COMPANY_CODE_CHECK</b>
    To validate Company Code
    <b>
    4. G_PERIOD_GET</b>
    Returns no. of Posting period & Special period for give company code, posting date & ledger
    <b>5. alv_display_function</b> -
    No such FM exists
    <b>
    6. G_SET_GET_ID_FROM_NAME -</b> Use this module to derive the internal set Id from the name that appears on the user interface, for example, in order then to import the set (see the function group documentation).
    The function module first determines a candidate list of sets based on the set name and the class that might have been specified that could match the set name. The class can also be masked (e.g. 000+ for all FI-SL sets, including dynamic sets).

Maybe you are looking for

  • Has anyone tried the TV@nywhere with SECAM?

    Est-ce que n'importe qui a essayé le TV@nywhere Master avec SECAM? I am considering living in France, has anyone had any experience with this card using the SECAM TV standard? Est-ce que j'habiter en France, n'importe qui considère a eu une expérienc

  • Digital Signature on Original File

    Hi Friends, I have a requirement which I am explaining below: There are various status for a document and workflow is triggered for each status.  I want to add the Diginal signature of person after he approves / select the status for that document th

  • JMS adpater

    Dear Expertise, I have some doubts in JMS Adpater. 1. IS JMS adapter in XI is JMS client? 2. If JMS adaper CC is in sender mode, will XI pull the data(queues) from JMS server or JMS server will send the data to XI. For IDOC to JMS scenario, what are

  • Music comments in iPhone

    Hi! I've added comments to some of my music tracks in iTunes. Can I look them in iPhone running iOS 6.1.3? -Matti

  • Wish to install photoshop elements on second PC. Where are the download files?

    I wish to install Photoshop Elements 9 on a second PC, but can't find the necessary download files on my first PC. What can I do?