cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SAPScript to Smartform (Print Program

Former Member
0 Kudos

I have already converted the form to a SmartForm but I am having trouble understanding the print program for the SAPScript (I am quite new to ABAP/SAP). Can anybody tell me if the code below is where the SAPScript is being called from? The T-code is VL70 and the code is as follows:

ZRVADEK01-> (A copy of RVADEK01)

form form_open using us_screen us_country.

  include rvadopfo.

endform.

RVADOPFO->

  call function 'OPEN_FORM'
       exporting
*           APPLICATION        = 'TX'
            archive_index      = toa_dara
            archive_params     = arc_params
            device             = lvf_device
            dialog             = ' '
            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.

Regards,

Davis

Message was edited by:

Davis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Davis,

If i have understood your question correctly you are looking for a form that is calling this print program ... it is taking the form name from tnapr table i.e,

form = tnapr-fonam

where this table has all the form and print program names

Regards,

Santosh

Former Member
0 Kudos

No, I'm looking for the part of the print program that is calling the form (SAPScript) so I can convert the program to call the new SmartForm. I know nothing about SAPScript (I have only changed one or two, minor changes) and I know nothing about SmartForms (except for what is in the SAP Press book) so I'm having difficult time with this. I am taking the SmartForms class in Chicago in two weeks but that is a long way off. Basically I need to get this print program to call the SmartForm.

Thanks for the reply though! Your tip on the table will come in handy. I only wish I knew that earlier!

Regards,

Davis

Message was edited by:

Davis

Former Member
0 Kudos

Hi Davis,

I think your starting point is wrong :

don't try at once to copy a SAPscript to Smartform and then think the related print program can be adjusted easily (because it is not).

The essential difference between a SAPscript form and Smartform is this :

A SAPscript form only reacts to a print program and doesn't have any logic in it. So the moment of printing certain text lines are totally depending of the print program and hence all the print events (e.g. print address, print main window etc.) are literally programmed in the print program.

However, a Smartform has its own logic and the only thing for the print program has to do is collect all data in structures and tables and call the smartform and in the "call" passes through all these data.

So you will have to TOTALLY rewrite the print program (so it is not only removing the function module OPEN_WINDOW, but also START_FORM, WRITE_FORM, END_FORM and then determine at ANOTHER place in the program to be sure where you have collected all necessary data)

Try this first :

Just like Santosh said, table TNAPR is of interest for printing sales document (this is actually the customizing for sales document output types).

Check for example SAP standard output type LD00 (delivery note, is quite close to picking list). It shows the print program and smartform .

Otherwise look for more related shipping documents by only entering 'V2' in the field [Application].

If the output seems to be close to what is needed (discuss with customer), then copy this to a new Z* output type in Customizing (so you still have the information about this SAP standard output type) and copy the print program & smartform .

I hope this gives you a refreshed view on your problem.

Former Member
0 Kudos

Chi, thanks for the reply. I will look into what you posted. I am new to the company and the person who created the zcopy of the program and SAPScript isn't around so I'll have to do some investigation into what was changed. Thanks again for the reply!

Regards,

Aaron

Former Member
0 Kudos

Another question you may ask yourself (and the requester) is :

why do you want to have a smartform instead of a SAPscript form ?

Yes, a smartform is nice to work with and certain program logic are available in the smartform so you don't have to program this.

However, if it is just to have a smartform because it is 'neat', I don't think it is a good argument .

In other words : If it is not broken, don't fix it. Just wait with the fix until it is almost broken

Former Member
0 Kudos

The reason we need to go with SmartForms is because this form prints out a barcode that we use in our warehouse. The printer we use to print the barcodes is almost, if not already, dead. We figure it would be better to make it a SmartForm rather than buying a new printer.

Regards,

Aaron

Answers (0)