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

Problem while scrolling the table control in BDC

Former Member
0 Likes
1,276

Hi,

I have used BDC call transaction for the transaction 9KE0.In one of the screens,the data is getting populated in the table control.

But the table has only 16 rows.To insert the records beyond 16 rows I have done a page down while recording the transaction.

While executing, the ok-code '=CP+' is appearing on screen.When I click enter, control is going to next page but data is not getting displayed.

Please find my code below.

   LOOP AT it_record1 into w_record1 WHERE layout = w_record-layout.

      IF NOT SY-TABIX GT 16.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=CP+'.
      ENDIF.
        CLEAR g_fnam.
        CONCATENATE 'Z-BDC02' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using 'BDC_CURSOR'
                                       g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-acc_num.

        CONCATENATE 'Z-BDC03' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-fun_area.

        CONCATENATE 'Z-BDC04' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-pro_cen.

        CONCATENATE 'Z-BDC05' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-parpro_cen.

        CONCATENATE 'Z-BDC06' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-plant.
        CONCATENATE 'Z-BDC07' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using 'Z-BDC07(02)'
                                    w_record-rep_mat.
        CONCATENATE 'Z-BDC08' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-tra_par.

        CONCATENATE 'Z-BDC09' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-tran_type.

        CONCATENATE 'Z-BDC10' '(' g_idx ')' INTO g_fnam.
        perform bdc_field       using g_fnam
                                      w_record1-amt_trancurr.
        CONDENSE w_record1-amt_trancurr.

        g_idx = g_idx+1.

       ENDLOOP.

Please let me know where I am wrong and help me to correct the error.

Regards,

Swapna

1 ACCEPTED SOLUTION
Read only

Aashish28
Contributor
785

Hiii,

       Try this ,

       IF NOT SY-TABIX GT 16.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=CP+'.

       
        PERFORM bdc_dynpro      USING 'your program name' 'screen number'. " Eg. - PERFORM bdc_dynpro      USING 'SAPLSZA6' '0200'.

      ENDIF.

And you have to reset or manage value of  g_idx because after one scrolling top row id again set to 1 so as per your screen reset or manage it .

4 REPLIES 4
Read only

bharat_rathod2
Active Participant
0 Likes
785

please,

give explain in breif.

Read only

Kartik2
Contributor
0 Likes
785

Hi,

After executing the command page down, you have to reset the counter back to 01, in your case, you have to reset the variable g_idx to 01.

Thaks and regards,

Kartik

Read only

Aashish28
Contributor
786

Hiii,

       Try this ,

       IF NOT SY-TABIX GT 16.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=CP+'.

       
        PERFORM bdc_dynpro      USING 'your program name' 'screen number'. " Eg. - PERFORM bdc_dynpro      USING 'SAPLSZA6' '0200'.

      ENDIF.

And you have to reset or manage value of  g_idx because after one scrolling top row id again set to 1 so as per your screen reset or manage it .

Read only

Former Member
0 Likes
785

Hi Asish,

Now the problem is resolved. Thanks.

Regards,

Swapna.