Doubt in function module...Urgent!!

hii all
     I want to find the difference between sy-datum and BLDAT and have to get only the days value...
for eg...
    sydatum(28.11.2007) - bldat(24.11.2007)= Days(4)
4 must the result... so i used the function module C14B_DIFF_BT_2_DATES..
but im unable to get the result...
my code is.....
*& Report  ZAGE1
REPORT  ZAGE1.
type-pools : slis,icon.
tables : bsid,kna1,knvv.
data : d_fieldcat type slis_t_fieldcat_alv,
       d_fieldcat_wa type slis_fieldcat_alv.
data : begin of itab_bsid occurs 0,
       kunnr like bsid-kunnr,
       bukrs like bsid-bukrs,
       bldat like bsid-bldat,
       waers like bsid-waers,
       belnr like bsid-belnr,
       end of itab_bsid.
data : begin of itab_kna1 occurs 0,
       kunnr like kna1-kunnr,
       end of itab_kna1.
data : begin of itab_knvv occurs 0,
       kunnr like knvv-kunnr,
       zterm like knvv-zterm,
       end of itab_knvv.
data : begin of itab_key occurs 0,
        kunnr like bsid-kunnr,
       bukrs like bsid-bukrs,
       bldat like bsid-bldat,
       waers like bsid-waers,
       belnr like bsid-belnr,
       zterm like knvv-zterm,
       due type i,
       end of itab_key.
selection-screen : begin of block blk1 with frame title text-001.
parameters : p_cc like bsid-bukrs.
selection-screen : end of block blk1.
select distinct kunnr bukrs bldat waers belnr from bsid into corresponding fields of table itab_bsid where bukrs = p_cc.
if not itab_bsid[] is initial.
select kunnr from kna1 into corresponding fields of table itab_kna1 for all entries in itab_bsid where kunnr = itab_bsid-kunnr.
if not itab_kna1[] is initial.
select kunnr zterm from knvv into corresponding fields of table itab_knvv for all entries in itab_kna1 where kunnr = itab_kna1-kunnr.
endif.
endif.
     loop at itab_bsid.
     itab_key-kunnr = itab_bsid-kunnr.
     itab_key-bukrs = itab_bsid-bukrs.
     itab_key-bldat = itab_bsid-bldat.
     itab_key-waers = itab_bsid-waers.
     itab_key-belnr = itab_bsid-belnr.
     append itab_key.
     clear itab_key.
     endloop.
     sort itab_key by kunnr.
     loop at itab_key.
     read table itab_knvv with key kunnr = itab_key-kunnr.
     if sy-subrc = 0.
     itab_key-zterm = itab_knvv-zterm.
     modify itab_key transporting zterm.
     endif.
     endloop.
    d_fieldcat_wa-fieldname = 'KUNNR'.
    d_fieldcat_wa-seltext_l = 'CUSTOMER'.
    d_fieldcat_wa-col_pos = 1.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
     d_fieldcat_wa-fieldname = 'BUKRS'.
    d_fieldcat_wa-seltext_l = 'COMPANY CODE'.
    d_fieldcat_wa-col_pos = 2.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
     d_fieldcat_wa-fieldname = 'WAERS'.
    d_fieldcat_wa-seltext_l = 'CURRENCY'.
    d_fieldcat_wa-col_pos = 3.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
     d_fieldcat_wa-fieldname = 'BLDAT'.
    d_fieldcat_wa-seltext_l = 'DOCUMENT DATE'.
    d_fieldcat_wa-col_pos = 4.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
     d_fieldcat_wa-fieldname = 'BELNR'.
    d_fieldcat_wa-seltext_l = 'DOCUMENT NO'.
    d_fieldcat_wa-col_pos = 5.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
     d_fieldcat_wa-fieldname = 'ZTERM'.
    d_fieldcat_wa-seltext_l = 'PAYMENT TERMS'.
    d_fieldcat_wa-col_pos = 6.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
*data : due type i.
loop at itab_key.
   CALL FUNCTION 'C14B_DIFF_BT_2_DATES'
     EXPORTING
       I_DATE_FROM                     = itab_key-bldat
       I_DATE_TO                       = sy-datum
    IMPORTING
      E_DAYS                          = itab_key-due
     E_MONTHS                        = months
    E_YEARS                         = years
   EXCEPTIONS
     PLAUSIBILITY_CHECK_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.
