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

Regarding SAP Scripts

Former Member
0 Likes
652

Hi,

I have one issue in SAP Scripts.

We have developed one SAP SCRIPT[FORM] for VL02N Transaction.

The Script is working correctlly.

Here in <b>VL02N</b> once we give <b>Order Number</b> and go for <b>Print Preview</b> one spool number will be generated in <b>SP01</b>.

If we open that file we can see the print preview.

Now actual issue is:

We have developed a <b>Z-Transaction</b> for the same for and we are calling above form's print program from this transaction.

Here we can run through multiple Order numbers.

The Actual issue over here is we want to See the print preview once we hit on <b>Print Preview</b> button in this transaction itself. We should not go to <b>SP01</b> and see the <b>print preview</b>.

How is it possible.

Can anybody give solution for the same.

I should view the <b>Print Preview</b> from my transaction only without generating any spools.

Thanks in advance.

Thanks & Regards,

Prasad.

6 REPLIES 6
Read only

Former Member
0 Likes
606

Hi,

In the print program ( Z program ), you would be using OPEN_FORM. In it there is a parameter OPTIONS of type ITCPO. Pass TDPREVIEW = `X`.

Best regards,

Prashant

Read only

0 Likes
606

Hi,

I had passed the same but of no use.

Is there any solution for this!

Thanks,

Prasad.

Read only

0 Likes
606

prasad,

uncheck

- print immediately and

- release after output option

than you can preview it by transaction:

Regards,

Naveen

Read only

0 Likes
606

hi ,

put like this.

 call function 'OPEN_FORM'
    exporting
      application                 = 'TX'
      device                      = 'PRINTER'
      dialog                      = 'X'
      form                        = 'YW2_DBNOTE'
      language                    = sy-langu

.

to avoid spool u have to pass the options , there u can eliminate spool request.

Regards

Prabhu

Read only

0 Likes
606

Hi,

Atually i had copied standard program RVADOPFO to Z Program and used OPEN_FORM in that.

I had checked DIALOG = 'X'.

ITCPO = LVS_ITCPO.

LVS_ITCPO paramters i am passing are

TDDEST = 'LP01'.

TDPREVIEW = 'X'.

TDIMMED = 'X'.

TDARMOD = 1

TDPROGRAM & TDRECEIVER are also filled up.

Code for OPEN_FORM is as below:

<b>* open form

CALL FUNCTION 'OPEN_FORM'

EXPORTING

APPLICATION = 'TX'

ARCHIVE_INDEX = TOA_DARA

ARCHIVE_PARAMS = ARC_PARAMS

DEVICE = LVF_DEVICE

DIALOG = 'X'

FORM = TNAPR-FONAM

LANGUAGE = NAST-SPRAS

OPTIONS = LVS_ITCPO

MAIL_SENDER = LVS_SENDER

MAIL_RECIPIENT = LVS_RECIPIENT

  • MAIL_APPL_OBJECT = ' '

  • RAW_DATA_INTERFACE = '*'

  • IMPORTING

  • LANGUAGE =

  • NEW_ARCHIVE_PARAMS =

  • RESULT =

EXCEPTIONS

CANCELED = 1

DEVICE = 2

FORM = 3

OPTIONS = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

ARCHIVE_ERROR = 7

OTHERS = 8.

IF SY-SUBRC NE 0.

CASE SY-SUBRC.

WHEN 7.

RETCODE = SY-SUBRC.

SYST-MSGID = 'VN'.

SYST-MSGNO = '096'.

SYST-MSGTY = 'E'.

SYST-MSGV1 = NAST-KSCHL.

SYST-MSGV2 = NAST-KAPPL.

PERFORM PROTOCOL_UPDATE.

WHEN OTHERS.

RETCODE = SY-SUBRC.

PERFORM PROTOCOL_UPDATE.

ENDCASE.

ENDIF.

SET COUNTRY US_COUNTRY.</b>

Thanks,

Prasad.

Read only

Former Member
0 Likes
606

Hi,

In your open_form you can find a parameter dialog --set that to 'X'.

Further you can also other parameters of your print parameters by passing a structure of type ITCPO in your open_form.

If still not clear, give me the code let me revert back.

Hope the information is helpful to you.

Reward points if convinced with the answer.

Regards