At Selection Screen modification for a paramter

hi
two questions
I am trying to make a parameter field have a default value with un-editable mode...
So I did it this way
*& Report  Z_506757_TEST3                                              *
REPORT  Z_506757_TEST3                          .
TYPES: STR(20).
TABLES: VBRP.
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETERS: FNAME TYPE STR,
            LNAME TYPE STR,
            FINAL TYPE STR DEFAULT '200'.
SELECTION-SCREEN END OF BLOCK B1.
*INITIALIZATION.
final = '200'.
APPEND final.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF SCREEN-NAME = 'FINAL'.
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
    ENDIF.
    PERFORM MERGE.
  ENDLOOP.
*&      Form  merge
      text
FORM MERGE.
  CONCATENATE FNAME LNAME INTO FINAL.
ENDFORM.                    "merge
I dont get the default value as 200.. if the screen-input = 0... so how should handle this problem
Another problem is if i fill the FNAME AND LNAME fields, WITHOUT PRESSING THE EXECUTE BUTTON i should get the value filled in the FINAL field
Can this be handled in the At-SELECTIOn Screen output
Is this possible

I tried this code in my system and it works as expected. The field FINAL is not input enabled and is defauled to 200.
REPORT zkartest.
TYPES: str(20).
PARAMETERS: fname TYPE str,
            lname TYPE str,
            final TYPE str DEFAULT '200'.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'FINAL'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Similar Messages

  • How to can we do selection-screen modification for LDB?

    Hi All,
    I have custom field in my selection-screen of LDB PNP.
    Can you people please let me know how can I put the selection-screen modificaiton For ex:
    i have created
    parameters a as checbox.
    select-options: p_btrtl for p0001-btrtl no-intervals.
    now If the check box is selected then p_btrtl we can enter values or esle If check box is not selected then p_btrtl will be grayed out, ( I.e. SCREEN-INPUT = 0)
    This is simple from ABAP without LDB. But with LDB can we achieve?????????????
    Satish
    Edited by: Satish Vasireddy on Jun 23, 2010 4:05 PM

    you can use the following logic for the additional selection validation. I have done by using PNP LDB. Ex : I have done for one of the field in IT0377.
    SELECT-OPTIONS: s_bplan FOR p0377-bplan.
    *&      Form  check_selection_0377
      This subroutine is used to check the selection screen
    FORM check_selection_0377.
      LOOP AT p0377 WHERE pltyp  IN s_bplan
                     AND levl1 IN s_lti
                     AND   begda LE pn-endda
                     AND   endda GE pn-begda.
        CALL FUNCTION 'HR_CHECK_AUTHORITY_INFTY'
          EXPORTING
            tclas            = 'A'
            pernr            = pernr-pernr
            infty            = p0377-infty
            subty            = p0377-subty
            begda            = pn-begda
            endda            = pn-endda
            level            = 'R'
          EXCEPTIONS
            no_authorization = 1
            internal_error   = 2
            OTHERS           = 3.
        IF NOT sy-subrc IS INITIAL.
          DELETE p0377.
        ENDIF.
      ENDLOOP.
    selection not found and no value selected
      IF sy-subrc NE 0.
        READ TABLE s_bplan.
        IF sy-subrc EQ 0.
          REJECT.
        ENDIF.
        READ TABLE s_lti.
        IF sy-subrc EQ 0.
          REJECT.
        ENDIF.
      ENDIF.
    ENDFORM.                    " check_selection_0377
    Regards,
    Preetham

  • Selection screen modification based on various buttons in selection screen

    Hi,
    I have 1 query related with Selection screen modification.
    In my Report Program,I have created GUI Status for my selection screen
    Now 2 buttons in application toolbar are coming on selection sceen.
    For this i used,'At selection screen output' event.
    And there are 2 blocks on selection screen.
    If user press button1 then block2 should not display.
    and if user press button2 then block1 should not display.
    but the problem is i m not getting reqd result and also while doing debugging its not showing me sy-ucomm value.
    Any pointers on this.
    Thanks,
    Mamta

    Hi Mamta,
       have it in a group then you can write code accordingly see sample example,
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS       : p_r1 RADIOBUTTON GROUP rad
                            USER-COMMAND clk DEFAULT 'X'.            " upload Radio Button
    SELECTION-SCREEN COMMENT 5(35) text-003.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
    PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                             DEFAULT 'c:\temp\parbmat.xls',
                p_werks     like t001w-werks MODIF ID a,              "Plant
    PARAMETERS: p_rest      LIKE rlgrap-filename MODIF ID a           "Dwonload File Path
                             DEFAULT 'c:\temp\Success.xls'.
    SELECTION-SCREEN : END OF BLOCK 001.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_r2 RADIOBUTTON GROUP rad.
    SELECTION-SCREEN COMMENT 5(35) text-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
    PARAMETERS     : p_plant  LIKE marc-werks MODIF ID b.                "Plant
    PARAMETERS     : p_lgort  LIKE mard-lgort MODIF ID b.                "Storage Location
    PARAMETERS     : p_vkorg  LIKE mvke-vkorg MODIF ID b.                "Sales Organization
    PARAMETERS     : p_vtweg  LIKE mvke-vtweg MODIF ID b.                "Distribution Channel
    SELECT-OPTIONS : s_mat FOR  mara-matnr MODIF ID b.                  "Material No No
    SELECT-OPTIONS : s_dat FOR  mara-ersda MODIF ID b.                  "Date on Record Created
    PARAMETERS     : p_down LIKE rlgrap-filename MODIF ID b
                      DEFAULT 'c:\temp\Material Master.xls'.           "Download File Path
    SELECTION-SCREEN : END OF BLOCK 002.
    AT SELECTION-SCREEN OUTPUT.
    *Inactive Fields depending on the radio button
      LOOP AT SCREEN.
        IF p_r1 = 'X'.
          IF screen-group1 = 'B'.
            screen-active = 0.
          ENDIF.
        ELSEIF p_r2 = 'X'.
          IF screen-group1 = 'A'.
            screen-active = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Edited by: suresh suresh on Jul 28, 2009 12:42 PM
    Edited by: suresh suresh on Jul 28, 2009 12:42 PM

  • At-selection-screen modification

    Hi Experts,
    I am doing the selection screen modification. The selection screen is designed such as i have two radio buttons 1. header & 2. Item anb beside header radio button i have field sales document number and beside item radio button sales item number field.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) text-005.
    SELECTION-SCREEN: position 32.
    parameter:p_sh type c radiobutton group rg.                "Sales header
    selection-screen: comment 35(15) for field p_sh.
    selection-screen: comment 60(20) for field p_vbeln.
    parameter:p_vbeln like vbak-vbeln MODIF ID gp5.            "Sales Document
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: position 32.
    parameter:p_si type c radiobutton group rg.                "Sales Item
    selection-screen: comment 35(15) for field p_si.
    selection-screen: comment 60(20) for field p_posnr.
    parameter:p_posnr like vbap-posnr MODIF ID gp6.            "Sales Document Item
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: skip.
    This is the selection screen  code where for sales document i have assiged Modif id GP5 for Item Modif id GP6.  so when i check radio button p_sh ( header ) then sales document ( p_vbeln) shoudl be active for input .
    if i check p_si (item) then both saleds document (p_vbeln) and p_posnr both have different group names i.e GP5 & GP6 should be active. i.e screen-inpu = 1.
    I have written the following code for header but for item i am unable to make screen-input = 1 for two different groups. how to do that?
    LOOP AT SCREEN.
        IF ( P_SH NE 'X' AND SCREEN-GROUP1 EQ 'GP5' ) OR
           ( P_SI NE 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
          screen-input = 0.
          MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    This code is working when i click header radio button but for when i click item radio button (p_si) only item field is active i am unable to make sales docuemnt active at same time. please help me in this regard.
    Regards,
    sunil kairam.

    Hi,
    Check this piece of code changed a bit.
    PARAMETERS : p_ct  RADIOBUTTON GROUP grp .
    SELECT-OPTIONS : s_kunnr FOR kna1-kunnr,
    PARAMETERS : p_sh RADIOBUTTON GROUP grp.
    SELECT-OPTIONS : s_vbeln  FOR vbak-vbeln,                
    PARAMETERS : p_si  RADIOBUTTON GROUP grp.
    SELECT-OPTIONS : s_vbeln1  FOR vbak-vbeln,
                                   s_posnr   for vbak-posnr.
    IF p_ct  IS NOT INITIAL .
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'S_KUNNR-LOW'.
              screen-input = 1.
              MODIFY SCREEN.
             WHEN 'S_KUNNR-HIGH'.
              screen-input = 1.
              MODIFY SCREEN.
               WHEN 'S_VBELN-LOW'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_VBELN-HIGH'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_VBELN1-LOW'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_VBELN1-HIGH'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_POSNR-LOW'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_POSNR-HIGH'.
              screen-input = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ELSEIF p_sh IS NOT INITIAL.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'S_KUNNR-LOW'.
              screen-input = 0.
              MODIFY SCREEN.
             WHEN 'S_KUNNR-HIGH'.
              screen-input = 0.
              MODIFY SCREEN.
               WHEN 'S_VBELN-LOW'.
              screen-input = 1.
              MODIFY SCREEN.
            WHEN 'S_VBELN-HIGH'.
              screen-input = 1.
              MODIFY SCREEN.
            WHEN 'S_VBELN1-LOW'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_VBELN1-HIGH'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_POSNR-LOW'.
              screen-input = 0.
              MODIFY SCREEN.
            WHEN 'S_POSNR-HIGH'.
              screen-input = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
    now one more  ELSEIF p_si  IS NOT INITIAL
    now make s_vbeln1 and s_posnr as input 1 and rest others as input 0.
    endif.
    Regards,
    Nagaraj

  • How to display the selection screen fields for selected checkboxes

    Hi all,
             I have 7 checkboxes, for each check box we have some seletion screen fields.if i select first check box,i want to display first slection screen fields only.
    and if we select more than one check box how to display the selection screen fields for selected check boxes,please help me this
    Thanks
    sriman.

    hi,
    Try this code
    report z_13317_sdn2.
    tables : mara, marc, dd03l.
    parameters : p_chk1 as checkbox user-command ABC,
                 p_chk2 as checkbox user-command PQR,
                 p_chk3 as checkbox user-command XYZ.
    select-options : s_matnr for mara-matnr modif id A,
                     s_ersda for mara-ersda modif id A,
                     s_werks for marc-werks modif id B,
                     s_lvorm for marc-lvorm modif id B,
                     s_tab for dd03l-tabname modif id C.
    data: v_chk1,
          v_chk2,
          v_chk3.
    at selection-screen output.
      loop at screen.
        if screen-group1 = 'A' or
           screen-group1 = 'B' or
           screen-group1 = 'C'.
            screen-input = 0.
           modify screen.
        endif.
      endloop.
      loop at screen.
        if v_chk1 = 'X'.
          if screen-group1 = 'A'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
        if v_chk2 = 'X'.
          if screen-group1 = 'B'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
        if v_chk3 = 'X'.
          if screen-group1 = 'C'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
      endloop.
    at selection-screen.
      if sy-ucomm = 'ABC'.
        if v_chk1 = ' '.
          v_chk1 = 'X'.
        else.
          v_chk1 = ' '.
        endif.
      endif.
      if sy-ucomm = 'PQR'.
        if v_chk2 = ' '.
          v_chk2 = 'X'.
        else.
          v_chk2 = ' '.
        endif.
      endif.
      if sy-ucomm = 'XYZ'.
        if v_chk3 = ' '.
          v_chk3 = 'X'.
        else.
          v_chk3 = ' '.
        endif.
      endif.
    Regards,
    Sailaja.

  • Screen Modifications for Travel Privileges (0017) screen

    Hi all,
    I am trying to change the screen modifications for Travel Privileges with module pool MP001700.  The problem is I can't find the module pool through the IMG>Personnel Management>Personnel Administration>Customization User Interfaces>Change Screen Modifications. If not here, where/how can I do this?
    Your help is much appreciated.
    Thanks.
    Regards,
    Eric

    Hi guys,
    Thanks for the replies but I was looking to do screen modifications preferably by non ABAP methods. I have found the solution where you need to create the module pool manually and the fields selections will appear.
    Regards,
    Eric

  • RFDOPR10 selection screen modifications

    Hi,
    I am attempting to modify the transaction S_ALR_87012178.  I have copied RFDOPR10 into ZRFDOPR10. 
    I need to modify the selection screen.  The problem I am encountering is that there are only some selection-screen elements in the report.  Where are the other ones coming from? IE. Customer selection through Line item selection. 
    The only elements that I can find in the report are Output Control and Further selections.

    Option 1:
    On the program attributes screen where the link to the logical database is, there is a field "Selection Screen" which for some logical databases gives you a choice of what selection screen the LDB will provide, perhaps even a blank one.
    Option 2:
    In some cases where a selection screen is set up by a logical database, there are options available in customizing through SPRO to control the layout of that selection screen.
    The one I am familiar with is logical database PNP for HR where the resulting selection screen can be changed significantly in HR customising.
    It may be that there are some similar options for the DDR selection screen - I suggest you check the relevant area of the IMG (SPRO), particularly any "Information System" customizing options.
    hope this is of some assistance.
    Andrew

  • Selection screen validation for batch

    This is my scenario:
    If program is executed in background, plant (in selection screen) is not mandatory.
    If program is executed directly, plant (in selection screen) needs to be filled (mandatory).
    I tried using sy-batch and coding at the AT SELECTION-SCREEN portion for validation but it seems that sy-batch is only populated after START-OF-SELECTION.
    How do i code it so that if user does not execute program in background, it will prompt an error message and prompt user to fill the plant field in the selection screen?

    HI,
    use sy-batch in start-of-selection. not in at selection-screen.
    start-of-selection.
    if sy-batch = ' X' . (If it runs in background)
    Then raise message.
    endif.
    This will work.
    Reward If helpful.

  • Selection Screen Validation for Character

    Hi All
    My query is regarding the selection screen validation for character.
    I am using a Select-option: S_ORDER FOR VBAK-VBELN OBLIGATORY.
    and S_order should be only having the numeric field.
    Please help how to validate it for character field.

    Hi,
    Do as below :
    at selection-screen.
    if not s_order[] is initial.
       if s_order-low CA 'ABCDEF.............Z'.
         message 'Enter only numerics only' type 'E'.
      endif.
    "similarly for s_order-high also.
    endif.
    Thanks,
    Sriram Ponna.

  • Selection screen variant for report

    Hi,
    Can we restrict the selection screen variants for reports by user? For example my report is ZREPORT. Different users can save variants for the report. When they choose a variant for executing the report, they would like to see only the variants they created.
    By default SAP lists all variants created (irrespective of who created).
    Thanks
    Anil

    Hi,
      If you want the other users doesn't want to execute (Not see) other variant..you can check if that user has created the variant in the AT SELECTION-SCREEN event..
      By checking VARI-VARIANT against the table VARID and check if sy-uname <> VARID-ENAME.
    Thanks,
    naren

  • Selection screen modification

    Hi Experts,
                  Kindly gothrough the below codes and when i click on rb2 radiobutton only that selection option  must appear but it is coming when i execute the program,, can any one help to resolve this issue...,
    *& Report  ZPROGRAM_KPI
    REPORT  ZPROGRAM_KPI.
    TYPE-POOLS SLIS.
    tables : pb4000.
    DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FCAT LIKE LINE OF IT_FCAT.
    DATA : IT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
           WA_FCAT1 LIKE LINE OF IT_FCAT1.
    data :       lv_end   TYPE  dats,
                 lv_beg   TYPE  dats,
                 v        type  i.
    data : begin of wa_pb40001,
                    pernr type pb4000-pernr,
                    SUBTY TYPE PB4000-SUBTY,
                    begda type pb4000-begda,
                    end of wa_pb40001,
                    it_pb40001 like table of wa_pb40001.
    data : begin of wa_pb40002,
                    pernr type pb4000-pernr,
                    SUBTY TYPE PB4000-SUBTY,
                    begda type pb4000-begda,
                    end of wa_pb40002,
                    it_pb40002 like table of wa_pb40002.
    selection-screen begin of block k with frame title text-001.
    parameter :  rb1 radiobutton group t, rb2 radiobutton group t.
    selection-screen end of block k.
    if rb1 = 'X'.
    CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'
      EXPORTING
        i_date_old = sy-datum
      IMPORTING
        e_date_new = lv_end.
    lv_beg = lv_end.
    lv_beg+6(2) = '01'.
    SELECT  pernr SUBTY   FROM pb4000 INTO TABLE it_pb40001 where  begda BETWEEN lv_beg AND lv_end.
    perform fcat using '1' 'PERNR' 'Personnel number' '20' 'C610'.
    perform fcat using '1' 'SUBTY' 'Sub type' '20' 'C310'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-CPROG
       I_GRID_TITLE                      = 'Report for displaying personnel number in previous month'
       IT_FIELDCAT                       = IT_FCAT
      TABLES
        t_outtab                          = IT_PB40001.
    elseif rb2 = 'X'.
    select-options s_date for wa_pb40001-begda obligatory.
    SELECT  pernr SUBTY   FROM pb4000 INTO TABLE it_pb40002 where  begda in s_date.
    perform fcat1 using '1' 'PERNR' 'Personnel number' '20' 'C610'.
    perform fcat1 using '1' 'SUBTY' 'Sub type' '20' 'C310'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-CPROG
       I_GRID_TITLE                      = 'Report for displaying personnel number using selection screen'
       IT_FIELDCAT                       = IT_FCAT1
      TABLES
        t_outtab                          = IT_PB40002.
    endif.
    *&      Form  FCAT
          text
         -->P_0068   text
         -->P_0069   text
         -->P_0070   text
    form FCAT  using    FP_COL_POS
                        FP_FIELDNAME
                        FP_SELTEXT_M
                        FP_OUTPUTLEN
                        FP_EMPHASIZE.
    WA_FCAT-COL_POS     = FP_COL_POS.
    WA_FCAT-FIELDNAME   = FP_FIELDNAME.
    WA_FCAT-SELTEXT_M   = FP_SELTEXT_M.
    WA_FCAT-OUTPUTLEN   = FP_OUTPUTLEN.
    WA_FCAT-EMPHASIZE   = FP_EMPHASIZE.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_fCAT.
    endform.                    " FCAT
    *&      Form  FCAT
          text
         -->P_0068   text
         -->P_0069   text
         -->P_0070   text
    form FCAT1  using    FP_COL_POS
                        FP_FIELDNAME
                        FP_SELTEXT_M
                        FP_OUTPUTLEN
                        FP_EMPHASIZE.
    WA_FCAT1-COL_POS     = FP_COL_POS.
    WA_FCAT1-FIELDNAME   = FP_FIELDNAME.
    WA_FCAT1-SELTEXT_M   = FP_SELTEXT_M.
    WA_FCAT1-OUTPUTLEN   = FP_OUTPUTLEN.
    WA_FCAT1-EMPHASIZE   = FP_EMPHASIZE.
    APPEND WA_FCAT1 TO IT_FCAT1.
    CLEAR WA_fCAT1.
    endform.                    " FCAT
    Regards,
    Thiru. R

    Copy paste this code for your new requirement:
    REPORT ZTEST15.
    TYPE-POOLS SLIS.
    TABLES : PB4000.
    DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
    WA_FCAT LIKE LINE OF IT_FCAT.
    DATA : IT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
    WA_FCAT1 LIKE LINE OF IT_FCAT1.
    DATA : LV_END TYPE DATS,
    LV_BEG TYPE DATS,
    V TYPE I.
    DATA : BEGIN OF WA_PB40001,
    PERNR TYPE PB4000-PERNR,
    SUBTY TYPE PB4000-SUBTY,
    BEGDA TYPE PB4000-BEGDA,
    END OF WA_PB40001,
    IT_PB40001 LIKE TABLE OF WA_PB40001.
    DATA : BEGIN OF WA_PB40002,
    PERNR TYPE PB4000-PERNR,
    SUBTY TYPE PB4000-SUBTY,
    BEGDA TYPE PB4000-BEGDA,
    END OF WA_PB40002,
    IT_PB40002 LIKE TABLE OF WA_PB40002.
    SELECTION-SCREEN BEGIN OF BLOCK K WITH FRAME TITLE TEXT-001.
    PARAMETER : RB1 RADIOBUTTON GROUP T DEFAULT 'X' USER-COMMAND RB,
                RB2 RADIOBUTTON GROUP T.
    SELECT-OPTIONS S_DATE FOR WA_PB40001-BEGDA MODIF ID DAT.
    SELECTION-SCREEN END OF BLOCK K.
    AT SELECTION-SCREEN OUTPUT.
      IF RB1 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'DAT'.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    AT SELECTION-SCREEN.
      IF RB1 = 'X'.
        CLEAR: S_DATE[], S_DATE.
      ENDIF.
      IF SY-UCOMM = 'ONLI'.
        IF RB1 = 'X'.
          CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'
            EXPORTING
              I_DATE_OLD = SY-DATUM
            IMPORTING
              E_DATE_NEW = LV_END.
          LV_BEG = LV_END.
          LV_BEG+6(2) = '01'.
          SELECT PERNR SUBTY FROM PB4000 INTO TABLE IT_PB40001 WHERE BEGDA BETWEEN LV_BEG AND LV_END.
          PERFORM FCAT USING '1' 'PERNR' 'Personnel number' '20' 'C610'.
          PERFORM FCAT USING '1' 'SUBTY' 'Sub type' '20' 'C310'.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              I_CALLBACK_PROGRAM = SY-CPROG
              I_GRID_TITLE       = 'Report for displaying personnel number in previous month'
              IT_FIELDCAT        = IT_FCAT
            TABLES
              T_OUTTAB           = IT_PB40001.
        ELSEIF RB2 = 'X'.
          IF S_DATE-LOW IS INITIAL.
            MESSAGE 'Enter date' TYPE 'E' DISPLAY LIKE 'S'.
          ENDIF.
          SELECT PERNR SUBTY FROM PB4000 INTO TABLE IT_PB40002 WHERE BEGDA IN S_DATE.
          PERFORM FCAT1 USING '1' 'PERNR' 'Personnel number' '20' 'C610'.
          PERFORM FCAT1 USING '1' 'SUBTY' 'Sub type' '20' 'C310'.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              I_CALLBACK_PROGRAM = SY-CPROG
              I_GRID_TITLE       = 'Report for displaying personnel number using selection screen'
              IT_FIELDCAT        = IT_FCAT1
            TABLES
              T_OUTTAB           = IT_PB40002.
        ENDIF.
      ENDIF.
    *&      Form  FCAT
          text
         -->FP_COL_POS    text
         -->FP_FIELDNAME  text
         -->FP_SELTEXT_M  text
         -->FP_OUTPUTLEN  text
         -->FP_EMPHASIZE  text
    FORM FCAT USING FP_COL_POS
    FP_FIELDNAME
    FP_SELTEXT_M
    FP_OUTPUTLEN
    FP_EMPHASIZE.
      WA_FCAT-COL_POS = FP_COL_POS.
      WA_FCAT-FIELDNAME = FP_FIELDNAME.
      WA_FCAT-SELTEXT_M = FP_SELTEXT_M.
      WA_FCAT-OUTPUTLEN = FP_OUTPUTLEN.
      WA_FCAT-EMPHASIZE = FP_EMPHASIZE.
      APPEND WA_FCAT TO IT_FCAT.
      CLEAR WA_FCAT.
    ENDFORM. " FCAT
    *&      Form  FCAT1
          text
         -->FP_COL_POS    text
         -->FP_FIELDNAME  text
         -->FP_SELTEXT_M  text
         -->FP_OUTPUTLEN  text
         -->FP_EMPHASIZE  text
    FORM FCAT1 USING FP_COL_POS
    FP_FIELDNAME
    FP_SELTEXT_M
    FP_OUTPUTLEN
    FP_EMPHASIZE.
      WA_FCAT1-COL_POS = FP_COL_POS.
      WA_FCAT1-FIELDNAME = FP_FIELDNAME.
      WA_FCAT1-SELTEXT_M = FP_SELTEXT_M.
      WA_FCAT1-OUTPUTLEN = FP_OUTPUTLEN.
      WA_FCAT1-EMPHASIZE = FP_EMPHASIZE.
      APPEND WA_FCAT1 TO IT_FCAT1.
      CLEAR WA_FCAT1.
    ENDFORM. " FCAT

  • SELECTION SCREEN FIELD FOR MONTH AND YEAR

    Hi All.
    We are developing a 'Monthly Sales Tax(payable) Report.
    they want the report based on the date(in the selection screen it will come only month and year only.).Depends on that month and year for that select-options ,it will pick up the record.
    like if, jan 2005  to march 2006.
    then it will  pick up from 01.01 .20005 to 31.03.2006  records.
    Can any body help me to resolve this.
    Thanks in advance,
    Regards,
    Venkat

    Hi Venkat,
    Copy the following code.
    DATA :  ws_billfrom    TYPE dats,
            ws_billto      TYPE dats.
    DATA : mon TYPE fcltx.
    SELECT-OPTIONS: s_month FOR mon
                MATCHCODE OBJECT zsdhtch_sh_mnth
                OBLIGATORY. "o get values for F4
    PARAMETER :  p_year LIKE bkpf-gjahr
                 MATCHCODE OBJECT zsdhtch_sh_year
                 OBLIGATORY.
    RANGES : s_date FOR sy-datum.
    DATA : ws_fcmnr TYPE fcmnr.
    START-OF-SELECTION.
      SELECT SINGLE mnr
             INTO ws_fcmnr
             FROM t247
             WHERE ltx = s_month-low.
      CONCATENATE p_year ws_fcmnr '01' INTO ws_billfrom.
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
           EXPORTING
                iv_date             = ws_billfrom
           IMPORTING
                ev_month_begin_date = ws_billfrom
                ev_month_end_date   = ws_billto.
      s_date-low = ws_billfrom.
      s_date-high = ws_billto.
      s_date-sign = 'I'.
      s_date-option = 'BT'.
      IF NOT s_month-high IS INITIAL.
        SELECT SINGLE mnr
               INTO ws_fcmnr
               FROM t247
               WHERE ltx = s_month-high.
        CONCATENATE p_year ws_fcmnr '01' INTO ws_billfrom.
        CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
             EXPORTING
                  day_in            = ws_billfrom
             IMPORTING
                  last_day_of_month = ws_billto.
        s_date-high = ws_billto.
      ENDIF.
      APPEND s_date.
      WRITE s_date.
    You can write your select statement here.  
      select * from dbtable where date in s_date.
    If 'HR_JP_MONTH_BEGIN_END_DATE' is nto there in your server, you can use 'RP_LAST_DAY_OF_MONTHS' in both cases.
    Regards,
    Susmitha.
    Dont forget to reward points for  useful answers

  • Error when generating the selection screen "1000"  for Report ztest

    Hi Experts,
    I am getting this strange error while trying to activate my report. I simply copy paste report from my other system to new system it was working fine there. I also created all include program etc.
    While I am trying to create "Selection-text" it is giving message that "Program contain some serious syntax error" while checking syntax saying that "Program is syntactically right".
    Any idea how to solve this???
    Regards,
    Gourav

    Here is the code::::
    SELECTION-SCREEN BEGIN OF BLOCK select  WITH FRAME TITLE text-sl1.
    Component
    SELECT-OPTIONS:
           s_xcide            FOR gw_zsmmess_compo-xcide
                              NO INTERVALS
                              MATCHCODE OBJECT zsm_xcide_oi.
    SELECTION-SCREEN END OF BLOCK select.
    SELECTION-SCREEN BEGIN OF BLOCK prcopt  WITH FRAME TITLE text-sl2.
    Default severity code
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-dsc.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_dfsevc   LIKE gw_zsmglob_sever-sevco
                           OBLIGATORY
                           MATCHCODE OBJECT zsm_sevco
                           DEFAULT '3'.
    SELECTION-SCREEN COMMENT 37(30) pt_sevtx.
    SELECTION-SCREEN END OF LINE.
    Minutes to wait before re-issuing alert
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-ria.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_aleexp(3) TYPE n
                            OBLIGATORY
                            DEFAULT '45'.
    SELECTION-SCREEN COMMENT 37(10) text-min.
    SELECTION-SCREEN END OF LINE.
    Use component specific parameters Yes/No
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-cpu.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_usecsp   RADIOBUTTON GROUP rg1  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(10) text-rby    FOR FIELD p_usecsp.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_dnucsp   RADIOBUTTON GROUP rg1.
    SELECTION-SCREEN COMMENT 35(10) text-rbn    FOR FIELD p_dnucsp.
    SELECTION-SCREEN END OF LINE.
    Create/update component specific parameters automatically
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(32) text-cpc.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_updcsp   RADIOBUTTON GROUP rg2.
    SELECTION-SCREEN COMMENT 35(10) text-rby    FOR FIELD p_updcsp.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_dnccsp   RADIOBUTTON GROUP rg2  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(10) text-rbn    FOR FIELD p_dnccsp.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-afo.
    SELECTION-SCREEN POSITION 33.
    Fire one alert per component/error type combination
    PARAMETERS: p_afrerr   RADIOBUTTON GROUP rg3  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(50) text-afe    FOR FIELD p_afrerr.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Fire one alert per component (= outbound XI interface)
    PARAMETERS: p_afrcom   RADIOBUTTON GROUP rg3.
    SELECTION-SCREEN COMMENT 35(50) text-afc    FOR FIELD p_afrcom.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Fire one alert per run
    PARAMETERS: p_afrrun   RADIOBUTTON GROUP rg3.
    SELECTION-SCREEN COMMENT 35(50) text-afr    FOR FIELD p_afrrun.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-sel.
    SELECTION-SCREEN POSITION 33.
    Select messages since last run
    PARAMETERS: p_lstrun   RADIOBUTTON GROUP rg4  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(40) text-slr    FOR FIELD p_lstrun.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Select messages in selected interval
    PARAMETERS: p_mintvl   RADIOBUTTON GROUP rg4.
    SELECTION-SCREEN COMMENT 35(40) text-sin    FOR FIELD p_mintvl.
    SELECTION-SCREEN END OF LINE.
    Message selection interval
    SELECTION-SCREEN BEGIN OF BLOCK msgfilt WITH FRAME TITLE text-msf.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(10) text-icr.
    SELECTION-SCREEN COMMENT 14(05) text-ifr.
    SELECTION-SCREEN COMMENT 25(05) text-dat       FOR FIELD p_stadat.
    Select messages - start date
    PARAMETERS: p_stadat   TYPE d.
    SELECTION-SCREEN COMMENT 46(05) text-tim       FOR FIELD p_statim.
    Select messages - start time
    PARAMETERS: p_statim   TYPE t.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 14(05) text-ito.
    SELECTION-SCREEN COMMENT 25(05) text-dat       FOR FIELD p_enddat.
    Select messages - end date
    PARAMETERS: p_enddat   TYPE d                  DEFAULT sy-datum.
    SELECTION-SCREEN COMMENT 46(05) text-tim       FOR FIELD p_endtim.
    Select messages - end time
    PARAMETERS: p_endtim   TYPE t                  DEFAULT sy-timlo.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK msgfilt.
    SELECTION-SCREEN END OF BLOCK prcopt.
    SELECTION-SCREEN BEGIN OF BLOCK testopt WITH FRAME TITLE text-tso.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(10) text-tst.
    SELECTION-SCREEN POSITION 33.
    List only, no updates
    PARAMETERS: p_lstonl    RADIOBUTTON GROUP rg5  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(14) text-tsl       FOR FIELD p_lstonl.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Execute updates
    PARAMETERS: p_update    RADIOBUTTON GROUP rg5.
    SELECTION-SCREEN COMMENT 35(14) text-tsu       FOR FIELD p_update.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK testopt.
    *eject
    INITIALIZATION.

  • Selection screen modification in case of SAP Query

    Hi All,
    I want to modify the selection screen in a standard progam.
    This program is getting generated through SAP QUERY.
    i want to modify some fields and also delete some fields in the
    selection screen. All these fields which i want to modify or delete
    are the logical database fields.So i can't do it through the t-code SQ01
    and SQ02. Also this is a program generated through the SAP QUERY,
    so i can't modify the generated code. Request if any one of you can suggest me to solve this.
    Waiting for a prompt reply!!
    Thanks,
    Rupesh

    Go to SQ02
    Select your Infoset-->Change
    On next Screen.
    Select GoTo->Code->Initialization.
    Write there code
    LOOP AT SCREEN.
      IF screen-name EQ 'SP$00004'.
           screen-required = 1.
           MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  • PNP Selection Screen Modification

    Hi All,
    Can anyone tell how to remove the payroll period section completely from the pnp selection screen. I tried all the means going to HR Report Category, I couldnt find the perfect category to hide the payroll period selection. It neither allow me to create a new one for my program. Please help me out as soon as possible with steps/navigation whichever possible..
    Thanks in advance,
    Charan

    you can create your own selection screen by going to Attributes -> HR Report Category -> New Report Category(button on the bottom of popup screen).
    here, you can select/deselect selection criteria.
    it looks like you were in the correct place - why didn't it let you create a new report category?
    if helpful, please don't forget to reward points.
    thanks,
    robert.

Maybe you are looking for