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

Create Button in Abap Program

Hi anybody,

I want to use click event button inside abap programe.

how to use click events of button.

anybody tell me.

thanks

s.muthu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 11:05 AM

    hi for this the user commmand is used...

    if sy-ucomm = 'TES'.

    do some thing....

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 11:06 AM

    Hi,

    Use user-command event, When button is created using PF-STATUS, put the name for that button (let say BUTTON1).

    When it is clicked the user command event will be triggered, then sy-ucomm will become BUTTON1, so that we can handle the button event.

    case sy-ucomm.

    when 'BUTTON1'.

    --> Code

    endcase.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 11:13 AM

    Hiii Mr Subramaniyan

    Well i want to make it clear wether u want to have the push button on the application tool bar or n the selection screen area....

    however if u want to have it on the application tool bar you have to set the pf status as ....

    SET PF-STATUS 'TEST'.

    just double click on the TEST and then you would enter SE41 transaction ...there u need to specify the Fcode ...and Display Text ...

    Once u activate it then come back to the SE38 screen...

    now u can call an event with the following code ...

    Case SY-UCOMM.

    When 'FCODE' **Fcode set for the icon in the SE41**.

    perform the task u want to have ...

    endcase ...

    regards

    chandu reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 11:15 AM

    hi,

    under END -OF-SELECTION.

    set pf-status <name>.

    // In pf-staus u can create a button on application toolbar.

    under AT USER-COMMAND.

    case sy-ucomm.

    when 'FCODE'.

    ...

    endcase.

    rgds.,

    subash

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 11:18 AM

    hiii

    use following code.it will create button

    START-OF-SELECTION.
    
      SET PF-STATUS 'STATUS'.
      PERFORM get_data_kna1.
    
    END-OF-SELECTION.

    Now write following code for performing task on clicking that button.

    CASE sy-ucomm.
      WHEN 'CUSTOMER'.
       SELECT SINGLE kunnr
          FROM kna1
          INTO w_kna1
          WHERE kunnr = w_kunnr.
    
          IF sy-subrc <> 0.
             MESSAGE e015(zmsg9).
           ENDIF.
    
    WHEN 'ORDER'.
               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

  • Posted on Jun 16, 2008 at 11:19 AM

    Hi,

    It is simple. Create ur Own PF status in SE41 transaction and assign the same to ur report.

    Go to SE41-> Select radio button status->press copy status in tool bar. Here Give From program name as SAPMSSY0 and status as STLI. In to program give ur report name and to status ur new PF status name. press on copy. Now go to this status, Add push button in application tool bar option. Save and Activate.

    now in ur program do like this.

    END-OF-SELECTION.

    SET PF-STATUS 'ZSTAT' "Ur new PF status.

    All ur processing.

    AT USER-COMMAND.

    CHECK sy-ucomm EQ 'MYCODE'. "This will be assigned "while creating push button in PF status.

    Do ur processing on clicking the button.

    Thanks,

    Vinod.

    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.