Application Development 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: 

Problem in BDC

Former Member
0 Kudos

Dear Experts,

I have developed a program for shipping advice and created transaction for this then I did BDC recording for this transaction

and in between I am calling printer (RSPO_FRONTEND_PRINTERS_FOR_DEV) to print the document.

The problem I am facing is the dialog for print will open if I run program in foreground (Mode 'A') but if run in background the print dialog will not open.

could anyone suggest me that how can I fix this issue.

CALL FUNCTION 'RSPO_FRONTEND_PRINTERS_FOR_DEV'

EXPORTING

DEVICE = 'LOCL'

IMPORTING

PRDEFAULT = V_DEFUALT_PRINTER

TABLES

LIST = L_PRLIST

EXCEPTIONS

NO_LIST = 1

LIST_TRUNCATED = 2

NAME_NOT_FOUND = 3

OTHERS = 4.

IF SY-SUBRC <> 0.

MESSAGE E600(FR) WITH 'Error on CALL FUNCTION "GET_DEFAULT_PRINTER" process. '.

V_ERROR = 1.

ENDIF.

Thanks in advance....

Best Regards

Venkat

3 REPLIES 3

Former Member
0 Kudos

Hi,

What is the format of your document?

You should probably use the EXECUTE method of the class CL_GUI_FRONTEND_SERVICES to achieve that...

for example to print a PDF document:


            cl_gui_frontend_services=>execute( 
              EXPORTING
                application = l_appl       "Full path to AcroRd32 executable
                parameter = l_param        "/n /t [filename] 
                synchronous = 'X'
              EXCEPTIONS
                cntl_error = 1
                error_no_gui = 2
                bad_parameter = 3
                file_not_found = 4
                path_not_found = 5
                file_extension_unknown = 6
                error_execute_failed = 7
                synchronous_failed = 8
                not_supported_by_gui = 9 ).

Concerning the parameter passed to acrobat reader:

/n = Launch a separate instance of the Acrobat application, even if one is currently open.

/t = Used to initiates the Reader, prints a file while suppressing the Acrobat print dialog box, then terminates Reader.

That means also that the document must be downloaded first...but can be deleted right after printing...

Hope it helps,

m.

Former Member
0 Kudos

its done

0 Kudos

Hi Venkatesh,

Please post how you solved your issue.If you solved by previous post ,give reward points or mention how you solved.In future it will be helpful for others.it's my humble Request.

with regards

Naresh