Skip to Content
0
Former Member
Dec 06, 2006 at 04:30 PM

Call LQ02 with BDC table in background mode only post the first record

166 Views

My program call LQ02 with BDC table in background mode but only the first record is posted. If I run LQ02 manually, all records in the ALV list will be posted. Below is the BDC code. Does anyone know how to resolve the problem ? Thanks in advance.

lv_cutoff_date = sy-datum - gs_zconage-zageday.

perform bdc_dynpro using 'RLLQ0200' '1000'.

perform bdc_field using 'BDC_CURSOR'

'PA_DUNKL'.

perform bdc_field using 'BDC_OKCODE'

'=ONLI'.

perform bdc_field using 'S1_LGNUM'

p_lgnum.

perform bdc_field using 'S1_LGTYP-LOW'

p_lgtyp.

perform bdc_field using 'SOBKZ-LOW'

'K'.

perform bdc_field using 'PA_LSONR'

gs_zconage-sonum.

perform bdc_field using 'PA_BWLVS'

'911'.

write lv_datum to lv_date mm/dd/yyyy.

perform bdc_field using 'WEDAT-LOW'

lv_date.

write lv_cutoff_date to lv_date mm/dd/yyyy.

perform bdc_field using 'WEDAT-HIGH'

lv_date.

write sy-datum to lv_date mm/dd/yyyy.

perform bdc_field using 'PA_BLDAT'

lv_date.

write sy-datum to lv_date mm/dd/yyyy.

perform bdc_field using 'PA_BUDAT'

lv_date.

perform bdc_field using 'PA_DUNKL'

'D'.

call transaction 'LQ02' using bdcdata

mode 'N'

messages into msg_tbl.

Philip