About selection-screen's question?

Dear gurus:
I have declare a screen like below:
SELECTION-SCREEN BEGIN OF BLOCK blk_d WITH FRAME TITLE text-004.
PARAMETERS: p_matnr TYPE resb-matnr. "Material
PARAMETERS: p_bdmng LIKE resb-bdmng. "Request Qty
PARAMETERS: p_meins LIKE resb-meins.
SELECTION-SCREEN END OF BLOCK blk_d.
How to achieve such an effect:
after i input a materical code to p_matnr, display the corresponding unit in p_meins.
Actually, when the user input the qty, them want know the unit of currently material. So i want show the unit in parameter(p_meins) after them input the p_matnr,but before them input the qty.
Message was edited by:
        Shao Hui Young

Hi shao,
1. User has to press ENTER,
    just after entering / selecting via F4,
    the material number.
2. This is one way.
3. Just copy paste.
4.
REPORT ABC.
SELECTION-SCREEN BEGIN OF BLOCK BLK_D WITH FRAME TITLE TEXT-004.
PARAMETERS: P_MATNR TYPE RESB-MATNR. "Material
PARAMETERS: P_BDMNG LIKE RESB-BDMNG. "Request Qty
PARAMETERS: P_MEINS LIKE RESB-MEINS.
SELECTION-SCREEN END OF BLOCK BLK_D.
<b>*----
AT SELECTION-SCREEN OUTPUT.
  SELECT SINGLE MEINS
  INTO P_MEINS
  FROM MARA
  WHERE MATNR = P_MATNR.</b>
regards,
amit m.