append itab_key.
endloop.
    d_fieldcat_wa-fieldname = 'DUE'.
    d_fieldcat_wa-seltext_l = 'DUE DATE'.
    d_fieldcat_wa-col_pos = 7.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    data : gd_repid like sy-repid.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = gd_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = d_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = itab_key[]
    EXCEPTIONS
      PROGRAM_ERROR                     = 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.
Urgent plz help me....!!
Regards
Asha

Check the following code for subtract years/months/date from particular date:
DATA: EDAYS LIKE VTBBEWE-ATAGE,
EMONTHS LIKE VTBBEWE-ATAGE,
EYEARS LIKE VTBBEWE-ATAGE.
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.
WRITE:/ 'Difference in Days ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years ', EYEARS.
INITIALIZATION.
FROMDATE = SY-DATUM - 60.
For difference between two dates.
data : date1 like sy-datum,
date2 like sy-datum,
diff(10 ) type c.
date1 = '20071003'.
date2 = '20071104' .
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
I_DATUM_BIS = date1
I_DATUM_VON = date2
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = diff
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 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 .

Similar Messages

  • Doubt in function module relating to delta upload

    Hi,
        Is there any ABAPer alive around who can tell me how i can write a funtion module to update data to BW side.
    They only tell me data is not going to BW side. Can anyone throw light as to how function module should be structured. I  have a function module that works very finely for full update mode in RSA3. What should be done in my function module for delta update mode to work on BW side?????
    <h1> THIS IS CRITICAL </h1>
    Regards,
    Prakash.K

    Critical?  Why?  Should I respond faster because you've a problem that's urgent for you?
    Does full extraction work when you run the extraction from BW?  Extraction only stops when you return an empty package.  Hence, RSA3 won't tell you if you've made this mistake. RSA3 will work fine, but the extraction will never end when run from BW.  I refer you to this discussion I had earlier. [Re: Transport Organ9izer]  I'll emphasise one important point: Also SAP supply RSAX_BIW_GET_DATA_SIMPLE as an example of how to write FM extractors 
    If your FM is actually working with full, then to get your function module to work as a delta load, you need to be able to determine which data records have changed with since the last extraction, and only send those.  How you do this depends very much on the data.  You'll also have to define the datasource as Generic.
    matt

  • Doubt in function module BAL_DSP_LOG_DISPLAY

    Hai, guys,
    i have doubt in the function module BAL_DSP_LOG_DISPLAY.
    actually after executing the functin module bapi_acc_document_post, how to pass bapi return table to this function module bal_dsp_log_display.
    if any one know means please tell me with sample coding.
    thanks in advance.
    From Elamaran.

    Hi Elamaran!
    Did you try to use SE37 with this module and use "Where-Used List" (CTRL + SHIFT + F3)? This should give you enough examples to look through.
    Best regards
    Wolfgang
    Message was edited by: Ralf Wolfgang Geithner

  • Doubt About Function Module

    Hi Experts,
    I want one function module which wil allows us to attach a attachment to the material in the SAP PLM System.
    Please clear my doubt . Why Because i got strucked here in this issue of selecting a right Function Module.
    Please clear my doubt. Helpful ANswers wil be Reward.
    Regards
    Khanna

    Hi khanna,
    try this MATERIAL_MAINT_DIAL_GET_DOC Functional Module for attachment in Material Master,
    In DIR try this CV110_DOC_ASSIGN_FILE,
    Regards
    Rehman

  • Function Modules - Urgent

    Hi,
    I need to create a Function Module where this FM should send a document as attachment to the internet mail id , example [email protected]
    Please help me out.
    Thanks,
    Pavan.

    Hi,
    Will a prog. be fine for sending a mail to xternal mail id??
    Mail with attachments: SO_NEW_DOCUMENT_ATT_SEND_API1
    Mail without attachments: SO_NEW_DOCUMENT_SEND_API1
    For Understanding the Function Module
    SO_OBJECT_Send:
    http://www.thespot4sap.com/articles/SAP_Mail_Understanding_SO_Object_Send.asp
    Try this:
    REPORT  zsendemail                    .
    PARAMETERS: psubject(40) type c default  'Testing',
                p_email(40)   type c default '[email protected]'.
    data:   it_packing_list like sopcklsti1 occurs 0 with header line,
            it_contents like solisti1 occurs 0 with header line,
            it_receivers like somlreci1 occurs 0 with header line,
            it_attachment like solisti1 occurs 0 with header line,
            gd_cnt type i,
            gd_sent_all(1) type c,
            gd_doc_data like sodocchgi1,
            gd_error type sy-subrc.
    data:   it_message type standard table of SOLISTI1 initial size 0
                    with header line.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Perform populate_message_table.
    *Send email message, although is not sent from SAP until mail send
    *program has been executed(rsconn01)
    PERFORM send_email_message.
    *Instructs mail send program for SAPCONNECT to send email(rsconn01)
    perform initiate_mail_execute_program.
    *&      Form  POPULATE_MESSAGE_TABLE
    *       Adds text to email text table
    form populate_message_table.
      Append 'Line1' to it_message.
      Append 'Line2' to it_message.
      Append 'Line3' to it_message.
      Append 'Test- 1' to it_message.
    endform.                    " POPULATE_MESSAGE_TABLE
    *&      Form  SEND_EMAIL_MESSAGE
    *       Send email message
    form send_email_message.
    * Fill the document data.
      gd_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      gd_doc_data-obj_langu = sy-langu.
      gd_doc_data-obj_name  = 'SAPRPT'.
      gd_doc_data-obj_descr = psubject.
      gd_doc_data-sensitivty = 'F'.
    * Describe the body of the message
    * Information about structure of data tables
      clear it_packing_list.
      refresh it_packing_list.
      it_packing_list-transf_bin = space.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      describe table it_message lines it_packing_list-body_num.
      it_packing_list-doc_type = 'RAW'.
      append it_packing_list.
    * Add the recipients email address
      clear it_receivers.
      refresh it_receivers.
      it_receivers-receiver = p_email.
      it_receivers-rec_type = 'U'.
      append it_receivers.
    * Call the FM to post the message to SAPMAIL
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_txt               = it_message
                receivers                  = it_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    * Store function module return code
      gd_error = sy-subrc.
    * Get it_receivers return code
      loop at it_receivers.
      endloop.
    endform.                    " SEND_EMAIL_MESSAGE
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *       Instructs mail send program for SAPCONNECT to send email.
    form initiate_mail_execute_program.
      wait up to 2 seconds.
      if gd_error eq 0.
          submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
      endif.
    endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    Regards,
    Anjali

  • Problem in Logical Databse Call via Function Module - Urgent

    Hi Experts,
    To use the Logical Database(LDB) in the function module(Custom) I am using the function module - LDB_PROCESS. But I didn't get any output. I am attaching the code. Please Help me in this.
    DATA : W_LDBNAME LIKE TRDIR-LDBNAME.
    DATA : IT_CALLBACK LIKE TABLE OF LDBCB WITH HEADER LINE,
           IT_SELECTIONS LIKE TABLE OF RSPARAMS WITH HEADER LINE,
           IT_PERNR TYPE TABLE OF PERNR WITH HEADER LINE.
    MOVE 'PNP' TO W_LDBNAME.
    IT_CALLBACK-LDBNODE = 'PERNR'.
    IT_CALLBACK-GET     = 'X'.
    IT_CALLBACK-CB_PROG = SY-CPROG.
    IT_CALLBACK-CB_FORM = 'CALLBACK_PERNR'.
    APPEND IT_CALLBACK.
    CLEAR IT_CALLBACK.
    IT_SELECTIONS-KIND    = 'S'.
    IT_SELECTIONS-SELNAME = 'PNPPERNR'.
    IT_SELECTIONS-SIGN    = 'I'.
    IT_SELECTIONS-OPTION   = 'EQ'.
    IT_SELECTIONS-LOW      = '100178'.
    APPEND IT_SELECTIONS.
    CLEAR IT_SELECTIONS.
    CALL FUNCTION 'LDB_PROCESS'
    EXPORTING
        LDBNAME                    = W_LDBNAME
      VARIANT                    =
      EXPRESSIONS                =
      FIELD_SELECTION            =
      DYN_NODE_TYPES             =
    TABLES
        CALLBACK                   = IT_CALLBACK
       SELECTIONS                 = IT_SELECTIONS
    EXCEPTIONS
       LDB_NOT_REENTRANT           = 1
       LDB_INCORRECT               = 2
       LDB_ALREADY_RUNNING         = 3
       LDB_ERROR                   = 4
       LDB_SELECTIONS_ERROR        = 5
       LDB_SELECTIONS_NOT_ACCEPTED = 6
       VARIANT_NOT_EXISTENT        = 7
       VARIANT_OBSOLETE            = 8
       VARIANT_ERROR               = 9
       FREE_SELECTIONS_ERROR       = 10
       CALLBACK_NO_EVENT           = 11
       CALLBACK_NODE_DUPLICATE     = 12
       CALLBACK_NO_PROGRAM         = 13
       CALLBACK_NO_CBFORM          = 14
       DYN_NODE_NO_TYPE            = 15
       DYN_NODE_INVALID_TYPE       = 16
       OTHERS                      = 17.
    IF SY-SUBRC <> 0.
      MESSAGE I039(ZABA) WITH  SY-SUBRC.
    ENDIF.
    LOOP AT IT_PERNR.
      message i039(zaba) with 'Inside loop'.
      WRITE : / IT_PERNR-PERNR, IT_PERNR-BUKRS.
    ENDLOOP.
    *&      Form  CALLBACK_PERNR
          text
         -->L_LDBNAME     text
         -->L_IT_PAYROLL  text
         -->TYPE          text
         -->PAY99_REULT   text
         -->L_EVT         text
         -->L_CHK         text
    FORM CALLBACK_PERNR USING  L_LDBNAME LIKE TRDIR-LDBNAME
                               L_IT_PERNR LIKE PERNR
                               L_EVT type C
                               L_CHK type C.
      message i039(zaba) with 'Inside Callback'.
      WRITE : / L_IT_PERNR-PERNR,
                L_IT_PERNR-BUKRS.
      MOVE-CORRESPONDING L_IT_PERNR TO IT_PERNR.
      APPEND IT_PERNR.
      CLEAR IT_PERNR.
    ENDFORM.                    "CALLBACK_PERNR
    Thanks in advance
    Arul Jothi.

    Hi,
    I think Arul commented the 'it_selections' while trying out.. I couldn't get the fm work for PNP.. it worked fine with the FI LDBs.. just didn't seem to like the PNP..
    Regards,
    Suresh Datti

  • Need code for a function module- Urgent

    Hi friends,
    I have a requirement where I am giving material description as an import parameter in the function module. ( Material description could be a wild search -- say - Mat* ) I want a sub routine in the function module which should get all the materials from the database ( mara or makt..not sure ) for the user entered Material description.
    I want this particular code to be written using a sub-routine using formal parameters inside this fm . Could any one send me the code for this.
    Thanks in advance,
    Vishnu.

    Hi Vishvanath,,
    Please find the below code.
    DATA : BEGIN OF itab OCCURS 0,
           matnr LIKE makt-MATNR,
           MAKTX LIKE makt-MAKTX,
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
           matnr LIKE makt-MATNR,
           MAKTX LIKE makt-MAKTX,
           END OF itab1.
    data : a(5) type c value 'TEST'.
    perform mat_no using a.
    form mat_no  using    p_a.
    data : lv_temp(4) type c.
    select matnr maktx from makt into table itab.
    loop at itab.
    lv_temp = itab-maktx+0(4).
    if lv_temp = p_a.
      move itab to itab1.
      APPEND ITAB1.
    endif.
    endloop.
    loop at itab1.
    write :/ itab1.
    endloop.
    endform.                    " mat_no
    Thanks.
    Amjad.

  • Doubt on function module

    in function module how to export all the fields in a table ..
    i.e. i am giving these fields..
    in
    IMPORT
    P_EBELN LIKE EKKO-EBELN
    IN
    EXPORT
    BUKRS LIKE EKKO-BUKRS
    and in source code
    SELSCT SINGLE BUKRS INTO BUKRS
    WHERE EBELN = EBELN.
    and i am getting for one record
    but if  i want to export more than one columns
    how to code it in source code.
    and what is the use of  TABLES in FM
    AND HOW TO EXPORT  full table columns ?
    and how to code it ...
    plz help me .......

    Hi
    See the doc on fun modules and create accordingly
    Function Modules;
    Check this matter.
    Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
    You can create them from TCode SE37.
    Go through the following doc:
    Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
    Function Module Interfaces
    The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
    Syntax
    ... [IMPORTING parameters]
    [EXPORTING parameters]
    [CHANGING parameters]
    [TABLES table_parameters]
    [{RAISING|EXCEPTIONS} exc1 exc2 ...]
    The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
    Interface parameters
    The interface parameters are defined on the relevant tab pages in the Function Builder.
    IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
    EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
    CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
    TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
    Exceptions
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    Note
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    RFC is a technology which is used to access a functions (Modules) from
    the remote systems.
    If a function module is set as remote enabled which can be access from
    the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
    A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
    But Normal function modules can not accessd from the remote system.
    Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
    Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
    CALLING A FUNCTION MODULE:
    1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
    --> Write the Corresponding FM name --> Hit Enter
    2)The appropriate import ,export Parameters will be displayed in ur editor
    3)Pass the Values Here.
    Also check these links.
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    See the following links:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Doubt In Function module : Write_Form_Lines in Sap Scripts

    Friends,
      I wanted to know for what purpose the funtion module Write_Form_Lines is used in SAP SCRIPTS.
    Regards
    Yamini

    From SAP documentation:
    The function module outputs the text lines in table LINES into the specified form window. The text lines must have the SAPscript ITF format. From the data in the text header, the system uses only the field TDSTYLE to apply the formatting attributes defined in the specified style for this text. If the field is empty, the system uses the identically named formatting attributes (character and paragraph formats) of the form.
    Use parameter WINDOW to specify into which of the windows defined in the form you want to output the text. You can specify any window used in the form. The parameter FUNCTION determines how to merge the text lines to be output with any existing contents in the window. There are differences between the different window types or areas.
    Prabhu Rajesh.

  • USE of Function module-- urgent

    hi,
    can any one explain the use of "OPEN_FI_PERFORM_00002050_P "
    thnx

    hi,
    go to se37,
    and give fm name,
    display,
    and then u can see function module documentation.
    reward points if helpful.

  • Function module - Urgent

    Hi Friends,
    I have a statement as below in one function module :
          SELECT a~matnr
            INTO TABLE t_mast
            FROM mast AS a
           INNER JOIN stko AS k
              ON astlnr EQ kstlnr
             AND astlal EQ kstlal
           WHERE a~werks eq plant
             AND a~stlal eq alt
             AND k~datuv EQ date .
    Import parameters are : Plant , Alt and Date.
    Here the problem is while I am executing the f/m it is giving the correct values only if input all the input parameters Plant,Alt and Date.If I give Plant and Alt as blank then it is not giving any values from the table.
    Could you please telme the resolution for this.
    Regards,
    Vishnu.
    If I am not

    You can overcome from this problem by using the RANGES.
    Like:
    ranges: r_alt for mast-stlal,
            r_date for stko-datuv,
            r_plant for mast-werks.
    if not alt is initial.       
    r_alt-sign = 'I'.
    r_alt-option = 'EQ'.
    r_alt-low = alt.
    append r_alt.       
    endif.
    if not date is initial.       
    r_date-sign = 'I'.
    r_date-option = 'EQ'.
    r_date-low = date.
    append r_date.       
    endif.
    if not plant is initial.       
    r_plant-sign = 'I'.
    r_plant-option = 'EQ'.
    r_plant-low = plant.
    append r_plant.
    endif.
    SELECT a~matnr
    INTO TABLE t_mast
    FROM mast AS a
    INNER JOIN stko AS k
    ON a~stlnr EQ k~stlnr
    AND a~stlal EQ k~stlal
    WHERE a~werks in r_plant
    AND a~stlal in r_alt
    AND k~datuv in r_date.
    Regards,
    Naimesh Patel

  • Doubt on Function Modules

    Hi Experts,
          I am creating one user defind function module. When i am giving table parameters,
    For example
    git_out like vbak
    it shows the error tables are obsolete..
    Please can any one tell me whats that error and any one tell me how to do that one..
           Thanks in Advance
    Thanks and Regards
    Srihari.

    Hi,
    As suggsted you need to move the parameter to CHANGING parameters.
    Since you are referenceing VBAK, but need a table, you need to refer the parameter to a table type.
    Hence in CHANGING parameter you put as so:
    git_out TYPE TAB_VBAK.
    After this, you would have to create a work area for the table in the code and always loop at the git_out into this work area for all operations.
    The work area should have type VBAK.
    Also, when calling the FM from program, you need to pass the body of the internal table to this parameter, i.e. if internal table is it_vbak, then you need to pass it_vbak[].
    Regards,
    Aditya
    Edited by: Aditya Laud on Feb 5, 2008 6:50 AM

  • ABOUT FUNCTION MODULE  (urgent)

    hi ,
    is any one know about below function module.
    CUST_ACCT_STMT_REQUEST_LITE
    we schedule customer account statement in th background.
    we want to add some functionality.
    if any one know anything then it will be appreciated.
    thans,
    jack

    Hi,
    I am giving the Function Modules list link, from there you can findout which is suitable for your application:
    http://sap-img.com/abap/function-list.htm
    Regards,
    Bhaskar

  • Deleted function module--urgent

    Hi all,
    By mistake i deleted a z* function module. From version management when i cannot get the function module back. when i press the retrieve button i got an error message saying " deleted function module cannot be recovered".
    So please help me in recovering the function module.
    Thanks in advance
    Regards
    Sree

    Hi Srinivas,
    I am checking old programs that are going to be copied to new upgrade version... one of them calls a FM that no longer exist, I guess that it was deleted...
    I am looking for a way to find a deleted FM (if it was deleted), I just have the FM name, but I don't have the function group.
    I guess that without it, it isn't possible to retrieve any old version, if there is one, is it?
    Maybe looking in a table? looking for any change request (by the way, my user do not have authorization for SE03).
    Regards.
    José Gabriel.

  • Re:Function modules: urgent

    Hi,
          Iam copying the standard function module, i have copied the function group also but the includes, subroutines are not getting copied, already my team created function group , the same function group name i gave, any one can help me in this issue
    Thanks in advance

    Hi
      Go to se84 Tcode in the left side pane select Program Library and in that select Function Groups, then in the right side pane give ur Function group name and execute, then click the check box of ur function group name and in the menu select Function Groups - Copy and then give the new Function Group name which should with either Z or Y, then it will ask u whether to copy the Function modules or not, click on ok. The Function Modules belong to that Function Group gets copied into ur new Function Group.
    Regards
    Haritha.

