cancel
Showing results for 
Search instead for 
Did you mean: 

Print program for customized smartform.........

Former Member
0 Kudos

Hi Abapers,

I designed a 'Purchase recommendation note' form (zprn),by using smartforms.

To assign this to the output type, i want the print program for this form.

I want to know whether, i want to write the print program or the form itself created a print program.

If for mitself created the print program, then tell me how to find it.

If i want to write the print prorgam, suggest me how to write.....

I searched sdn before posting this, but i can't find it...

Thanks & Regards,

BDK.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thnx for all the replies....

Former Member
0 Kudos

Hi,

Take your output type name and then go to NACE TCODE and then with your output type you will find list of another output types just open them and then select any output type. Then double click on the Processing Routines there you will find the program name in the Standard Program column you can take that one as your standard program for your Output type.

Hope this will help you,

Regards,

Venkat.

Former Member
0 Kudos

To find the print program and output type;

1) You can ask your MM consultant.

2) Check tcode NACE

3) Check table TNAPR with original smartform name.

Regards

Karthik D

Former Member
0 Kudos

Hi Karthik,

Thnx for ur reply...

I aked my MM consultant, he has no idea abt it.

I checked with tnapr table, but i cant find the print program for my form 'ZPRN'...

Can u reply in detail abt this.....

Former Member
0 Kudos

>

> I checked with tnapr table, but i cant find the print program for my form 'ZPRN'...

> Can u reply in detail abt this.....

I told you to check TNAPR table for the original form.

Regards

Karthik D

Former Member
0 Kudos

Hi

You have to use standard print program or create your own.

One can find example of print program from the program attached to the Output type in NACE Transaction.

Regards

Vijai

Edited by: Vijai Dixit on Jun 23, 2009 7:34 AM

Former Member
0 Kudos

Hi

you need to write the print program for the smart form

it just creates a function module which you need to call in the print program..

you need to write the print program in this way

DATA: fm_name TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'ZPRN' "-->Give your smartform name here
  IMPORTING
    fm_name            = fm_name
  EXCEPTIONS
    no_form            = 1
    no_function_module = 2
    OTHERS             = 3.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

" Call the function module here that is the function module generated by smartform. 
"You can get the name of the function module by going to 
" environment in the menubar in the smartform -> function module name
"change the function module name to variable declared above
CALL FUNCTION fm_name  
 EXCEPTIONS
    formatting_error = 1
    internal_error   = 2
    send_error       = 3
    user_canceled    = 4
    OTHERS           = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

[Check this link for knowing more |https://wiki.sdn.sap.com/wiki/x/mAc]

Thanks & Regards

Sarves

Former Member
0 Kudos

Hi Sarves,

Thnx for ur reply....

I had writen the print program with the form name & function module name...

But while executing it displaying error like ' form zpurchase doesn't exist'..... I dont know wat mistake i done.... So clarify my for this....


REPORT  ZPO.

tables: ekko,pekko,ekpo,ekpa,eket,ekkn,ekek,komk.

data : fm_name type rs38l_fnam.

data: it_ekpo like standard table of ekpo,
      it_ekpa like standard table of ekpa,
      it_pekpo like standard table of pekpo,
      it_eket like standard table of eket,
      it_tkomv like standard table of komv,
      it_ekkn like standard table of ekkn,
      it_ekek like standard table of ekek,
      it_komk like standard table of komk.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME                 = 'zpurchase'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
 IMPORTING
    FM_NAME                  = fm_name
* EXCEPTIONS
*   NO_FORM                  = 1
*   NO_FUNCTION_MODULE       = 2
*   OTHERS                   = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Former Member
0 Kudos

code as follows.....


CALL FUNCTION fm_name
  EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
    IS_EKKO                    = ekko
    IS_PEKKO                   = pekko
*   IS_NAST                    =
*   IV_FROM_MEM                =
*    IV_DRUVO                   = druvo
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
  TABLES
    IT_EKPO                    = it_ekpo
    IT_EKPA                    = it_ekpa
    IT_PEKPO                   = it_pekpo
    IT_EKET                    = it_eket
    IT_TKOMV                   = it_tkomv
    IT_EKKN                    = it_ekkn
    IT_EKEK                    = it_ekek
    IT_KOMK                    = it_komk
* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR             = 2
*   SEND_ERROR                 = 3
*   USER_CANCELED              = 4
*   OTHERS                     = 5
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

former_member555112
Active Contributor
0 Kudos

Hi,

Please give ZPURCHASE in capital and not in lower case.

Regards,

Ankur Parab

Former Member
0 Kudos

Hi,

Do as Ankur said, you need to give the form name in capitals not in small

ZPURCHASE

Regards

Sarves

Former Member
0 Kudos

Hi,

Write the form name in capital letters. That was the error.

Regards,

Rajitha.

Former Member
0 Kudos

Hi Ankur,

Thnx for ur reply... Now form has executed.....

But i got a dump error stating tat "one of the parameter missing, i.e.., 'druovo'".....

One more thing, how to give declare this parameter druvo in program.,

and i want to give the purchase order number in runtime, so tat the user can give the PO number after executing this program and to get the print out of this form.....

former_member555112
Active Contributor
0 Kudos

HI,

Just check in your smartforms in the Form Interface tab.

You have declared some parameter as DRUVO and have not check the optional flag.

Incase you do not need it remove it from there or make it optional so that the dump does not appear.

Regards,

Ankur PArab

Former Member
0 Kudos

Hi Ankur,

I had checked as optional in form interface, and now i got the output...

i want to give the purchase order number in runtime, so tat the user can give the PO number after executing this program and to get the print out of this form.....

I had declared the parameter for ebeln as,


 parameters: iv_ekko like ekko-ebeln.
    

But after giving the PO number in runtime, i m getting only the empty layout, not with the values of tat PO number....

So, guide me how to do this...

Thanks,

BDK....