Selection screen data validation problem

Hello all,
Transaction FBL3N has an authority check on company.  If the user enters a company for which they have no authority, a message displays and they can then exclude that company.  The following steps can be repeated as many times as are required to ensure that all selection-screen values can be used.  The program, RFITEMGL, is doing all of the authorization using the code of the logical database that is part of the program.
I added the following logic in my program, which works fine, except when the entered values fail the authority check, I can't get off of screen 1000 and get to the sub-screen to exclude the unauthorized values unless I first change the range on screen 1000.
For an example:
If I enter range '100 ' through '900 ', and there is an unauthorized company, '200' in that range,  I can't add '200' as an excluded value without first changing the range to '100 ' to ' 199 ' on screen 1000.
Any thoughts on a solution?  I tried looking at the logical database code without much success.
at selection-screen on s_bukrs.
check if person entering company has authority
data: i_t001 type table of t001.
data: w_t001 type          t001.
  select * from t001
           into table i_t001
           where bukrs in s_bukrs.
  loop at i_t001 into w_t001.
    authority-check object 'F_BKPF_BUK'
                id 'BUKRS' field w_t001-bukrs
                id 'ACTVT' field '03'.
    if sy-subrc ne 0.
      message e000(zf) with 'Company'
                          w_t001-bukrs
                          'not authorized'.
    endif.
  endloop.
Thanks
Bruce

Hi,
Yes this is normal way as you entered wrong value in s_bukrs unless and until you change that you cannot proceed further.
instead of at selection-screen on s_bukrs.
use at selection-screen.
if s_bukrs is not initial.
do processing .,
and display info message'
endif.
or ., instead of error message  use dispaly like 'E'
like.,
at selection-screen on s_bukrs.
check authority.,
MESSAGE 'You are not Authorized to use the Company Code' type 'S' display like 'E'.
hope this helps you,
Thanks & Regards.

