Application Development 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: 

disabling check-box in table control row wise

santosh_kumar94
Participant
0 Kudos

dear experts,

          i have a requirement of reports. i have to display data in table control.  there are line item in table control after displaying the data. each row have one check box. user want if he select one check-box and click on post button. it will trigger one bdc program and data will be uploaded for that line item.

up to here it's ok.

After that he want that once that line item is posted. that check-box related to that line item should be in disabled mode. he can not further select that line item.

how to disable that check-box  related to that line item means row-wise ?

when i am trying to do that it is disabling all check box in that column. how we can disable row-wise.?

1 ACCEPTED SOLUTION

davis_raja
Active Participant
0 Kudos

Dear Santosh,

Try to use the subroutine PERFORM SCREEN_DISPLAY inside the LOOP of Internal table which you will be using in PBO module.

It will work.

I didnt see a LOOP at internal table WITH CONTROL in your sample code.

I hope you are using it in your code.

12 REPLIES 12

nabheetscn
Active Contributor
0 Kudos

In PBO inside loop endloop of table control set screen-input as zero.

0 Kudos

dear nabheet , i did this but it's disabling all checkbox column. i want to disable only one which is selected and posted.

0 Kudos

Santosh you have to put a condition before modifying the screen to check if checbox is marked or posted then only run the code else wont. Share your sample code and field which identifies to disable or not

0 Kudos

TYPES : BEGIN OF TY_TRANSPORT11,

                VCODE TYPE YTRANSPORT-VCODE,                 "VENDOR CODE

                VNAME TYPE YTRANSPORT-VNAME ,

                TRUCKNO TYPE YTRANSPORT-TRUCKNO, "TRUCK NO.

                TDATE TYPE YTRANSPORT-TDATE,

                FNAME TYPE YTRANSPORT-FNAME,      " FARMER NAME

                FCODE TYPE YTRANSPORT-FCODE,        " FARMER CODE

                ROUTE TYPE YTRANSPORT-ROUTE,         "ROUTE

                QUANTITY TYPE YTRANSPORT-QUANTITY,     " QUANTITY IN UNIT OF ENTRY

                RATE TYPE YTRANSPORT-RATE,      "RATE

                TOTALCOST TYPE YTRANSPORT-TOTALCOST,

                CHECK(1) TYPE C,

                SEL(1) TYPE C,

   END OF TY_TRANSPORT11.

DATA : IT_TRANSPORT TYPE STANDARD TABLE OF TY_TRANSPORT11, " WITH UNIQUE KEY VCODE VNAME TRUCKNO,

             WA_TRANSPORT TYPE TY_TRANSPORT11.

MODULE STATUS_0200 OUTPUT.

   SET PF-STATUS 'TITLE'.

   SET TITLEBAR 'TIT'.

          PERFORM SCREEN_DISPLAY.

ENDMODULE.                 " STATUS_0200  OUTPUT

FORM SCREEN_DISPLAY.

  LOOP AT IT_TRANSPORT INTO WA_TRANSPORT ." WHERE CHECK = 'X'.

   IF WA_TRANSPORT-CHECK = 'X'.

       LOOP AT SCREEN.

*     IF SCREEN-GROUP2 = 'CHE'.

    if   screen-name = 'WA_TRANSPORT-CHECK'.

         SCREEN-INPUT = '0'.

         SCREEN-INTENSIFIED = '1'.

          MODIFY SCREEN.

       ENDIF.

       ENDLOOP.

      ENDIF.

    ENDLOOP.

   ENDFORM.

0 Kudos

Santosh this code should be loop endloop of table control...you are having it at the wrong place

davis_raja
Active Participant
0 Kudos

Dear Santosh,

Try to use the subroutine PERFORM SCREEN_DISPLAY inside the LOOP of Internal table which you will be using in PBO module.

It will work.

I didnt see a LOOP at internal table WITH CONTROL in your sample code.

I hope you are using it in your code.

0 Kudos

yes i am using it in screen pbo.

0 Kudos

thanks nabheet. you are absolutely right. i decalred one module :-

LOOP AT   IT_TRANSPORT

        INTO WA_TRANSPORT

        WITH CONTROL TRANS

        CURSOR TRANS-CURRENT_LINE.

     MODULE TRANS_GET_LINES.

     MODULE FILL_TABLE_CONTROL.

     MODULE SCREEN_OUTPUT.  " decalred this mudule.

MODULE SCREEN_OUTPUT OUTPUT.

   IF WA_TRANSPORT-CHECK = 'X'.

       LOOP AT SCREEN.

    if   screen-name = 'WA_TRANSPORT-CHECK'.

         SCREEN-INPUT = '0'.

         SCREEN-INTENSIFIED = '1'.

          MODIFY SCREEN.

       ENDIF.

       ENDLOOP.

      ENDIF.

ENDMODULE.

it's working fine now. thnks a lot nabheet.

0 Kudos

Dear nabheet, one issue is coming here. when i am clicking on one check box it's enabling the other's also. i don't want others to be enabled.

for example : -

1)  *

2)  *

3) 

4)  *

5)  *

*  means checked. so, here 1 , 2 , 4 & 5 are checked.

when i am selecting 3. then, 3 is getting selected rest are blank. it should show the all checked

item which are selected before.

1)

2)

3) *

4)

5)

0 Kudos
Please check in debugging in PAI inside loop endloop you are overwriting the value...just debug after selecting 3rd checkbox...

0 Kudos

this is the code for readiing checkbox value.

IF WA_TRANSPORT-CHECK = 'X'.

      loop at IT_TRANSPORT into g_TRANS_wa3

        where CHECK = 'X'.

        g_TRANS_wa3-CHECK = ' '. ----here value is blank.

        modify IT_TRANSPORT

          from g_TRANS_wa3

          transporting CHECK.

      endloop.

   endif.

   MODIFY IT_TRANSPORT

     FROM WA_TRANSPORT

     INDEX TRANS-CURRENT_LINE

     TRANSPORTING CHECK.

******************************************************************

IF WA_TRANSPORT-CHECK = 'X'.

      loop at IT_TRANSPORT into g_TRANS_wa3

        where CHECK = 'X'.

        g_TRANS_wa3-CHECK = 'x '. ----here value is x

        modify IT_TRANSPORT

          from g_TRANS_wa3

          transporting CHECK.

      endloop.

   endif.

   MODIFY IT_TRANSPORT

     FROM WA_TRANSPORT

     INDEX TRANS-CURRENT_LINE

     TRANSPORTING CHECK.

if am using this code . it's working fine for check box.

but, it is not selecting that particular line. because while looping on internal table it has more than one value for check. so,

always it is reading the last value in work-area which has value x. it is not picking the picking the value which is selected.

0 Kudos
Santosh in PAI why do have a loop again apart from table control one. Can please elaborate what issue you  are facing in selecting checkbox