Skip to Content
0
Former Member
Oct 30, 2008 at 07:50 PM

Reg: Probelm with BDC For FB70 (Table control)

96 Views

Hi All,

I have created a BDC for FB70. And here is my code


    IF WA_HEADER-XMWST = SPACE.
      perform bdc_dynpro      using 'SAPMF05A' '1200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BU'.
      perform bdc_field       using 'INVFO-SGTXT'
                                    WA_HEADER-SGTXT_HEADER.
      perform bdc_field       using 'BDC_CURSOR'
                                    'ACGL_ITEM-KOSTL(01)'.
      MOVE 001 TO IDX.
      MOVE 002 TO INDEX.
      LV_WRBTR = 0.

      LOOP AT INT_ITEM INTO WA_ITEM WHERE KUNNR = WA_HEADER-KUNNR AND
                                          XBLNR = WA_HEADER-XBLNR.
        MOVE INDEX TO WA_ITEM-ITEM_INDEX.
        MODIFY INT_ITEM FROM WA_ITEM TRANSPORTING ITEM_INDEX.


        CONCATENATE 'ACGL_ITEM-HKONT(' IDX ')' INTO FNAM.

        perform bdc_field       using FNAM
                                      WA_ITEM-HKONT.

        CONCATENATE 'ACGL_ITEM-WRBTR(' IDX ')' INTO FNAM.
        perform bdc_field       using FNAM
                                      WA_ITEM-WRBTR.

        CONCATENATE 'ACGL_ITEM-SGTXT(' IDX ')' INTO FNAM.
        perform bdc_field       using FNAM
                                      WA_ITEM-SGTXT_ITEM.

        CONCATENATE 'ACGL_ITEM-KOSTL(' IDX ')' INTO FNAM.
        perform bdc_field       using FNAM
                                      WA_ITEM-KOSTL.



      IF IDX > 7.
      perform bdc_dynpro      using 'SAPMF05A' '1200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=P++'.
      IDX = 1.
      ENDIF.	

        IDX = IDX + 1.
        INDEX = INDEX + 1.
        LV_WRBTR = LV_WRBTR + WA_ITEM-WRBTR.
      ENDLOOP.

    ENDIF.

.

I am able to update upto 7 records and when i try to update the eight record i am unable to do it and i have checked for P++ As well as P+ option also. its not working.

When i tried with OK CODE 0005 AS WELL AS 0006 FOR insert row as well as add items i am unable to add the 8 item since index is a problem here..

Can any one share some views towards this how to get it done?