Skip to Content
0
Former Member
Jul 02, 2007 at 01:39 AM

Batch Input and print Preview

106 Views

Dear all,

I make a batch input of ME28's print preview. It was recorded the print preview function of ME28.

and then I call this batch input in my new report. But I found if mode is set to "N",It can NOT preview the report

CALL TRANSACTION 'ME28' USING BDCDATA

MODE "N"

MESSAGES INTO MESSTAB.

if mode is set "A", It can preivew the report.

I don't know Why?

the following code for your reference :

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

FORM BDC_FIELD USING FNAM FVAL.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDFORM.

FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM.

perform bdc_dynpro using 'RM06EF00' '1000'.

perform bdc_field using 'BDC_CURSOR'

'S_EBELN-LOW'.

perform bdc_field using 'BDC_OKCODE'

'=ONLI'.

perform bdc_field using 'P_FRGCO'

'01'.

perform bdc_field using 'P_FRGSE'

'X'.

perform bdc_field using 'P_FRGVO'

'X'.

perform bdc_field using 'LISTU'

'BEST'.

perform bdc_field using 'S_BSTYP-LOW'

'F'.

perform bdc_field using 'S_EBELN-LOW'

'5110004414'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'=PREV'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'05/10'.

perform bdc_field using 'BDC_OKCODE'

'=PREV'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'=SCAN'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'/EXIT'.

perform bdc_field using 'BDC_CURSOR'

'05/10'.

CALL TRANSACTION 'ME28' USING BDCDATA

MODE "N"

MESSAGES INTO MESSTAB.

Thanks you

John