Similar Messages

  • One question about Selection screen

    Hi experts,
    I am writing a report, on the selection screen, I need to input the file path and then do the file upload.
    My question is about how to check the file path I put is correct or not? If it is incorrect, I want to get a message and the cursor still in the field and don't jump to the next page.
    How can I do like that?
    Any one has any suggestion, please help me.
    Thanks in advance.
    Regards,
    Chris Gu

    Hi Chris,
        do it this way: check my code after calling gui_upload what condition i am using.
    parameters:
      p_file type rlgrap-filename.          " File name
    *           AT SELECTION-SCREEN ON VALUE-REQUEST EVENT               
    at selection-screen on value-request for p_file.
      perform get_file_name.
    *                       AT SELECTION-SCREEN EVENT                    
    at selection-screen on p_file.
      perform validate_upload_file.
    *  Form  GET_FILE_NAME                                               
    form get_file_name.
      call function 'F4_FILENAME'
       exporting
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
         field_name          = ' '
       importing
         file_name           = p_file.
    endform.                               " GET_FILE_NAME
    *  Form  VALIDATE_UPLOAD_FILE                                        
    form validate_upload_file.
      data:
        lw_file  type string.              " File Path
      lw_file = p_file.
      call function 'GUI_UPLOAD'
        exporting
          filename                    = lw_file
          filetype                    = 'ASC'
          has_field_separator         = 'X'
          dat_mode                    = 'X'
        tables
          data_tab                    = t_final_data.
      IF sy-subrc ne 0 and t_final_data is initial. " here message if file path is wrong
        Message 'File not found' type 'E'.
      ELSEIF sy-subrc eq 0 and t_final_data is initial.
        Message 'File empty' type 'E'.
      ENDIF.                              
    endform.                               " VALIDATE_UPLOAD_FILE
    With luck,
    Pritam.
    Edited by: Pritam Ghosh on May 8, 2009 8:57 AM

  • About selection screen validation

    Hi all,
            I have query regarding a selection screen.
            I have one field in a selection screen where i ve put the matnr field as a parameter from MARA table.
             My requirement is that when I will select any material by pressing F4 and select the value the corresponding material description will come automatically in another field which I had taken in the Selection screen.I must get it automatically without any push button or execute button.
             Now where I have to write the logic of the code and at which event of the report .
             Please experts help me.
    With regards,
      Abir.

    REPORT  ZSRIM_TEMP10.
    tables : mara,makt.
    data : v_maktx type makt-maktx.
    parameters : p_matnr type mara-matnr,
                 p_maktx type makt-maktx.
    AT SELECTION-SCREEN OUTPUT.
    if p_matnr is not initial.
       select single maktx from makt into v_maktx
             where matnr = p_matnr and spras = sy-langu.
        p_maktx = v_maktx.        
    endif.
    I am sorry, this code will works only if you click any enter key etc.. then only Description will appear.
    Regards
    Srikanth.
    Message was edited by: Srikanth Kidambi

  • About selection screens

    we define a user defined selection screen in one program 'x'.Can we call it in another program 'Y'? and Why?

    There are many use. Ex: you want a basic selection screen for some criteria. No you want farther selection that will based on the basic selection. Means farther selection screen should change dynamically according to the input of basic selection screen.
    REPORT demo_call_selection_screen.
    SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE tit1.
    PARAMETERS: cityfr TYPE spfli-cityfrom,
                cityto TYPE spfli-cityto.
    SELECTION-SCREEN END OF BLOCK sel1.
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
    SELECTION-SCREEN INCLUDE BLOCKS sel1.
    SELECTION-SCREEN BEGIN OF BLOCK sel2
                              WITH FRAME TITLE tit2.
    PARAMETERS: airpfr TYPE spfli-airpfrom,
                airpto TYPE spfli-airpto.
    SELECTION-SCREEN END OF BLOCK sel2.
    SELECTION-SCREEN END OF SCREEN 500.
    INITIALIZATION.
      tit1 = 'Cities'.
    AT SELECTION-SCREEN.
      CASE sy-dynnr.
        WHEN '0500'.
          MESSAGE w888(SABAPDOCU) WITH 'Screen 500'.
        WHEN '1000'.
          MESSAGE w888(SABAPDOCU) WITH 'Screen 1000'.
      ENDCASE.
    START-OF-SELECTION.
      tit1 = 'Cities for Airports'.
      tit2 = 'Airports'.
      CALL SELECTION-SCREEN 500 STARTING AT 10 10.
      tit1 = 'Cities again'.
      CALL SELECTION-SCREEN 1000 STARTING AT 10 10.

  • About selection screen

    hi all,
      i have 3 radio button and corresponding thier 3 input loist box . i just want to deactivate 2 list box on the click of one radio button.
    please give the solution if possible .
    Thanks and Regards
    priyank dixit

    Hi,
    Check the following code:
    TYPE-POOLS : vrm,
                 icon.
    *SELECTION SCREEN FIELDS
    TABLES : sscrfields.
    *GLOBAL DECLARATIONS
    DATA : flag TYPE c,
          tablename(10),
          mmtable LIKE dd02l-tabname,
          sdtable LIKE dd02l-tabname,
          hrtable LIKE dd02l-tabname.
    *DECLARATIONS FOR SELECTION SCREEN STATUS
    DATA it_ucomm TYPE TABLE OF sy-ucomm.
    ***********SELECTION-SCREENS*********************
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    *FOR DYNAMIC DISPLAY OF MODULES
    PARAMETERS :  pa RADIOBUTTON GROUP rad USER-COMMAND com MODIF ID mod,
                  pb RADIOBUTTON GROUP rad MODIF ID rad,
                  pc RADIOBUTTON GROUP rad MODIF ID cad.SELECTION-SCREEN SKIP.
    **TO INCLUDE DYNAMIC ICONS
    SELECTION-SCREEN COMMENT 2(6) text_001.
    *DYNAMIC LIST BOX BASED ON USER SELECTIONS
    PARAMETERS one AS LISTBOX VISIBLE LENGTH 20  MODIF ID mod.
    PARAMETERS two AS LISTBOX VISIBLE LENGTH 20   MODIF ID rad.
    PARAMETERS three AS LISTBOX VISIBLE LENGTH 20 MODIF ID cad.
    SELECTION-SCREEN END OF BLOCK blk1.
    *DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2,
                      FUNCTION KEY 3.
    **EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY
    AT SELECTION-SCREEN OUTPUT.
    *CLICK OF FIRST RADIO BUTTON
      IF pa = 'X'.
        sscrfields-functxt_01 = 'Materials Management'.
        WRITE icon_plant AS ICON TO text_001.
    *CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO
        LOOP AT SCREEN.
          IF screen-group1 = 'MOD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CLICK OF SECOND RADIO
      IF pb = 'X'.
        sscrfields-functxt_02 = 'Sales And Distribution'.
        WRITE icon_ws_ship AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CLICK OF THIRD RADIO
      IF pc = 'X'.
        sscrfields-functxt_03 = 'Human Resources'.
        WRITE icon_new_employee AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Regards,
    Bhaskar

  • Engent, Who could help about selection-screen.

    Below is the code!
      CALL FUNCTION 'DATE_CREATE'
        EXPORTING
          anzahl_tage = 7
          datum_ein   = sy-datum     "
        IMPORTING
          datum_aus   = gdf_wadat.   "
    SELECT-OPTIONS: p_wadat  FOR likp-wadat
    DEFAULT sy-datum to gdf_wadat.
    All I want to do is to set the low as currenct system date
    then the high as seven days later.
    But, by using the code above I could not do that!
    God help me! Thank you very much!

    Hello Minghan,
    I see that you have registered just a few hours back. Welcome to SDN.
    Coming to your requirement, you do not need a Function Module call at all. Try this out.
    tables likp.
    select-options: p_wadat for likp-wadat.
    initialization.
    p_wadat-low = sy-datum.
    p_wadat-high = sy-datum + 7.
    append p_wadat.
    Hope this helps,
    Regards,
    Anand Mandalika.
    P.S. : Since you are a new member here, I should like to introduce you to the Forum Etiquette. Answering the queries you make in SDN requires some time and effort from the person(s) who take up your question. So when you get an answer that you find to be useful, please do reward it accordingly by clicking on the Yellow star icon in the reply. It is an SDN way of saying Thank You! For more information, you can refer to the weblog https://weblogs.sdn.sap.com/pub/wlg/680. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

  • Abap objects and selection screen

    Hello everybody,
    I am interested in your ways of implementing selection-screens in the style of ABAP Objects.
    In earlier times (when I used to implement ABAP objects in a procedural way) I just put the selection-screen commands in an include or a form routine of my ABAP report. So it was possible to run the report in background.
    Now I read something about selection-screens/dynpros and "separation of concerns" in the book "ABAP Objects" written by Keller. He advises using function groups to encapsulate presentation from logical matters. (Selection-screen commands are in an automatically generated include now). I implemented this way. (ABAP report with a local class, which has a main method, where function module of the function group is called). It works, but i see no chance to run my report in background now.. but I need to run the report in background.
    Does anybody know a solution without deleting function group?
    What do you think is the best way of using selection-screen-commands and ABAP Objects, especially regarding running in background?
    Thx for your advise in advance.
    Kind regards,
    Anne

    Hi Naimesh,
    thx for explanation. I am not sure, if I understood everything in the right way.
    Where do you write the code for building the selection-screen? (PARAMETERS, SELECT-OPTIONS etc.)
    If you write these commands in a class method, you will get a syntax error ( because it's forbidden per definition of ABAP objects). So, am I right assuming that you put the coding just at the beginning of the ABAP report ? And after START-OF-SELECTION-event you start the processing... ?
    Furthermore, I don't really understand why you create an separate class for ALV. I found your "SAP abap help"-blog, where you explained the concept of MVC ((By the way, well done!), but you didn't mention an "ALV class" there..
    Mh.. another question - have you ever combined MVC with object services?
    At the moment I'm working on a software project where I use object services. I created 2 persistent classes via SE24 and one local class in my ABAP Report.
    I don't really see possibility to implement MVC in this project without change very much of coding and class structure...
    In my opinion the M (data&business logic) are my existing global classes and my local class is kind of Controller class?!
    Thx in advance,
    Anne

  • A question about keeping screen field unchangable in selection screen

    Hello Expert,
    I have a program as below.
    REPORT Z_TEST.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-i01.
    SELECT-OPTIONS: s_kappl FOR a017-kappl DEFAULT 'M' NO INTERVALS.
    SELECTION-SCREEN: END OF BLOCK b1.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-name CS 'KAPPL'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    When I executed the report, the field for S_KAPPL is unchangable. This is as expected. But if I select one variant,  the filed will change back to changable.
    My question is how can I keep the field unchangable after I select variant?
    Thanks in advance,
    Regards, Johnny

    Hello Johnny,
    When you're creating the variant you've to mark the check-box "Protect field" as true.
    This will make the field as output only.
    BR,
    Suhas

  • Hi Experts, a question about messages in selection screen? thank you!

    Hi Experts,
    I have a selection screen and two parameters on it, I need to check if the entries exist if the fields is filled in, if it doesn't exist I need to issue a warning message, but if the two parameters are both filled in and the related entries both don't exist, how can I handle this situation? what I mean is that I want to display the two warnings at the same time(like below), now I only can display one warning, can anyone help me on this? thank you much!
    You are not authorised for this purchasing organisation
    Plant: invalid entry
    Purchasing organisation: invalid entry
    No valid record selected
    Kind regards
    Dawson

    Hi Dawson
    As far as i get from your disciption of the problem, i get that: -
    (a) You want to check that both the fields are filled or not
    (b) If they are filled, then you want to check if in database there exists any record pertaining to them.
    Correct me if i am wrong.
    If this is correct, then you will have to make use of nested if condtions to diaplay the warnings.
    Like as follows: -
    If pa1 IS INITIAL and pa2 IS INITIAL.
      <your warning message>.
    ELSEIF pa1 IS INITIAL and pa2 IS NOT INITIAL.
      <your warning message>.
    ELSEIF pa1 IS NOT INITIAL and pa2 IS INITIAL.
      <your warning message>.  
    ELSEIF pa1 IS NOT INITIAL and pa2 IS NOT INITIAL.
      <try matching it with the database records>.
      <your warning message>.
    ENDIF.
    As far as i know, the 2 warning messages cannot be issued as they appear in the status bar of the current screen. SO you will have to put them in if condition only and display the approriate warning .
    Hope this solves your problem.
    Regards
    Gaurav.

  • Hi,a question about transportation of translation of selection screen?

    Hi Experts,
    I am working on an ALV and there is a selection screen for it, and I have translate the texts in the selection screen and can they be transported while the program is transported to another system? if not how can I transport the translations, thank you much.
    Kind regards
    Dawson

    Hello ,
    Please follow the below steps for transalation ..
    - Complete your development and release the same .
    - Always have the Translations which u can do wtih SE63 tocde and have them within a specific transport request (Recomended Transport of Copies) .
    Now u release the TR of translation then everything wil work fine .
    Ensure always Translations TR is younger than Development TR withrespect to their creation and Releases ....
    Regards,

  • Hi, experts, a question about fields in selection screen?

    Hi Experts,
    In my selection screen there are two fields, one is customer nr(kunnr), another is a checkbox, and I want to know is that when the customer is filled in and the checkbox is marked and then I press "enter", there should be a email address of the customer displayed at the right of the checkbox, thank you in advance.
    by the way, I have known how to get the email address but I don't know how to make the email address display at the right of the checkbox.
    Kind regards
    Dawson
    Edited by: dawson wang on Mar 28, 2009 4:49 AM

    Hi,
    Test Sample Code Bellow it will solve out your problem. First enter the pernr and than click the Check Box.
    TABLES: pa0001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) tpernr.
    PARAMETERS: ppernr LIKE pa0001-pernr.
    SELECTION-SCREEN COMMENT 42(1) t.
    PARAMETERS: check AS CHECKBOX USER-COMMAND a.
    SELECTION-SCREEN COMMENT 46(50) cpernr FOR FIELD ppernr MODIF ID dpt.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
    tpernr = 'Please Enter Pernr'.
    AT SELECTION-SCREEN OUTPUT.
      IF check = 'X'.
        PERFORM get_lables.
        LOOP AT SCREEN.
          IF screen-group1 = 'DPT'.
            screen-intensified = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        CLEAR: cpernr.
      ENDIF.
    **&      Form  get_lables
    **       text
    FORM get_lables.
      IF ppernr IS INITIAL.
        cpernr = ''.
      ELSE.
        SELECT SINGLE * FROM pa0001
          WHERE pernr = ppernr
            AND endda = '99991231'.
        IF sy-subrc = 0 .
          cpernr = pa0001-ename.
        ENDIF.
      ENDIF.
    ENDFORM.                    "get_lables
    Please Reply if any Issue,
    Best Regards,
    Faisal

  • Hi Experts, a question about search help in selection screen?

    Hi Experts,
    I have a selection screen and two parameters, one is plant and another is material, what I want is as following:
    the user select a plant and when he select the material the material should be in the plant he has filled in, how can I handle this? detail help, thank you in advance.
    Kind regards
    Dawson

    Hi,
    Check the below code.
    tables: t001k.
    For Identification Number
    DATA: BEGIN OF it_bwkey OCCURS 0,
            bwkey LIKE t001k-bwkey,
          END OF it_bwkey.
    data: v_bukrs(4).
    For Run date
    DATA: BEGIN OF it_bukrs OCCURS 0,
            bukrs LIKE t001k-bukrs,
          END OF it_bukrs.
    DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_bukrs(4) TYPE c.
    SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK main.
    INITIALIZATION.
    SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING retfield = 'BUKRS'
    dynpprog = sy-repid
    dynpnr = sy-dynnr
    dynprofield = 'P_BUKRS'
    value_org = 'S'
    TABLES value_tab = it_bukrs
    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.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.
    TABLES: t130r.
    DATA: BEGIN OF dynpfields OCCURS 0.
    INCLUDE STRUCTURE dynpread.
    DATA: END OF dynpfields.
    DATA : sy_repid LIKE sy-repid,
           sy_dynnr LIKE sy-dynnr.
    CLEAR dynpfields.
    REFRESH dynpfields.
    dynpfields-fieldname = 'P_BUKRS'.
    APPEND dynpfields.
    sy_repid = sy-repid.
    sy_dynnr = sy-dynnr.
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    dyname = sy_repid
    dynumb = sy_dynnr
    TABLES
    dynpfields = dynpfields
    EXCEPTIONS
    OTHERS = 01.
    IF sy-subrc = 0.
    READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
    IF sy-subrc = 0.
    v_bukrs = dynpfields-fieldvalue.
    ENDIF.
    ENDIF.
    SELECT bwkey FROM t001k INTO TABLE it_bwkey WHERE bukrs = v_bukrs.
    DELETE ADJACENT DUPLICATES FROM it_bwkey.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'BWKEY'
    dynpprog = sy-repid
    dynpnr = sy-dynnr
    dynprofield = 'S_BWKEY'
    value_org = 'S'
    TABLES
    value_tab = it_bwkey
    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.
    Regards,
    Kumar Bandanadham

  • Question on Logic of seperation in OOAbap-Selection screen

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

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

  • Question on selection-screen

    Hi,
    1) How we can provide two fields on selection-screen side by side
    2) How we can provide Text on selection-screen (ie some comments regarding selection-screen fields)

    Moderator message - Welcome to SCN
    However, this is not a training forum for ABAP. Please read the appropriate documentation.
    Thread locked..
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.

  • Selection screen : matchcode on RYEAR and also question on FILE_SAVE_DIALOG

    Hiii
    Question 1 -->
    i have on the selection screen a parameter of type RYEAR i check in database and theere is no matchcode attach to it.
    can you please advise whether there is a standard matchcode i can used or am i missing something?
    Question 2 -->
    And also on my selection screen i have 2 parameter
    P_path type string
    P_name type string
    on the P_path we need to put the directory name and also implement a F4 where user can browse the directory.   On the p_name we will put the file name
    have done somwthing like that.  sorry i don't remember the exact name?
    at selection screen on value request p_path
    call method cl_xxxxx-file_save_dialogue
    the problem is that the FILE_SAVE_DIALOGUE i must enter the a file name on the pop-up before clicking on save,
    I don't want an F4 of P_PATH i want to only the browse directory path not save. can you please advise if there are another method for that?

    Check this code;
    PARAMETER: p_path TYPE char50,
                                   p_name TYPE char50.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
      DATA: lv_path TYPE string.
      lv_path = p_path.
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
    *      window_title         = 'Jay'
          initial_folder       = lv_path
        CHANGING
          selected_folder      = lv_path
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      p_path = lv_path.

