Urgent:SELECT_OPTIONS_RESTRICT function module

I have to use declare the PO number,IDoc Number,Invoice number in the selection screen and the criteria is it must be Multiple single values and Optional so i can use this FM.How should i declare?

Hema,
***SELECTION-SCREEN----
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:     p_bukrs LIKE zap_clearing_hst-planning_plant OBLIGATORY
                        DEFAULT '1000',
                p_spart LIKE knvv-spart OBLIGATORY DEFAULT '02'.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_kund1 FOR zvdevice_history-kund1
                MATCHCODE OBJECT zkunnr_ccn2006 NO INTERVALS,
                s_bzirk FOR zvdevice_history-bzirk NO INTERVALS.
SELECT-OPTIONS: p_equnr FOR zvdevice_history-equnr.
SELECTION-SCREEN: END OF BLOCK b2.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS:     p_delim TYPE c DEFAULT c_comma OBLIGATORY,
                p_path  LIKE rlgrap-filename
                         DEFAULT '/data/sapdata/PORTFOLIO/' OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b3.
INITIALIZATION.
  PERFORM restrict_input_parameter.
Define the object to be passed to the RESTRICTION parameter
  DATA restrict TYPE sscr_restrict.
Auxiliary objects for filling RESTRICT
  DATA : optlist TYPE sscr_opt_list,
             *** TYPE sscr_***.
Restricting the MATNR selection to only EQ.
  optlist-name = 'OBJECTKEY1'.
  optlist-options-eq = 'X'.
  APPEND optlist TO restrict-opt_list_tab.
  ***-kind = 'S'.
  ***-name = 'S_KUND1'.
  ***-sg_main = 'I'.
  ***-sg_addy = space.
  ***-op_main = 'OBJECTKEY1'.
  APPEND *** TO restrict-***_tab.
Restricting the WERKS selection to CP, GE, LT, NE.
  optlist-name = 'OBJECTKEY2'.
  optlist-options-eq = 'X'.
  APPEND optlist TO restrict-opt_list_tab.
  ***-kind = 'S'.
  ***-name = 'S_BZIRK'.
  ***-sg_main = 'I'.
  ***-sg_addy = space.
  ***-op_main = 'OBJECTKEY2'.
  APPEND *** TO restrict-***_tab.
  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
       EXPORTING
            restriction = restrict.
Don't forget to reward if useful...

