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

Attach ZSmartform to NACE and Code to write in Program

Former Member
0 Likes
873

Attach ZSmartform to NACE and Code to write in Program.Please Reply ASAP.

Moderator message: please do more research before posting, ask detailed and polite questions only without "ASAP"

Regards

Sumit Saini

Message was edited by: Thomas Zloch

Attach ZSmartform to NACE and Code to write in Program.Please Reply ASAP.

Moderator message: please do more research before posting, ask detailed and polite questions only without "ASAP"

Regards

Sumit Saini

Message was edited by: Thomas Zloch

5 REPLIES 5
Read only

SharathYaralkattimath
Contributor
0 Likes
779

This message was moderated.

Read only

0 Likes
779

Dear Sharath.

Thanks for Giving helpful reply , But Still half answer i get.

Half answer is remaining that is how to call that  NACE  in  Smartform. What code i have to Write.

Regards

Sumit.

Read only

0 Likes
779

Dear Sumit,

For attaching your z smartform you have to select the output type to which you have to attach this form.

In NACE you have to develop and attach the Z program which has one ENTRY function module which can be called to call the output type from the standard sap program.

example :

FORM ENTRY USING RETURN_CODE US_SCREEN.
   CLEAR RETCODE.
   XSCREEN = US_SCREEN.
   PERFORM PROCESSING USING US_SCREEN"  Output on screen /printer
   CASE RETCODE.
     WHEN 0.
       RETURN_CODE = 0.
     WHEN 3.
       RETURN_CODE = 3.
     WHEN OTHERS.
       RETURN_CODE = 1.
   ENDCASE.

ENDFORM.         

in above code PROCESSING contain the code to call the smartform using SSF function module.


with regards,


Jayraj Joshi

Read only

Former Member
0 Likes
779

Example of a program to print a smartforms

&---------------------------------------------------------------------*

*& Report  ZZPRINT_SMARFORMS                     *

*&                                                                     *

*&---------------------------------------------------------------------*

*&                                                                     *

*&                                                                     *

*&---------------------------------------------------------------------*

REPORT  ZZPRINT_SMARFORMS

***********************************************************************

*                                                                     *

* Standard Routine ENTRY                                              *

*                                                                     *

***********************************************************************

FORM entry_neu USING return_code us_screen.

* Seleccionamos los datos

   xscreen = us_screen.

   CALL FUNCTION 'ME_READ_PO_FOR_PRINTING'

     EXPORTING

       ix_nast        = nast

       ix_screen      = us_screen

     IMPORTING

       ex_retco       = return_code

       ex_nast        = l_nast

       doc            = l_doc

     CHANGING

       cx_druvo       = l_druvo

       cx_from_memory = l_from_memory.


   CHECK return_code EQ 0.

   PERFORM print_smartform.

ENDFORM.                    "entry

* ----------------------------------------------------------------------

FORM print_smartforms

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

     EXPORTING

       formname           = wg_tdsfname

     IMPORTING

       fm_name            = wg_fnam

     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 you smarforms and pas your parameterts

   CALL FUNCTION wg_fnam

     EXPORTING

       archive_index      = toa_dara

       archive_parameters = arc_params

       control_parameters = ls_control_param

       mail_recipient     = ls_recipient

       mail_sender        = ls_sender

       output_options     = ls_composer_param

       is_lfa1            = x_lfa1

       is_texto           = wg_text

       is_xekko           = l_doc-xekko

       user_settings = ' '

       is_xpekko          = l_doc-xpekko

     TABLES

       l_xekpo            = l_doc-xekpo[]

       l_xekpa            = l_doc-xekpa[]

       l_xpekpo           = l_doc-xpekpo[]

       l_xeket            = l_doc-xeket[]

       l_xtkomv           = l_doc-xtkomv[]

       l_xekkn            = l_doc-xekkn[]

       l_xekek            = l_doc-xekek[]

       l_xkomk            = l_xkomk

     EXCEPTIONS

       formatting_error   = 1

       internal_error     = 2

       send_error         = 3

       user_canceled      = 4

       OTHERS             = 5.

   IF sy-subrc <> 0.

     wg_retcode = sy-subrc.

     PERFORM protocol_update_i.

* get SmartForm protocoll and store it in the NAST protocoll

     PERFORM add_smfrm_prot.

   ENDIF.

ENDFORM.                    "invocar_smartform