Validation on VKORG+VTWEG+SPART COMBINATION of my selection screen?

Hi Experts,
User has ability to enter the Sales Org-VKORG, Distribution channel-VTWEG, Division-SPART values in the selectuion screen, so I have to validate all this (VKORGVTWEGSPART) COMBINATION is correct, if not I have to throw an error message.
Not sure, TVTA table helps me in this validation? if so, How to do that? or do we have any standard SAP function module to  cross-check all this COMBINATION!!
Thank you

Am Sorry Rob.
Its all are parameters.
Actually, this is a very common requirement(validation) with many many cases, so I thought, SAP might have come up (ECC) with any FM, we are on ECC
Thank you

Similar Messages

  • Table for vkorg,vtweg,spart and werks(urgent)

    Hi experts,
    I have selection screen with vkorg,vtweg,spart,werks.
    i want to validate this field (to check the combination is valid or not)
    is there any table which contain all this four field.
    thanks in advance
    thanks,
    Neo

    thanks naren for your quick reply,
    but do i need to check combination.for example
    vkorg : 6000
    vtweg : 03
    spart: 02
    This all 3 values are valid but the combination is not giving me any output.
    then how do i check combination .
    thanks,
    neo

  • VKORG, VTWEG, SPART cannot be determined for customer C3000 , vendor VENDOR001

    Message Type is ORDERS & basic Type is ORDERS05.
    While executing IDOC, we are getting error message 51 with below message.
    Message no. VG204
    VKORG, VTWEG, SPART cannot be determined for customer C3000 , vendor VENDOR001.
    Relation with SAP values is maintained table EDPAR. but while executing IDOC through IDOC_INPUT_ORDERS, System is not collecting values from EDPAR table.
    Do we have user exit available to resolve this issue.
    Please help.
    Thanks & Regards,
    Ashish Mankar/Ganesh.

    Hi Guido,
    One of my clients are getting the same error, and without a complete access to their system its proving very difficult to resolve.
    I know about VOE4 - Mapping, where the supplier 'maps' the customers cost-centre/business unit/int ref etc to suppliers account number.
    Just wondering what is the difference between VOE2 and VOE4?
    Thanks,
    Tanzim

  • IDoc error: VKORG, VTWEG, SPART cannot be determined for customer PNR020 , vendor 0000010000

    Hi,
    we want to use EDI & IDoc to fulfill communication between group companies. i have done some related setting:
    scenario: PAQ(customer) as a customer deliver PO to PAD(vendor), then PAD created SO automatically:
    but PAD cant' create SO due to:   VKORG, VTWEG, SPART cannot be determined for customer PNR020 , vendor 0000010000, i also have maintained table: EDSDC, but still failed, Could someone please let me me know how to fix this, thanks.
    PAD setting:
    we20:
    table: EDSDC:

    Hi Mishra,
    Thanks for your reply, have a great day.

  • Vkorg,vtweg,spart cannot be determined

    im using ORDERS05 idoc to create sales order.when im executing it in we19,the above error is displayed.can any one suggest me the process and mandatory fields in orders05.where should i give the inputs for sales area??
    Edited by: vidya sagar on Jul 15, 2009 7:49 PM

    What sense does it make to address this question to a person who did not respond to same question 2 years ago?
    Just click his user name and look at his profile :
    last logged in in January 2011 - 2 and half year ago. Do you really think that a second kiss wakes up the sleeping beauty?
    Hadn't you already made experience 2 weeks ago where you added your "I have the same problem" to a question from 2010: IDOC_INPUT_ORDERS | SCN
    You did not get any answer.
    Can you imagine why nobody else shows up?
    The questions are marked answered. It is not really beneficial to answer answered questions.
    Wouldn't it be much better to create your own discussion and explain in detail your issue and why the answers from the old discussion did not solve your problem.
    If it is the same problem, then usually the same solution should help you too, dont you think so?

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

  • Validating field on  selection screen

    wht is the meaning of validation
    how to validate a particular field on selection screen
    suppose parameters:p_vkorg like vbak-vkorg.
    how to validate p_vkorg.
    pz give me coding

    Hello pavan,
    Validation means "checking whether the input which u are gining to the selection secreen is valid or not". means...
    Lets take your example only...
    parameters:p_vkorg like vbak-vkorg.
    in selection screen you will give inout in that parameter....
    users can give any input... lets suppose I'll give input as ABC... which is not in the table VBAK. No need to excute the code once we came to know that the input is not there in the table. So we will do validation like...
    at selection-screen on p_vkorg.
    select * from vbak where vkorg = p+vkorg. " This is the case with Parameter.
    at selection-screen on p_vkorg.
    Select * from vbak where vkorg = p+vkorg. " This is the case with Selct-option.
    if the input that u r giving is present in the table... the above stmt will execute successfully, otherwise not.
    You can make use of System variable SY-SUBRC and you can go ahead with ur coding...
    Reward If Helpful
    Regards
    Sasidhar Reddy Matli.
    Message was edited by:
            Sasidhar Reddy Matli

  • Problem in AT selection screen validation

    Hi,
    I am having problem in AT SELECTION SCREEN Validation.
    I have 2 radiobutton and 6 parameter. if i click first radio button  all the 6 radiobutton should enable and take the user input, that is working fine for me.
    if i click second radiobutton , out of 6 , 3 parameter should disable and remaining 3 should enable. thats also working fine.
    My problem is program has written the validation for this 3 parameter in the AT SELECTION SCREEN.
    For first radioutton all the validation working  fine, for second validation as soon as i press the radiobutton it will display error message. Based on 2 parameter user is filling value for 3 rd parameter.
    I want the same validation to be done for second radio button after user pressing enter.
    PARAMETER: p_single RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND f1,
               p_multi RADIOBUTTON GROUP rad1.
    PARAMETERS: s_pwwrk LIKE plaf-pwwrk.          
    PARAMETERS: p_lgort LIKE plaf-lgort.
    PARAMETERS: p_kostl LIKE cobl-kostl.
    here is my code:
    AT SELECTION SCREEN.
    CLEAR t001w.
      CLEAR t001k.
      CLEAR marv.
      SELECT SINGLE * FROM t001w WHERE werks EQ s_pwwrk.
      IF sy-subrc NE 0.
        MESSAGE e999 WITH 'Plant' s_pwwrk 'does not exist'.
      ELSE.
        SELECT SINGLE * FROM t001k WHERE bwkey EQ t001w-bwkey.
        SELECT SINGLE * FROM marv WHERE bukrs EQ t001k-bukrs.
        IF p_budat0(4) NE marv-lfgja OR p_budat4(2) NE marv-lfmon
    IF marv-xruem IS NOT INITIAL.
            IF p_budat0(4) NE marv-vmgja OR p_budat4(2) NE marv-vmmon.
    MESSAGE e999 WITH p_budat4(2) p_budat0(4)
                                'is closed.
                                            Please try again.'.
            ENDIF.
          ELSE.
            MESSAGE e999 WITH p_budat4(2) p_budat0(4)
                              'is closed.
                                          Please try again.'.
          ENDIF.
        ENDIF.
      ENDIF.

    For your Case ,
    If i understand clearly,You can do the validation when you want on AT SELECTION SCREEN ON WP_FIELD.
    If you say your validation to be done only for Selection of Second Radio Button, then..
    AT SELECTION SCREEN.
    if p_multi  eq 'X'. "<- Make Validation to be done only if user select Second Button
    CLEAR t001w.
    CLEAR t001k.
    CLEAR marv.
    SELECT SINGLE * FROM t001w WHERE werks EQ s_pwwrk.
    IF sy-subrc NE 0.
    MESSAGE e999 WITH 'Plant' s_pwwrk 'does not exist'.
    ELSE.
    SELECT SINGLE * FROM t001k WHERE bwkey EQ t001w-bwkey.
    SELECT SINGLE * FROM marv WHERE bukrs EQ t001k-bukrs.
    IF p_budat+0(4) NE marv-lfgja OR p_budat+4(2) NE marv-lfmon
    IF marv-xruem IS NOT INITIAL.
    IF p_budat+0(4) NE marv-vmgja OR p_budat+4(2) NE marv-vmmon.
    MESSAGE e999 WITH p_budat+4(2) p_budat+0(4)
    'is closed.
    Please try again.'.
    ENDIF.
    ELSE.
    MESSAGE e999 WITH p_budat+4(2) p_budat+0(4)
    'is closed.
    Please try again.'.
    ENDIF.
    ENDIF.
    ENDIF.
    endif.

  • Selection-screen validation

    Hi Experts,
          Please can any one give me the details ..
      1)What is the actual use of selection screen  validation?
    2) When we use Selection-screen validation?
    3)If we are not written the selection-screen validation is there any effect?
    I know how to write the validation for a selection screen. But why i am asking above questions is I am very new to ABAP .My Functionl people also new to ABAP. They told me one report.I asked me what are the validation for selection screen . At that time they told there is no validation.
         Thats the reason to ask above questions..
      please tell me the details..
    Thanks In Advance..
    Thanks and Regards
    Siri..

    Abhi,
    Selection Screen Validation are used for correct input processing.
    Selection screen elements are used further in select queries to fetch data. if user enters some wrong input
    we will unnecessarily hit the data base with wrong values and select will fail , hence validation of the input
    will avoid unnecessary data base hit.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 27, 2008 12:26 PM

  • Getting list of Sales condition types based on matnr , vkorg,vtweg

    Hi ,
               I would like to know if there are any FM that retrieve condition values similar to transaction:VK13 based on access sequence.What I mean by access sequence is if there are no records maintained for the first key combination then it should search for the next key combination until a condition value exist.
    I have all the mandatory information like VKORG,VTWEG,MATNR,VKGRP..etc similar to VK13
    for all the key combinations of VK13.
    i tried using FM's
       WV_KOMK_FILL_V
       WV_KOMP_FILL_V
       CONDITION_RECORD_READ
       SALES_PRICE_COND_TYPE_GET
       PRICING_GET_CONDITIONS
       PRICING_LOAD_CONDITION_TYPS
      SD_COND_TYPES_OF_PRICING_PROC
      WB2_SD_MAUNAL_PRICING_COND_GET
    CONDITION_TYPS_FOR_PRICING
    SALES_PRICE_CALCULATE_01
    SD_COND_AUTH_CHECK
    SD_GET_ALL_CONDTYPE_FROM_KOTAB
      But i couldn't get the solution . Plz guide me in using these FM's  in which order.
      My input will be MATNR(Article Number),Sales Organisation(VKORG),Division(VTWEG),Customer(kunnr) .
    I want to list all the condition types . 
    Thanks in advance .
    Regards,
    S.Sivakumar
    Edited by: sivakumar subramaniam on Oct 31, 2009 4:29 PM

    You can try the function : SD_CONDITION_TIME_INTERVAL_GET
    This func reture condition records and types:
          KOMG-VKORG = P_VKORG.
          KOMG-VTWEG = P_VTWEG.
          KOMG-MATNR = P_MATNR.
          KOMG-VKGRP = P_VKGRP.
          CALL FUNCTION 'SD_CONDITION_TIME_INTERVAL_GET'
            EXPORTING
              KOMG_I      = KOMG
              DATVO_I     = S_DATAB-LOW
              DATBI_I     = S_DATAB-HIGH
            TABLES
              PERIODS_TAB = GT_PREDATE
              KSCHL_TAB   = GT_TKSCH
            EXCEPTIONS
              OTHERS      = 1.
          READ TABLE GT_PREDATE INDEX 1.
          CHECK SY-SUBRC = 0.
          LOOP AT GT_PREDATE.
            SELECT SINGLE H~ERNAM H~ERDAT P~KBETR
                INTO (GT_ITAB-ERNAM, GT_ITAB-ERDAT,GT_ITAB-KBETR)
                FROM KONH AS H
                JOIN KONP AS P
                  ON P~KNUMH = H~KNUMH
               WHERE H~KNUMH = GT_PREDATE-KNUMH.
            APPEND GT_ITAB.
          ENDLOOP.
    Edited by: Song Huang on Jan 20, 2010 11:46 AM

  • Selection-screen: Input help for VTWEG

    Hello!
    Can anybody help me with the following problem:
    I have two select-options (VKORG and VTWEG) on my selection screen. Now there should be the possibility to restrict the values shown as input help for VTWEG after having selected a value for VKORG.
    I've already tried to do this by using a matchcode object but for VKORG and VTWEG I was not able to find suitable search helps.
    In my opinion this should be possible without using the "AT SELECTION-SCREEN ON VALUE-REQUEST FOR ...". If not, it would be interesting to getting to know your approaches to this task.
    Thank you in advance!

    you can refer to the following code
    and you can write the code in the same way as per your requirement
    *& Report  ZRKTEST5                                                    *
    REPORT  ZRKTEST5                                .
    DATA: PROGNAME TYPE SY-REPID,
          DYNNUM   TYPE SY-DYNNR,
          DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
          FIELD_VALUE LIKE LINE OF DYNPRO_VALUES.
    DATA: BEGIN OF T_T001L OCCURS 0,
            WERKS TYPE WERKS_D,
            LGORT TYPE LGORT_D,
          END OF T_T001L.
    DATA: V_WERKS TYPE WERKS_D,
          V_LGORT TYPE LGORT_D.
    SELECTION-SCREEN BEGIN OF BLOCK B1.
      PARAMETERS: P_PLANT LIKE MSEG-WERKS,
                  P_STOLOC LIKE MSEG-LGORT.
    SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION.
      PROGNAME = SY-REPID.
      DYNNUM = SY-DYNNR.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_STOLOC.
      CLEAR: FIELD_VALUE, DYNPRO_VALUES. REFRESH DYNPRO_VALUES.
      FIELD_VALUE-FIELDNAME = 'P_PLANT'.
      APPEND FIELD_VALUE TO DYNPRO_VALUES.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME             = PROGNAME
                DYNUMB             = DYNNUM
                TRANSLATE_TO_UPPER = 'X'
           TABLES
                DYNPFIELDS         = DYNPRO_VALUES.
      READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
      SELECT WERKS LGORT INTO TABLE T_T001L FROM T001L WHERE WERKS = FIELD_Value-fieldvalue.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                RETFIELD    = 'P_STOLOC'
                DYNPPROG    = PROGNAME
                DYNPNR      = DYNNUM
                DYNPROFIELD = 'P_STOLOC'
                VALUE_ORG   = 'S'
           TABLES
                VALUE_TAB   = T_T001L.
    START-OF-SELECTION.
      WRITE:/ 'TEST F4 PROGRAM'.
    END-OF-SELECTION.
    <b></b>
    reward points if helpfull
    Regards
    Vikure

  • Can you "combine" criteria for 2 or more fields on a Selection Screen?

    Good day everyone,
    Here's my question:  I understand that I can put fields on a Selection Screen and pre-fill them with data values.  In this particular case, I want to pre-fill a couple of hidden fields with data values that will be used as criteria when I read data from the database; however, I need to pull back records that have this COMBINATION of data.  For example:
    WERKS     BTRTL
    Z002      Z001
    Z002      Z002
    Z003      Z001
    Z003      Z002
    So in my SQL, if I say "werks IN s_werks" and "btrtl IN s_brtrl", true, it will still work.  But really, I need to say "if werks = 'z002' and btrtl = 'z001', or werks = 'z002' and btrtl = 'z002', etc.  I can't rely on the simple "IN" functionality because it's possible a new value could be added in the future:
    WERKS     BTRTL
    Z003      Z003
    So if I use the "IN" logic and the record has werks = 'Z002' and btrtl = 'Z003', it would be returned.  But I really don't want it returned, since a combination of werks = 'Z002' and btrtl = 'Z003' doesn't exist in my table of valid combinations.
    Is this even possible to do in a Selection Screen?  Do I go ahead and populate the fields separately, use the "IN" functionality, then spin through my resulting internal table and delete anything that doesn't match my "table" of valid combinations?  Do I skip putting these on a Selection Screen completely and check the values in my SQL statement?
    Thanks in advance -- points, as always, will be given.

    Hi
    Yuo can try to use FOR ALL ENTRIES option.
    IF you have:
    WERKS BTRTL
    Z002 Z001
    Z002 Z002
    Z003 Z001
    Z003 Z002
    You should do something like that:
    DATA: BEGIN OF <TAB_SEL> OCCURS 1,
           WERKS TYPE WERKS,
           BTRTL TYPE BTRTL,
          END   OF <TAB_SEL>.
    WERKS BTRTL
    <TAB_SEL>-WERKS = 'Z002'. <TAB_SEL>-BTRTL = 'Z001'.
    APPEND <TAB_SEL>.
    <TAB_SEL>-WERKS = 'Z002'. <TAB_SEL>-BTRTL = 'Z002'.
    APPEND <TAB_SEL>.
    <TAB_SEL>-WERKS = 'Z003'. <TAB_SEL>-BTRTL = 'Z001'.
    APPEND <TAB_SEL>.
    <TAB_SEL>-WERKS = 'Z003'. <TAB_SEL>-BTRTL = 'Z002'.
    APPEND <TAB_SEL>.
    SELECT * FROM <TABLE> INTO TABLE ITAB
       FOR ALL ENTRIES IN <TAB_SEL>
                       WHERE WERKS = <TAB_SEL>-WERKS
                          AND BTRTL = <TAB_SEL>-BTRTL.
    In this case you need to fill correctly the internal table <TAB_SEL> with the all combinations.
    Max

  • Multiple select options validation at selection screen

    Hi,
    I have the requirement to create a selection screen with 3 select options. Two of them are cross-dependent. It is mandatory to fill one of them and it is not allowed to fill both. The third one is optional. I tried the validation at selection-screen on block... and I have a problem that search help buttons for select options react like execution buttons, when I press any of them I am getting one of errors instead of search help.
    Any help on this issue would be appreciated.
    Here is my code:
    DATA:
          so_rbkp TYPE rbkp,
          so_mseg TYPE mseg.
    SELECTION-SCREEN BEGIN OF BLOCK blok WITH FRAME.
      SELECT-OPTIONS:
            s_fakt   FOR so_rbkp-belnr,
            s_matdok FOR so_mseg-mblnr,
            s_god FOR so_mseg-gjahr.
    SELECTION-SCREEN END OF BLOCK blok.
    INITIALIZATION.
    SET TITLEBAR '0100'.
    START-OF-SELECTION.
      AT SELECTION-SCREEN on block blok.
          if s_fakt <> space and s_matdok <> space.
            MESSAGE 'Message1' TYPE 'E'.
          elseif s_fakt = space and s_matdok = space.
            MESSAGE 'Message2' TYPE 'E'.
          endif.
        ENDIF.

    Only perform the check when user wants to execute or submit the program, not when pressing F4 or even Enter, but in a selection-screen event, before START-OF-SELECTION which were program would terminate in error :
    TABLES: SSCRFIELDS.
    AT SELECTION-SCREEN OB BLOCK b01.
        IF sscrfields-ucomm EQ 'ONLI'
        OR sscrfields-ucomm EQ 'PRIN'
        OR sscrfields-ucomm EQ 'SJOB'.
          IF s_fakt[] IS NOT INITIAL AND s_matdok IS NOT INITIAL.
            MESSAGE 'Message1' TYPE 'E'.
          ELSEIF s_fakt[] IS INITIAL and s_matdok[] IS INITIAL.
            MESSAGE 'Message2' TYPE 'E'.
          ENDIF.
        ENDIF.
    (You could also always send the message, but using type 'E' for those function code and 'S' status for any other value.)
    Regards,
    Raymond

  • Selection screen validation in HR ad hoc query

    Hi Experts,
    I have created a query in SQ01. My infoset is created using Logical database PNPCE. Selection criteria contains Fields  Personnel Number and Employment status. so when the query will be run, I want to display error message if invalid personnel number or Employment status is entered. Please let me know, How do I achieve it.
    Thanks in advane.
    Regards.

    Hi
    After declaring selection screen fields.
    select the field to handle validation and click on the button 'Check coding for
    Element' .
    you will get a block to handle the validation.

  • How do I add validation to a system-generated Selection Screen?

    As HR ABAPers know, using the Logical Database approach (I'm using PNPCE) gives you a system-generated Selection Screen.  Part of the specs I have for this report involves making sure that the begin and end dates for the period selected are for a two-week period.  If not, I should display an error message until the user enters a period such that the period (pn-begda and pn-endda) reflect a two-week period.
    The code for the validation is easy enough, and I put it in the AT SELECTION-SCREEN event.  But here's the problem -- the code fires every time the user clicks the "Reporting Period" drop-down box, never giving the user a chance to specify a two-week period.  It fires because pn-begda and pn-endda are still all zeroes.  Even if I select "Other Period" from the drop-down list, the text boxes to allow me to specify the begin and end dates don't appear.
    I've been working on this for quite a while, trying all kinds of things, but I'm spinning my wheels now.  I just want that check to happen when the user clicks the Execute button on the Selection Screen, not when he/she is still trying to enter criteria.  I'm thinking screen field validation for a system-generated Selection Screen has to be a pretty common thing, and there must be a good solution out there.
    Any ideas?

    Rich,
    Absolutely beautiful -- that's exactly what I needed to learn.  Thank you so much.
    Rob, I thought about that.  I even proposed to the users that I could default in a two-week range beginning with today, exactly as you suggested, but they didn't want that.  They felt that this report would more often than not be run to reflect data from two-week periods not necessarily starting today.  Still thought it was a good idea, but that's their call. _
    Again, thanks Rich.  Points awarded.

Maybe you are looking for