Similar Messages

  • Very Urgent Please function module FAGL_GET_TT_DATA_LEAD  Enhancement

    Hi Guys,
    I want to enhance the function module FAGL_GET_TT_DATA_LEAD (that gets the data from FAGLFLEXT) to read the FAGLFLEXA table.Can any one get me an idea on how to enhance it ....
    If possible please send me brief code steps aswell ...
    Thanks in adnvace

    hi Harish,
      One thing you can do is copy the function module into Z-function module and try to incorporate the custom code and replace the standard function module with custom function module in your program.
    Hope it helps...

  • Urgent: creation function module for chvw table

    hi,
    I want to make Function Module for the fields in which i have to display the production order and batch numbers.plzz tell me how to create for it.

    Hi Everybody,
    About how to use this function Does anyone have an idea?
    I've found it.
    call function 'FI_DOCUMENT_READ'
    exporting
       i_awtyp = 'VBRK'
       i_awref = vbfa_tab-vbeln
       i_awsys = vbrk-logsys
       i_bukrs = vbrk-bukrs
       i_gjahr = vbrk-gjahr
    tables
       t_bkpf = xbkpf
       t_bseg = xbseg
    exceptions
    wrong_input = 1
    not_found = 2.
    But this is not enough.
    Best Regards Rasim.

  • Urgent: want function module to translate text into russian language

    Hello All,
    My requirement is that, field is fetched from std. table. This fiels of data type string, i.e., it contains text. I want to translate this text into russian language before displaying this in output. For otr text, i used se63 to translate. But, this text is not otr, it is dynamically fetched from diff. std. tables. So, se63 is not working here.
    Please help me as its very urgent.
    Useful answers will be rewarded.
    Thanks and regards,
    Ashlesha Desai

    Hi
    I don't know if there's an unique solution, you should try to open an OSS message
    All tables with description should have the language (usually field SPRAS) as key fields
    so u can try to read a record and create a new one but with the new language:
    select * from makt where spras = 'ZH'.
       makt-spras = 'E'.
       makt-maktx = ......
       insert makt.
    endselect.
    But it's better to analize the risk
    Max

  • Urgent: Problems in Generic Extraction by Function Module

    Hi BW Gurus,
    I am new to SDN and also new to generic extraction using function module. My requirement is to extract long text(142 char) from CRM to BW as the text is not stored in database table I used function module read_text with in another ZXXX function module copy of (RSAX_BIW_GET_DATA_SIMPLE). In my extract structure I used GUID(char,32), Langu, long text(142 char) and 2 placeholders. Text can be extracted by passing STXH table fields(Tdname, Tdid, Tdobject, Tdspars) to read_text as parameters and i also need to use CRMD_ORDERADM_H field GUID(32 char) to compare 1st 32 chars of tdname(70 char) with Guid to select Guids and loop thru this Guids and for each Guid i need to append lines of text to e_t_data but as i donot know ABAP i unable to write the code for this. Through my friends help i wrote code when i check in RSA3 it is displaying the text but when i replicate into BW and load into data target in monitor the status is red with records initially but afterwards it will be red status again with 0 from 0 records for initial load again.when i check on job logs the errors i have are:
    The background job has created a job log file of 2Gb size and it is currently on a infinite loop writing entries into the SAP System Log that it cannot write to the Job log file due to “Error 22 for write/read access to a file” this is because of the datasource i have created. Please find my Function module and if anyone would please correct FM and send me that will be really great.I appreciate it in advance.
    MY Function Module is:
    FUNCTION Z_CRMORDERH_STR_TXT.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SRSC_S_IF_SIMPLE-REQUNR
    *"     VALUE(I_DSOURCE) TYPE  SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *"     VALUE(I_READ_ONLY) TYPE  SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *"     VALUE(I_REMOTE_CALL) TYPE  SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
    *"  TABLES
    *"      I_T_SELECT TYPE  SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *"      E_T_DATA STRUCTURE  YCRM_TEXT_STR OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    ***"  EXCEPTIONS     NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
      Tables: CRMD_ORDERADM_H, STXH.
    Auxiliary Selection criteria structure
    data: l_s_select type srsc_s_select.
    Maximum number of lines for DB table
      Statics: s_s_if type srsc_s_if_simple,
    counter
             s_counter_datapakid like sy-tabix,
    Cursor
             s_cursor type cursor.
    data: i_crmtext type standard table of TLINE .
      types: begin of xsreph ,
              GUID type CRMD_ORDERADM_H-guid,
            end of xsreph.
       data: i_guid type standard table of xsreph.
      data: I_TEXT type STXH-TDNAME.
      data: xempl like  YCRM_TEXT_STR occurs 0 with header line.
      data: t_tab like dd03l-tabname.
    Select ranges
      ranges: l_r_guid for CRMD_ORDERADM_H-guid.
             l_r_connid  for sflight-connid.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      if i_initflag = sbiwa_c_flag_on.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    Check DataSource validity
        case i_dsource.
          when 'yCRM_TEXT'.  " for S_SREPH1
          when others.
            if 1 = 2. message e009(r3). endif.
    this is a typical log call. Please write every error message like this
            log_write 'E'                  "message type
                      'R3'                 "message class
                      '009'                "message number
                    i_dsource   "message variable 1
                      ' '.                 "message variable 2
            raise error_passed_to_mess_handler.
        endcase.
       append lines of i_t_select to s_s_if-t_select.
    Fill parameter buffer for data extraction calls
        s_s_if-requnr    = i_requnr.
        s_s_if-dsource = i_dsource.
        s_s_if-maxsize   = i_maxsize.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
       append lines of i_t_fields to s_s_if-t_fields.
    we will do our selection based on what is in the p table for the
    infoobject
      else.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    First data package -> OPEN CURSOR
        if s_counter_datapakid = 0.
    Fill range tables BW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
        LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'GUID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_GUID.
            APPEND L_R_GUID.
          ENDLOOP.
          case i_dsource.
            when 'YCRM_TEXT'.  " for S_SREPH1
              t_tab = 'CRMD_ORDERADM_H'.
          endcase.
          select GUID
          from (t_tab)
          into table i_guid where   PROCESS_TYPE = 'ZACI'  and ( OBJECT_ID < '0000000042').
         select tdname from stxh into i_text where tdobject = 'TEXT'.
         if sy-subrc ne 0.
           message e009(r3).
    this is a typical log call. Please write every error message like this
           log_write 'E'                  "message type
                     'R3'                 "message class
                     '009'                "message number
                     i_dsource   "message variable 1
                     'No master data found'.           "message variable 2
           raise error_passed_to_mess_handler.
         endif.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between DataSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
         open cursor with hold s_cursor for
         select (s_s_if-t_fields) from CRMD_ORDERADM_H
                                  where GUID in L_R_GUID .
                                   ENDIF.
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
       fetch next cursor s_cursor
                  appending corresponding fields
                  of table e_t_data
                  package size s_s_if-maxsize.
        IF SY-SUBRC <> 0.
         CLOSE CURSOR S_CURSOR.
         RAISE NO_MORE_DATA.
       ENDIF.
    as we are doing this only once can use the select statement.
    ***data: crmtext like tline occurs 0 with header line.
    **data: i_crmtext type standard table of TLINE.
    **data: i_guid type standard table of xsreph.
    data: l_guid type THEAD-TDNAME.
    data: st_guid type xsreph.
    data: st_crmtext type TLINE.
    data: lan type THEAD-TDSPRAS.
    lan = 'E'.
    loop at i_guid into st_guid.
    l_guid = st_guid-guid.
    CALL FUNCTION 'READ_TEXT'
       EXPORTING
       CLIENT                        = SY-MANDT
         ID                            = 'A002'
         LANGUAGE                      = lan
         NAME                          = l_guid
         OBJECT                        = 'CRM_ORDERH'
       ARCHIVE_HANDLE                = 0
       LOCAL_CAT                     = ' '
    IMPORTING
       HEADER                        =
       TABLES
         LINES                         = i_crmtext.
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
       WRONG_ACCESS_TO_ARCHIVE       = 7
       OTHERS                        = 8
    e_t_data-guid = l_guid.
    loop at i_crmtext into st_crmtext.
    move lan to e_t_data-langu.
    move st_crmtext-tdline to e_t_data-description.
    append e_t_data.
    endif.
    endloop.
    clear: st_guid,l_guid.
    refresh: i_crmtext.
    endloop.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
    endif.
    ENDFUNCTION.
    please Gurus as I donot know ABAP i appreciate if anyone would write a FM based on requirement and send me that will be really great this is my request. I gurantee of award points for good answers.
    Regards
    Kishore

    Hi,
    The statement <b>RAISE NO_MORE_DATA</b> should be active (uncommented) in your code. Otherwise, the infinte loop occurs.
    See also, the Siggi's blog:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    BTW, was it your thread here:
    Re: Urgent: problems in extracting Long Text
    Best regards,
    Eugene

  • Very urgent help needed in activating a function module

    Hello experts.
    I had a standard report and i copied into an z report. i need to change some field output , and that field is there in a standard function module.so i copied that fun module  into z fun module and stored in a new fun group. Now it is showing the error in the z fun module. include in the fun module is giving the error stating that it is not existing. please help me in coping the standard fun module correctly . please its very urgent.

    Hi,
    You should not copy a Function module alone, as it will have some dependant INLCUDES and global data in TOP include of the function group.
    SO if you want the function module copy the entire Function Group into Z function group.
    Regards,
    Sesh

  • Urgent: Problems in Generic Deltas by Function Module

    Hi BW Experts,
    My requirement is to extract text from CRM to BW using Zfunction module, copy of RSAX_BIW_GET_SIMPLE_DATA
    which works fine for full loads but the problem arises only when i go for generic deltas. My code in FM for Deltas is:
    LOOP AT s_s_if-t_select INTO l_s_select.
    CASE l_s_select-fieldnm.
    WHEN 'ZDATE'.
    s_date_from = l_s_select-low.
    s_date_to = l_s_select-high.
    WHEN OTHERS.
    ENDCASE.
    ENDLOOP.
    IF s_date_from IS INITIAL.
    s_date_from = '20060401'.
    ENDIF.
    IF s_date_to IS INITIAL.
    s_date_to = '99991231'.
    ENDIF.
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT * FROM STXH
    WHERE TDOBJECT = 'CRM_ORDERH'
    AND TDID = 'A002'
    AND TDSPRAS = sy-langu
    and TDLDATE between s_date_from and s_date_to
    or tdfdate between s_date_from and s_date_to.
    ENDIF.
    FETCH NEXT CURSOR S_CURSOR
    APPENDING CORRESPONDING FIELDS
    OF TABLE wa_stxh
    PACKAGE SIZE S_S_IF-MAXSIZE.
    TDFDATE is creation date and TDLDATE is changed on
    My extract structure contains Zdate(TDLDATE), Ztext1,2,3, Key field and langu in RSO2 I have selected calday in generic delta and Zdate as field Nm and upper limit as 1 and lower limit as space in settings and new status for changed records button.
    Did I missed something because when i check in RSA7 i didnot see any changed records under totals column and i tried to load without it into BW than i didnot received single record evenafter changes.Would anyone suggest me the good solution for it I appreciate it in advance. I have seen lot of posts in SDN but I didnot find this type of secenario anywhere.
    Thanks in advance
    Regards
    Kishore

    Kishore,
    go through the thread... which i provided for Generic DS using function for CRM Texts.
    Re: Urgent: Extraction through function module
    Any questions please let me know. If you have any questions update the thread with your mail id.
    Replace the code with ...
    LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZDATE'.
    MOVE-CORRESPONDING L_S_SELECT TO L_R_TDLDATE.
    APPEND L_R_TDLDATE.
    ENDLOOP.
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT * FROM STXH
    WHERE TDOBJECT = <Text Object>
    AND TDID = <Text ID >
    AND TDSPRAS = sy-langu
    AND (TDLDATE IN L_R_TDLDATE
    or TDFDATE IN L_R_TDLDATE).
    ENDIF. "First data package ?
    Fetch records into interface table.
    named E_T_'Name of extract structure'.
    FETCH NEXT CURSOR S_CURSOR
    APPENDING CORRESPONDING FIELDS
    OF TABLE wa_stxh
    PACKAGE SIZE S_S_IF-MAXSIZE.
    L_R_TDLDATE will be calculted by the system. Internally, system will save the Last Delta date(you need to enable this field for Generic delta).
    all the best.
    Regards,
    Nagesh Ganisetti.

  • 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 .

  • Function module "select_options_restrict"

    what is the functionlity of the FM select_options_restrict?

    hi..
    This function module simplifies the handling of SELECT-OPTIONS on the selection screen by restricting possible selection options and signs.
    By calling this function module, you can restrict the number of selection options available for the chosen selection field. You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E').
    U can check the Documentation in SE37 for this FM. It is available in English with an example.
    regards,
    Padma

  • Need a Function Module for fetching the prior date-Urgent!!

    Hi All,
         I need a function module which will give the prior date with respect to the no: of days days that are entered as input.
    Can anyone please help me to fing one function module which acts as the above.
    Required very urgently!!!
    Thanks and Regards,
        Neethu

    Hi Neethu,
    Please run the report 'ZRECTIFY_FM_DOCUMENTS' in your system.
    Before running the report, create the following selection texts for the parameters/select-options as given below:
    P_BUKRS:  Company code
    S_GJAHR:  Fiscal year
    S_BELNR:  FI document no.
    P_TEST:   Test run
    For More information please refer <b>SAP Note: 309619</b>
    Best Regards,
    Johnny.

  • I'm very new tp SAP ABAP, how to create a function module..V.URGENT

    hi folks,
    I'm very new to sap abap.
    I want to create a function module.
    the following is my requirement.
    by passing(eporting parameters to funtion module from pgm point of view) a field, i want to get(importing parameters from the funtion module, from pgm point of view) some 7 fields(of various tables).
    please also tell me how can code an inner join for tables 5 tables(a,b,c,d,e). i'm joining a on b, b on c, c on d,the problem here is that i can not join d on e as there are no common fields in d and e.
    can i join e and c or b, there are no common fields even in a and e.
    please tell me the solution as soon as possible, this very important and urgent deliverable.
    thanks in advance

    Here is link for creating function modules
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm">Creating Function Modules</a>
    Regds
    Manohar

  • Update Equipment BOM using Function module (very urgent)

    Hi All,
    I am an ABAPER and trying to update equipemnt BOM.
    I want to update equipment BOM using a function module. I am currently using 'CSAI_BOM_MAINTAIN' function module. But i am not able to update the Equipment BOM. After function call the sy-subrc value is 0, even though the BOM is not updated.
    Please help its very urgent.
    Kind Regards,
    Sharat.

    Hi Sharat,
    I am facing the same problem. Could you please let me know what might be the reason.
    Plz mail me at [email protected]
    Plz update this section once u have mailed the answer.
    Thanks a lot in advance.
    Regards,
    Himanshu

  • Table name /function module needed(urgent)

    need a function module or a table in which i cod get a list of "tables names " used in "includes " .... urgent
    ne alternate way to fetch so is also welcome

    Hi
    use the program
    RPR_ABAP_SOURCE_SCAN
    Regards
    Anji

  • Function module required--Urgent

    Hi Friends,
    I have a requirement where in I have to get the final date if I add some days to the initial date.
    For example I have the begin date as 11/02/2007...I have the number of days as 91...If I add these days to the initial date I will get the final date.
    Is there any fm to achieve the same if i have the initial date and number of days...Please let me know..Its bit urgent
    Susmita

    hi ,
    you dont have to go for any function module.You can directly add the number of days to the date for getting the final date.try this example..
    parameters:
      p_date like sy-datum,
      p_days type i.
      p_date = p_date + p_days.
      write p_date.
    regards,
    veeresh

  • URGENT: Function modules or BAPIs

    Hi Experts,
    I need function modules or BAPI to get the open items and cleared items G/L Account wise.
    Useful replies will be surely awarded.

    Hi Chakradhar,
    Check tcode : BAPI
    u will get all bapis there.
    Regards,
    Hemant

Maybe you are looking for