on 12-01-2005 5:29 AM
Hello All,
I have completed the BDC on F-30 but new problem I am facing is that the data is not changing. Only first record is taken for all the uploads.
Kindly suggest where I am going wrong.
Following is my code.
Regards,
Dilip
LOOP AT IBSID.
clear tmp.
clear ibsid1.
refresh ibsid1.
********************To get index of BSID table
perform get_index.
********************
clear tmp.
TMP = IBSID-DMBTR.
*To avoid automatic convetsion of date
clear : bLdat1, budat1.
concatenate iabsid-bLdat6(2) iabsid-bLdat4(2)
iabsid-bLdat(4)
into bLdat1
separated by w_separator.
concatenate iabsid-budat6(2) iabsid-budat4(2)
iabsid-budat(4)
into budat1
separated by w_separator.
perform bdc_header using 'SAPMF05A' '0122'.
perform fnamval using 'BDC_CURSOR'
'RF05A-NEWUM'.
perform fnamval using 'BDC_OKCODE'
'=SL'.."'/00'.
perform fnamval using 'BKPF-BLDAT'
bLdat1. "'08.10.2005'.
perform fnamval using 'BKPF-BLART'
ibsid-blart. "'PT'.
perform fnamval using 'BKPF-BUKRS'
ibsid-bukrs."'KBL'.
perform fnamval using 'BKPF-BUDAT'
'22.09.2005'.
perform fnamval using 'BKPF-MONAT'
'6'.
perform fnamval using 'BKPF-WAERS'
ibsid-WAERS."ibsid-waers."'INR'.
CLEAR NUMB.
perform fnamval using 'BKPF-XBLNR'
ibsid-belnr.".'5503000049'.
perform fnamval using 'BKPF-BKTXT'
ibsid-vtext."'10% ADVANCE RECEIPT'.
perform fnamval using 'FS006-DOCID'
'*'.
perform fnamval using 'RF05A-NEWBS'
'09'.
perform fnamval using 'RF05A-NEWKO'
ibsid-kunnr. "'104410'.
perform fnamval using 'RF05A-NEWUM'
ibsid-umskz."'A'.
perform fnamval using 'RF05A-XPOS1(04)'
'X'.
perform bdc_header using 'SAPMF05A' '0304'.
perform fnamval using 'BDC_CURSOR'
'BSEG-ZUONR'.
perform fnamval using 'BDC_OKCODE'
'=PA'.
perform fnamval using 'BDC_CURSOR'
ibsid-BELNR. "'BSEG-ZUONR'.
perform fnamval using 'BSEG-WRBTR'
tmp ."'21417.04'.
clear tmp.
perform fnamval using 'BSEG-GSBER'
GSBER."'BA02'.
perform fnamval using 'BSEG-ZFBDT'
budat1 ."'22.09.2005'.
IF IBSID-PROJK <> SPACE.
perform fnamval using 'BSEG-PROJK'
ibsid-posid."IBSID-PROJK."'C2I-05-03-T-E-D'.
else.
perform fnamval using 'BSEG-VBEL2'
IBSID-VBEL2."'R21E5G0180'.
perform fnamval using 'BSEG-POSN2'
IBSID-POSN2."'10'.
endif.
*perform bdc_field using 'BSEG-ZUONR'
'5503000049'.
perform fnamval using 'BSEG-ZUONR'
IBSID-BELNR."'5503000049'.
*perform bdc_dynpro using 'SAPMF05A' '0710'.
perform bdc_header using 'SAPMF05A' '0710'.
*perform bdc_field using 'BDC_CURSOR'
'RF05A-AGKON'.
perform fnamval using "'BDC_CURSOR'
'RF05A-XPOS1(03)'"'RF05A-AGKON'.
'X'.
perform fnamval using "'BDC_CURSOR'
'RF05A-AGKON'
IBSID-KUNNR. "'102962'.
****Addition for screen to enter Document No.
*perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_header using 'SAPMF05A' '0731'.
perform fnamval using 'BDC_CURSOR'
'RF05A-SEL01(01)'.
perform fnamval using 'BDC_OKCODE'
'=PA'.
perform fnamval using 'RF05A-SEL01(01)'
IBSID-BELNR."'5502700004'.
*RF05A-AGKOA.
****End Addition
perform fnamval using 'BDC_OKCODE'
'=PA'.
*****Start of new code
perform bdc_header using 'SAPDF05X' '3100'.
perform fnamval using 'BDC_OKCODE'
'=OMX'.
perform fnamval using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
perform fnamval using 'RF05A-ABPOS'
'1'.
perform bdc_header using 'SAPDF05X' '3100'.
perform fnamval using 'BDC_OKCODE'
'=Z-'.
perform fnamval using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
perform fnamval using 'RF05A-ABPOS'
'1'.
perform bdc_header using 'SAPDF05X' '3100'.
perform fnamval using 'BDC_OKCODE'
'/00'.
perform fnamval using 'BDC_CURSOR'
'RF05A-ABPOS'.
perform fnamval using 'RF05A-ABPOS'
'2'.
perform bdc_header using 'SAPDF05X' '3100'.
perform fnamval using 'BDC_OKCODE'
'=Z+'.
perform fnamval using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
perform fnamval using 'RF05A-ABPOS'
index."'2'.
perform bdc_header using 'SAPDF05X' '3100'.
perform fnamval using 'BDC_OKCODE'
'=BU'.
perform fnamval using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
call transaction 'F-30' using ibdcdata
mode 'A'
update 'S'
messages into ibdcmsgcoll.
clear : tmp,ibsid,ibsid1.
ENDLOOP.
FORM get_index.
******temp data declaration
data : itab1 like ibsid occurs 10 with header line,
itab2 like ibsid occurs 10 with header line,
itab3 like ibsid occurs 10 with header line..
******end temp data declaration
itab1[] = ibsid[].
loop at itab1.
select bukrs belnr waers zterm kunnr bldat budat projk dmbtr xblnr
buzei zterm infae from bsid
into corresponding fields of table Itab2
for all entries in itab1
where belnr =
itab1-belnr and kunnr eq itab1-kunnr and zterm eq itab1-zterm.
clear index.
loop at itab2.
read table itab2 with key
belnr = itab1-belnr kunnr = itab1-kunnr zterm = itab1-zterm into
iabsid.
index = sy-tabix.
****just to test
break-point.
numb = iabsid-waers.
****
exit.
endloop.
exit.
endloop.
delete itab1 index sy-tabix.
delete ibsid index sy-tabix.
clear itab1.
ENDFORM. " get_index
it could be that you are not refreshing table ibdcdata so it is growing and each time you call F-30 it only acts on the first set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dilip,
Not refreshing is the problem in this case. Here is where you shoud refresh your internal table.
call transaction 'F-30' using ibdcdata
mode 'A'
update 'S'
messages into ibdcmsgcoll.
clear : tmp,ibsid,ibsid1.
<b>refresh: ibdcdata.</b>
At this point your first transaction is complete, and you don't need that data anymore. You then start the next transaction's BDC data again.
Srinivas
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.