Skip to Content
author's profile photo Former Member
Former Member

regd : pass the screen variants into SAP Scripts or Smartforms for printing

hi,

i have developed one application using modulepool programing in that i need to print a particular screen ...i am unable to do that..can we populate that screen into SAP SCRIPTS or SMARTFORMS for printing..please if it is possible send me the code...that screen includes image also.

Surely points will be rewarded

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Sep 17, 2007 at 06:39 PM

    You can create your own custom Smartform and pass whatever fields you want to it. I've never done any forms with images myself but am pretty sure that you can pass some reference to an image and print it on a form.

    In a nutshell, these steps need to be performed:

    1) Decide what data you need to pass to the form and, if necessary, define a structure in SE11 to use in your calling program and in the Smartform.

    2) Create a Smartform using the structure defined on step 1 (or any existing structure) in the Form Interface.

    3) In your program:

    a) fill in the structure with the data (from the screen fields or wherever)

    b) call SSF_FUNCTION_MODULE_NAME to get the function module assigned to your form

    c) call that function module EXPORTING the structure that you used in the Form Interface on step 2.

    Here is a very basic code fragment of step 3 (c) - here MY_STRUCTURE is your interface structure:

    DATA: fm_name TYPE rs38l_fnam.
    
    * The data must be in S_MY_STRUCTURE
    
    FORM start_smartform  USING p_form TYPE tdsfname.
    
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = p_form
        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.
    
    * Set s_ctrlop and s_output values here
    
      CALL FUNCTION fm_name
        EXPORTING
          control_parameters = s_ctrlop
          output_options     = s_output
          MY_STRUCTURE = S_MY_STRUCTURE
          user_settings      = space
        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.
    
    ENDFORM.                    " start_smartform

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 10:19 AM

    hi,

    In the module pool programming, we always use the set PF-STATUS to design the MENU.

    Its always better to copy the menu items from the standard and also include the application tool bar, so that the functions in the standard bar will also work along with the functions and buttons in the application bar.

    I hope this logig will be useful, if not i will be sending you the proper codes and procedure of doing it.

    Reward points, if useful.

    bye now

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.