Skip to Content
avatar image
Former Member

Reg upload of vendor master data

Dear Friends,

I am unable to uplaod vendor master data in XK01 txn table control fields ie banks, bankn, bankl, koinh, bkont and banka..

1. Data which is supposed to be uploaded in the table control fields may have more than one record.

2. We can get coding thru recording ie SHDB txn code. Coding we get thru recording is depended upon no of records we enter in table control fields.

3. But i want the coding with internal tables for table control fields and data to be looped in the internal tables.

Pls help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 06, 2008 at 05:02 AM

    Hi

    First, you have to be familiar with the Table Control Concept in BDC..

    For the fields which need table control, they have to be changed using concatenate statement:

    data:fnaml(20) type c,
           id type string.
    
    move 1 to id.
    *
        loop at TI_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE.
    
          concatenate 'RM06E-EPSTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-itmcategory.
    
          concatenate 'EKPO-KNTTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-accassignment.
    
          concatenate 'EKPO-EMATN(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-material.
    
          concatenate 'EKPO-TXZ01(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-shortxt.
    
          quan = ti_staging-poqty.
          concatenate 'EKPO-MENGE(0' id ')' into fnam.
          perform bdc_field       using fnam quan.
    
          concatenate 'RM06E-EEIND(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-deliverydate.
    
          netpr = ti_staging-netpr.
    
          concatenate 'EKPO-NETPR(0' id ')' into fnam.
          perform bdc_field       using fnam netpr.
    
          concatenate 'EKPO-MATKL(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-mategroup.
    
          concatenate 'EKPO-WERKS(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-plant.
    
          ID = ID + 1.
    *
        ENDLOOP.

    Regards,

    Vishwa.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi

      Instead of writing so many loops for one line item fields, you can put them in one loop:

      LOOP AT T_BANKS INTO WA_BANKS FROM X TO X.
      CONCATENATE 'LFBK-BANKS(' CNT ')' INTO FLD.
      perform bdc_field using FLD wa_BANKS-BANKS.
      ENDLOOP.
      
      
      CONCATENATE 'LFBK-BANKL(' CNT ')' INTO FLD.
      perform bdc_field using FLD wa_BANKL-BANKL.
      ENDLOOP.
      
      
      CONCATENATE 'LFBK-BANKN(' CNT ')' INTO FLD.
      perform bdc_field using FLD wa_BANKN-BANKN.
      ENDLOOP.
      
      
      CONCATENATE 'LFBK-KOINH(' CNT ')' INTO FLD.
      perform bdc_field using FLD wa_KOINH-KOINH.
      
      
      CONCATENATE 'LFBK-BKONT(' CNT ')' INTO FLD.
      perform bdc_field using FLD wa_BKONT-BKONT.
      
      CNT = CNT + 1." NEVER FORGET TO INCREMENT THE COUNTER,ONLY THEN SECOND LINE WILL COME.
      
      
      ENDLOOP.
      
      perform bdc_field using 'BDC_CURSOR' 'LFBK-bkont'.
      perform bdc_field using 'BDC_OKCODE' '=BANK'.
      
      perform bdc_dynpro using 'SAPLBANK' '0100' 'X'.
      
      "PUT THIS ALONE IN A SEPERATE LOOP..
      CONCATENATE 'BNKA-BANKA(' CNT ')' INTO FLD.
      perform bdc_field using FLD wa_BANKA-BANKA.

      Regards,

      Vishwa.

      Edited by: vishwa sri hari on Oct 6, 2008 7:20 AM