Skip to Content
0
Former Member
Dec 01, 2005 at 05:29 AM

BDC not changing data

80 Views

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