Need logic to develop input paramaeter (dynamic selection)

Hi All,
A Function Module needs to be developed with the following are the input parameters
A     Plant(Optional)
B     Application(Optional)
C     Material(Optional)
D       Date and Timestamp(Mandatory only if none of the above are provided)
   If there is no value in the  'D'parameter, then it will apply the logic mentioned below in the function module.
     The function module should do following checks
     (a) If  A is provided then B and C should not be null.
     (b) If C is provided then B should not be null.
                    Or
     (c ) The user should provide data and timestamp in YYYYMMDDHHMMSS format. 
          This date range should not be more than 14 days.
My questions is,
(1)How to bring parameter 'D' manitory if paramaeter A,B and C is not provided.
(2)how to make a check if A is provided , B and C should not be null
(3) how to make a check if B is provided B should not be null.
(4)How to check the user has entered the date not more than 14 days.
can any one help me out in this logics ...
Regards,
Sri

HI,
IF  A ,B and C is initial.
give message as d is madatory.
endif.
if A is not initial.
check B and C is not intial.
do the things.
endif.
if  B is not intial.
check C is not initial.
endif.
4th one i am not clear wat ur syaing.
if the user enterd date is todays date.
get todays date into local variable.
check the 14 days.

Similar Messages

  • Need to Add BKTXT in the dynamic selection in FB03

    Hi Gurus,
    In the dynamic selection FB03, the field BKTXT is not included in the dynamic selection. Would it be possible to add this field?
    Youre inputs would be greatly appreciated.
    Thanks and best regards,
    JeCCas_DJ

    Hi,
    You wants to add the BKTXT field on the selection screen of FB03?
    Why? for what purpose?
    Better copy the program related FB03 to some Zprogram and modify it by writing a select statement to get this BKTXT firld form BKPF/BSEG tables.
    SInce this is a text field, normally we don't put onthe selection screen.
    Regards,
    Anji

  • Exclude one field from Logical Database's dynamic selection screen

    Hi Guru,
    I have a requirement to amend a program to exclude the document number field (bsik-belnr) from the dynamic selection-screen of the logical database KDF(Vendor Database) so that the program will not filter according to the document number.
    I have use the below syntax in my zprogram.
      selection-screen exclude select-options: doc-no.
    However I get syntax error "The addition EXCLUDE is only allowed in INCLUDE DBKDFSEL".
    Please advice.
    Best Regards,
    Fung

    The selection part of the logical database defines input fields for selecting data.
              The runtime environment displays these on the selection screen when you run an executable program linked to the logical database.
              Include called DB<ldbname>SEL.
            SELECTION-SCREEN BEGIN OF VERSION ver TEXT-xxx.
                                                                    SELECTION-SCREEN EXCLUDE ... .
                                                    SELECTION-SCREEN END OF VERSION ver.
    Defines a selection screen version (with a three-character name ver ). Between BEGIN OF VERSION and END OF VERSION , you can exclude selection screen objects for the version ver , i.e. remove them from the selection screen with SELECTION-SCREEN EXCLUDE.
              SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab
    If one of these tables is active in the report (i.e. it is declared under TABLES or lies somewhere on the path from the root of the database hierarchy to a table declared with TABLES ), a pushbutton called 'Dynamic selections' appears on the selection screen.

  • Need to wite pl sql procedure for dynamic select statement

    Need pl sql procedure for a Dynamic select statement which will drop tables older than 45 days
    select 'Drop table'||' ' ||STG_TBL_NAME||'_DTL_STG;' from IG_SESSION_LOG where substr(DTTM_STAMP, 1, 9) < current_date - 45 and INTF_STATUS=0 order by DTTM_STAMP desc;

    I used this to subtract any data older than 2 years, adjustments can be made so that it fits for forty five days, you can see how I changed it from the originaln dd-mon-yyyy to a "monyy", this way it doesn't become confused with the Static data in the in Oracle, and call back to the previous year when unnecessary:
    TO_NUMBER(TO_CHAR(A.MV_DATE,'YYMM')) >= TO_NUMBER(TO_CHAR(SYSDATE - 365, 'YYMM'))

  • Add field in dynamic selections of FBL3N

    Hi,
    I know this question has been post before and i have followed the sap note 188663  and 832997, and also I read it in the wiki tab, "Enhancing Selection Views in the dynamic selection of FB03, FBL3n, FBL5n and etc".
    But no available for me.
    Requirement: Accounting document entry date(BKPF-CPUDT) need to be added in the dynamic selection in FBL3N.
    I did the following customizations, but it doesn't work.
    1.Execute Transaction code SE36.  Enter "SDF" in Logical database field.
    2.From the initial screen of SE36, Choose from the path EXTRAS>> Selection Views
    3.Change the selection views "CUS".
    4.double click table BKPF, and enter "02" in function group of Accounting document entry date(BKPF-CPUDT).
    But, when I execute FBL3N, the custmized filed was not displaying in dynamic selection.
    And then, I found there is no BKPF table in dynamic selections setting in front screen of SE36. ( Menu path : Extras >>Dynamic selections ).
    So, I modified the Selections of Subobjects as belows.
    "SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE BKPF."
    When I use a test run(F8) in SE36, I could get the additional field in the dynamic selection.
    However, I still could not get it in executing FBL3N.
    I see that there is a Edit -> generate -> selections and program in front screen of SE36, and when I selected, the message was displayed as "The slections for LDB SDF cannot be generated (already exist)".
    Please assist me.
    Thanks in advance.
    Weiyang

    Dear  Weiyang         
    kindly note that as per SAP note 310886 Only certain tables or fields are permitted
    Permitted tables:
    SKA1: all fields
    SKB1: all fields
    BSIS: all fields
    no other table is allowed
    so your field BKPF-CPUDT is not allowed in dynamic selection
    Hope your query is solved
    Cheers
    IMK

  • How to add into dynamic selection criteria (FBL1N) - custom field from LFB1

    Hello all,
    i have following problem. I added new customer field into table LFB1 (Z* field). And now i need to use this field as dynamic selection criteria in transaction FBL1N. I enhanced selection view for logical database KDF - i have created new customer view and I added my new field from LFB1. It is OK, i see this field in dynamic selection criteria in FBL1N but if i try to select according that Z* field, short dump occured.  
    open cursor with hold LC_KRED for select (VF_KRED_FIELDS)
            from <b>VF_KRED</b>
              where LIFNR in KD_LIFNR
              and   BUKRS in KD_BUKRS
              and   LAND1 in KD_LAND1
              and   KONZS in KD_KONZS
              and   VBUND in KD_VBUND
              and   AKONT in KD_AKONT
              and   BUSAB in KD_BUSAB
              and (VF_KRED_WHERE)
    Problem is in VF_KRED - this is database view (LFA1 joins LFB1). This view has no Z* fields and therefore it cannot be use in statement above -> dump.
    Is needed repature of standard - enhancement of view VF_KRED?
    Thank you very much.

    Hi guys,
    thanks so far. I managed to show prompts in the report. But still my problem is nor 100% solved
    I would like t achieve that the filtered criteria in the report title is separated through a comma like in the report filter summary - e.g.: {001, 002, 003, 004} followed by just 1chart/table that is including the whole information.
    When I however just drag a variable into the report it automatically created different sections, right? Like ........ table, chart, whatever... .......table chart whatever........
    Regards

  • Problems creating dynamic selection screen

    Hi all,
    i'm trying to dynamically generate a selection screen and show it as subscreen using the two function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. I call the function modules in the PBO of the therefor defined subscreen. The FREE_SELECTIONS_DIALOG fm has the two import parameter "as_subscreen" and "as_window". If i use the "as_window" parameter the selection screen comes up as popup. If i use the "as_subscreen" parameter, i can't see anything in my defined subscreen.
    Any suggestions ?
    Thanks in Advance
    Dirk

    Hi,
    The above requirement is not possible without using logical database.
    The reason is that the compiler identifies the below syntax only inside a LDB program .
    SELECTION-SCREEN DYNAMIC SELECTIONS
                     FOR {NODE|TABLE} node [ID id].
    The above syntax creates a subscreen container on the standard selection screen of the program during generation
    and we are able to view the dynamic selections icon on the selection screen.
    Hence it is not possible to use the FM 'FREE_SELECTIONS_DIALOG' as a subscreen without using a
    logical database of the relevant table.
    However if you dont want to create a new LDB for each table, there is a trick which needs to be performed
    once in your SAP system and all custom programs can use this FM to create a dynamic selection screen
    as a subscreen of the standard selection screen.
    The prerequisite steps are as follows:
    1: Create a dummy  / test database table in SE11 with a single field i.e. for example mandt , matnr
    2: Create a new logical database program for this table in SE36. Save and activate.
    This will create dynamic selections for the fields of the table created in step 1.
    Steps to be followed in the required custom ABAP program to create the dynamic selection screen as a subscreen.
    A: Include the LDB program created in step 2, in the attributes of the custom ABAP program.
    Now when you execute the program, you can see the dynamic selection icon for the dummy table created in step 1.
    B: In your custom program we need to suppress the icon for 'Dynamic Selections' from the standard selection screen.
       We need to perform this action, because the 'Dynamic Selections' icon always triggers a call to the
       dynamic selection screen of the included LDB progam. ( In our case a dummy table created in step 1 ).
       Whereas we want to trigger a call of the dynamic selection screen of our desired table.
       Logic is as follows:
       In 'AT SELECTION-SCREEN OUTPUT' event call the FM RS_SET_SELSCREEN_STATUS to exclude the fcode 'DYNS'.
    C: Add a pushbutton / checkbox on your selection screen to trigger a call to the FM 'FREE_SELECTIONS_INIT' &
       'FREE_SELECTIONS_DIALOG' in the 'AT SELECTION-SCREEN' event.
    D: When the user clicks the pushbutton / checkbox for dynamic selections call the above 2 FM for the desired table
        with the AS_SUBSCREEN flag of FREE_SELECTIONS_DIALOG = 'X'
    Result: Your dynamic selections screen will be created as a subscreen of the standard selection screen and not as a pop-up.
    Advantage: With the creation of the single custom table & LDB, you are now able to create dynamic selections as subscreen
    in any program in the system. All we need to do is follow the steps A, B & C in each program.
    Note: Your other restrictions with dynamic selection screen ie. submit in background , save as variant still remain and
    you need to handle them accordingly.
    let me know if you need sample code.
    Regards,
    Bhawit Kumar

  • RS_VARIANT_CREATE and dynamic selections

    We would like to use a function module to create a variant and run the job in batch mode.  The program that we are trying to use is RFBILA00.  We need to use one of the dynamic selections and do not know how to do this.
    Can anyone help?  I have seen other posts on this subject but no one ever answers them.
    thanks!

    Thanks for your input but this does not help.  We have a program that is run that creates the variant to run F.01 using RFBILA00.  The variants are not defined before this program runs.  
    We are able to create the variant based on input from a selection screen in our z program, but now have a requirement to use the dynamic selection P/L account type and Balance sheet account. 
    Our Z program creates the variant, runs the job and then deletes the variant.
    If anyone has any other ideas, we are open to suggestions.

  • Issue with MB25 BDC for Dynamic Selection Screen

    Hi Experts,
    I recorded one BDC for MB25 Tcode regarding to determine Open Reservation(s) in E Mode (Display Mode). I am passing 3 parameters.
    1. Plant,
    2. Requirement Date
    3. Multiple Reservation Numbers i.e. RSNUM from Dynamic Selection i.e. 2nd Button -> Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    But while executing that BDC, I need to manually click every time on 'Header Data for Reservation' Tree and then Multiple Selection for Reservation Icon.
    I want below steps automatically while executing:
    - Open 'Header Data for Reservation' Tree
    - Click Reservation
    - Open Popup for 'Multiple Selection'.
    So no need to click every time on Dynamic Selection Screen i.e. Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    Please find attached screen shot for your reference.
    Please guide.
    Thanks and Regards,
    Emon Master

    Hello Jainam,
    submit (sy-repid) with selection-table v_sp
                             with free selections EXPRESSIONS
                             via selection-screen.
    Without going through the details, dont you think this will cause an inifinite loop as the calling & the called programs are the same.
    Please enlighten me !!
    BR,
    Suhas

  • Unable to enhance dynamic selections in FAGLL03

    Followed Note 945932 to extend FAGLFLEXA by adding the fields to CI_FAGLFLEXA.
    The fields (BSEG-XREF3) appeared in the dynamic selections but if I try to use the field, it throws the following error:
    ===============================================================================================
    MSITEM 103 - Custom selections deleted because fields not active in ledger
    Custom selections deleted because fields not active in ledger
    Message no. MSITEM103
    Diagnosis
    Either you have entered custom selections or you have switched between ledgers and had already entered custom selections for the previous ledger.
    System Response
    From the custom selections, the program deletes any entries for fields that are not active in the ledger currently selected.
    Procedure
    If necessary, adjust the custom selections for the currently selected ledger.
    ===============================================================================================
    Is there anything else that I need to do to use the dynamic selections ? How do I activate the field in the ledger ? Looks like most of the fields in the ledger are being read from the totals tables - FAGLFLEXT.
    Any help will be greatly appreciated.
    Thanks
    Sridhar

    SE16 - added the fields in FAGLFLEXA as per the note. It said not to add an "append structure". So I went in and added the field directly.

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • How to extend dynamic selection for Logical Database PNPCE

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

  • How to use dynamic selection screen inputs in main program

    hi all,
      its a report where in it calls one dynamic selection screen( user need to enter the parameters here) after that i need to use those inputs for some check, can any buddy help how to use/ get that input parameters into main program.
    regards,
    vara..

    Hi,
    i think u have created that dynamic selection screen in seperate program and calling to ur main program.instead of that u just create that synamic selection screen program as include program and include it in ur main program.
    or u need to use set/get parameter id concept.
    rgds,
    bharat.

  • Modifying Dynamic selection in standard logical database

    Hello guys,
    I have a requirement to add a field to a dymamic selection of standard programs.
    The standard programs used the logical database KDF.
    I have created a custom selection view and included the required field which is from table BKPF.
    But this field is not appearing as the table BKPF is not defined as a node in Dynamic selection but in only field selection.
    Can anyone please provide me with come help on this?
    I need to add the a field from BKPF to the dynamic selection of standard logical DB KDF. Is this possible?
    Thanks and regards

    Hello Thomas,
    thank you very much for the precious help.
    I appended the field BKTXT to BSIK and BSAK as used in logical database and these are automatically filled for new postings thanks to Move corresponding (as indicated).
    We are left with only to feed these new fields with existing data/records.
    kind regards..
    Edited by: Devi on May 19, 2009 12:51 PM
    Edited by: Devi on May 19, 2009 12:51 PM

  • Adding a dynamic selection to a logical database query

    Hello,
    I would like to add a dynamic selection to a SQ02 Infoset using logical database SDF. I need the report to show only documents created at certain dates. I've added a selection field "CR_DATE" for BKPF-CPUDT to the Infoset and added the following code:
    SELECT * FROM BKPF
    WHERE BKPF-CPUDT IN CR_DATE.
    ENDSELECT.
    However, the report displays documents created on all kinds of dates regardless of the ones I've specified at the selection screen.
    I can only use SQ02 and SQ01. I don't have access to most other transactions such as SE36 nor have the authorization to edit the existing report transaction such as FAGLL03.
    Please, help.

    Hi John,
    Only certain table fields are allowed in dynamic selection, please see this sap note for detail :
    Sap Note 310886 - Line items: Dynamic selections ignored
    Permitted tables:
    SKA1: all fields
    SKB1: all fields
    BSIS: all fields
    So BKPF-CPUDT field is not allowed for dynamic selection.
    Regards
    Javed

Maybe you are looking for