Maybe you are looking for

  • Power Mac Dual 2.5 G5 won't start up!

    Downloaded Mac OS X Server 10.4.8 Build 8L117 {Power PC} for testing purposes and the installer upgraded my system. Upon restart, I get the progress bar loading all the way but then just stops and does nothing - won't go to the login window. I have n

  • Error message: When trying to run iTunes

    I've just installed iTunes and I'm trying to run it, but every time i 'Agree' to the iTunes Software Liscence Agreement, I get an error that states, "The folder "iTunes" cannot be found or created, and is required. The default location for this folde

  • Error ITMS 9000 Fragment Identifier

    Hello, I was trying to add the required sample to my iBook file and reupload it to the itunes store, however, after add my sample, I tried to redeliver it and received an error. ITMS-9000: "OPS/content1.xhtml(3): 'anchor-3': fragment identifier is no

  • BTHub Boosting

    Hello, I live in part of an annex house setup, and the signal doesn't reach into the "barn", we have 2 lines going into the property, at the same section, one has become far too expensive, so we're dropping it and sticking with BT. Previous setup: Th

  • Adobe AIR and Adobe´s About Flash -site?

    I encountered a strange thing while checking if I have the latest version of Adobe Flash installed. When I go to About Flash page (http://www.adobe.com/software/flash/about/) I instantly get the following notification on separate window: "Adobe AIR S