Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Batch Input and print Preview

Former Member
0 Likes
864

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

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
605

The reason is that mode "N" means that the transaction will be entirely in the backgroun, mode "A" means that it will step thru each screen and function click in foreground, mode "E" means that it will stop at any error messages, or if it simply runs out of instructions(partial BDC). I assume that you have recorded the transaction to the point where the user clicks the print preview button, and then you want the user to take over. If this is the case, simply set the mode = 'E', the BDC will perform the recording and simply stop and let the user take over.

REgards,

RIch Heilman

Read only

Former Member
0 Likes
605

Hi John,

The mode N specifies as do not display, it will display the screen only if there is any error.

The mode A is display mode in BDC so you can see on the screen on this mode.

Hope it is clear.

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
605

Hi,

Thanks you.

I set mode to 'E', but it still can NOT preview the report.

thanks you

John

Read only

0 Likes
605

Hi John,

Even in the E mode you can't view.

You need to use A only if you want to see Print preview, the other option is just do the coding still the print prieview part and leave the OK_CODE blank for the last screen and use E mode then you will come still that screen.

Reward points if useful.

Regards,

Atish