Skip to Content
author's profile photo Former Member
Former Member

how to display records when clicking button

I am displayed one button name 'SELECT' and one

table with 2 fields using screen painter.

If i click the button means then the records from

the database table should be displayed.

send me the coding....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 09:43 AM

    hiii

    use following code

    START-OF-SELECTION.
    
      SET PF-STATUS 'STATUS'.
      PERFORM get_data_kna1.
    
    END-OF-SELECTION.
    
    CASE sy-ucomm.
      WHEN 'CUSTOMER'.
    
         GET CURSOR FIELD fs_kna1-kunnr
         VALUE w_kunnr.
      
          SELECT SINGLE kunnr
          FROM kna1
          INTO w_kna1
          WHERE kunnr = w_kunnr.
    
          IF sy-subrc <> 0.
             MESSAGE e015(zmsg9).
           ENDIF.
    
          
         WHEN 'ORDER'.
          GET CURSOR FIELD fs_kna1-vbeln
          VALUE w_vbeln.
    
         
          SELECT SINGLE vbeln
          FROM vbak
          INTO w_vbak
          WHERE vbeln = w_vbeln.
    
          IF sy-subrc <> 0.
           MESSAGE e015(zmsg9).
          ENDIF.
    
      ENDCASE.

    reward if useful

    thx

    twinkal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 08:22 AM

    Hi ,

    on clicking the button .

    case sy-ucomm.

    when 'SELECT'.

    SELECT FIELD1 FIELD2 FROM TABLE TABLE1 INTO TABLE ITAB WHERE FIELDN = SOME VALUE .

    THEN display either a secondary list or an ALV or a table control.

    Please reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 08:27 AM

    hi check this..

    tables :mara .

    data: begin of itab occurs 0,

    matnr like mara-matnr,

    meins like mara-meins,

    end of itab .

    select-options:s_matnr for mara-matnr .

    start-of-selection.

    set pf-status 'TEST'.

    case sy-ucomm.

    -----> here double click the test give the button name as the select

    when 'SELECT'.

    select matnr meins

    from mara

    into table itab

    where matnr in s_matnr .

    loop at itab .

    write:/ itab-matnr, itab-meins.

    endloop.

    endcase .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 09:39 AM

    Hi,

    By using sy-ucomm we can do.

    Declare the data with same data type and length as per db table.

    case sy-ucomm.

    when '----- '.

    select........

    endcase.

    Edited by: Murali Krishna Makineni on Jun 17, 2008 11:40 AM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.