cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable/Enable a row in Steploop based on checkbox

heterocigoto
Participant
260

I have been working on a report for a Handheld device with Steploops. The problem I am having is that I need to disable a qty field when a checkbox is checked but enable it again when it is unchecked.

The main problem right now is that on my Loop at Screen, I will see one row instead of them all and if I change it to Screen-active = '0'. It disables all the qty fields.

There is any idea I will apply to fix it?

Accepted Solutions (1)

Accepted Solutions (1)

heterocigoto
Participant

*THIS ANSWER WAS POSTED BY phil soady IN STACKOVERFLOW*

https://stackoverflow.com/questions/76706949/how-to-disable-enable-a-row-in-steploop-based-on-checkb...

______________________________________________________________________________________________

The trick is to call a module from the DYNPRO inside LOOP on the screen. Here is minimum style solution, by hand to illustrate the concept.

PROCESS BEFORE OUTPUT.
  LOOP AT DATA_AREA_TAB  CURSOR current_line INTO data_area_rec.
       MODULE LOOP_INIT.
       MODULE DATA_AREA_TAB_SHOW.
  ENDLOOP.

then inside the MODULE...

You can read the current line so you know the content and adjust the field accordingly. Since it is called per line of dynpro it updates the current line

MODULE DATA_AREA_TAB_SHOW OUTPUT.  
READ TABLE data_area_tab INTO data_area_rec INDEX current_line.

LOOP AT SCREEN.

 IF screen-name = '???'.   " your rules here
  IF data_area_rec-VALUE  = '???'
    screen-invisible = '0'.
    screen-input = '1'.
   ELSE.
    screen-invisible = '1'.
    screen-input = '0'.
  ENDIF.
 ENDIF.

 MODIFY SCREEN.
ENDLOOP.
ENDMODULE.

I test it and works as expected.

Answers (0)