Skip to Content
0
Former Member
Sep 12, 2007 at 12:23 PM

BDC (at new)

39 Views

Hi experts,

look at the code below.

I have a problem with BCD. I want to make a transaction at every new referencre (BKTXT). When I loop on the table t_tab, and the program execution reach first time the at new bktxt statement, the header of the table t_tab shows that everything after the field bktxt shown as asterix (*), however the fields are correct in the table. The header isn't correct.... By this reason the Batch doc will be not correct in sm35.

I hope u understand what my problem is. Do you have any idea how to solve the case?

perform open_group.

loop at t_tab.

at new bktxt.

perform bdc_dynpro using 'SAPMF05A' '0100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BKPF-BLDAT'

l_bldat.

perform bdc_field using 'BKPF-BLART'

t_tab-blart.

perform bdc_field using 'BKPF-BUKRS'

t_tab-bukrs.

perform bdc_field using 'BKPF-BUDAT'

l_bldat.

perform bdc_field using 'BKPF-MONAT'

t_tab-monat.

perform bdc_field using 'BKPF-WAERS'

t_tab-waers.

perform bdc_field using 'BKPF-XBLNR'

t_tab-xblnr.

perform bdc_field using 'BKPF-BKTXT'

t_tab-bktxt.

perform bdc_field using 'RF05A-NEWBS'

t_tab-newb1.

perform bdc_field using 'RF05A-NEWKO'

t_tab-newc1.

endat.

perform bdc_dynpro using 'SAPMF05A' '0300'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BSEG-WRBTR'

t_tab-wrbt1.

perform bdc_field using 'BSEG-VALUT'

l_bldat.

perform bdc_field using 'RF05A-NEWBS'

t_tab-newb2.

perform bdc_field using 'RF05A-NEWKO'

t_tab-newc2.

perform bdc_field using 'DKACB-FMORE'

'X'.

perform bdc_dynpro using 'SAPLKACB' '0002'.

perform bdc_field using 'BDC_OKCODE'

'=ENTE'.

perform bdc_dynpro using 'SAPMF05A' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'BSEG-WRBTR'

t_tab-wrbt2.

perform bdc_field using 'BSEG-VALUT'

l_bldat.

perform bdc_field using 'DKACB-FMORE'

'X'.

perform bdc_dynpro using 'SAPLKACB' '0002'.

perform bdc_field using 'BDC_OKCODE'

'=ENTE'.

*perform bdc_transaction using 'FB01'.

at new bktxt.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'FB01'

TABLES

DYNPROTAB = BDCTAB.

REFRESH BDCTAB.

endat.

endloop.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

endform.