cancel
Showing results for 
Search instead for 
Did you mean: 

custom driver program and form in smartforms

Former Member
0 Kudos

Hi,

I have to customise both the credit memo and debit memo.

Can you please let me know where to replace the driver program and form name .

I checked in NACE- application type v3 -> o/p type RD00. I dont see program name for smart forms.

Please suggest.

Thank you!

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Sep 1, 2008 5:15 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

For debit/credit memo's also we use same RD00.

copy the RD00 and change it smartform name driver program name.

ask functional people to configure another output type and assign your dirver program and smartform.

copy the standard driver program and customize according to your requirement.

or else use below code as driver program.

tables: nast.

  • Variable Declaration

data: g_retcode type sy-subrc , " Returncode

g_xscreen(1) type c , " Output on printer or screen

g_fm_name type rs38l_fnam, " Function Module Name

g_formname type tdsfname . " Form Name

----


  • FORM ENTRY *

----


  • Entry form for Calling Smartforms from Standard Transaction *

----


form entry using return_code type i

us_screen type c.

clear g_retcode.

g_xscreen = us_screen.

  • Calling Smartforms through standard Tcodes

perform sub_processing.

if g_retcode ne 0.

return_code = 1.

else.

return_code = 0.

endif.

endform. "ENTRY

&----


*& Form SUB_PROCESSING

&----


  • This routine is for calling Smartforms through standard Tcodes

----


form sub_processing .

  • For getting Form name

perform sub_get_formname.

if g_formname is not initial.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = g_formname

importing

fm_name = g_fm_name

exceptions

no_form = 1

no_function_module = 2

others = 3.

if sy-subrc <> 0.

case sy-subrc.

when 1.

message e000(38) with 'No Form Found'(001)

space space space.

when 2.

message e000(38) with 'No Function Module'(002)

space space space.

when others.

message e000(38) with 'Unknown Error'(003)

space space space.

endcase.

endif.

call function g_fm_name

exporting

is_nast = nast

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

case sy-subrc.

when 1.

message e000(38) with 'Formatting Error'(004)

space space space.

when 2.

message e000(38) with 'Internal Error'(005)

space space space.

when 3.

message e000(38) with 'Send Error'(006)

space space space.

when 4.

message e000(38) with 'User Cancelled'(007)

space space space.

when others.

message e000(38) with 'Unknown Error'(003)

space space space.

endcase.

endif.

else. " Form Does not exits

message e000(38) with 'No Form Found For This Output Type'(008)

nast-kschl space space.

endif.

endform. " SUB_PROCESSING

&----


*& Form SUB_GET_FORMNAME

&----


  • This routine is for Getting formname based on Condition Type

  • Message transmission medium and Application from table NAST

----


form sub_get_formname .

select single sform

into g_formname

from tnapr

where kschl eq nast-kschl

and nacha eq nast-nacha

and kappl eq nast-kappl.

endform. " SUB_GET_FORMNAME

Former Member
0 Kudos

Hi Pankaj,

There is a unique driver program. Kindly refer the below code. When ever a NAST entry get saved, the program triggers and gets the NAST-objkey. Based on that Smartform gets formatted. Just give this program name and smartform name at nace. This will work out surely.

&----


*& Report ZSD_INVOICE_DRIVER

&----


report zsd_invoice_driver.

tables: nast.

  • Variable Declaration

data: g_retcode type sy-subrc , " Returncode

g_xscreen(1) type c , " Output on printer or screen

g_fm_name type rs38l_fnam, " Function Module Name

g_formname type tdsfname . " Form Name

----


  • FORM ENTRY *

----


  • Entry form for Calling Smartforms from Standard Transaction *

----


form entry using return_code type i

us_screen type c.

clear g_retcode.

g_xscreen = us_screen.

  • Calling Smartforms through standard Tcodes

perform sub_processing.

if g_retcode ne 0.

return_code = 1.

else.

return_code = 0.

endif.

endform. "ENTRY

&----


*& Form SUB_PROCESSING

&----


  • This routine is for calling Smartforms through standard Tcodes

----


form sub_processing .

  • For getting Form name

perform sub_get_formname.

if g_formname is not initial.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = g_formname

importing

fm_name = g_fm_name

exceptions

no_form = 1

no_function_module = 2

others = 3.

if sy-subrc <> 0.

case sy-subrc.

when 1.

message e000(38) with 'No Form Found'(001)

space space space.

when 2.

message e000(38) with 'No Function Module'(002)

space space space.

when others.

message e000(38) with 'Unknown Error'(003)

space space space.

endcase.

endif.

call function g_fm_name

exporting

is_nast = nast

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

case sy-subrc.

when 1.

message e000(38) with 'Formatting Error'(004)

space space space.

when 2.

message e000(38) with 'Internal Error'(005)

space space space.

when 3.

message e000(38) with 'Send Error'(006)

space space space.

when 4.

message e000(38) with 'User Cancelled'(007)

space space space.

when others.

message e000(38) with 'Unknown Error'(003)

space space space.

endcase.

endif.

else. " Form Does not exits

message e000(38) with 'No Form Found For This Output Type'(008)

nast-kschl space space.

endif.

endform. " SUB_PROCESSING

&----


*& Form SUB_GET_FORMNAME

&----


  • This routine is for Getting formname based on Condition Type

  • Message transmission medium and Application from table NAST

----


form sub_get_formname .

select single sform

into g_formname

from tnapr

where kschl eq nast-kschl

and nacha eq nast-nacha

and kappl eq nast-kappl.

endform. " SUB_GET_FORMNAME

Former Member
0 Kudos

Hi

Use tcode - NACE and follow procedure as follows

1)Choose Application from list(eg PO)

2)Click OP type

3)Chose one OP type from Right pane.

4)Click on processing routines

and attach driver program and smartform to processing routine.

With Regards

Nikunj Shah