2008 Feb 02 10:27 AM
Hello Guys,
I want to knw the flat file strucute of vendor master data (specially vendor with multiple banks)
pls let me knw tht
thnks
sunny
Hello Guys,
I want to knw the flat file strucute of vendor master data (specially vendor with multiple banks)
pls let me knw tht
thnks
sunny
2008 Feb 02 2:14 PM
helo,
it depends up on the file format used by client.
u can use two files,first fiel general data,file.
second fiel for bank details,with ref to first file vendor number.
or else u can maintain in same file as line items.
read the records and loop depending up on header and line item concept as we do got tabel control in bdc.
2008 Feb 02 5:11 PM
IT CAN BE SINGLE FLAT FILE OR IT CAN BE CSV SEPARATED BY COMMA
OR IT CAN BE TWO
IN ORDER TO UPLOAD SUCH A FILE YOU HAVE TO USE BDC TABLE CONTROL
HERE IS THE SAMPLE CODE WITH 2 FLAT FILES
report ZABVENDOR_UPLOAD1
no standard page heading line-size 255.
types :begin of ty_ven,
i1 TYPE c,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
end of ty_ven.
data: it_ven type table of ty_ven,
wa_ven like line of it_ven.
types: begin of ty_bank,
j1 type c,
banks LIKE lfbk-banks,"BANK COUNTRY KEY
bankl LIKE lfbk-bankl,"BANK KEYS
bankn LIKE lfbk-bankn,"CONTROL KEY
koinh LIKE lfbk-koinh,"aacount name
BANKA LIKE BNKA-BANKA,
end of ty_bank.
data:it_bank type table of ty_BANK,
wa_bank like line of it_BANK.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
*DATA : c TYPE i.
*
include bdcrecx1.
start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\VN1.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
TABLES
DATA_TAB = IT_VEN.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\BANK.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
TABLES
DATA_TAB = IT_BANK.
.
*ENDLOOP.
LOOP AT IT_VEN INTO WA_VEN.
SPLIT WA_VEN AT '*' INTO WA_VEN-I1
WA_VEN-LIFNR
WA_VEN-bukrs
WA_VEN-ekorg
WA_VEN-ktokk
WA_VEN-anred
WA_VEN-name1
WA_VEN-sortl
WA_VEN-land1
WA_VEN-akont
WA_VEN-fdgrv
WA_VEN-waers.
perform open_group.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
WA_VEN-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
WA_VEN-bukrs.
perform bdc_field using 'RF02K-EKORG'
WA_VEN-ekorg.
perform bdc_field using 'RF02K-KTOKK'
WA_VEN-ktokk.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-ANRED'
WA_VEN-anred.
perform bdc_field using 'LFA1-NAME1'
WA_VEN-name1.
perform bdc_field using 'LFA1-SORTL'
WA_VEN-sortl.
perform bdc_field using 'LFA1-LAND1'
WA_VEN-land1.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-KOINH(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
CNT = 0.
LOOP AT IT_BANK INTO WA_BANK WHERE J1 EQ WA_VEN-I1.
SPLIT WA_BANK AT '*' INTO WA_BANK-J1
WA_BANK-BANKS
WA_BANK-bankl
WA_BANK-bankn
WA_BANK-koinh
WA_BANK-BANKA.
CNT = CNT + 1.
CONCATENATE 'LFBK-BANKS( ' CNT ' )' INTO FDT.
perform bdc_field using FDT
WA_BANK-BANKS.
CONCATENATE 'LFBK-BANKL( ' CNT ' )' INTO FDT.
perform bdc_field using FDT
WA_BANK-BANKL.
CONCATENATE 'LFBK-BANKN( ' CNT ' )' INTO FDT.
perform bdc_field using FDT
WA_BANK-BANKN.
CONCATENATE 'LFBK-KOINH( ' CNT ' )' INTO FDT.
perform bdc_field using FDT
WA_BANK-KOINH.
IF cnt = 5.
cnt = 0.
perform bdc_dynpro using 'SAPLBANK' '0100'.
perform bdc_field using 'BDC_CURSOR'
'BNKA-BANKA'.
*CONCATENATE 'BNKA-BANKA( ' CNT ' )' INTO FDT.
*
*perform bdc_field using FDT
WA_BANK-BANKA.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'BNKA-BANKA'
'BANK OF INDIA'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFB1-AKONT'
WA_VEN-akont.
perform bdc_field using 'LFB1-FDGRV'
WA_VEN-fdgrv.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
WA_VEN-waers.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'XK01'.
ENDLOOP.
SOME SAMPLE DATA(JUST FOR LEARNING)
VENDOR DETAILS
13010000100010001COMPANY1IDES1SAP1DE31000A2INR*
13190000100010001COMPANY1SATYAM1CONSULTING1IN31000A2INR*
24090100000010001MR.AMBANI1RELIANCE1IN31000A2INR*
BANK DETAILS FLAT TYPE
1DE234206630493TSYSTEM1BANK OF MELBOURNE*
1IN2305866307039TCS1BANK OF ARMENIA*
1DE453886630765TOSHIBA1BANK OF BERLIN*
1AU893206639785SHELL1AXIS BANK*
1CA366373940643YASHODA1BANK OF TORONTO*
2PK7802374902393CARE1ISLAMIC CONVENTORY BANK*
2NZ400297494393LG1WELLINGTON NATIONAL BANK*
2008 Feb 02 5:13 PM
2008 Mar 20 6:44 AM
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |