Logic based on Date on Selection-Screen

Dear friends,
I've been writing a report in which I have the date field on selection-screen. By default I have been displaying the system date on the selection-screen.
The reqiurement is that the user cannot execute the code for a date in past (less than the system date) or cannot give a date less than the sytem date
but can execute the same for a date in future (greater than the system date).
Can any one give me the logic for the same.
Regards,
Alok.

Hi
This is the code for u.
PARAMETERS : P_DATE TYPE SY-DATUM .
INITIALIZATION.
  MOVE SY-DATUM TO P_dATE.
AT SELECTION-SCREEN ON P_DATE.
   IF P_DATE < SY-DATUM.
              MESSAGE 'Entered date cannot be in Past' Type 'E'.
**Raise any message that u created otherwise 
   ENDIF.
<b>Reward if Helpful</b>

Similar Messages

  • HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?

    HI,
    HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
    thanks,
    samba.

    By selection screen, what do you mean?   There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component?  Are you wanting to call a standard transaction via ITS - SAPGUI for HTML?  Please provide more details to your question.

  • Question on Logic of seperation in OOAbap-Selection screen

    Hello guys
    I like to ask you one question i found and get your ideas.
    If you look at the codes for creating an ALV
    it always recommends you to seperate logic and business layer etc..
    this is the new way of creating an ALV
    So you have  a model view and a controller
    I implemented that following useful resources.
    So that there s class called view
    and the selection screen gets called from there inside the method
    like
        call SELECTION-SCREEN 100.
         IF sy-subrc EQ 0.
         ENDIF.
    But one issue when you execute the report and press GO BACK standard button it doesnot come back to your selection screen but way to your code.
    Is there a get around to that?
    here is the code below:
    Header 1
    *& Report  ZZ_SOLEN_FIRST
    REPORT ZZ_SOLEN_FIRST.
    DATA: gv_vbeln type vbap-Vbeln.
    ***Screen
    SELECTION-SCREEN: BEGIN OF SCREEN 100 TITLE t-004.
    SELECTION-SCREEN: BEGIN OF block aa WITH FRAME TITLE t-001.
    SELECT-OPTIONS: s_vbeln FOR gv_vbeln.
    SELECTion-SCREEN: END OF block aa.
    SELECTion-SCREEN: END OF SCREEN 100.
    *****DATA Layer
    class lcl_data DEFINITION.
       PUBLIC SECTION.
         TYPES: BEGIN OF ty_out,
           vbeln type vbap-vbeln,
           posnr type vbap-posnr,
           matnr type vbap-matnr,
           vkorg type vbak-vkorg,
           END OF ty_out
         TYPES: tt_out TYPE STANDARD TABLE OF ty_out.
         TYPES: gr_vbeln TYPE RANGE OF vbap-vbeln.
         DATA: gt_output TYPE tt_out.
         methods: constructor,
                  select_data IMPORTING VALUE(rs_vbeln) TYPE gr_vbeln.
    ENDclass.
    class lcl_data IMPLEMENTATION.
       method constructor.
         clear GT_OUTPUT.
       ENDMETHOD.
       method select_data.
         DATA: lt_vbak type SORTED TABLE OF vbak WITH UNIQUE KEY vbeln.
         FIELD-SYMBOLS: <lfs_output> like LINE OF gt_output,
                        <lfs_vbak> like LINE OF lt_vbak
         select vbeln posnr matnr from vbap
           INto TABLE
            GT_OUTPUT
           where vbeln in S_VBELN
         IF sy-SUBRC EQ 0.
           select * from vbak
             INTO TABLE lt_vbak
             FOR ALL ENTRIES IN  GT_OUTPUT
             where vbeln = GT_OUTPUT-vbeln
           LOOP AT gt_output ASSIGNING <lfs_output>.
             READ TABLE lt_vbak ASSIGNING <lfs_vbak>
             with TABLE KEY vbeln = <lfs_output>-vbeln.
             IF sy-Subrc eq 0.
               <lfs_output>-vkorg = <lfs_vbak>-VKORG.
             ENDIF.
           ENDLOOP.
         ENDIF.
       ENDMETHOD.
    ENDCLASS.
    ****Display
    class lcl_view DEFINITION.
       PUBLIC SECTION.
         methods: start RETURNING VALUE(rv_true) type abap_bool.
         METHODS: display CHANGING it_data TYPE STANDARD TABLE.
    ENDCLASS.
    class lcl_view IMPLEMENTATION.
       METHOD start.
         call SELECTION-SCREEN 100.
         IF sy-subrc EQ 0.
           rv_true = abap_true.
         ENDIF.
       endmethod.
       method display.
         DATA: lo_salv_table type REF TO CL_SALV_TABLE,
               lt_columns TYPE SALV_T_COLUMN_REF.
         FIELD-SYMBOLS: <lfs_columns> like LINE OF lt_columns.
         CL_SALV_TABLE=>FACTORY(
    *    exporting
    *      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE    " ALV Displayed in List Mode
    *      R_CONTAINER    =     " Abstract Container for GUI Controls
    *      CONTAINER_NAME =
           importing
             R_SALV_TABLE   = lo_salv_table    " Basis Class Simple ALV Tables
           changing
             T_TABLE        = it_data
    *    catch CX_SALV_MSG.    " ALV: General Error Class with Message
         lt_columns = lo_salv_table->GET_COLUMNS( )->GET( ).
    *    LOOP AT  lt_columns ASSIGNING <lfs_columns>.
    *    break developer.
    *    ENDLOOP.
         lo_salv_table->DISPLAY( ).
       ENDMETHOD.
    ENDCLASS.
    class lcl_controller DEFINITION.
       PUBLIC SECTION.
         methods: main.
    ENDCLASS.
    class lcl_controller IMPLEMENTATION.
       method main.
         DATA: lo_view type REF TO lcl_view,
               lo_data TYPE REF TO LCL_DATA .
         CREATE OBJECT: lo_data, lo_view.
         break developer.
         IF lo_view->START( ) Eq abap_true.
    **get the data
           lo_data->SELECT_DATA( s_vbeln[] ).
           lo_view->DISPLAY(
             changing
               IT_DATA = lo_data->GT_OUTPUT
         ENDIF.
       ENDMETHOD.
    ENDCLASS.
    INITIALIZATION.
    START-OF-SELECTION.
       break developer.
       DATA: lo_controller type REF TO lcl_controller.
       CREATE OBJECT lo_controller.
       lo_controller->MAIN( ).

    Here is the complete code that works fine!!!
    Thanks to your ideas:
    OO ALV
    *& Report  ZZ_SOLEN_FIRST
    REPORT ZZ_SOLEN_FIRST.
    DATA: gv_vbeln type vbap-Vbeln.
    ***Screen
    SELECTION-SCREEN: BEGIN OF SCREEN 100 TITLE t-004.
    SELECTION-SCREEN: BEGIN OF block aa WITH FRAME TITLE t-001.
    SELECT-OPTIONS: s_vbeln FOR gv_vbeln.
    SELECTion-SCREEN: END OF block aa.
    SELECTion-SCREEN: END OF SCREEN 100.
    *****DATA Layer
    class lcl_data DEFINITION.
       PUBLIC SECTION.
         TYPES: BEGIN OF ty_out,
           vbeln type vbap-vbeln,
           posnr type vbap-posnr,
           matnr type vbap-matnr,
           vkorg type vbak-vkorg,
           END OF ty_out
         TYPES: tt_out TYPE STANDARD TABLE OF ty_out.
         TYPES: gr_vbeln TYPE RANGE OF vbap-vbeln.
         DATA: gt_output TYPE tt_out.
         methods: constructor,
                  select_data IMPORTING VALUE(rs_vbeln) TYPE gr_vbeln.
    ENDclass.
    class lcl_data IMPLEMENTATION.
       method constructor.
         clear GT_OUTPUT.
       ENDMETHOD.
       method select_data.
         DATA: lt_vbak type SORTED TABLE OF vbak WITH UNIQUE KEY vbeln.
         FIELD-SYMBOLS: <lfs_output> like LINE OF gt_output,
                        <lfs_vbak> like LINE OF lt_vbak
         select vbeln posnr matnr from vbap
           INto TABLE
            GT_OUTPUT
           where vbeln in S_VBELN
         IF sy-SUBRC EQ 0.
           select * from vbak
             INTO TABLE lt_vbak
             FOR ALL ENTRIES IN  GT_OUTPUT
             where vbeln = GT_OUTPUT-vbeln
           LOOP AT gt_output ASSIGNING <lfs_output>.
             READ TABLE lt_vbak ASSIGNING <lfs_vbak>
             with TABLE KEY vbeln = <lfs_output>-vbeln.
             IF sy-Subrc eq 0.
               <lfs_output>-vkorg = <lfs_vbak>-VKORG.
             ENDIF.
           ENDLOOP.
         ENDIF.
       ENDMETHOD.
    ENDCLASS.
    ****Display
    class lcl_view DEFINITION.
       PUBLIC SECTION.
         methods: start RETURNING VALUE(rv_return_flag) type abap_bool.
         METHODS: display CHANGING it_data TYPE STANDARD TABLE.
    ENDCLASS.
    class lcl_view IMPLEMENTATION.
       METHOD start.
         call SELECTION-SCREEN 100.
         IF sy-subrc EQ 0.
           rv_return_flag = abap_true.
         ENDIF.
       endmethod.
       method display.
         DATA: lo_salv_table type REF TO CL_SALV_TABLE,
               lt_columns TYPE SALV_T_COLUMN_REF.
         FIELD-SYMBOLS: <lfs_columns> like LINE OF lt_columns.
         CL_SALV_TABLE=>FACTORY(
    *    exporting
    *      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE    " ALV Displayed in List Mode
    *      R_CONTAINER    =     " Abstract Container for GUI Controls
    *      CONTAINER_NAME =
           importing
             R_SALV_TABLE   = lo_salv_table    " Basis Class Simple ALV Tables
           changing
             T_TABLE        = it_data
    *    catch CX_SALV_MSG.    " ALV: General Error Class with Message
         lt_columns = lo_salv_table->GET_COLUMNS( )->GET( ).
    *    LOOP AT  lt_columns ASSIGNING <lfs_columns>.
    *    break developer.
    *    ENDLOOP.
         lo_salv_table->DISPLAY( ).
       ENDMETHOD.
    ENDCLASS.
    class lcl_controller DEFINITION.
       PUBLIC SECTION.
         methods: main.
    ENDCLASS.
    class lcl_controller IMPLEMENTATION.
       method main.
         DATA: lo_view type REF TO lcl_view,
               lo_data TYPE REF TO LCL_DATA .
         CREATE OBJECT: lo_data, lo_view.
         break developer.
    *    while lo_view->START( ) eq abap_true.
    ***get the data
    *      lo_data->SELECT_DATA( s_vbeln[] ).
    *      lo_view->DISPLAY(
    *        changing
    *          IT_DATA = lo_data->GT_OUTPUT
    *    ENDWHILE.
         do.
           if lo_view->START( ) eq abap_true.
    ***get the data
             lo_data->SELECT_DATA( s_vbeln[] ).
             lo_view->DISPLAY(
               changing
                 IT_DATA = lo_data->GT_OUTPUT
           else.
             return.
           ENDIF.
         ENDDO.
       ENDMETHOD.
    ENDCLASS.
    class lcl_test_submit DEFINITION.
       PUBLIC SECTION.
         TYPES: tr_vbeln TYPE RANGE OF vbap-vbeln.
         data: lt_list type table_abaplist.
         methods: test_submit IMPORTING VALUE(ir_vbeln) type tr_vbeln
                              EXCEPTIONS submit_failed
                                         no_data_found
    ENDCLASS.
    class lcl_test_submit IMPLEMENTATION.
       method test_submit.
      submit ZZ_SOLEN_FIRST
       with s_vbeln in ir_vbeln
       exporting list to memory and return
    ***Get the list from the memory
        call function 'LIST_FROM_MEMORY'
           tables
             listobject = lt_list
           exceptions
             not_found  = 1
             others     = 2.
         if sy-subrc <> 0.
           raise submit_failed.
         endif.
         if lt_list is initial.
           raise no_data_found.
         endif.
       ENDMETHOD.
    ENDCLASS.
    INITIALIZATION.
    START-OF-SELECTION.
       break developer.
       DATA: lo_controller type REF TO lcl_controller.
    ****Testing the Main
       CREATE OBJECT lo_controller.
       lo_controller->MAIN( ).

  • Dynamic Creation of Columns based on Date from variable screen

    Hi Experts,
    Is it possible to create the Columns dynamically?
    My requirement is,
    for eg if the user selects the dates from 23Aug2008 to March2010 in variable screen, then in the output I should be able to drilldown and see the individual months data i.e., from Aug2008 to March2010 (20 columns).
    If the user selects March2009 to November2009 (9 columns)
    Is it possible to display in output like this?
    Is it possible to create columns dynamically(based on the period selected) in the output?
    Kindly help.
    Thanks,
    Guru
    Edited by: hi2guru on Aug 3, 2010 12:07 PM

    Hi Shanthi,
    Thanks for replying.
    And sorry If i havnt elaborated my requirement.
    I used a new structure->new selection with 0CALDAY restricted by 0I_DAYS periodFrom/to variable in Columns.
    Its displaying the total of the selected period in a single column.
    My requirement is to drilldown the same into individual months values in seperate columns.
    If the selected period has 8 months, then 8 columns. if the selected period has 15 months, then 15 individual columns.
    Pls help me.
    Guru
    Edited by: hi2guru on Aug 3, 2010 12:24 PM

  • Default date on selection-screen.

    Hi ABAPers,
    My requirement is that, i have one period(date) select-option in my selection screen.
    Now the problem was basing on the month the first and last date of that particular month should be initialised.
    For Ex:- present month was may, so in selection screen the date should be,
    PERIOD    05/01/2007    TO   05/31/2007
    Can any one send me the code for that.
    Thanks in Advance.
    Regards,
    Ramana Prasad. T

    Hi,
    you can use this code just copy paste and run
    SELECT-OPTIONS: s_date FOR sy-datum OBLIGATORY.
                                   DATA: l_date TYPE sy-datum.
                                   INITIALIZATION.
                                     s_date-sign   = 'I'.
                                     s_date-option = 'EQ'.
                                     s_date-low  = sy-datum.
                                     s_date-low+6(2) = '01'.
                                     s_date-sign   = 'I'.
                                     s_date-option = 'EQ'.
                                     s_date-high = sy-datum - l_date+6(2)  .
                                     s_date-high4(2) =  s_date-high4(2).
                                     CASE sy-datum+4(2).
                                       WHEN '1' OR '3' OR '5' OR '7' OR '8' OR '10' OR '12'.
                                         s_date-high+6(2) = '31'.
                                       WHEN '4' OR '6' OR  '9' OR  '11'.
                                         s_date-high+6(2) = '30'.
                                       WHEN '2' .
                                         s_date-high+6(2) = '28'.
                                     ENDCASE.
                                     APPEND s_date.
    regards ,
    Sudha.
    reward points if useful.

  • Fetching check number based on condition in selection screen

    In selection screen there r four fields document no,document date ,company code,fiscal year .
    According to client requirement, I have added check number in selection screen. If I enter  the document no in selection screen , the value (bseg –zuonr) should be retrived  in the field check number. If I press F4 in the check number field , the value zuonr based on condition bschl = 50 should be displayed..
    Now it is working fine in development  system.
    But in production it displays 3 values (bschl = 50, bschl = 40 and bschl = 25.Now I need that it should display a single  value based on posting key bseg -bschl = 50 only.
    my code:
    At selection-screen on value-request for P_ZUONR-low.
    select  ZUONR INTO CORRESPONDING FIELDS OF TABLE VALUE_IT1 from BSEG where BELNR IN S_BELNR and BSCHL = '50'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
           retfield        = 'ZUONR'
           dynprofield =  'P_ZUONR'
           dynpprog    = sy-cprog
          dynpnr      = sy-dynnr
           value_org   = 'S'
           TABLES
         value_tab       = VALUE_IT1
         FIELD_TAB              = IG_BSEG
          RETURN_TAB             = RETURN
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Thanks in advance.

    Hi,
    You can achieve this using Boolean type transient variable.
    > Create a Boolean type Transient variable in VO
    > Use this transient variable as SPELL like ${oa.<view instance>.<view attribute>}
    and in process for request method of controller class. set the value of this transient variable as true or false based on the condition

  • Validating the Program Run Date on selection screen

    Hi ,
    REGUH-LAUFD field has to be validate on selection screen parameter, for this filed no check table available in REGUH.
    Finally date should be validate through any table as per my concern.
    Could please anyone tell me that which table i have to go for validate the above field.
    Regards,
    sud

    >
    sudsap wrote:
    > Hi ,
    >
    > REGUH-LAUFD field has to be validate on selection screen parameter, for this filed no check table available in REGUH.
    >
    > Finally date should be validate through any table as per my concern.
    >
    > Could please anyone tell me that which table i have to go for validate the above field.
    >
    >
    > Regards,
    > sud
    REGUH-LAUFD is the date that the payment run has created. There is no such foreign key check for this date. If you want, you create your own table and do your checks but not advisable.
    What is your requirement anyway?

  • Displaying Data Using Selection-screen in Module Pool

    Hi All,
    Currently I'm working on a module pool program.In that i'm having two screens 9000 and 9001.
    I want to select a bookrefno using a selection screen and display header & table control data in 9001 screen when the bookrefno is validated.
    can anyone help me sending sample code regarding this
    Regards
    Ravi S

    Hi Ravi
    Place "bookrefno." field on screen 9000.
    Use validations on that particular field by using chain-endchain.
    in PAI of 9000
    case sy-ucomm
    when 'display'
    call screen 9001
    write select statment to display data i.e header & table control in 9001 .
    hope this would solve your problem.
    reward points, if its helpful.
    Thanks
    RK Nimma

  • How to print data of selection screen

    hi plz tell me how to print that data in smartforms which the user enters in the selection screen...........

    Use FM RS_COVERPAGE_SELECTIONS
        CALL FUNCTION 'RS_COVERPAGE_SELECTIONS'
             EXPORTING
                  REPORT            = L_REPORTIDENTIFICATION
                  VARIANT           = SY-SLSET
                  NO_IMPORT         = 'X'                       "07/04/98
             TABLES
                  INFOTAB           = T_INFOSELECT
             EXCEPTIONS
                  ERROR_MESSAGE     = 1
                  VARIANT_NOT_FOUND = 3
                  OTHERS            = 2.

  • Regarding dates and selection screen

    Hi all,
    In my selection screen i have 2 date fields(ranges). I have a requirement wherein i have to allow user to select only one date i.e. let the date fields be date1 and date2 when the user enters date1 he should not be allowed to enter date2 and when the user enters date2 then he should not be allowed to enter date1.
    when user enters date1 and tries to enter date2 then a message should be displayed.
    pls urgent requirement and points are gauranteed.
    Regards,
    Ravi

    try this code
    slect-options : sdate1 for mkpf-budat,
                          sdate2 for mkpf-budat.
    parameters : rdate1 radiobutton group rb1 user-command date default 'X',
                       rdate1 radiobutton group rb1.
    at selection-screen output.
    if rdate1 = 'X'.
    loop at screen.
    if screen-name = sdate2-low or screen-name = sdate2-high.
    screen-input = '0'.
    modify screen.
    elseif rdate2 = 'X'.
    loop at screen.
    if screen-name = sdate1-low or screen-name = sdate1-high.
    screen-input = '0'.
    modify screen.
    endif.
    at selection-screen.
    if rdate1 = 'X'.
    clear sdate2[].
    elseif rdate2 = 'X'.
    clear sdate1[].
    endif.
    START-OF-SELECTION.
    regards
    shiba dutta

  • Dynamic Variant -Current date  in selection screen - for batch jobs

    Hi Experts,
    My report runs in batch job with a variant, daily.
    One of the filed in selction screen should hv CURRENT DATE, with out providing as input explicitly by user.
    So, How Can I get it done?
    Its some thing with Dynamic variants + Selection Variables +  date selection, but, I forgot the navigation etc.
    pl. let me know
    thanq

    thanq.
    and pls. let me further clarify that,
    programitically am populating the date as current date minus 1 in the field of my_date in the selection screen.
    now, they wanna to run the report in back ground, daily.
    now, I followed ur tip/link and saved with_date_variant, fine.
    so, pls. let me know that,
    1) if the report runs in back ground tomorrow with with_date_variant(which is i created by seeing ur link), Is the selection screen my_date(prog. populates as June 5th) will be override with current date(i.e. June 6th)?
    In broad, Is the selection criteria wuld be over writes with the Dynamic varints?
    thanq

  • Validate the data in the internal table with the date in selection screen

    Hi all,
    I want to validate the data in the internal table and get only the records with the input date in the selection screen.
    The date is in the select options and please let me know how to get the records only if it satisfies the input date in the selection screen.
    Regards,
    Shalem

    For Ex.
    SELECT-OPTIONS: S_DATE FOR VBAK-VDATU
    If you want to read one INTERNAL TABLE record
    READ TABLE it_tab(internal table name) WHERE vdatu(date field name in the internal table) = s_date
    If you want to move more then one
    LOOP AT it_tab WHERE vdatu = s_date.
    Take the field values in another table and append it. then end loop.
    you will get the records which only have the date in select option..
    If you want detail code give me internal table name and select option name i will write you the code.
    regards
    Yuvaram

  • Not accepting date in selection screen

    Hi,
    I'm trying to submit rkaep000 with values to order, expected debit date and display variant in the selection screen. I'm able to fill values to order and display variant but not to the date. Why am I not able to pass the dates????? Tried directly passing then passing as range but still it takes the default date.
            submit rkaep000  via selection-screen
                   WITH p_tcode = 'KOB2'
                   WITH aufnr   in r_aufnr
                 WITH r_obdat in r_date
                    WITH r_obdat-low EQ '01032003'
                    WITH r_obdat-high EQ '01032007'
                    WITH p_disvar = 'SCORP 1404'
                   to sap-spool spool parameters params
                   without spool dynpro
                   and return .

    if r_obdat is a select option have you also tried:
    r_date-low = '20030301'.
    r_date-high = '20070301'.
    r_date-sign = 'I'.
    r_date-option = 'BT'.
    append r_date.
    submit rkaep000 via selection-screen
    WITH p_tcode = 'KOB2'
    WITH aufnr in r_aufnr
    WITH r_obdat in r_date
    WITH p_disvar = 'SCORP 1404'
    to sap-spool spool parameters params
    without spool dynpro
    and return .

  • Dates in selection screens

    I need to ask for the month in a selection screen (january, feb...) witha F4, wathever
    How can I do that???
    Thanks

    hi  check this ,
    report .
    tables: t247 , DFIES.
    parameters:p_month  LIKE T247-MNR.
    data: begin of itab occurs 0,
          mnr like t247-mnr,
          ktx like t247-ktx,
          end of itab .
    DATA : LT_FIELDS TYPE TABLE OF DFIES,
    LS_FIELD TYPE DFIES.
    at selection-screen on  value-request for  p_month.
    select MNR
           KTX
           from t247 into  corresponding fields of table itab
    where  spras = 'EN'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'P_MONTH'
    DYNPPROG = sy-cprog
    DYNPNR = sy-dynnr
    DYNPROFIELD = 'MNR'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = itab
    FIELD_TAB = LT_FIELDS .
    regards,
    venkat.

  • CS4: can I apply logic based on data merge?

    Hello all,
    I'm creating an InDesign document using CS4 that has variable text in it.  Some of that variable text is "static", in that it's inserted directly from a data merge.  In other cases, though, I'd like to display one block of text (I'd specify) if an element in the data merge had one value and another block of text if the data merge element had a different value.  Can I do that with a script?  Here's an example: in the data merge file I have a "WorkingHours" element.  It can have a value of either "8-5" or "24x7".  If the value is "8-5" I want to display "8 a.m. - 5 p.m. Monday - Friday" and if the value is "24x7" I want to display "24 hours, 7 days a week".  I want the text to display in a cell in a table in my document.
    If I can do this, do I just create the script, save it, then select it via the data merge panel to insert it in the cell where I want the output data to be displayed?
    Thanks a lot,
    Ed

    EdwinJaquaAtWork wrote:
    Hello all,
    I'm creating an InDesign document using CS4 that has variable text in it.  Some of that variable text is "static", in that it's inserted directly from a data merge.  In other cases, though, I'd like to display one block of text (I'd specify) if an element in the data merge had one value and another block of text if the data merge element had a different value.  Can I do that with a script?  Here's an example: in the data merge file I have a "WorkingHours" element.  It can have a value of either "8-5" or "24x7".  If the value is "8-5" I want to display "8 a.m. - 5 p.m. Monday - Friday" and if the value is "24x7" I want to display "24 hours, 7 days a week".  I want the text to display in a cell in a table in my document.
    If I can do this, do I just create the script, save it, then select it via the data merge panel to insert it in the cell where I want the output data to be displayed?
    Thanks a lot,
    Ed
    Hi, Ed:
    It's probably more conventional to perform this kind of logic when creating the source material for the merge, However, if the text items "8-5" and "24x7" will always require the exact substitution that you describe, you can probably create a GREP paragraph style for the cells that expect the content that needs substitution. I'm not a GREPper, but perhaps a GREP guru on this forum will suggest the proper notation to make it happen...automatically, of course. The GREP action will ignore any paragraph that lacks the exact item to be substituted.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

Maybe you are looking for

  • XSLT mapping to retrieve FileName from FILE SENDER adapter

    Hi I have an File Sender adapter scenario where I have switched on Adapter-specific message attributes (FileName). In my XSLT mapping program I need to RETRIEVE the filename and map it. Can anyone help please? Thx in advance

  • How to create a report using XML data source from Crystal Report Designer

    Hi, Iu2019m having Crystal Report Designer XI R2 SP4. Iu2019m trying to create a report using XML data source stored on disk. This is a customer order report and the xml is structured in such a way that it has an order details header part (master) an

  • Changing name in Org structure - central person

    Hello All, I have got request for name change in SRM. So, i have changed the name details in SU01 and it is not reflecting at central person. I even tried to edit but it was of no use. Could you please help me on changing the name at central person i

  • Thinkpad T500 No Video

    This is a strange one, no video/post I have tried about everything on the message board here. Bios 3.23 CPU T9400 2.53.Ghz Ram 4096 I pull the power cord and the battery then upplug the bios battery, plug the bios battery back in and the laptop batte

  • Dynamic Hyperlinks

    I will end up having internal site links repeated a few times in my site, complete with mouseovers. I want to have only one set of these hyperlinks, so I only have to change them once if need be in the future. I tried setting the Text value, the link