Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BDC for multiple lin items

Hi All,

In my BDC BDCDATA table is populated properly but when I am trying to put the data in to the BDC_INSERT it is talking only first item insted.

Please Suggest

Regards

Sagar

Former Member
Former Member replied

Hi,

When populating table control the index of the fieldname changes... you need to concatenate the index to the fieldname inorder to populate the correct line item

check this sample code.

LOOP AT itab_fields WHERE count EQ w_index.
    ADD 1 TO w_tabix.

    IF w_tabix gt <no> " number of visible lines of the table control of the screen

      PERFORM bdc_dynpro      USING 'SAPLSD41' '2200'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                   w_fname.

      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=P+'.
      w_tabix = 2.
    ENDIF.
    CONCATENATE 'DD03P-FIELDNAME(' w_tabix ')' INTO w_fname.
    CONCATENATE 'DD03P-KEYFLAG(' w_tabix ')' INTO w_fkey.
    CONCATENATE 'DD03D-DATATYPE(' w_tabix ')' INTO w_ftype.
    CONCATENATE 'DD03P-LENG(' w_tabix ')' INTO w_flen.
    CONCATENATE 'DD03P-DDTEXT(' w_tabix ')' INTO w_fdesc.

    PERFORM bdc_dynpro      USING 'SAPLSD41' '2200'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM bdc_field       USING w_fname
                                  itab_fields-fname.
    PERFORM bdc_field       USING w_fkey
                                  itab_fields-fkey.
    PERFORM bdc_field       USING w_ftype
                                  itab_fields-ftype.
    PERFORM bdc_field       USING w_flen
                                    itab_fields-flen.
    PERFORM bdc_field       USING w_fdesc
                                  itab_fields-fdesc.


  ENDLOOP.

regards

padma

Edited by: Padmavathi Palli on Sep 22, 2008 11:17 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question