cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase Order Driver Program Not loading SMARTFORM

Former Member
0 Kudos

Hi,

I have developed Z smartform by copying from standard form and tried to call from standard program only but here I am not able to call my Z smartform and I am able to call only Z SAPSCRIPT from this standard program.

I have done all the necessary changes in NACE transaction but then also only when I keep the script name its working fine but when I replace this by smartform name the driver program is not calling smartform .!! why?

Please do let me know why is it like this?

Thanks

Sudharshan

Accepted Solutions (1)

Accepted Solutions (1)

amit_khare
Active Contributor
0 Kudos

Did you check in the driver Program is there a call for SMARTFORM.

Check for this FM in the driver program -

SSF_FUNCTION_MODULE_NAME

Former Member
0 Kudos

No,I didnt find that in the driver program so I think we need to change the driver program but can is it not available from SAP to open an smartform.

Can you please let me know how should I get this driver program corrected to call smartform.

Thanks

Sudharshan

Former Member
0 Kudos

Hi

The standard driver program PO is /SMB40/FM06P which is available with /SMB40 package. If it is not available then use RVORDER01 and copy and change as below:

Call the function module SSF_FUNCTION_MODULE_NAME in RVORDER01SUB and comment all the FMs used for SAPSCRIPT

Regards

Shiva

amit_khare
Active Contributor
0 Kudos

Hi,

In that program look for FM FP_FUNCTION_MODULE_NAME. this is called to print ADOBE form.

I think you can use the same place for your modifications.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

PO driver program is written to support only SAPSCRIPT. So if you want to assign smartform in NACE, you should take a Zcopy of the driver program SAPFM06P with its include FM06PE02 as ZFM06PE02. And give the zprogram against the driver program field in NACE.

Then you need to replace the entry_nue subroutine in ZFM06PE02 with the below code.

form entry_neu using ent_retco ent_screen.

  data: l_druvo like t166k-druvo,
        l_nast  like nast,
        l_from_memory,
        l_doc   type meein_purchase_doc_print.

* Data Declaration for PO smartform Modification
DATA: fname TYPE rs38l_fnam,
        xkomk TYPE TABLE OF komk,
        gs_output TYPE ssfcompop,
        gs_dialog TYPE ssfctrlop.
  clear ent_retco.
  if nast-aende eq space.
    l_druvo = '1'.
  else.
    l_druvo = '2'.
  endif.

  call function 'ME_READ_PO_FOR_PRINTING'
       exporting
            ix_nast        = nast
            ix_screen      = ent_screen
       importing
            ex_retco       = ent_retco
            ex_nast        = l_nast
            doc            = l_doc
       changing
            cx_druvo       = l_druvo
            cx_from_memory = l_from_memory.
  check ent_retco eq 0.
   IF tnapr-sform NE ' '.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = tnapr-sform
      IMPORTING
        fm_name            = fname
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc EQ 0.

        gs_dialog-no_dialog = 'X'.
        gs_dialog-preview = 'X'.
        gs_output-tddest = 'LP01'.
        gs_output-tdnoprev = ' '.
        gs_output-tdnoprint = ' '.
        gs_output-tdimmed = 'X'.
        gs_output-tdnewid = 'X'.


     CALL FUNCTION fname  " modify the interface as per your needs
        EXPORTING
          control_parameters = gs_dialog
          output_options     = gs_output
          user_settings      = ' '
          zxekko             = l_doc-xekko
          zxpekko            = 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            = xkomk
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
    ELSE.
      CALL FUNCTION 'ME_PRINT_PO'
        EXPORTING
          ix_nast        = l_nast
          ix_druvo       = l_druvo
          doc            = l_doc
          ix_screen      = ent_screen
          ix_from_memory = l_from_memory
          ix_toa_dara    = toa_dara
          ix_arc_params  = arc_params
          ix_fonam       = tnapr-fonam                      "HW 214570
        IMPORTING
          ex_retco       = ent_retco.
    ENDIF.
  ELSE.
    CALL FUNCTION 'ME_PRINT_PO'
      EXPORTING
        ix_nast        = l_nast
        ix_druvo       = l_druvo
        doc            = l_doc
        ix_screen      = ent_screen
        ix_from_memory = l_from_memory
        ix_toa_dara    = toa_dara
        ix_arc_params  = arc_params
        ix_fonam       = tnapr-fonam                        "HW 214570
      IMPORTING
        ex_retco       = ent_retco.
  ENDIF.

endform.

While calling the smartform modify the fm interface to your needs.

This will solve your problem.

Regards

Karthik D

Former Member
0 Kudos

create ur driver program by using these 2 standard includes which are used for PO smartforms

INCLUDE /SMB40/FM06TOP.

INCLUDE /SMB40/FM06PE02.

Former Member
0 Kudos

Hi,

first get Function Module name from 'Environment' tab in your Smartform than in your program call this Function Module name through 'Pattern' tab and give that name.

Follow this procedure..

hope it will work.

Regards:

Alok