Skip to Content
avatar image
Former Member

Converting smartform into executable(report) program..........

Hi Abapers,

I had a requirement to convert the smartform 'zpurchase'(customized std. PO form /SMB80/MMPO_ES), into an executable(report) program..so tat the user can execute this program by giving the Po Number in the run time and get the required form print out....

I had written a print program(zpo) for this form, but after executing i got only the layout not the values .... So guide me how to pull the values from tcode ME23N.....

REPORT  ZPO.

tables: ekko,pekko,ekpo,ekpa,eket,ekkn,ekek,komk.
*parameters: iv_druvo like druvo.
parameters: iv_ekpo like ekpo-ebeln.

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 25, 2009 at 06:28 AM

    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.
    

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Just check the select query you wrote in the smartform to fill the details into the internal table.

      may be you have not populated it correctly..

      check in your where condition you have mentioned the EBELN = PO_NUMBER or not...

      that might be a reason why the internal tables are not getting populated...

      may be you forgot to change the where condition perfectly..

      check this once ..

      Regards

      Sarves

  • avatar image
    Former Member
    Aug 07, 2009 at 07:27 AM

    Thread closed...

    Add comment
    10|10000 characters needed characters exceeded