Similar Messages

  • Selection Screen Data Validation

    Hi All.
    I have made a program with vendor and purchase order inputs. If I give the correct vendor and PO it works fine. I want to implement validation. For that I have an internal table with vendor and all the PO's raised on him. Now I have to validate 1. vendor, 2. PO and 3. if a PO not of that vendor is entered then to display a message. I tried some option but the error message comparing the vendor and PO doesn't work. Can anyone give an idea please. Tks & Best Regards.

    Hi,
    Validate Vendor in LFA1-LIFNR , PO in EKKO-EBELN
    and combination as :
    select EBELN LIFNR
    from EKKO
    into table itab
    where EBELN = p_ebeln
    and    LIFNR   = p_lifnr.
    if sy-subrc ne 0.
          Message 'error message'.
    endif.
    Regards,
    Sachchidanand

  • Tabstrip on selection screen and validations

    Hi,
    I need to validate the selection screen data which is entered in tab strips.
    I need help in writing the validation for the data as below:
    If the MATERIAL (on tab1) is blank then the fields on tab2 are mandatory.
    AND if the MATERIAL (on tab1) is blank then the fields on tab2 are NOT mandatory.
    The code is as follows
    REPORT  ztest123.
    TABLES kna1.
    TABLES : sscrfields, vbap.
    DATA  gv_activetab(6) TYPE c .
    SELECTION-SCREEN BEGIN OF SCREEN 001 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS p_matnr TYPE mara-matnr.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN END OF SCREEN 001.
    SELECTION-SCREEN BEGIN OF SCREEN 002 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECT-OPTIONS:  so_kunnr  FOR kna1-kunnr NO INTERVALS NO-EXTENSION.
    SELECT-OPTIONS:  so_datum  FOR vbap-erdat NO-EXTENSION." DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN END OF SCREEN 002.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 5 LINES.
    SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1 DEFAULT SCREEN 001.
    SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2.
    SELECTION-SCREEN END OF BLOCK tabb1.
    AT SELECTION-SCREEN .
      CASE sscrfields-ucomm.
        WHEN 'UCOMM1'.
          tabb1-prog = sy-repid.
          tabb1-dynnr   = 001.
          tabb1-activetab = 'TABS1'.
          gv_activetab = 'TABS1' .
        WHEN 'UCOMM2'.
          tabb1-prog = sy-repid.
          tabb1-dynnr   = 002.
          tabb1-activetab = 'TABS2'.
          gv_activetab = 'TABS2'.
      ENDCASE.
    START-OF-SELECTION.
      CASE gv_activetab.
        WHEN 'TABS1'.
          WRITE: 'Material ' .
        WHEN 'TABS2'.
          WRITE: 'Plant '.
      ENDCASE.

    you have to do 2 things
    1) set fields mandatory
    IF p_matnr IS INITIAL.
        LOOP AT SCREEN.
          IF screen-name EQ 'SO_KUNNR-LOW'.
            screen-required = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    2) ensure the program is not run without a value, because the point 1 will be done only if user goes through tabstrip 2
    AT SELECTION-SCREEN .
      IF sscrfields-ucomm EQ 'ONLI'.
        IF p_matnr IS INITIAL.
          IF so_kunnr-low IS INITIAL.
            sscrfields-ucomm = 'UCOMM2'.
          ENDIF.
        ENDIF.
      ENDIF.
      CASE sscrfields-ucomm.
        WHEN 'UCOMM1'.

  • Error which validating selection screen data in subroutine

    Hi,this is my code
    selection-screen begin of block b_selection with frame title text-001.
    SELECT-OPTIONS: s_belnr for  rbkp-belnr,                                         "Invoice number
                    s_gjahr for rbkp-gjahr NO-EXTENSION NO INTERVALS,               "Fiscal year
                    s_stat  for  rbkp-rbstat OBLIGATORY NO-EXTENSION DEFAULT c_status, "Invoice status
                    s_blart for rbkp-blart OBLIGATORY DEFAULT c_doc_type,              "Document type
                    s_lifnr for rbkp-lifnr.                                          "Vendor
    selection-screen end of block b_selection.
    at selection-screen.
    select belnr gjahr from rbkp into table i_inv_data
                           where belnr  IN s_belnr
                           and   gjahr  IN s_gjahr
                           and   blart  IN s_blart
                           and   rbstat IN s_stat.
                           and   lifnr  IN s_lifnr.
      if i_inv_data[] is initial.
      message e000 with 'No record matching the search criteria'(001).
      endif.
    This is working fine...now when I try to modularise it, it is nt working
    selection-screen begin of block b_selection with frame title text-001.
    SELECT-OPTIONS: s_belnr for  rbkp-belnr,                                         "Invoice number
                    s_gjahr for rbkp-gjahr NO-EXTENSION NO INTERVALS,               "Fiscal year
                    s_stat  for  rbkp-rbstat OBLIGATORY NO-EXTENSION DEFAULT c_status, "Invoice status
                    s_blart for rbkp-blart OBLIGATORY DEFAULT c_doc_type,              "Document type
                    s_lifnr for rbkp-lifnr.                                          "Vendor
    selection-screen end of block b_selection.
    at selection-screen.
    perform sub_validate_data.
    FORM SUB_VALIDATE_DATA.
    select belnr gjahr from rbkp into table i_inv_data
                           where belnr  IN s_belnr
                           and   gjahr  IN s_gjahr
                           and   blart  IN s_blart
                           and   rbstat IN s_stat.
                           and   lifnr  IN s_lifnr.
      if i_inv_data[] is initial.
      message e000 with 'No record matching the search criteria'(001).
      endif.
    ENDFORM.                    " SUB_VALIDATE_DATA
    the error which I m getting is ' IN s_belnr should be followd by an internal table'Please tell how can I modularize this code and put the checking part in subroutine

    If I remove the period after s_stat your code is compiling without problems:
    SELECTION-SCREEN BEGIN OF BLOCK b_selection WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_belnr FOR  rbkp-belnr,
                    s_gjahr FOR rbkp-gjahr NO-EXTENSION NO INTERVALS,
                    s_stat  FOR  rbkp-rbstat OBLIGATORY NO-EXTENSION DEFAULT 'X',
                    s_blart FOR rbkp-blart OBLIGATORY DEFAULT 'X',
                    s_lifnr FOR rbkp-lifnr.
    SELECTION-SCREEN END OF BLOCK b_selection.
    AT SELECTION-SCREEN.
      PERFORM sub_validate_data.
    *&      Form  SUB_VALIDATE_DATA
    *       text
    FORM sub_validate_data.
      SELECT belnr gjahr FROM rbkp INTO TABLE i_inv_data
                         WHERE belnr  IN s_belnr
                         AND   gjahr  IN s_gjahr
                         AND   blart  IN s_blart
                         AND   rbstat IN s_stat
                         AND   lifnr  IN s_lifnr.
      IF i_inv_data[] IS INITIAL.
        MESSAGE e000(oo) WITH 'No record matching the search criteria'(001).
      ENDIF.
    ENDFORM.                    " SUB_VALIDATE_DATA
    Check, if you have an additional period somewhere else, or any other subtle differenec.
    Michael

  • Selection-screen fields validation for dialog

    Hello ABAP Gurus
    Requirements: this is a report wherein , depending upon the correct select-options , user will pick some field values from table and some will be entered by the user in the next se51 custom screen for creation of a record in a ztable .
    the problem is :without validating select-options values , it calls the se51 screen 100.
    How to keep the cursor at the selection-screen field until & unless user enters the correct i/p s .if i/p are correct then only it should call screen 100 otherwise remain in the selection screen only .
    *& Report ZSD_REP_QUOT_BANK_CREATE *
    REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.
    DATA: OK_CODE LIKE SY-UCOMM,
    SAVE_OK_CODE LIKE SY-UCOMM,
    WA_ITAB LIKE ZSD_TABL_QOTBANK,
    ANSWER TYPE C,
    COPIED ,
    STS TYPE N,
    EMGRP LIKE MARA-EXTWG,
    QTY LIKE ZSD_TABL_QOTBANK-QTY,
    UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,
    TOT LIKE ZSD_TABL_QOTBANK-TOT,
    INO LIKE VBAP-POSNR.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO
    NO INTERVALS NO-EXTENSION OBLIGATORY,
    S_ITNO FOR ZSD_TABL_QOTBANK-ITNO
    NO INTERVALS NO-EXTENSION OBLIGATORY.
    S_MATNO FOR ZSD_TABL_QOTBANK-MATNO
    NO INTERVALS NO-EXTENSION. "
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
    SELECT SINGLE VBTYP
    INTO VBAK-VBTYP
    FROM VBAK
    WHERE VBELN IN S_QTNO.
    IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.
    MESSAGE I005(ZQOTBANK).
    SET CURSOR FIELD S_QTNO-LOW.
    SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
    ENDIF.
    CLEAR WA_ITAB.
    SELECT SINGLE QTNO ITNO
    INTO WA_ITAB
    FROM ZSD_TABL_QOTBANK
    WHERE QTNO IN S_QTNO
    AND ITNO IN S_ITNO.
    IF SY-SUBRC EQ 0.
    MESSAGE I001(ZQOTBANK).
    SET CURSOR FIELD S_QTNO-LOW.
    SET CURSOR FIELD S_ITNO-LOW.
    SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
    ENDIF.
    *START-OF-SELECTION.
    END-OF-SELECTION.
    CALL SCREEN 0100.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS '0100'.
    SET TITLEBAR '0100'.
    ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.
    SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT
    KNUMV
    INTO (ZSD_TABL_QOTBANK-CCODE,
    ZSD_TABL_QOTBANK-SORG,
    ZSD_TABL_QOTBANK-DISTCHAN,
    ZSD_TABL_QOTBANK-DIV,
    ZSD_TABL_QOTBANK-CUSTNO,
    ZSD_TABL_QOTBANK-QTDAT,
    ZSD_TABL_QOTBANK-QTVALDAT,
    VBAK-KNUMV)
    FROM VBAK
    WHERE VBELN IN S_QTNO
    AND VBTYP = 'B'.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE KWMENG POSNR MATNR
    INTO (QTY , INO , ZSD_TABL_QOTBANK-MATNO)
    FROM VBAP
    WHERE VBELN IN S_QTNO.
    SELECT SINGLE EXTWG
    INTO EMGRP
    FROM MARA
    WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.
    ZSD_TABL_QOTBANK-ITNO = INO.
    ZSD_TABL_QOTBANK-EMATGRP = EMGRP.
    ZSD_TABL_QOTBANK-QTY = QTY.
    SELECT SINGLE KBETR
    INTO UPRICE
    FROM KONV
    WHERE KNUMV = VBAK-KNUMV
    AND KPOSN = INO
    AND KSCHL = 'PR00'.
    ENDIF.
    ZSD_TABL_QOTBANK-UPRICE = UPRICE.
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-CGL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-CGL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.
    UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.
    UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-TELK_QTY.
    UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-TELK_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-OTH_QTY.
    UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-OTH_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'SAVE'.
    INSERT ZSD_TABL_QOTBANK.
    IF SY-SUBRC EQ 0.
    MESSAGE I000(ZQOTBANK).
    COMMIT WORK.
    CALL SELECTION-SCREEN 1000.
    ELSE.
    MESSAGE E001(ZQOTBANK).
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module EXIT_COMMAND INPUT
    text
    MODULE EXIT_COMAND INPUT.
    SAVE_OK_CODE = OK_CODE.
    CLEAR OK_CODE.
    CASE SAVE_OK_CODE.
    WHEN 'CANCEL'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TITLEBAR = 'Quotation Bank Entry'
    TEXT_QUESTION = 'Do you want to Cancel ?'
    TEXT_BUTTON_1 = 'Yes'
    TEXT_BUTTON_2 = 'No'
    DEFAULT_BUTTON = '2'
    IMPORTING
    ANSWER = ANSWER.
    IF ANSWER = '1'.
    LEAVE PROGRAM.
    ELSE.
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    WHEN 'EXIT'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TITLEBAR = 'Quotation Bank Entry'
    TEXT_QUESTION = 'Do you want to Exit ?'
    TEXT_BUTTON_1 = 'Yes'
    TEXT_BUTTON_2 = 'No'
    DEFAULT_BUTTON = '2'
    IMPORTING
    ANSWER = ANSWER.
    IF ANSWER = '1'.
    LEAVE PROGRAM.
    ELSE.
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    ENDCASE.
    ENDMODULE. " EXIT_COMMAND INPUT
    Thnx in Advance

    Put the statement
    CALL SCREEN 100
    in the event <b>AT SELECTION-SCREEN</b> and NOT in <b>END-OF-SELECTION</b>.
    Regards,
    Subramanian V.

  • Filtering of the data based upon the selection screen data using ldb

    Hi Experts ,
    I am using ldb pnpce, for my report ,and i created my own report category with selection paramaters
    action type and payroll area
    now the problem is when i am giving the action type as Z0 ,the data to be extracted is not getting filtered
    based upon the action type ,the data consists the records having different action types other than Z0
    Please give me some solution for this

    Thanks Durga ,but the link wat ever u was for hiding the selection screen fields
    but my question is when am using get pernr event my data is not getting filtered with the selection screen paramater value
    i,e m giving action type as only hiring ,but m getting the data for all the action types ,its not filtering based upon my selection

  • Selection OPTION: Date input problem in Module POOL through Subscreen

    Dear ALL,
    Being new to ABAP, I am struck in a Problem.
    Requirement:
    I want an option on the Screen( My Screen 9000) for Date Range. Through this Date-Range I want to filter and pull some data from
    Database.
    As Date Range Selection option is possible only through Sub-Screen integration. Hence I integrated a Sub-Screen 400 (as below) and named the Sub-Screen area as SEL on my screen.
    Problem: As soon as I enter the dates on the screen, then those dates are not taken up by the code.
    During debugging I saw the the S_datum-low and S_datum-high are empty (in fact 00000000)
    The code follows:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_9000.
      Call SUBSCREEN SEL  INCLUDING sy-repid '400'.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_9000.
    DATA:  gv_datum     Type   dats,
    SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
        SELECT-OPTIONS: s_datum FOR gv_datum.
    SELECTION-SCREEN END OF SCREEN 400 .
    Plz help where I am missing something.
    Regards
    Chandan

    Call the subscreen during the AT SELECTION-SCREEN event.
    SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
    SELECT-OPTIONS: s_datum FOR gv_datum.
    SELECTION-SCREEN END OF SCREEN 400 .
    AT SELECTION-SCREEN.
       CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
       SET PF-STATUS '0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
       CASE sy-ucomm.
         WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
           LEAVE TO SCREEN 0.
       ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

  • To display  selection screen date parameter  in smart form

    Hi to all
    My requirement is to display date parameters which are given at selection screen (module pool program ) on the smart forms.
    I just want to dispaly this on selection.
    SO_BLDAT-LOW
    SO_BLDAT-HIGH
    Please guide.
    Regards
    Anubhav

    Hi,
      If you are calling the smartform from the module program then export the parameters from the calling FM  
      and import the same in the smartform.
    Regards,
    Sandeep

  • Selection Screen - Date and Time

    Hi,
    I have given a selection screen where the user needs to key in the input in the following format
    dd.mm.yyyy hh:mm:ss.
    Reason is that the database fetching these elements accepts only in this criteria.
    Now as they look into automating this program, they would want to automatically take the current system date and time - 24 hours .
    How do I achieve this in the above format? If this is not possible, let me know if i can make the selection screen with normal sap date format and convert it to the above format on passing to the select statement.
    Regards
    Sam

    Hi Sam,
    See this. Is this your requirement.
    With this we are able to get Current time-stamp to selection parameter.
    REPORT ZTEST.
    DATA: L_TS TYPE TZNTSTMPS,
           L_TS_C TYPE CHAR14.
    PARAMETERS:
    P_TMSTMP TYPE TMSTMP OBLIGATORY MEMORY ID TEST.
    INITIALIZATION.
       GET TIME STAMP FIELD L_TS.
       MOVE L_TS TO L_TS_C.
       SET PARAMETER ID  'TEST' FIELD L_TS_C.
    The output is
    Jogeswara Rao K

  • Date Validation problem in form with report

    Hi,
    I am stuck on this date validation issue in a form with report that I am working on-
    I have an Active_date_start and an Active_date_end field. I want to validate the form in such a way that if the user enters the Active_date_end < active_date_start then it should error out appropriately asking to change the active_end_date . Also another problem is that the changes are made to the active_date_end they should reflect in the table. How do I accomplish this.
    Appreciate all the help offered.
    Thanks.

    Hi,
    Thanks for the code.Now the APPLY CHANGES works fine except that it throws an error when I change the end date to a date which is less than the start date . So it does show me my error and does not go further but also shows me the error -
    Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306: wrong number
    or types of arguments in call to 'NVL' ORA-06550: line 1, column 7: PL/SQL: Statement
    ignored Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306:
    wrong number or types of arguments in call to 'NVL' ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I looked up the error number and it says its a generic error type where the error can be found on the line number specified. But in this case how and where do I look for the error line?. This is the code I am using-
    DECLARE
    vACTIVE_DATE_START DATE;
    vACTIVE_DATE_END DATE;
    BEGIN
    vACTIVE_DATE_START := TO_DATE(:P4_ACTIVE_DATE_START, 'DD/MM/YYYY');
    vACTIVE_DATE_END := TO_DATE(:P4_ACTIVE_DATE_END, 'DD/MM/YYYY');
    IF vACTIVE_DATE_END < vACTIVE_DATE_START THEN
    RETURN 'End date is before start date';
    ELSE
    RETURN NULL;
    END IF;
    END;
    My base table has the active_date_start as NOT NULL. Now I have the exact same code for APPLY CHANGES
    in other form and it works fine not giving the above error. I am at a loss to know how I can get rid of the error.
    Any suggestions!.
    Thanks in advance,
    A

  • Select-options on selection-screen type char100 problem

    Hi friends! I created on selection-screen a select-options:
    SELECT-OPTIONS: zzcduc     FOR      equi-ZZCDUC.
    The field  equi-ZZCDUC is a CHAR100 field. The problem is when I run program, in this field user can't input more of 46 characters. This is a serial number with 100 characters, why I can input 100 characters?
    Thanks for any help.

    Hi, this is copied from SELECT-OPTION documentation:
    The LOW and HIGH fields of a selection option are displayed in a length up to 18 bytes long (scrollable up to 45 bytes). If you define a length longer than 45, fields are truncated on the selection screen after the 45th character. This affects the first line of the SELECT-OPTIONS table. You can, however, use SUBMIT to pass longer selection options to a report if they are specified with the addition NO-DISPLAY and thus do not appear on the selection screen. Without NO-DISPLAY, the fields are then truncated whenever the selection screen is processed in the background ( SUBMIT without VIA SELECTION-SCREEN).
    regards,

  • Selection screen parameter validation using search help/check table

    Hi experts,
    I have a select-option that is tied to a search help and check table (type tq80-qmart). Is there a way to automatically validate the field based on what comes up in the F4 search help? What I mean is, when the user hits F4 on the parameter, the list pops up with several records that the user can choose. When the program is executed, I want the program to show an error if the value is NOT in that F4 list.
    I know this can be done in AT SELECTION SCREEN event with a select, but I was wondering if there was a way ABAP does it automatically. Any help will be greatly appreciated.
    Thanks,
    Juan

    Hello Juan,
    SAP does have a standard way of allowing the the user to select from the list via LISTBOX.
    But list box is restricted to parameters only, you cannot attach list boxes to select-options.
    I think the best place to do this validation would be th AT SELECTION-SCREEN event & from your original post it seems you know what code to write

  • Viewset - active view and data validation problem

    Hey there,
    I've a problem while using a viewset (1 col, 2 rows) and the data-validation in the wdDoBeforeAction() method.
    My application works basically like this:
    The first view is displayed with 2 mandatory input fields. Upon the evaluation result of the entered data in these fields, a corresponding second view will be displayed. The input fields in the first view are set to read only and a button named "Change" appears. This button triggers an action which fires and outbound-plug to an empty view, so that the second view disappears and resets the "read only" properties of the input fields in the first view, so that the user can enter new data.
    The problem is, that the second view contains input fields itself, which are validated in the wdDoBeforeAction() method of this view. The navigation is cancelled if an error occurs. Well, this is fine if i want to submit (pressing the button "Approve" in the second view) this data and proceed, but if i want to go back to the first view (by hitting the "Change" button), i want to discard all information entered in the second view and i dont want this data to be validated. It's quite annoying if u just want to correct the first views data but have to enter correct values for the second view in order to get through the second views checks..
    I hope that's clear enough, otherwise i will upload a screenshot to clarify.
    Thx in advance
    Regards
    Pascal

    Hi Pascal,
    although I wont prefer to do so for reasons of readability, you could use wdDoProcessbeforeAction to control your view-flow.
    Take a look at the example, I have two Buttons with two actions, one is set on "Validate", the other is not (guess which on is the validating ).
    You can get the action triggered inside the doBefore ... method and determine whether or not the checkbox is set.
    So put your code to validate the input in the i(isValidting) branch and your problems are solved.
    Keep in Mind: I would delegate the Validation from the view to the controller, handle the validation myself with custom coding and then check in the view controller if any errors occured.
    hope that helped,
    Jan
      //@@end
      public void wdDoBeforeAction(com.sap.tc.webdynpro.progmodel.api.IWDBeforeAction validation)
        //@@begin wdDoBeforeAction
           IWDAction currentAction = validation.getCurrentAction();
           if (currentAction == null) return;
           String action = currentAction.getText();
           boolean isValidating = currentAction.isValidating();
           if (isValidating) {
                wdComponentAPI.getMessageManager().reportException(action);
           } else {
                wdComponentAPI.getMessageManager().reportSuccess(action);
        //@@end
    Edited by: Jan Galinski (Holisticon) on Sep 8, 2009 3:15 PM

  • Displaying selection screen data on alv header in multiple rows and columns

    Hi
    Presently in my requirement , whatever  the data entered in  selection screen  should display  on alv header  and item details on alv grid display.
    for eg...
    on alv header
      customer no :  1000 to 2000         sales order no: 111
      name :    gff to ff                                 sales org:
      city:                                         country:
      item details below this   
      plz guide me how to solve this issue.
    Thanks & Regards,
    Pradeep

    Hi,
    Check this code this may help you.
    <code>
    TYPE-POOLS : SLIS.
    TABLES VBRK.
    TYPES : BEGIN OF TY_VBRK,
            VBELN TYPE VBRK-VBELN,
            VKORG TYPE VBRK-VKORG,
            VTWEG TYPE VBRK-VTWEG,
            SPART TYPE VBRK-SPART,
            FKDAT TYPE VBRK-FKDAT,
            END OF TY_VBRK,
            BEGIN OF TY_VBRP,
            VBELN TYPE VBRP-VBELN,
            POSNR TYPE VBRP-POSNR,
            MATNR TYPE VBRP-MATNR,
            ARKTX TYPE VBRP-ARKTX,
            FKIMG TYPE VBRP-FKIMG,
            NETWR TYPE VBRP-NETWR,
            END OF TY_VBRP,
            BEGIN OF TY_TARGET,
            VBELN TYPE VBRK-VBELN,
            VKORG TYPE VBRK-VKORG,
            VTWEG TYPE VBRK-VTWEG,
            SPART TYPE VBRK-SPART,
            FKDAT TYPE VBRK-FKDAT,
            POSNR TYPE VBRP-POSNR,
            MATNR TYPE VBRP-MATNR,
            ARKTX TYPE VBRP-ARKTX,
            FKIMG TYPE VBRP-FKIMG,
            NETWR TYPE VBRP-NETWR,
            END OF TY_TARGET.
    DATA : T_VBRK TYPE TABLE OF TY_VBRK,
           W_VBRK TYPE TY_VBRK,
            T_VBRP TYPE TABLE OF TY_VBRP,
            W_VBRP TYPE TY_VBRP,
            T_TARGET TYPE TABLE OF TY_TARGET,
            W_TARGET TYPE TY_TARGET,
    FIELD CATALOG ******************
            T_FCAT TYPE SLIS_T_FIELDCAT_ALV,
            W_FCAT TYPE SLIS_FIELDCAT_ALV,
    *************************************SUB TOTALS AND SORTING***********
            T_SORT TYPE SLIS_T_SORTINFO_ALV,
            W_SORT TYPE SLIS_SORTINFO_ALV,
    *************************************FOR LIST HEADER******************
            T_LIST_HEAD TYPE SLIS_T_LISTHEADER,
            W_LIST_HEAD TYPE SLIS_LISTHEADER,
            T_LIST_HEAD1 TYPE SLIS_T_LISTHEADER,
            W_LIST_HEAD1 TYPE SLIS_LISTHEADER,
    *************************************FOR LIST HEADER******************
            W_LAYOUT TYPE SLIS_LAYOUT_ALV,
    ************************************FOR EVENTS************************
            T_EVENT TYPE SLIS_T_EVENT,
            W_EVENT TYPE SLIS_ALV_EVENT.
    *********************************SELECT OPTIONS***********************
    SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN DEFAULT 90005316 TO 90005330.
    **RETRIVING DATA************************
    PERFORM DATA_RETRIVE.
    **BUILDING THE FIELD CATALOG************
    PERFORM BUILD_FCAT.
    **BUILDING THE TABLE FOR LIST HEADER****
    PERFORM BUILD_LIST_HEAD.
    *******************************CALLING THE FUNCTION MODULE************
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM     = SY-REPID
        I_CALLBACK_TOP_OF_PAGE = 'LIST_TOP_OF_PAGE'
        IT_FIELDCAT            = T_FCAT
        IT_SORT                = T_SORT
      TABLES
        T_OUTTAB               = T_TARGET.
    *&      Form  DATA_RETRIVE
    FORM DATA_RETRIVE .
    SELECT VBELN VKORG VTWEG SPART FKDAT FROM VBRK INTO CORRESPONDING FIELDS
    OF TABLE T_VBRK WHERE VBELN IN S_VBELN.
      IF SY-SUBRC EQ 0.
        SORT T_VBRK BY VBELN.
        SELECT VBELN POSNR MATNR ARKTX FKIMG NETWR FROM VBRP INTO TABLE
         T_VBRP FOR ALL ENTRIES IN T_VBRK WHERE VBELN = T_VBRK-VBELN.
      ENDIF.
      LOOP AT T_VBRP INTO W_VBRP.
        LOOP AT T_VBRK INTO W_VBRK WHERE VBELN = W_VBRP-VBELN.
          W_TARGET-VBELN = W_VBRK-VBELN.
          W_TARGET-VKORG = W_VBRK-VKORG.
          W_TARGET-VTWEG = W_VBRK-VTWEG.
          W_TARGET-SPART = W_VBRK-SPART.
          W_TARGET-FKDAT = W_VBRK-FKDAT.
          W_TARGET-POSNR = W_VBRP-POSNR.
          W_TARGET-MATNR = W_VBRP-MATNR.
          W_TARGET-ARKTX = W_VBRP-ARKTX.
          W_TARGET-FKIMG = W_VBRP-FKIMG.
          W_TARGET-NETWR = W_VBRP-NETWR.
          APPEND W_TARGET TO T_TARGET.
        ENDLOOP.
      ENDLOOP.
      SORT T_TARGET BY VBELN.
    ENDFORM.                    " DATA_RETRIVE
    *&      Form  BUILD_FCAT
    FORM BUILD_FCAT .
      W_FCAT-COL_POS = 1.
      W_FCAT-FIELDNAME = 'VBELN'.
      W_FCAT-SELTEXT_M = 'BILLING NO'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 2.
      W_FCAT-FIELDNAME = 'VKORG'.
      W_FCAT-SELTEXT_M = 'SALES ORGANIZATION'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 3.
      W_FCAT-FIELDNAME = 'VTWEG'.
      W_FCAT-SELTEXT_M = 'DISTRIBUTION CHANNEL'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 4.
      W_FCAT-FIELDNAME = 'SPART'.
      W_FCAT-SELTEXT_M = 'DIVISION'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 5.
      W_FCAT-FIELDNAME = 'FKDAT'.
      W_FCAT-SELTEXT_M = 'CREATION DATE'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 6.
      W_FCAT-FIELDNAME = 'POSNR'.
      W_FCAT-SELTEXT_M = 'BILLING ITEM'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 7.
      W_FCAT-FIELDNAME = 'MATNR'.
      W_FCAT-SELTEXT_M = 'MATERIAL NUM'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 8.
      W_FCAT-FIELDNAME = 'ARKTX'.
      W_FCAT-SELTEXT_M = 'DESCRIPTION'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 9.
      W_FCAT-FIELDNAME = 'FKIMG'.
      W_FCAT-SELTEXT_M = 'QUANTITY'.
      APPEND W_FCAT TO T_FCAT.
      W_FCAT-COL_POS = 10.
      W_FCAT-FIELDNAME = 'NETWR'.
      W_FCAT-SELTEXT_M = 'NET VALUE'.
      W_FCAT-DO_SUM = 'X'.
      APPEND W_FCAT TO T_FCAT.
    ENDFORM.                    " BUILD_FCAT
    *&      Form  BUILD_LIST_HEAD
    FORM BUILD_LIST_HEAD .
      DATA : L_DATE(10),
             L_TIME(8).
      W_LIST_HEAD-TYP = 'S'.
      W_LIST_HEAD-KEY = 'Sales org :'.
      W_LIST_HEAD-INFO = S_VBELN-LOW .
      APPEND W_LIST_HEAD TO T_LIST_HEAD.
      CLEAR W_LIST_HEAD.
      W_LIST_HEAD-TYP = 'S'.
      W_LIST_HEAD-KEY = 'TO '.
      W_LIST_HEAD-INFO =  S_VBELN-HIGH.
      APPEND W_LIST_HEAD TO T_LIST_HEAD.
      CLEAR W_LIST_HEAD.
    ENDFORM.                    " BUILD_LIST_HEAD
    *&      Form  LIST_TOP_OF_PAGE
    FORM LIST_TOP_OF_PAGE .
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = T_LIST_HEAD.
    ENDFORM.                    " LIST_TOP_OF_PAGE
    <code>
    Regards

  • Selection screen :data retrieval

    how to pass the contents of each individual input fieldfrom the selection screen to the ABAP program.My selection screen is
    SELECTION-SCREEN BEGIN OF BLOCK ID WITH FRAME TITLE TEXT-001.
       SELECT-OPTIONS:
                        EBELN  FOR EKKO-EBELN NO INTERVALS,
                        AEDAT  FOR EKKO-AEDAT.
    SELECTION-SCREEN END OF BLOCK ID.
    i need value of ebeln(purchase order) which i select on selection screen as i have to use it in query in same program.

    Hi,
    You can get the details in an internal table<b> i_ekko</b> as shown below.Use this table for further procesing in your program.
    SELECTION-SCREEN BEGIN OF BLOCK ID WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS:
    S_EBELN FOR EKKO-EBELN NO INTERVALS,
    S_AEDAT FOR EKKO-AEDAT.
    SELECTION-SCREEN END OF BLOCK ID.
    DATA: i_ekko type standard table of ekko with header line.
      SELECT  *  FROM EKKO INTO TABLE i_lfa1 WHERE ebeln IN s_ebeln AND aedat IN s_aedat.
    *Always reward points for helpful answers.
    Regards,
    Amit
    Message was edited by:
            Amit Kumar

Maybe you are looking for

  • Is there a limit to the number of selectors you can have in a CSS file for Mozilla Firefox to work?

    I am writing the CSS code for my website and the CSS is being interpreted correctly by Chrome but is not even being read by Mozilla Firefox. When I use firebug, I can see that the classes appear in the HTML code but are not interpreted in the CSS. Th

  • App.executeCommand(app.findMenuCommandId("Solid...")) doesn't work right?

    Hey guys, I'm tring to use app.executeCommand(app.findMenuCommandId("Solid...")) to add a solid layer to active comp. But it only add a solid layer to the project panel, instead of adding the solid layer to both project panel and active comp. It work

  • FBL3N_MASS CHANGE

    Dear : we want to user the FBL3N to change the document line items field _reason code. but when we use the "MASS CHange", the system didn't allow . when I use anather one's id to change the same document numbers , it is ok. so i want to consult that

  • Restart dunning notice printout

    Hello all, I've got a problem with the dunning process (F150) of just one concret execution (id "XXXX"): - Parameters maintaned --> Ok - Proposal generated --> Ok - Dunning printout --> Ko --> Some items of some customers changed dunning level and so

  • How to unlock the password

    Hi Friends, My R/3 system is locked how to reset the password again. Please give me solution Reset the password. it's very urgent plz give reply's ASAP. Thanks & Regards, Guna.