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

Hi all,

Hi,

how to write print program for smartform (PO). this program is assign to Nace T-code .plz help me.

Murali.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 04:44 AM

    Hi,

    Check this

    REPORT zqmr_quality_notification NO STANDARD PAGE HEADING .

    &----


    • Table Declaration

    &----


    TABLES: qmel,

    prps,

    proj,

    afvc,

    makt,

    qpct,

    jest,

    jsto,

    tj30t,

    tq80_t.

    &----


    • Types Declaration

    &----


    TYPES: BEGIN OF typ_qmel,

    qmnum TYPE qmel-qmnum,

    qmart TYPE qmel-qmart,

    qmtxt TYPE qmel-qmtxt,

    erdat TYPE qmel-erdat,

    qwrnum TYPE qmel-qwrnum,

    psp_nr TYPE qmel-psp_nr,

    fertaufnr TYPE qmel-fertaufnr,

    ebeln TYPE qmel-ebeln,

    ebelp TYPE qmel-ebelp,

    matnr TYPE qmel-matnr,

    mblnr TYPE qmel-mblnr,

    arbpl TYPE qmel-arbpl,

    ekorg TYPE qmel-ekorg,

    bkgrp TYPE qmel-bkgrp,

    objnr TYPE qmel-objnr,

    pnlkn TYPE qmel-pnlkn,

    fertaufpl TYPE qmel-fertaufpl,

    qmcod TYPE qmel-qmcod,

    qmnam TYPE qmel-qmnam,

    ernam TYPE qmel-ernam,

    prueflos TYPE qmel-prueflos,

    zz_short_text TYPE qmel-zz_short_text,

    END OF typ_qmel.

    TYPES: BEGIN OF typ_prps,

    psphi TYPE prps-psphi,

    END OF typ_prps.

    TYPES: BEGIN OF typ_proj,

    post1 TYPE proj-post1,

    pspnr TYPE proj-pspnr,

    END OF typ_proj.

    TYPES: BEGIN OF typ_afvc,

    vornr TYPE afvc-vornr,

    ltxa1 TYPE afvc-ltxa1,

    aufpl TYPE afvc-aufpl,

    plnkn TYPE afvc-plnkn,

    END OF typ_afvc.

    TYPES: BEGIN OF typ_makt,

    maktx TYPE makt-maktx,

    matnr TYPE makt-matnr,

    END OF typ_makt.

    TYPES: BEGIN OF typ_qpct,

    code TYPE qpct-code,

    katalogart TYPE qpct-katalogart,

    codegruppe TYPE qpct-codegruppe,

    kurztext TYPE qpct-kurztext,

    END OF typ_qpct.

    TYPES: BEGIN OF typ_jest,

    stat TYPE jest-stat,

    objnr TYPE jest-objnr,

    END OF typ_jest.

    TYPES: BEGIN OF typ_jsto,

    stsma TYPE jsto-stsma,

    objnr TYPE jsto-objnr,

    END OF typ_jsto.

    TYPES: BEGIN OF typ_tj30t,

    txt04 TYPE tj30t-txt04,

    txt30 TYPE tj30t-txt30,

    estat TYPE tj30t-estat,

    stsma TYPE tj30t-stsma,

    END OF typ_tj30t.

    TYPES: BEGIN OF typ_tq80_t,

    qmartx TYPE tq80_t-qmartx,

    qmart TYPE qmel-qmart,

    END OF typ_tq80_t.

    &----


    • Internal table Declaration

    &----


    DATA: gt_qmel TYPE STANDARD TABLE OF typ_qmel.

    DATA: gt_prps TYPE STANDARD TABLE OF prps.

    DATA: gt_proj TYPE STANDARD TABLE OF typ_proj.

    DATA: gt_afvc TYPE STANDARD TABLE OF typ_afvc.

    DATA: gt_makt TYPE STANDARD TABLE OF typ_makt.

    DATA: gt_qpct TYPE STANDARD TABLE OF typ_qpct.

    DATA: gt_jest TYPE STANDARD TABLE OF typ_jest.

    DATA: gt_jsto TYPE STANDARD TABLE OF typ_jsto.

    DATA: gt_tj30t TYPE STANDARD TABLE OF typ_tj30t.

    DATA: gt_text1 TYPE STANDARD TABLE OF text1.

    DATA: gt_tq80_t TYPE STANDARD TABLE OF typ_tq80_t.

    DATA: gt_final TYPE STANDARD TABLE OF zqms_qn.

    &----


    • Structure Declaration

    &----


    DATA:gs_qmel TYPE typ_qmel.

    DATA:gs_prps TYPE prps.

    DATA:gs_proj TYPE typ_proj.

    DATA:gs_afvc TYPE typ_afvc.

    DATA:gs_makt TYPE typ_makt.

    DATA:gs_qpct TYPE typ_qpct.

    DATA:gs_jest TYPE typ_jest.

    DATA:gs_jsto TYPE typ_jsto.

    DATA:gs_tj30t TYPE typ_tj30t.

    DATA:gs_text1 TYPE text1.

    DATA:gs_tq80_t TYPE typ_tq80_t.

    DATA:gs_final TYPE zqms_qn.

    DATA: gv_inspt TYPE char20.

    &----


    • Selection Screen

    &----


    SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-110.

    PARAMETER: p_qmnum TYPE qmel-qmnum OBLIGATORY.

    SELECTION-SCREEN END OF BLOCK b11.

    &----


    • Start of Selection

    &----


    START-OF-SELECTION.

    PERFORM zf_fetch_data.

    PERFORM zf_final_table.

    &----


    *End of Selection

    &----


    END-OF-SELECTION.

    PERFORM zf_print_form.

    &----


    *& Form zf_print_form

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM zf_print_form .

    DATA: lv_form_name TYPE rs38l_fnam.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'ZQMS_QUALITY_NOTIFICATION'

    • VARIANT = ' '

    • DIRECT_CALL = ' '

    IMPORTING

    fm_name = lv_form_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.

    CALL FUNCTION lv_form_name

    • EXPORTING

    • ARCHIVE_INDEX =

    • ARCHIVE_INDEX_TAB =

    • ARCHIVE_PARAMETERS =

    • CONTROL_PARAMETERS =

    • MAIL_APPL_OBJ =

    • MAIL_RECIPIENT =

    • MAIL_SENDER =

    • OUTPUT_OPTIONS =

    • USER_SETTINGS = 'X'

    • IMPORTING

    • DOCUMENT_OUTPUT_INFO =

    • JOB_OUTPUT_INFO =

    • JOB_OUTPUT_OPTIONS =

    TABLES

    gt_final = gt_final

    • 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. " zf_print_form

    &----


    *& Form zf_fetch_data

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM zf_fetch_data .

    REFRESH gt_qmel.

    SELECT qmnum

    qmart

    qmtxt

    erdat

    qwrnum

    psp_nr

    fertaufnr

    ebeln

    ebelp

    matnr

    mblnr

    arbpl

    ekorg

    bkgrp

    objnr

    pnlkn

    fertaufpl

    qmcod

    qmnam

    ernam

    zz_short_text

    prueflos

    FROM qmel

    INTO CORRESPONDING FIELDS OF TABLE gt_qmel

    WHERE qmnum EQ p_qmnum.

    IF NOT gt_qmel[] IS INITIAL.

    SELECT vornr

    ltxa1

    aufpl

    plnkn

    FROM afvc INTO CORRESPONDING FIELDS OF TABLE gt_afvc FOR

    ALL ENTRIES IN gt_qmel WHERE

    aufpl EQ gt_qmel-fertaufpl AND

    plnkn EQ gt_qmel-pnlkn.

    SELECT maktx

    matnr

    FROM makt INTO CORRESPONDING FIELDS OF TABLE gt_makt FOR

    ALL ENTRIES IN gt_qmel WHERE

    matnr EQ gt_qmel-matnr AND

    spras EQ sy-langu.

    SELECT qmartx

    qmart

    FROM tq80_t INTO CORRESPONDING FIELDS OF TABLE gt_tq80_t

    FOR ALL ENTRIES IN gt_qmel WHERE

    qmart EQ gt_qmel-qmart AND

    spras EQ sy-langu.

    SELECT code

    katalogart

    codegruppe

    kurztext

    FROM qpct INTO CORRESPONDING FIELDS OF TABLE gt_qpct

    FOR ALL ENTRIES IN gt_qmel WHERE

    code EQ gt_qmel-qmcod

    AND katalogart EQ 'T'

    AND codegruppe EQ 'INSPTYPE'.

    SELECT pspnr

    psphi

    FROM prps INTO CORRESPONDING FIELDS OF TABLE gt_prps

    FOR ALL ENTRIES IN gt_qmel WHERE

    pspnr EQ gt_qmel-psp_nr.

    SELECT stat

    FROM jest INTO CORRESPONDING FIELDS OF TABLE gt_jest FOR

    ALL ENTRIES IN gt_qmel WHERE

    objnr EQ gt_qmel-objnr

    AND stat EQ 'E*'

    AND inact <> 'X'.

    SELECT stsma FROM jsto INTO CORRESPONDING FIELDS OF TABLE gt_jsto

    FOR ALL ENTRIES IN gt_qmel WHERE

    objnr EQ gt_qmel-objnr.

    ENDIF.

    IF NOT gt_prps[] IS INITIAL.

    SELECT pspnr

    post1

    FROM proj INTO CORRESPONDING FIELDS OF TABLE gt_proj

    FOR ALL ENTRIES IN gt_prps WHERE

    pspnr EQ gt_prps-psphi.

    ENDIF.

    IF NOT gt_jsto[] IS INITIAL.

    SELECT txt04

    txt30

    estat

    FROM tj30t INTO CORRESPONDING FIELDS OF TABLE

    gt_tj30t FOR ALL ENTRIES IN gt_jsto

    WHERE stsma EQ gt_jsto-stsma

    AND spras EQ sy-langu.

    ENDIF.

    ENDFORM. " zf_fetch_data

    &----


    *& Form zf_final_table

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM zf_final_table .

    LOOP AT gt_qmel INTO gs_qmel.

    MOVE gs_qmel-qmnum TO gs_final-qmnum .

    MOVE gs_qmel-qmart TO gs_final-qmart .

    MOVE gs_qmel-erdat TO gs_final-erdat.

    MOVE gs_qmel-qwrnum TO gs_final-qwrnum .

    MOVE gs_qmel-psp_nr TO gs_final-psp_nr .

    MOVE gs_qmel-fertaufnr TO gs_final-fertaufnr.

    MOVE gs_qmel-ebeln TO gs_final-ebeln .

    MOVE gs_qmel-ebelp TO gs_final-ebelp .

    MOVE gs_qmel-matnr TO gs_final-matnr .

    MOVE gs_qmel-mblnr TO gs_final-mblnr .

    MOVE gs_qmel-arbpl TO gs_final-arbpl .

    MOVE gs_qmel-ekorg TO gs_final-ekorg .

    MOVE gs_qmel-bkgrp TO gs_final-bkgrp .

    MOVE gs_qmel-qmnam TO gs_final-qmnam .

    MOVE gs_qmel-ernam TO gs_final-ernam .

    MOVE gs_qmel-zz_short_text TO gs_final-zz_short_text.

    MOVE gs_qmel-prueflos TO gs_final-prueflos .

    MOVE gs_qmel-qmtxt TO gs_final-qmtxt .

    READ TABLE gt_makt INTO gs_makt WITH KEY matnr = gs_qmel-matnr.

    IF sy-subrc = 0.

    MOVE gs_makt-maktx TO gs_final-maktx .

    ENDIF.

    READ TABLE gt_tq80_t INTO gs_tq80_t WITH KEY qmart = gs_qmel-qmart.

    IF sy-subrc = 0.

    MOVE gs_qmel-qmart TO gs_final-qmartx .

    ENDIF.

    READ TABLE gt_afvc INTO gs_afvc WITH KEY aufpl = gs_qmel-fertaufnr

    plnkn = gs_qmel-pnlkn.

    IF sy-subrc = 0.

    MOVE gs_afvc-vornr TO gs_final-vornr .

    MOVE gs_afvc-ltxa1 TO gs_final-ltxa1 .

    ENDIF.

    READ TABLE gt_prps INTO gs_prps WITH KEY pspnr = gs_qmel-psp_nr.

    READ TABLE gt_proj INTO gs_proj WITH KEY pspnr = gs_prps-psphi.

    IF sy-subrc = 0.

    MOVE gs_proj-post1 TO gs_final-post1.

    ENDIF.

    READ TABLE gt_jest INTO gs_jest WITH KEY objnr = gs_qmel-objnr.

    READ TABLE gt_jsto INTO gs_jsto WITH KEY objnr = gs_qmel-objnr.

    READ TABLE gt_tj30t INTO gs_tj30t WITH KEY stsma = gs_jsto-stsma

    estat = gs_jest-stat.

    IF sy-subrc = 0.

    MOVE gs_tj30t-txt04 TO gs_final-txt04 .

    MOVE gs_tj30t-txt30 TO gs_final-txt30 .

    ENDIF.

    READ TABLE gt_qpct INTO gs_qpct WITH KEY code = gs_qmel-qmcod.

    IF sy-subrc = 0.

    CONCATENATE gs_qpct-code '-' gs_qpct-kurztext INTO gv_inspt.

    MOVE gv_inspt TO gs_final-insp.

    ENDIF.

    APPEND gs_final TO gt_final.

    ENDLOOP.

    CLEAR: gs_qmel,gs_jest,gs_tj30t,gs_afvc,gs_tq80_t,gs_makt .

    ENDFORM. " zf_final_table

    Thanks

    Ankur Sharma

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 04:50 AM

    Hi Murali,

    Make sure when u write your program for PO, you write it in a modularised pattern and call the smartform in an include, coz when u assign your smartform and driver program in NACE, you need to assign a form Routine there, which would be the name of the include where your smartform is called.

    Thanks

    Nayan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Murali,

      Get in touch with me, find the details in my Business card. The code is very big, cant paste it here. you just copy the code that i send u and il show u how to configure.

      Close the thread if required

      Thanks

      Nayan

  • Posted on Jun 19, 2008 at 07:05 AM

    hi murali.

    how ru here i am confusing with archiving. their requirement is have to archive the programs.

    they have given me some programs and asking me to adapt them to archived. how it is i found out the reason.but i need to confirm. do one thing is plz ask to deepak and send me to urgent

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 19, 2008 at 07:33 AM

    sorry murali its not relavent to my requirement.

    i am asking how to create archiving files on storage system

    and how to assign the write programs to that.

    steps are.

    create archive files.

    create archive objects.

    and assign the write program to that.

    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.