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

Push Button

Hi,

In this program when i click submit button i want to display Male if the Radio button is select in Male option otherwise i want to display Female. But it's not working fine, so please help me

REPORT ZJJ1.

tables : sscrfields.

parameters : p1 radiobutton group rg1,

p2 radiobutton group rg1.

selection-screen:

pushbutton /6(20) but1 user-command cli1.

initialization.

but1 = 'submit'.

at selection-screen.

if sscrfields-ucomm = 'cli1'.

if p1 = 'x'.

write 'male'.

elseif p2 = 'x'.

write 'female'.

endif.

endif.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Dec 05, 2007 at 05:02 AM

    Hi,

    Refer this code

    ----


    • PARAMETERS & SELECT-OPTIONS *

    ----


    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.

    PARAMETERS : p_pay1 RADIOBUTTON GROUP grp USER-COMMAND fc DEFAULT 'X',

    p_pay2 RADIOBUTTON GROUP grp.

    SELECTION-SCREEN END OF BLOCK b1.

    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

    SELECT-OPTIONS : s_pernr FOR pa0000-pernr. "Personnel Number

    SELECTION-SCREEN BEGIN OF LINE.

    SELECTION-SCREEN COMMENT (31) text-018.

    PARAMETERS : p_begda LIKE pa0000-begda OBLIGATORY. "Start Date

    SELECTION-SCREEN COMMENT 52(05) text-019.

    PARAMETERS : p_endda LIKE pa0000-endda OBLIGATORY. "End Date

    SELECTION-SCREEN END OF LINE.

    SELECT-OPTIONS : s_stat2 FOR pa0000-stat2, "Status

    s_werks FOR pa0001-werks, "Personnel Area

    s_raufnr FOR catsdb-raufnr MODIF ID md1. "Internal Order Number

    SELECTION-SCREEN END OF BLOCK b2.

    ----


    • AT SELECTION-SCREEN *

    ----


    AT SELECTION-SCREEN OUTPUT.

    IF p_pay1 EQ 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'MD1'.

    screen-active = '1'.

    screen-input = '0'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ELSEIF p_pay2 EQ 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'MD1'.

    screen-active = '1'.

    screen-input = '1'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    Regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 05:03 AM

    Hi,

    Instead of AT selection-screen event use AT User-command Event.

    regards,

    Santosh Thorat

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 05:09 AM

    I want to change my code

    Add a comment
    10|10000 characters needed characters exceeded

    • <b>Hii

      Modify ur program as follows..

      n while executing.. after clicking the push button... execute the program.. otherwise u wont get the result

      reward if helpful</b>

      TABLES : sscrfields.

      DATA:v_flag TYPE i VALUE 0.

      PARAMETERS : p1 RADIOBUTTON GROUP rg1,

      p2 RADIOBUTTON GROUP rg1.

      SELECTION-SCREEN:

      PUSHBUTTON /6(20) but1 USER-COMMAND cli1.

      INITIALIZATION.

      but1 = 'submit'.

      AT SELECTION-SCREEN .

      IF sscrfields-ucomm = 'CLI1'.

      IF p1 = 'X'.

      v_flag = 1.

      ELSEIF

      p2 = 'X'.

      v_flag = 0.

      ENDIF.

      ENDIF.

      START-OF-SELECTION.

      IF v_flag = 1.

      WRITE:'male'.

      ELSE.

      WRITE:'female'.

      Message was edited by:

      Sheeba Bhaskaran

  • Posted on Dec 05, 2007 at 12:19 PM

    Hi,

    I have done some modifications to your program.

    Push button's function code and check 'X' for P1 and P2 should be in capital letters.

    Copy and paste the code below, it will work . I have checked it.

    tables : sscrfields.

    parameters : p1 radiobutton group rg1,

    p2 radiobutton group rg1.

    selection-screen:

    pushbutton /6(20) but1 user-command cli1.

    initialization.

    but1 = 'submit'.

    at selection-screen.

    if sscrfields-ucomm = 'CLI1'.

    if p1 = 'X'.

    set pf-status ' '.

    leave to list-processing and return to screen 1000.

    write 'male'.

    elseif p2 = 'X'.

    set pf-status ' '.

    leave to list-processing and return to screen 1000.

    write 'female'.

    endif.

    endif.

    Reward points if your problem is solved.

    Regards,

    Soumya.

    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.