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: 

DISABLE INPUT FOR A SINGLE CELL UPON CHANGING FIELD IN A TABLE CONTROL

tan_michael
Active Participant
0 Kudos

Hi ABAP Experts,

Here are my requirements. In VA2*/VA0* - Program SAPMV45A - Screen 4912 - Table Control TCTRL_U_ERF_ANGEBOT...

if the field detected that the value is equal to space or "AA", It will set the screen-input = 0 of specific cell of field VBKD-PLTYP. I tried to search it but I only found the references for disabling the entire column.

I also tried below code in Screen 4912 PBO, but upon activation it throws me an error regarding the loop.

Error: LOOP AT ITAB should be followed by the addition CURSOR.

Error: "LOOP" cannot be assigned to any field

loop at LT_ITEM into LS_ITEM with control TCTRL_U_ERF_ANGEBOT.

endloop.

I hopes that you can guide me or throw me any sample program reference/link.

3 REPLIES 3

DoanManhQuynh
Active Contributor
0 Kudos

are you trying to modify standard screen? it is not recommended to do so.

your error is because there already have a loop with table control in different way, you cant add another loop there.

I suggest you to check if there is any enhancement to achive it. Take a look and give a try with one of those below:

Badi: BADI_SD_SEPA

customer exit: EXIT_SAPMV45A_004

user exit: userexit_field_modification

0 Kudos

yes there's already a loop for table control angebot. so i enter my module program there but it seems that my program not working although the screen-input is already 0.

module z4912 output.

loop at TCTRL_U_ERF_ANGEBOT-COLS into cols where index eq 39.
      lv_loopc = sy-tabix.
      loop at lt_vbap assigning <fs_vbap>.
        lv_loopv = sy-tabix.
        read table lt_vbkd assigning <fs_vbkd> with key posnr = <fs_vbap>-posnr.
        if sy-subrc eq 0.
          if TCTRL_U_ERF_ANGEBOT-CURRENT_LINE eq lv_loopv and cols-screen-name eq 'VBKD-PLTYP'.
            cols-screen-input = 0.
            modify TCTRL_U_ERF_ANGEBOT-COLS from cols index lv_loopc.
            modify screen.
          endif.
        endif.
      endloop.
endloop.

0 Kudos

tan.michael : as i told its not recommended to modify standard program unless you dont have other option, check enhancement first those enhancement already have logic to modify screen. btw, i think you should loop at screen and modify screen instead of screen-input of table control.