Reg upload of vendor master data
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.
Vishwa Srihari replied
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.
Edited by: vishwa sri hari on Oct 6, 2008 7:20 AM