Maybe you are looking for

  • Please help with a track matte

    I'm trying to get the text box to fill with a black solid from within it but also for the solid to begin filling in from the white outlines and not from a center. The way it looks is that the white outlines are animated first, making the square - the

  • Keynote 6.5.2 update won't open with Yosemite 10.10.2

    Keynote 6.5 won't open even though I've updated it from 6.2.2.  My OS X version is Yosemite 10.10.2.  I get the error: Install the latest version of OS X, then download the latest version of Keynote from the Mac App Store.  I have done all possible u

  • PI EHP1 7.1 CACHE UPDATE ISSUE

    Hi All; I get an error when I try do a full cache refresh. I've read all the posts have been solved before in sdn for the same issue as same mine but stil there's no help. I've checked the sm59 RFC connection test for INTEGRATION_DIECTORY_HMI configu

  • Sending content in an html page via email as body

    Hi I am really in need of a prompt help for sending a web page which contains some html content as an email body. I really have no clue about this. I have tried searching in google but could not find any thing in java. I have everything ready for sen

  • Soundtrack guitar amp

    Thanks for reading I have a new audio interface (m-audio). The mic works great. I plugged in the guitar but don't know how to use the speakers as an amp. I want to be able to plug in and hear myself play. Also, plug in and record directly. I can't fi