Validating a selection screen on input parameters

hi,
on my selection screen ,a parameter called no. of boxes and 3 select options are given.
i want to validate the 3 select options according to the entry done in no. of box .
ex. if 2 is entered in no. of boxes then only the 2 select options would be available to  user for entering rest 1 would be isolated
Thanks in advance !!!
amit

Hi,
Check this,
PARAMETERS: p_1 type i.
SELECT-OPTIONS:num1 for mara-matnr.
SELECT-OPTIONS:num2 for mara-matnr.
SELECT-OPTIONS:num3 for mara-matnr.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if p_1 = '1'.
IF screen-name cs 'NUM2'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-name cs 'NUM3'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
elseif p_1 = '2'.
IF screen-name cs 'NUM3'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
endif.
endloop.
Regards,
Vik

Similar Messages

  • Validations at selection-screen

    hi ,
    how to do validations at selection-screen?
    with regards
    always learner
    points will be rewarded if useful

    Hi Buddy
      Its good to learn alwasys . Here are some progarms which are useful in selection- screen.
    Dont forget to reward points.
    at selection-screen.
    select LIFNR
           from LFB1
           into table
           where lifnr in s_lifnr.
    if sy-subrc ne 0.
    message e888(sabapdocu) with 'no number found'.
    endif.
    in this way u can write the select query.
    selection-screen begin of block b1.
    parameters: p_datum1 type sy-datum,
    p_datum2 type sy-datum.
    selection-screen end of block b1.
    at selection-screen on block b1.
    if p_datum1 is initial
    and p_datum2 is initial.
    message e001(00) with 'Enter at least one date'.
    endif.
    PARAMETERS: TEST1(10) MODIF ID SC1,
                TEST2(10) MODIF ID SC2,
                TEST3(10) MODIF ID SC1,
                TEST4(10) MODIF ID SC2.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'SC1'.
        SCREEN-INTENSIFIED = '1'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
      IF SCREEN-GROUP1 = 'SC2'.
        SCREEN-INTENSIFIED = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
                  R2 RADIOBUTTON GROUP RAD1,
                  R3 RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
      PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
                  R5 RADIOBUTTON GROUP RAD2,
                  R6 RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
      IF R1 = 'X'.
        MESSAGE W040(HB).
      ENDIF.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.
      IF R4 = 'X'.
        MESSAGE W040(HB).
      ENDIF.

  • At selection screen on input

    What is the use of the event at selection-screen on input?

    Hi,
    This event is used mainly for validating an input provided to the selection screen element. Once a value is entered in the Selection Screen this Event gets triggered.
    The syntax for this is
    AT SELECTION-SCREEN ON {para/selcrit}
    Effect
    This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
    Reward if helpful.

  • Validation in selection screen

    SELECT-OPTIONS AND PARAMETERS
    selection-screen begin of block a with frame title text-001.
    selection-screen begin of line.
    selection-screen comment 1(20) for field p_bl.
    parameters : p_bl    as   checkbox .
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) for field p_di.
    parameters : p_di    as   checkbox .
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) for field p_pl.
    parameters : p_pl    as   checkbox .
    selection-screen comment 25(20) for field p_plout.
    parameters : p_plout like nast-kschl.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) for field p_in.
    parameters : p_in    as   checkbox .
    selection-screen comment 25(20) for field p_inout.
    parameters : p_inout like nast-kschl.
    selection-screen end of line.
    selection-screen end of block a.
    selection-screen begin of block c with frame title text-003.
    parameters: pa_email no-display ,
                pa_downl no-display.
    selection-screen end of block c.
    START-OF-SELECTION
    if p_bl eq c_x.
        perform download_bl.
      endif.
      if p_di eq c_x.
        perform download_di.
      endif.
    If Delivery Order is checked
      if p_pl eq c_x.
        perform download_packlist.
      endif.
    If Invoice , Based On The OutPut Type is checked
      if p_in eq c_x .
        perform download_invoice.
      endif.
    I using the above program.
    My question is i want validation in selection screen  for below stmts.
                      1) atleast 1 of the check box should be selected
                      2) If packing list is selected, then the message type Must be selected. (can not allow blank)
                     3) If invoice list is selected, then the message type must be selected
                     4) Validate the message type field entered.

    Hi Sen 001
    It depends how you want to validate. If you want to validate immediately after the user put a check box or enter value then you shoul use <AT SELECTION SCREEN> event and <USER-COMMAND> following your parameters (or select-options) in your selection screen. You can also validate when user presses F8, where you should put your validation inside <START-OF-SELECTION> event.
    Example to immediate validate after check box entered
    SELECTION-SCREEN: BEGIN OF BLOCK b02 WITH FRAME.
    PARAMETERS: p_grp RADIOBUTTON GROUP gr1 DEFAULT 'X' USER-COMMAND zcomm,
                p_dst RADIOBUTTON GROUP gr1.
    SELECTION-SCREEN: END   OF BLOCK b02.
    AT SELECTION-SCREEN.
      IF sy-ucomm(6) = 'ZCOMM'.
        PERFORM xxx.
      ELSE.
        PERFORM yyy.
      ENDIF.

  • 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

  • How to write XSJS Select Query with input parameters

    Hello Experts,
    I am creating a xsjs file and in that file I am trying to write a Select Query based on a Calculation View
    I have tried it the following way:
    var query = 'SELECT TOP 100 \"Name\", \"Address\", \"City\", \"Country\" FROM \"_SYS_BIC\".\"Test.HL/AddressView\"'
        + 'WITH PARAMETERS(\'PLACEHOLDER\' = (\'$$P_Name$$\', \' Akhil \'),'
      + '\'PLACEHOLDER\' = (\'$$P_City$$\', \' Lucknow \'))';
    But it gives me the "Mixed spaces and tabs error".
    How should I write XSJS Select Query with input parameters?
    Regards,
    Rohit

    >But it gives me the "Mixed spaces and tabs error".
    Mixed spaces and tabs has nothing to do with the syntax of the statement. You used both spaces and the tab in the content - which JSLint doesn't like.  Remove the beginning spaces of each line and use only one or the other.
    The actual syntax of your statement doesn't look right.  The problem is that you are escaping the \ when you don't need to if you are using ' instead of " for your string.  You escape with \" in the first line but then escape with \' in the 2nd and 3rd line.  That is going to cause serious parsing problems with the command.

  • Mass validations in selection screen

    Hello experts,
    I have a simple requirement to check "if atleast one of the fields on selection screen is filled or not".
    If all the fields are initial, i'll raise a message.
    I dont want to check all the fields one by one using ANDs.
    The closest I got was-
    loop at screen.
    field = screen-name.
    see if the field is empty.
    if yes, increment the counter.
    endif.
    check if the counter is still zero. That means all fields are empty. Raise message.
    The problem here is, in "screen-name", i'll get the name of screen field. How do I read it? How to find the value in a varible that is stored in another variable? I tried paranthesis ( screen-field ) = value. But it doesnt work. If that can be done, my problem's solved.
    Thanks in advance!
    Sumit Nene.

    This should be a good start, if you still persist to move ahead with your initial approach inspite of Thomas's suggestion.
    TABLES:
      mara.
    SELECT-OPTIONS:
      s_matnr FOR mara-matnr.
    PARAMETERS:
       p_test1 TYPE char10,
       p_test2 TYPE char10.
    DATA:
       count TYPE i.
    FIELD-SYMBOLS:
      <fs> TYPE ANY.
    AT SELECTION-SCREEN.
      IF sy-ucomm = 'ONLI'.
        CLEAR count.
        LOOP AT SCREEN.
          CHECK: screen-input  = 1,
                 screen-active = 1.
          ASSIGN (screen-name) TO <fs>.
          IF <fs> IS ASSIGNED AND
             <fs> IS NOT INITIAL.
            ADD 1 TO count.
            UNASSIGN <fs>.
          ENDIF.
        ENDLOOP.
      ENDIF.
    -Rajesh
    Edit
    P.S : I haven't tested the above solution thoroughly, if for any reasons you find issues with the above approach, as an alternative you can consider using the FM 'RS_REFRESH_FROM_SELECTOPTIONS' to read the selection screen contents. But as already suggested, it would be easy to query the fields individually, you don't want to perform a simple validation with a complicated processing...
    Edited by: Rajesh Paruchuru on Jul 12, 2011 10:03 AM

  • Validation Of  selection screen in Module pool

    Hi Guru,
    I am giving Plant as input at selection screen.
    Below that I am creating one table control at selection screen.
    I have to do validation of the Plant at the selection screen.
    I am doing that IN PAI module. But when i give wrong plant at selection screen the table control fields get disable.Then I tried b/w chain end chain the same problem i am facing in that case. Please help me to resolve that.
    Maximum point will be rewarded.

    hi
       if you are giving a msg when user input a wrong plant then do not give that message as Error type give it as type 'S'

  • Selection screen 2 connected parameters

    Hi folks,
    I would like to have 2 fields. Both are "F4 enabled" ( they are of type of key fields in one DBtable, and those DBtable fields have domains, which have value check with their table). And I want these 2 parameters to be connected - when I choose value in 1, value in the 2nd should be placed, and vice versa.
    (What I miss is some event like on value-request...)
    Thanks in advance,
    Piotr

    Hi,
    Check the sample code..
    REPORT  ZTEST_F4HELP                              .
    *---Report with selection screen and to display the list of
    * possible entries for field 'B' as per the value in field 'A'.
    parameters: p_vbeln type vbak-vbeln,
                p_posnr type vbap-posnr.
    at selection-screen on value-request for p_posnr.
      data: begin of help_item occurs 0,
              posnr type vbap-posnr,
              matnr type vbap-matnr,
              arktx type vbap-arktx,
            end of help_item.
      data: dynfields type table of dynpread with header line.
      dynfields-fieldname = 'P_VBELN'.
      append dynfields.
      call function 'DYNP_VALUES_READ'
           exporting
                dyname               = sy-cprog
                dynumb               = sy-dynnr
                translate_to_upper   = 'X'
           tables
                dynpfields           = dynfields
           exceptions
                invalid_abapworkarea = 1
                invalid_dynprofield  = 2
                invalid_dynproname   = 3
                invalid_dynpronummer = 4
                invalid_request      = 5
                no_fielddescription  = 6
                invalid_parameter    = 7
                undefind_error       = 8
                double_conversion    = 9
                stepl_not_found      = 10
                others               = 11.
      read table dynfields with key fieldname = 'P_VBELN'.
      p_vbeln = dynfields-fieldvalue.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
           exporting
                input  = p_vbeln
           importing
                output = p_vbeln.
      select posnr matnr arktx into table help_item
                     from vbap
                          where vbeln = p_vbeln.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
           exporting
                retfield    = 'POSNR'
                dynprofield = 'P_POSNR'
                dynpprog    = sy-cprog
                dynpnr      = sy-dynnr
                value_org   = 'S'
           tables
                value_tab   = help_item.
    Regards
    vijay

  • Validating a selection-screen field

    Hi all,
    I am Anil.can any body explains me how to validate a selection-screen field for the following scenario?
    I have customer nos ranging from 100-1000.among them i dont have any sales orders for the customers who are in between 150-250.I have sales order(VBELN) as select-options and Plant(WERKS) as Parameter on the selection-screen.I want to validate these fields without hardcaode.How can i do that?Please send me the complete code.
    I am not getting how to validate a field  which is declared as parameter?
    regards and thanks in advance.
    Anil.

    Make sure that u are validating against the header table.
    say eg if u wnat t validate matnr in marc, then do as below.
    SELECT-OPTIONS: s_matnr FOR  marc-matnr.                  "Material No
    AT SELECTION-SCREEN.
    *Validate material no details
      PERFORM validate_matno.
    FORM validate_matno.
    DATA: v_matnr LIEK mara-matnr.
      SELECT SINGLE matnr INTO v_matnr
             FROM <b>mara</b>
             WHERE matnr IN s_matnr.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.
    Dont select from marc.
    Hope this is clear.

  • Validation on selection screen

    Hi all,
       i have a selection screen
       on which there are 2 select-options
        The user to enter only particular values in that   fields if he doesnt a error message is shown.
       After that error message the user is forced to
       run the program again (this much is working)
       i want that even if he enters invalid value,
        a error shoould be shown and the field where
       he enterd the invalid value should be ready for input  again
       how to do it??
    Regards,
    Tarang

    Hi tarang,
    1. he enterd the invalid value should be ready for input again
    For this we have to take care of two things :
    a) write code in the event
       START-OF-SELECTION
    b) use the command
       LEAVE LIST-PROCESSING.
    2. The code would be somewhat like this.
    START-OF-SELECTION.
      IF ERROR CONDITION.
      <b>MESSAGE 'wrong values' type 'I'.
      LEAVE LIST-PROCESSING.</b>
      ENDIF.
      *---- Write :/
    3. Important thing.
       a) Give message type of I,W (not E)
    regards,
    amit m.

  • Validation on selection screen parameter.

    I have select options in my selection screen.
    1) s_a
    2) s_b
    Requirement:-
    1) If I run the program and click the arrow on the "s_a" field, it should open multi selection screen. From that I can make multi entry or upload data from excel file.
    2) If "s_a" and "s_b" is empty it sud throw an error message.
    Can I do this validation in AT SELECTION-SCREEN n how?

    hi Abhijeet,
    u can do the first by just writing the sel-options as:
    S_A like table-field (say vbak-vbeln). then the multiple selection comes automatically.
    the second - u can do thru at selection-screen by just writing a if condition.
    if s_a-low is initial and s_a-high is initial.
    message e001.
    endif.
    Let me know if you still have any issue.
    /Praveen

  • Adding Standard Text to the Selection Screen obtained using PARAMETERS

    Hi all,
    I have a report program which has the selection screen declared by the key word PARAMETERS.
    Now I need to make the changes to this program such that a Text Editor appears on the Selection Screen and has a Standard text that should be displayed.
    How can I do it?
    I saw the screen number of the Selection Screen and went to screen painter and tried to add the Text Editot..but it did not let me dou2026.Why?
    How should I add a standard text to a selection screen? The standard text should not be on top , but some where on the screen.
    Regards,
    Jessica Sam

    Hi Sam,
    I dont want to create a new screen for this. On the existing screen whihc was built using PARAMETERS key word..i should insert a blokc of text whihc is mpre than 5-6 lines..how should i do it.
    I navigated to Text Elements---->Selection Texts
    it is now asking for Name and Text and i see in Name column the name of the parametsr that they used for Check box, radio button etc and in Text i see the text that is appearing on the screen
    Now i am not sure what is should do next
    My req is..i should display a block of standard text that doesnt change and whihc is of 4-6 lines?
    how should i do it?
    please also help me with what data declartions that i should do in parametrs key word in program?
    Regards,
    Jessica Sam

  • Selection Screen - User input to select option only through f4 help,

    Hi..
    In case of selection screen,  I need selection screen such a that user input must be through search help not manual entry is allowed/ possible

    TYPES:BEGIN OF ty,
          field1 TYPE char01,
          END OF ty.
    DATA:it TYPE TABLE OF ty,
         wa TYPE ty.
    data:v_var type c.
    select-options:so for v_var.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'SO-LOW'  .
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
        IF screen-name = 'SO-HIGH'  .
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so-low.
      CLEAR it[].
      wa-field1 = 'A'.
      APPEND wa TO it.
      wa-field1 = 'B'.
      APPEND wa TO it.
      CLEAR wa.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield    = 'FIELD1'
          dynpprog    = sy-cprog
          dynpnr      = sy-dynnr
          dynprofield = 'SO-LOW'
          value_org   = 'S'
          display     = 'F' "F = Force
        TABLES
          value_tab   = it[].
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so-high.
      CLEAR it[].
      wa-field1 = 'A'.
      APPEND wa TO it.
      wa-field1 = 'B'.
      APPEND wa TO it.
      CLEAR wa.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield    = 'FIELD1'
          dynpprog    = sy-cprog
          dynpnr      = sy-dynnr
          dynprofield = 'SO-HIGH'
          value_org   = 'S'
          display     = 'F' "F = Force
        TABLES
          value_tab   = it[].

  • Validation for selection screen

    hi all,
       can anyone help me on the particular issue for adding f4 functionality based on selection criteris.i am using the code below but i am not able to get the selection.
      SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
         PARAMETERS:     P_MBLNR LIKE MKPF-MBLNR OBLIGATORY, "Customer Number
                         P_WERKS LIKE MSEG-WERKS OBLIGATORY.
      SELECTION-SCREEN:SKIP 2.
             SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
                PARAMETERS:    RAD1 RADIOBUTTON GROUP RAD DEFAULT 'X',
                               RAD2 RADIOBUTTON GROUP RAD.
             SELECTION-SCREEN END OF BLOCK B2.
      SELECTION-SCREEN END OF BLOCK B1.
      AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MBLNR.
      DATA: BEGIN OF I_MBLNR OCCURS 0,
              V_MBLNR LIKE MSEG-MBLNR,
              V_BWART LIKE MSEG-BWART,
            END OF I_MBLNR.
    IF NOT P_MBLNR IS INITIAL.
       IF RAD1 = 'X'.
        SELECT SINGLE MBLNR INTO I_MBLNR-V_MBLNR FROM MSEG
                WHERE BWART = '541'.
    ELSEIF RAD2 = 'X'.
        SELECT SINGLE MBLNR INTO I_MBLNR-V_MBLNR FROM MSEG
                WHERE BWART = '551'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
        DDIC_STRUCTURE         = MSEG-MBLNR
         RETFIELD               = IT_HEADER-MBLNR
       PVALKEY                = ' '
       DYNPPROG               = ' '
       DYNPNR                 = ' '
       DYNPROFIELD            = ' '
       STEPL                  = 0
       WINDOW_TITLE           =
       VALUE                  = ' '
       VALUE_ORG              = 'C'
       MULTIPLE_CHOICE        = ' '
       DISPLAY                = ' '
       CALLBACK_PROGRAM       = ' '
       CALLBACK_FORM          = ' '
       MARK_TAB               =
    IMPORTING
       USER_RESET             =
       TABLES
         VALUE_TAB              = IT_HEADER.
       FIELD_TAB              =
       RETURN_TAB             =
       DYNPFLD_MAPPING        =
    EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 2
       OTHERS                 = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDIF.

    HI NAVNEET ,
       thanks for replying actuallty i have n internal table it_header which i have used it for my program but this interna table i have used only for selection criteria. can you plz see the portion of my code which i have used for selection criteria.please find below
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MBLNR.
      DATA: BEGIN OF I_MBLNR OCCURS 0,
              MBLNR LIKE MSEG-MBLNR,
            END OF I_MBLNR.
    IF NOT ( P_MBLNR IS INITIAL ).
       refresh i_mblnr.
       clear i_mblnr.
      IF ( RAD1 = 'X' ).
         SELECT  MBLNR INTO I_MBLNR FROM MSEG
                WHERE BWART = '541'.
            ENDSELECT.
      ELSEIF ( RAD2 = 'X' ).
         SELECT MBLNR INTO I_MBLNR FROM MSEG
                WHERE BWART = '551'.
            ENDSELECT.
      ENDIF.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
       DDIC_STRUCTURE         = 'MSEG'
         RETFIELD               = 'MBLNR'
       PVALKEY                = ' '
        DYNPPROG               = SY-REPID
        DYNPNR                 = SY-DYNNR
        DYNPROFIELD            = 'P_MBLNR'
        VALUE_ORG              = 'S'
        CALLBACK_FORM          = SY-REPID
       TABLES
         VALUE_TAB              = I_MBLNR
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.

Maybe you are looking for