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

table control

Former Member
0 Likes
458

i want to add a custom button for select and deselect all,

for that i am writing a case statement for okcode in PAI and when the okcode is equal to that value i do the LOOP AT SCREEN code

but it is not working please help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
433

yes your code will not work,

go to your code where you have written LOOP AT SCREEN press F1 there you will find that this code only works in the PBO

you can do like this you can either paste the code in PBO or if you want to do it more systematically then you shoul set any flag variable there (IN PAI) then base on that value check condition in PBO and LOOP AT SCREEN

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
433

hi

can you send the code you have written for selecting & deselecting?

we can see where the error was made.

thx

pavan

Read only

Former Member
0 Likes
433

hi,

declare ind in table control index

and just follow this code

CASE SY-UCOMM.

WHEN 'SELECT'.

LOOP AT ITAB.

IND = 'X'.

ITAB-CHECK = IND.

MODIFY ITAB TRANSPORTING CHECK.

ENDLOOP.

WHEN 'DESEL'.

LOOP AT ITAB.

IND = ' ' .

ITAB-CHECK = IND.

MODIFY ITAB TRANSPORTING CHECK.

ENDLOOP.

ENDCASE.

Read only

Former Member
0 Likes
433

Hi,

Design the GUI status and give Fun codes for those buttons and write the code as below;

&----


*& Form select_all

&----


  • Select All objects

----


FORM select_all .

CLEAR v_lisel.

DO.

READ LINE sy-index FIELD VALUE v_chk.

IF sy-subrc NE 0.

EXIT.

ENDIF.

READ LINE sy-index FIELD VALUE sy-lisel INTO v_lisel.

IF v_lisel+2(1) = ' ' AND sy-index GT 5.

v_lisel+2(1) = 'X'.

MODIFY LINE sy-index FIELD VALUE sy-lisel FROM v_lisel.

ENDIF.

ENDDO.

ENDFORM. " select_all

&----


*& Form deselect_all

&----


  • Deselect All Objects

----


FORM deselect_all .

CLEAR v_lisel.

DO.

READ LINE sy-index FIELD VALUE v_chk.

IF sy-subrc NE 0.

EXIT.

ENDIF.

READ LINE sy-index FIELD VALUE sy-lisel INTO v_lisel.

IF v_lisel+2(1) = 'X'.

v_lisel+2(1) = ' '.

MODIFY LINE sy-index FIELD VALUE sy-lisel FROM v_lisel.

ENDIF.

ENDDO.

ENDFORM. " deselect_all

Regards,

Anji

Read only

Former Member
0 Likes
434

yes your code will not work,

go to your code where you have written LOOP AT SCREEN press F1 there you will find that this code only works in the PBO

you can do like this you can either paste the code in PBO or if you want to do it more systematically then you shoul set any flag variable there (IN PAI) then base on that value check condition in PBO and LOOP AT SCREEN

Thanks