Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help on Screen Logic

Former Member
0 Likes
1,123

Hi Folks,

I have a requirement where on the output screen I have two buttons "Calculate" and "POST".

I need to enable the "post" button once the processing through calculate button is being done.

Please let me know how?

vishal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,094

Hi

U should say us what the button CALCULATE does, anyway u can set a FLAG in order to be enable the button POST.

IF CALCULATE_RUN = 'X'.
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'POST'.
         SCREEN-INPUT = 0.
         MODIFY SCREEN.
     ENDIF.
  ENDLOOP.
ENDIF.

Max

Hi

U should say us what the button CALCULATE does, anyway u can set a FLAG in order to be enable the button POST.

IF CALCULATE_RUN = 'X'.
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'POST'.
         SCREEN-INPUT = 0.
         MODIFY SCREEN.
     ENDIF.
  ENDLOOP.
ENDIF.

Max

6 REPLIES 6
Read only

Former Member
0 Likes
1,095

Hi

U should say us what the button CALCULATE does, anyway u can set a FLAG in order to be enable the button POST.

IF CALCULATE_RUN = 'X'.
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'POST'.
         SCREEN-INPUT = 0.
         MODIFY SCREEN.
     ENDIF.
  ENDLOOP.
ENDIF.

Max

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,094

Hi,

You can use export/import logic.

In PAI of the screen validate like this.


IF sy-ucomm EQ 'CALC'.  " Clicked on calculate.
Do your processing...
.
.
.
.
MOVE 'CALC' to l_calc.
EXPORT l_calc TO MEMORY ID 'CALC'.
CLEAR l_calc.
ENDIF.

ENDIF.

IF sy-ucomm EQ 'POST'.  " Clicked on post.
IMPORT l_calc FROM MEMORY ID 'CALC'.
IF sy-subrc IS INITIAL.
Process your posting logic.
ELSE.
MESSAGE 'Calculate has not happened' TYPE 'E'.
ENDIF.
ENDIF.

Thanks,

Vinod.

Read only

Former Member
0 Likes
1,094

Hi,

You can manage a global variable (flag) to know when the "calculate" button has been pressed. And in the PBO you can desactive the "post" button if the flag is not ticked.


  IF gv_flag_calculate IS INITIAL.
    LOOP AT SCREEN.
      IF screen-name = 'POSTBUTTON'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Hope this help

Read only

Former Member
0 Likes
1,094

hi,

in your PBO write the code like this.


if ok_code = 'CALCULATE'  "capture sy-ucomm for calculate button.
loop at screen.
screen-name = name of the push button for POST.
screen-active = 1.
modify screen.
endloop.
else.
loop at screen.
screen-name = name of the push button for POST.
screen-active = 0.
modify screen.
endloop.endif.

regards,

sakshi

Read only

Former Member
0 Likes
1,094

Hi,

IN PBO,

module check_calc.

module check_calc.

if chk_calc = 'X'. if Calculations are done then Enable POST button

LOOP AT SCREEN.

IF screen-name = 'POST'.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

else.

if Calculations are not done then Disable POST button

LOOP AT SCREEN.

IF screen-name = 'POST'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

endmodule.

IN PAI.

ok_code = sy-ucomm.

case ok_code.

when 'CALCULATE'.

Do you processing and after that enable the post button.

chk_calc = 'X'.

endcase.

hope it helps you,

Regards,

Abhijit G. Borkar

Read only

Former Member
0 Likes
1,094

Thanks folks for replying. It helps me to resolve the issue.