Help in Function module

Hi All,
I want to add FILE NAME  option in import parametsr in function module. I want to download the RFC FM  interface Output in excel format.
Please give any sample programs.
regards,
Ajay reddy

PROGRAM  ZSV_TEST.
Data : IT type table of kna1 initial size 0.
Select * from kna1 into table IT up to 10 rows.
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
  EXPORTING
  I_FIELD_SEPERATOR          =
   I_LINE_HEADER              = 'X'
    I_FILENAME                 = 'C:\TEST.XLS'
   I_APPL_KEEP                = 'X'
  TABLES
    I_TAB_SAP_DATA             = IT
CHANGING
  I_TAB_CONVERTED_DATA       =
EXCEPTIONS
  CONVERSION_FAILED          = 1
  OTHERS                     = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
The Headings wont be downloaded. if needed then declare a internal table with character fields append the titles and then the values and call this function.
Reward if it helpful
Thanks & Regards
Senthilvel Murugesan

Similar Messages

  • Urgent help in function modules

    Hi Gurus,
    Please send me the names of the related function modules of ISU.also if possible send examples or tutorials of FM creation and the coding involved in it.
    My email is [email protected]
    All Replies will be rewarded.

    Check the links below for details about creating Function Modules:
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://www.erpgenie.com/abap/functions.htm
    Check this link for how to create the function module exit..
    http://sap.niraj.tripod.com/id62.html

  • Required help on Function Modules and Bapis

    Web portal publishing of ERS invoice letters. This involves modification in the BAPI screens to show the invoice PDF instead of printing??
    can anyone help me in fixing this issue.

    hi Anjaneyulu,
    open the t-code --> and go to menu system->status-->select the program and open the program-->
    selct the tree structure----in the left side the includes screen and function module everthing will show..
    or
    open the t-code --> and go to menu system->status-->select the program and open the program-->
    go to attributes and select the Package..
    next----
    go to se80--> enter the package --> and dispalay it shows the list of Program , include transaction function modules and bapi's under the pakage
    Regards,
    Prabhudas

  • Help for function module

    hi all,
    I want to know whether the standard price for a material is released during costing run or not.
    so can anyone tell me where this information (std price released or not)is available .
    if some one know the field name please tell that and if anyone know any function module to get the status of releasing please help me
    points will be rewarded!!!!!!

    hi all,
    I want to know whether the standard price for a material is released during costing run or not.
    so can anyone tell me where this information (std price released or not)is available .
    if some one know the field name please tell that and if anyone know any function module to get the status of releasing please help me
    points will be rewarded!!!!!!

  • Help on function module

    hi all,
    I want to know whether the standard price for a material is released during costing run or not.
    so can anyone tell me where this information (std price released or not)is available .
    if some one know the field name please tell that and if anyone know any function module to get the status of releasing please help me
    points will be rewarded!!!!!!

    Hi,
    Create a table type in SE11 for the parameter and the same in the importing parameter..This will it will allow multiple values for the function module..
    Check the table type SD_WERKS_RANGES in SE11...
    You might have to create a similar one for your parameter..
    Thanks,
    Naren

  • Hi help in function module

    hi,
    what are the function modules do we use for the conversion of currency and units.
       1) i want to convert currency(US$) to INR.
       2) and to convert from one unit to another unit.
    before using these function modules what we have to do in bdcs.
    regards
    vivek

    Hi,
    Check this sample code,
      CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
        EXPORTING
    *     CLIENT                  = SY-MANDT
          DATE                    = pdate
          FOREIGN_AMOUNT          = p_amt1
          FOREIGN_CURRENCY        = p_curr1
          LOCAL_CURRENCY          = p_curr2
    *     RATE                    = 0
    *     TYPE_OF_RATE            = 'M'
    *     READ_TCURR              = 'X'
        IMPORTING
          EXCHANGE_RATE           = w_rate
          FOREIGN_FACTOR          = w_fact1
          LOCAL_AMOUNT            = w_amt
          LOCAL_FACTOR            = w_fact2
    *     EXCHANGE_RATEX          =
    *     FIXED_RATE              =
    *     DERIVED_RATE_TYPE       =
        EXCEPTIONS
          NO_RATE_FOUND           = 1
          OVERFLOW                = 2
          NO_FACTORS_FOUND        = 3
          NO_SPREAD_FOUND         = 4
          DERIVED_2_TIMES         = 5
          OTHERS                  = 6.
      IF SY-SUBRC <> 0.
        write: / 'Conversion to loc.curr. failed:',
                 p_curr1, '->', p_curr2, 'err.code=', sy-subrc.
      ELSE.
        write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',
               w_amt currency p_curr2, p_curr2,
               '(', w_rate, ')', w_fact1, w_fact2.
      ENDIF.
    http://www.geocities.com/victorav15/sapr3/examples/currconv.txt
    Check this
    CONVERSION_FACTOR_GET
    <b>Measurement unit conversion:</b> Get measurement unit conversion factor  Not for Dimensionless Units of Measure 
    UNIT_CONVERSION_SIMPLE  Measurement unit conversion by table T006, with rounding 
    UNIT_OF_MEASURE_SAP_TO_ISO 
    UNIT_OF_MEASURE_ISO_TO_SAP
    MATERIAL_UNIT_CONVERSION  Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa.  For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET.
    CONVERSION_EXIT_CUNIT_INPUT  Conversion exit for commercial (3-char) measurement unit INPUT 
    CONVERSION_EXIT_CUNIT_OUTPUT  Conversion exit for commercial (3-char) measurement unit OUTPUT 
    CONVERSION_EXIT_LUNIT_INPUT  Conversion exit for technical (6-char) measurement unit INPUT 
    CONVERSION_EXIT_LUNIT_OUTPUT  Conversion exit for technical (6-char) measurement unit OUTPUT 
    UNIT_OF_MEASUREMENT_HELP  Input help for measurement units of a predefined dimension 
    http://www.geocities.com/victorav15/sapr3/abapfun.html

  • F4 help for function module

    Hi experts
    Is it possible to place F4 help for the function module import parameter like If we excute the FM from se37 the input box should need the F4 help.
    if possible , let me know the sample code
    thanks
    sai

    yes you can do that..
    in side the source code ..
    write the select statement according to requirement and pass the internal table to below function moduel and return field to yor help field..
    call the below  fm inside the function module..
    'POPUP_WITH_TABLE_DISPLAY'   or   'REUSE_ALV_POPUP_TO_SELECT'
    see the sample code...
    FUNCTION Z_MFG_PLANTS_F4 .
    "*"Local Interface:
    "  IMPORTING
    "     REFERENCE(W_WERKS) TYPE WERKS OPTIONAL
    "  IMPORTING
    "      REFERENCE(W_MATNR)    TYPE MANTR OPTIONAL
    * Alv popup display
    DATA : gc_selfield     TYPE slis_selfield,
           gt_fieldcat_drd TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    p_werks = W_WERKS.
    data : begin of t_marc occurs 0,
                werks type werks,
                matnr type matnr,
            end of t_marc
    select matnr werks from marc into table t_marc where werks = p_werks.
      IF t_disp[] IS NOT INITIAL.
      gt_fieldcat_drd-seltext_m = 'Material'.
      gt_fieldcat_drd-fieldname = 'MATNR'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
      gt_fieldcat_drd-seltext_m = 'WERKS'.
      gt_fieldcat_drd-fieldname = ''WERKS'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
    * Allow the user to select the required plant
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
          i_title               = 'Material Selection for Plant'
          i_selection           = 'X'
          i_screen_start_column = 5
          i_screen_start_line   = 5
          i_screen_end_column   = 70
          i_screen_end_line     = 20
          i_tabname             = 'T_MARC'
          it_fieldcat           = gt_fieldcat_drd[]
        IMPORTING
          es_selfield           = gc_selfield
        TABLES
          t_outtab              = t_MARC
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
      IF sy-subrc <> 0.
      ENDIF.
      READ TABLE t_MARC INDEX gc_selfield-tabindex.
      IF sy-subrc = 0.
            w_matnr = t_matnr-matnr.
      ENDIF.
    ENDIF.
    ENDFUNCTION.
    Prabhudas
    Edited by: Prabhu Das on May 21, 2009 7:35 PM

  • Need Some help on Function Module

    Hello;
        Hello i want to put some data in BAPI's Function Module hard codedly..can anybody give some suggestion..
    Thanks and Regards,
         Omkar..
    Moderator message: please search for available information before asking, do not ask basic or generic questions, warning #4 (this is the last one from my side)
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    locked by: Thomas Zloch on Sep 28, 2010 9:53 AM

    hI!
    I mean coding like this in :
    IF fieldname = project definition
    select value  by     'F4IF_FIELD_VALUE_REQUEST'
    save it in global variable
    IF fieldname = 'DATE'.
    select dates with saved project definition and show values with HELP_VALUES_GET_WITH_TABLE
    but it no good solution.
    Another  way - create seach help with import export parameters and assign to tables fields.
    Look at example:
    REPORT  z_popup                               .
    DATA: BEGIN OF fields OCCURS 1.
            INCLUDE STRUCTURE sval.
    DATA: END OF fields.
    CLEAR fields.
    MOVE 'T001L' TO fields-tabname.
    MOVE 'WERKS' TO fields-fieldname.
    APPEND fields.
    CLEAR fields.
    MOVE 'T001L' TO fields-tabname.
    MOVE 'LGORT' TO fields-fieldname.
    APPEND fields.
    CALL FUNCTION 'POPUP_GET_VALUES_USER_HELP'
      EXPORTING
        popup_title = 'test'
      TABLES
        fields      = fields.
    it works as you need it.

  • ABAP Programing help regarding function modules coding

    Hi,
    i'm currently creating a function module that retrieve a number from a table and add one to it and return back the value to the table.
    the codes are as follow:
    FUNCTION ZFM_NUMBER
    " * " Local Interface:
    " EXPORTING
    "      VALUE (ZZNUMBER) TYPE ZNUMBER
    "      VALUE (ZENUMBER) TYPE ZNUMBER
    SELECT ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    END SELECT.
    ZENUMBER = ZZNUMBER + 1.
    UPDATE ZTAB_NUM SET ZNUMBER = ZENUMBER WHERE ZNUMBER = ZZNUMBER.
    END FUNCTION.
    this function module works finely, but now i need to concatenate the number with the year to store it into another table.
    i know something about the sysdatum where i select only the first 4 characters...but i'm not sure how could i do that?
    do i need to create another function module to call the above function module and concatenate it with the year?
    or i just need to continue the codes in the same function module?
    and how should i code it?
    i'm very new to abap coding and i could'nt get help from anyone in my team. your help is very much appreciated!!!
    Thanks,
    leesyy

    hi you can do it in the same function module.
    SELECT ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    END SELECT.
    instead of the above statement use the following statement, it improves performance of your program
    SELECT single ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    in the above statement you can also specify some where condition
    ZENUMBER = ZZNUMBER + 1.
    UPDATE ZTAB_NUM SET ZNUMBER = ZENUMBER WHERE ZNUMBER = ZZNUMBER.
    data: var_date type sy-datum,
          var_yyyy(4) type c,
          var_numyear(10) type c.                   
    var_date = sy-datum.
    var_yyyy = var_date+0(4).
    concatenate ZENUMBER var_yyyy into var_numyear.
    UPDATE ZTAB_NUMyear SET ZNUMyear = var_numyear WHERE ZNUMBER = ZZNUMBER.
    Regards
    Sajid
    Edited by: shaik sajid on Jan 14, 2010 5:08 AM
    Edited by: shaik sajid on Jan 14, 2010 5:09 AM

  • Dynpro field: value help via function module

    Hi all!
    I've got a subscreen with an input field. We would like to use function module RH_OBJID_REQUEST_46A to create a popup where the user is able to select values.
    In a normal report I would do this with AT SELECTION-SCREEN ON VALUE-REQUEST FOR. I wonder how it to do it in a dynpro? Is it neccessary to implement a search help and call the function module in a search exit?
    Thank you a lot!
    Florian

    hi
    in the Dypro screen , goto flow logic.
    Process Before output
    Process After input
    Process on value request.
    field vbeln module mycode_vbeln. "in this module  mycode_vbeln, u will write ur code
    Kind Regards
    Sajid

  • Need Help with Function Module or BAPI for Stock Requirements & PIRs

    Hello,
             I am working on making changes to a Report which should be displaying the PIR (Planned Independant Requirements) Quantities as well as Stock Requirements for SOs & STOs for below Type of Materials for the Given Date.
    1. Planning Materials
    2. Planned SKUs (that is Materials which do not have a Planning Material attached to them).
            In the Current Logic, we are using an FM REQUIREMENTS_ALLOCATION which fetches the Requirements only for the Planning Materials. It does not work for Planned SKUs.
    So, is there any Function Module / BAPI which serves this Purpose for both types of Materisls?
       Also, I've managed to Find out two Function Modules which I thought might be useful but still need confirmation regarding the same.
    MD_STOCK_REQUIREMENTS_LIST_API and
    BAPI_MATERIAL_MRP_LIST
            Please suggest any other FM if available for this Requirement.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

    Basically, here is what my scenario is. I have two Types of Materials which have a Planning Material attached to it. and the Other Category is that it doesn't have a Planning Material attached to it. So, we call it a Planned SKU. That is a Material planned at the SKU level.
              Now, the Issue is , the Function Module REQUIREMENTS_ALLOCATION doesn't work for the Plannd SKUs but it only works for the Planning Material. Now, based on this Function Module, we are populating the Data for the Planning Materials of Material Type ZPLN. Similarly, is there any we can make this FM work for a Material which is planning at its own Level.
              Please help me in this Regard.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • Help standard function module

    Hello,
    In the java programs can I calls standard function module(no bapi, no rfc).
    Can I have an example?
    Thanks
    Giorgio

    Giorgio,
    standard BAPIs or standard function modules cannot be called if they aren't RFC. You need to create another version of BAPI or module (as RFC) or extend them.
    Best regards,
    Vito

  • I couldn find it in forum.Plz help on function module

    which is the function module to update data to tables of different system dynamically.
    Moderator message : Vague question, show the work you have already done.  Thread locked.
    Edited by: Vinod Kumar on Feb 1, 2012 2:58 PM

    Hello,
    This is a generic question please explain the requirement.
    You'll have to code your Function Module call this FM in your report Prg, and schedule the Prg.
    Regards,
    Abhishek

  • Help on Function Module - 'MS_EXCEL_OLE_STANDARD_DAT'

    Hi All,
        I am using the function module '<b>MS_EXCEL_OLE_STANDARD_DAT</b>' in my program to download the file.The file is opening immediately after downloading itself. Please tell me as how i can suppress this display of file.
    P.N: I am downloading this file to the Presentation Server.

    Hi
    Use GUI_DOWNLOAD instead of this
    so that it won't open immediately as this fun module
    MS_EXCEL_OLE_STANDARD_DAT
    there is no control parameter (like - No_DIALOG = 'X') for this fun module
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Help on Function module in Generic Extraction

    Hi ,
    i am writing FM in for Generic Extraction.
    i am dont know ABAP.
    i am using RSAX_BW_GET_DATA_SIMPLE..
    i created Strcture  from the MVER table  ..
    Strcture fileds : MATNR
                           GJAHR
                           GSV01,
                           GSV02,
                           SUM.
    SUM is not in the MVER table .
    Pl . give me code for this logic ..
    Logic :
    Take  sum of  GSV01 , GSV02 from table MVER with the key
                       MVER-MATNR = MARA- MATNR and
                       MVER-GJAHR = Year from SY-DATUM.
    Pl . give me code for this logic..
    i assign points ..
    Regards,
    PSR
    Edited by: PSR on Feb 19, 2008 11:08 AM

    Hi Diego Lombardini ,
    thanks for fast reply..
    i  retrieve fields from 6 tables , thats why i choose function module but
    my main logic mention above  .
    i created view but it gives wrong values bcoz  lot of  joins .
    so i decide FM is better option ..
    Pl . provide code for this logic ..
    Regards,
    PSR

Maybe you are looking for