cancel
Showing results for 
Search instead for 
Did you mean: 

BDC not changing data

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186741
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi,

I am clearing IBDCDATA after appending. there is no problem even when I debug the program there are different values for each field as per my internal table.

One more thing REFRESH will delete all the records from the internal table.

Regards,

Dilip

Former Member
0 Kudos

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

former_member186741
Active Contributor
0 Kudos

sorry, Diliip but I'm a bit confused. I thought Table IBDCDATA holds all the screen and field stuff which you pass to the CALL transaction. If that's true, it needs to be cleared after each call transaction. Refresh will do this.

Former Member
0 Kudos

Dear Shrinivas,

Thanks I have awarded 10 points for solving my problem.

Regards,

Dilip

former_member186741
Active Contributor
0 Kudos

Dilip,

I replied to your problem with the correct solution. Why don't I get any points??

Former Member
0 Kudos

Hi Dilip,

Neil does deserve the points here, being the first to point the same problem that I elaborated. Please reward points to him.

Thanks,

Srinivas

Answers (0)