Changes in medruck

hi folks,
i am working on scripts now and i hv to do modification to the script zmedr (a copied version of medruck).
now i hv to change the address.
so can anyone please tell me what is the process i have to follow please.
thanks in advance.

Hi,
enter the transacion SE71 in that screen
menubar utilities-->copy from client click on that.
enter the fomr name MEDRUCK
enter the target form name ZMEDRUCK.
clikc on execute. it will be coppied to your ZMEDRUCK. and come back to SE71 screen and click on change.
in next screen click on page windows in application menu bar.
it will display the windows and double click on ADDRESS window again click on text elements(menu bar EDIT-->TEXT ELEMENTS(F9)). there you can change the address whatever you want in change editor screen. after changes in your ZMEDRUCK save it and activate it.
enter NACE transaction code. select application  EF for purchase order and click on output types in application tool bar
it will display the different output types in next screen
select output type as NEW and double click on processing routines.
remove the form name MEDRUCK and enter your form name ZMEDRUCK in first line in the next screen. save it.
finally enter ME23N transaction code enter purchase order number and click on messages in application tool bar
enter output type as NEW and mediup print output press enter
and click on further data in application tool bar select send immedeatly in next screen save it and back again click on communication method enter your form name in the last input field of that screen. save and enter and finally save it. it comes back to initial screen (ME23N) click on print priview in application tool bar. select output type in next screen press enter it asks you print or print preview and click on print preview.
there you can see your changes in pruchase order.
Regards.
sriram.

Similar Messages

  • Changes to medruck to display full consignee address.

    Hi all,
        We have copied the medruck as a zmedruck form and made changes to it. Now our requirement is that the complete consignee address(ship-to-address) has to be printed.
    Plese guide me in getting it done.
    Thanks in advance,
    Neela

    Hi,
       From the pekko table using adrnr we have pulled data from sadr table. Which field of ekpa has to be used to get data from lfa1 table. Pls guide me through.
    Thanks in advance,
    Neela
    Edited by: Neela M B on Oct 18, 2010 12:39 PM
    Edited by: Neela M B on Oct 18, 2010 12:40 PM

  • How To Copy MEDRUCK?

    Dear Abapers,
    Please tell me how to copy MEDRUCK program to print the Purchase Order. Please tell me step by step as I am new to ABAP. Also tell me how to make changes in MEDRUCK according to my company i.e. how & where to change the company logo, address etc.
    Waiting for ur valuable reply,
    Thanx,
    Deepti

    We modified the driver program because there was a requirement to add stuff that was not available in the standard driver program. Here is what we did.
    First, Copied the SAPFM06P program to SAPFZM06P. Did not copy all of the includes. Copied only the FM06PE02 include program to ZFM06PE02.
    Second, in the include ZFM06PE02, there is a form call ENTRY_NEU, this is the entry point to print the form, notice that there is a function module in this form called ME_PRINT_PO. This is the function module that will print the PO. Eventually, you will want to call a Z version of that funciton module.
    Third, copy the entire funtion group MEDRUCK into ZMEDRUCK. This is the function group which has the function module ME_PRINT_PO. Don't copy the includes into Z versions. You don't need to modify all of them. Only copy them when needed. Save and Activate.
    Finally, go back to that include program ZFM06PE02, now make the call to ME_PRINT_PO to the Z version, in my case it is ZME_PRINT_PO. Save and activate.
    Make sure that you change your configuration in SPRO to use the SAPFZM06P program instead of the standard. Now your form should be printing from the custom driver program. Modify away!!!!
    The standard form layout is also called MEDRUCK.  You can copy this into a "Z" form via SE71.
    Please don't forget to award points for helpful answers.'
    Regards,
    Rich Heilman

  • Medruck Enhancement-point

    I have to make to multiple Sapscript changes to MEDRUCK for RFQ. I have copied the include LMEDRUCKTOP to LZSC_MEDRUCKTOP.
    When I add new tables and data declaration in LZSC_MEDRUCKTOP, it give a message ENHANCEMENT POINT will be created for LMEDRUCKTOP_04. It does not allow me to delete the the line of code
    ENHANCEMENT-POINT LMEDRUCKTOP_04 SPOTS ES_SAPLMEDRUCK STATIC.
    What is enhancement-point and how can I proceed further ?
    Thanks.

    The enhancement spots are used to manage explicit enhancement options
    Enhancement options are positions in Repository objects where enhancements can be made. These options are either explicitly defined (by the developer) or exist implicitly. Explicit enhancement options are generally defined in a central initial system. Enhancements are made in follow-on systems.
    Explicit enhancement options can currently be defined by:
    ●     Explicitly flagging source code points or sections in ABAP programs. For an enhancement, these can be enhanced or replaced by source code plug-ins.
    ●     Including Business Add-Ins (BAdIs) in ABAP programs. These programs are then enhanced by object plug-ins with predefined interfaces.
    Explicit enhancement options are managed by  enhancement implementations
    Currently, implicit enhancement options are:
    ●     Specific options in ABAP programs – such as the end of the program – which can be enhanced by source code plug-ins.
    ●     Parameter interfaces of function modules, which can be enhanced with parameters.
    ●     Attributes and parameter interfaces of global classes, which can be enhanced with attributes or parameters.
    Implicit enhancement options always exist and do not require enhancement spots. They are also enhanced by enhancement implementations.
    Incase if you want to delete the enhancement spot
    After the program has been saved, the enhancement option is managed by the Enhancement Builder, and can only be deleted using the function Enhancements ® Remove Enhancement.
    Pl follow the documentation link provided below for further info on Enhancement spots.
    link

  • Output type NEU

    Hi All,
    Scenario is like this we have one client where three company codes are dealt & po format is different for all the three.
    1) company A uses NEU
    2) company B used ZNEU
    Here i want to you help to know whether i need to have customized output type for third company since format is different
    OR
    can i acheive by attaching smartform, or do i have to change program MEDRUCK to customized according to requirement.
    If i need different format for domestic PO & Import PO how can this be achieved.
    Regards
    Message was edited by:
            Ashok G

    Hi Ashok,
    You need to have a new output type & develop progam & attach to it, import & domestic distinction can be attained with smartform.
    Regards

  • In runtime i want change the font of form of medruck

    hi expects,
        in runtime i want change the font of form of medruck.is it possible?

    You can do that by puuting the line you want to change in the condition and on the basis of the condition selected , display your line of script.
    Line can have your character format.
    Otherwise not.
    Regards,
    Amit
    reward all helpful replies.

  • Changing Main window tet elements of MEDRUCK?

    Hi all,
    I am doing sap script to display PO . I copied MEDRUCK and created the form.
    But it is giving only one line item details in the output. The mistake i did is , i totally commented the
    code of standard form and written own code with out any standard text elements.
    Is it possible to display all items in above procedure ? Else how to know where to modify the standard code.
    Please explain clearly as i have no idea on this text elements of standard form.
    Thanks,
    Vamshi.

    Purchasing/MEDRUCK is a bit complicated. Different conditions will trigger different text elements (stock items vs consignment, free vs cost, etc). Unless you change the print programs you can't have everything print from one element. I'd suggest only commenting out things you fully understand and know you do not need (don't comment out the text element itself, just the contents).

  • How to change stnadrd smartform..medruck..

    Hi all,
    How to change stnadrd smartform..medruck..
    I want to change MEDRUCK form..
    How can this be done..
    can it be done in NACE...how
    <<Text removed by moderator>>
    Thanx,
    Bhakti
    Edited by: Matt on Nov 7, 2008 8:19 AM

    yes medruck is a script.
    Create a Z copy of it and if u want smartform now convert ur Zscript to form in following way.
    Migrating a SAPscript form
    1.     Go to the SAP Smart Forms initial screen (transaction SMARTFORMS ).
    2.     In the Form field enter the name of the Smart Form you want to create.
    3.     Choose Utilities  Migrate SAPscript form.
    The dialog window Migrate SAPscript Form appears.
    4.     Enter the name and the language of the source form (SAPscript).
    5.     Choose Enter.
    This takes you to the change mode of the SAP Form Builder.
    If the selected SAPscript form does not exist in the selected language, a dialog window appears on which you can select one of the existing languages.
    6.     Now change the design of the form and of the form logic. To activate the Smart Form choose Activate.
    Now in nace assign ur smartform to the output type u want

  • Medruck change

    Hi,
    Any one can help me in changing of <b>company logo and address in Medruck, with SAP scripts and in SMARTFORMS</b> with detailed information.
    You can send your views to '[email protected]'.
    Thanks in advance.
    -Muraly

    Hi,
    Any one can help me in changing of <b>company logo and address in Medruck, with SAP scripts and in SMARTFORMS</b> with detailed information.
    You can send your views to '[email protected]'.
    Thanks in advance.
    -Muraly

  • Medruck changing eket-eindt with subroutine

    Hello!
    I want to read the field eket-eindt from a subroutine and changing it in the form medruck (which I have modified).
    But this is not my problem - it works fine.
    I get the value of eket-eindt in my form, but in that way: '20061016' now I want the format: '16.10.2006'!
    I have tried to format the print with:
    SET LANGUAGE ...
    SET DATA MASK ...
    but nothing works.
    I think it doesn't work, because from subroutines you only get text-fields and not data-fields. So the form medruck doesn't have the information that eket-eindt is a data-field...
    Have any one a solution for me?

    hi,
    u can try this code.
    eket-eindt
    data date1(10) type c.
    write eket-eindt to date1 use edit mask '__/__/____'.
    now u can write date1.
    r else
    eket-eindt = date1.
    u can write eket-eindt .
    regards.
    sriram.

  • Medruck script Item line changes

    Hi
    how to track changes in item line when ever changes are made in item level in which strucutre or special fields it stores tht value.

    Hi,
      The item changes can be tracked using the CDHDR (for header changes) and CDPOS (item changes)tables.
    The object class OBJECTCLAS has to be passed as 'EINKBELEG' for Purchase orders. And the object id OBJECTID has to be the purchase order number.The TABNAME field has to contain the table name (EKKO in the case of purchase orders).
    Check the below FM also:
    CHANGEDOCUMENT_READ_HEADERS
    CHANGEDOCUMENT_READ_POSITIONS
    Thanks.

  • Changing MEDRUCK

    Hi
    I have copied the MEDRUCK and made new sap script for our customised purchase order.
    My problem is in the line items basic price/unit i.e RM06P-NETWRV is showing zero for all materials where as in details everything fine
    What can be the problem. I have debugged the above script and unable to find the solution.
    regards
    sateesh

    Hi Sateesh,
              Is the field name is NETWR or NETWRV ?
              I hope you have done the customization of the new layout you copied.
    Thanks
    Sravan

  • Change indicator of PO for Medruck PO sapscript

    Dear All,
    Is there fields so that I can understand that this form is printed for Changed existing PO. So that I need to change the header..
    If any one know any update flag indicator, your input will be very helpful.
    Thanks
    Subhankar'

    Hello,
    do you find a sollution for this problem?
    We have the same problem.
    regards!

  • Print Change Text in PO

    Hi All,
             I have replaced standard script(MEDRUCK) with Zsmart form for PO printing. when user change in any line of PO, like he have changed quantity. for this change a text message as **PO quantity changed** print in standard script. Now I want print this text message in my smart form . I know this is the message field T166T-CHTXT but i cant find any relation between this text messege and PO line item. So plz tell me how can i print it my smart form. I am sending u the programe where i have put my smart form.
      INCLUDE FM06PE02                                                   *
    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.
      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.
    ***to get the data not given by the above function module
    ***as, on some std conditions some data may be deleted by the same.
      SELECT * FROM EKPO INTO TABLE l_doc-XEKPO
               WHERE EBELN EQ l_doc-XEKKO-EBELN AND
                     LOEKZ NE 'L'.
      IF l_doc-XTKOMV IS INITIAL.
        SELECT * FROM KONV INTO TABLE l_doc-XTKOMV
                 WHERE KNUMV EQ l_doc-XEKKO-KNUMV.
      ENDIF.
       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.
      data: l_komk type komk occurs 0 with header line.
      DATA: lf_fm_name            TYPE rs38l_fnam.
      TYPES: BEGIN OF TP_RECORD,
              EBELP TYPE EKPO-EBELP,
              KNUMH TYPE KONP-KNUMH,
              END OF TP_RECORD.
      data: CD_record type TP_RECORD OCCURS 0 WITH HEADER LINE.
      TYPES: BEGIN OF TP_TAX,
             EBELP TYPE EKPO-EBELP,
             KSCHL TYPE KONP-KSCHL,
             KBETR TYPE KONP-KBETR,
             KONWA TYPE KONP-KONWA,
             VTEXT type T685T-VTEXT,
             END OF TP_TAX.
      DATA: TAB_TAX TYPE TP_TAX OCCURS 0 WITH HEADER LINE.
      data: wa_ekpo  type ekpo,
            wa_komv  type komv,
            wa_pekpo type pekpo.
      DATA: T_ITEM TYPE STANDARD TABLE OF ZMM_PO_ITEM WITH HEADER LINE.
      data: l_VAKEY type KONH-VAKEY,
            l_KNUMH type KONH-KNUMH.
      DATA: ls_control_param      TYPE ssfctrlop.
      DATA: ls_composer_param     TYPE ssfcompop.
      DATA: ls_recipient          TYPE swotobjid.
      DATA: ls_sender             TYPE swotobjid.
      DATA: lf_formname           TYPE tdsfname.
      DATA: ls_addr_key           LIKE addr_key.
      DATA: ls_job_info           TYPE ssfcrescl.
      DATA: ls_arc_params         TYPE ARC_PARAMS.
      DATA: ls_MAIL_APPL_OBJ      TYPE swotobjid.
      DATA: INPUT                 TYPE SSFCOMPIN.
      DATA: RESULT                TYPE SSFCRESOP.
      DATA: SECESS                TYPE KONP-KBETR .
      loop at l_doc-XEKPO into wa_ekpo.
        refresh CD_RECORD.
    *****GET TAXES FOR MATERIAL *************************
        if wa_ekpo-matnr is not initial.
          select knumh from A363 into corresponding fields of CD_RECORD
                 WHERE KAPPL = 'TX' AND
                       WERKS = WA_EKPO-WERKS     AND
                       LIFNR = l_doc-XEKKO-LIFNR AND
                       MATNR = WA_EKPO-MATNR     AND
                       DATBI GE l_doc-XEKKO-BEDAT.
            CD_RECORD-EBELP = wa_ekpo-EBELP.
            append CD_RECORD.
          endselect.
          if CD_RECORD[] is not initial.
            SELECT KSCHL KBETR KONWA FROM KONP INTO CORRESPONDING FIELDS OF TAB_TAX
                   FOR ALL ENTRIES IN CD_RECORD
                   WHERE KNUMH    =  CD_RECORD-KNUMH AND
                         LOEVM_KO NE 'X'.
              TAB_TAX-EBELP = wa_ekpo-EBELP.
              if TAB_TAX-KONWA = '%'.
                TAB_TAX-KBETR = TAB_TAX-KBETR / 10.
              endif.
              SELECT SINGLE VTEXT FROM T685T INTO TAB_TAX-VTEXT
                     WHERE SPRAS = 'EN' AND
                           KAPPL = 'TX' AND
                           KSCHL = TAB_TAX-KSCHL.
              APPEND TAB_TAX.
            ENDSELECT.
          endif.
        endif.
    ****GET TAXES FOR MATERIAL GROUP************************
        refresh CD_RECORD.
        if wa_ekpo-matkl is not initial.
          if wa_ekpo-knttp eq 'K' .
          select knumh from A700 into corresponding fields of CD_RECORD
                 WHERE KAPPL = 'TX' AND
                       WERKS = WA_EKPO-WERKS AND
                       MATKL = WA_EKPO-MATKL AND
                       DATBI GE l_doc-XEKKO-BEDAT AND
                       LIFNR EQ L_DOC-XEKKO-LIFNR .
            CD_RECORD-EBELP = wa_ekpo-EBELP.
            append CD_RECORD.
          endselect.
          if CD_RECORD[] is not initial.
            SELECT KSCHL KBETR KONWA FROM KONP INTO CORRESPONDING FIELDS OF TAB_TAX
                   FOR ALL ENTRIES IN CD_RECORD
                   WHERE KNUMH = CD_RECORD-KNUMH AND
                         LOEVM_KO NE 'X'.
              TAB_TAX-EBELP = wa_ekpo-EBELP.
              if TAB_TAX-KONWA = '%'.
                TAB_TAX-KBETR = TAB_TAX-KBETR / 10.
              endif.
              SELECT SINGLE VTEXT FROM T685T INTO TAB_TAX-VTEXT
                     WHERE SPRAS = 'EN' AND
                           KAPPL = 'TX' AND
                           KSCHL = TAB_TAX-KSCHL.
              APPEND TAB_TAX.
            ENDSELECT.
          endif.
        endif.
        endif.
      endloop.
    ******Fill T_ITEM***************
      loop at l_doc-XEKPO into wa_ekpo.
        CLEAR T_ITEM.
        MOVE-CORRESPONDING wa_ekpo TO T_ITEM.
        MOVE WA_EKPO-EMATN TO T_ITEM-MATNR.
    ********Field NETPR (net price) used for Gross price per piece**
       SELECT SINGLE KBETR FROM KONV
              INTO   T_ITEM-NETPR
                     WHERE KNUMV EQ l_doc-XEKKO-KNUMV AND
                           KPOSN EQ wa_ekpo-EBELP     AND
                           KSCHL EQ 'P000'.
        LOOP AT l_doc-xtkomv INTO WA_KOMV
                where KPOSN = T_ITEM-EBELP AND
                      ( ( KSCHL = 'P000' AND KBETR IS NOT INITIAL ) OR
                        ( KSCHL = 'P001' AND KBETR IS NOT INITIAL ) OR
                        ( KSCHL = 'PB00' AND KBETR IS NOT INITIAL ) OR
                        ( KSCHL = 'PBXX' AND KBETR IS NOT INITIAL ) ).
          MOVE WA_KOMV-KBETR TO T_ITEM-NETPR.
        ENDLOOP.
    *******Get Discount************************
        LOOP AT l_doc-xtkomv INTO WA_KOMV
                where KPOSN = T_ITEM-EBELP AND
                      ( ( KSCHL = 'R000' AND KBETR IS NOT INITIAL ) OR
                        ( KSCHL = 'R001' AND KBETR IS NOT INITIAL ) OR
                        ( KSCHL = 'R002' AND KBETR IS NOT INITIAL ) ).
          T_ITEM-C_DSCNT = WA_KOMV-WAERS.
          T_ITEM-DSCNT   = WA_KOMV-KBETR.
          IF T_ITEM-C_DSCNT NE 'INR'.
            T_ITEM-DSCNT   = T_ITEM-DSCNT / 10.
          ENDIF.
        ENDLOOP.
    *******Get Taxes**************************
        LOOP AT TAB_TAX
                WHERE EBELP = T_ITEM-EBELP.
          CASE TAB_TAX-KSCHL.
            WHEN 'JMOP' OR 'JMOQ' OR 'JSRT'.
              IF TAB_TAX-KBETR IS NOT INITIAL.
                T_ITEM-EXCSE   = TAB_TAX-KBETR.
                T_ITEM-C_EXCSE = TAB_TAX-KONWA.
                T_ITEM-KSCHL   = TAB_TAX-KSCHL .
              ENDIF.
            WHEN 'JEC1' OR 'JEC3'.
              IF TAB_TAX-KBETR IS NOT INITIAL.
                T_ITEM-CESS   = TAB_TAX-KBETR.
                T_ITEM-C_CESS = TAB_TAX-KONWA.
                T_ITEM-KSCHL   = TAB_TAX-KSCHL .
              ENDIF.
            WHEN 'JVRD' OR 'JIPC'.
              IF TAB_TAX-KBETR IS NOT INITIAL.
                T_ITEM-VAT_CST   = TAB_TAX-KBETR.
                T_ITEM-C_VAT_CST = TAB_TAX-KONWA.
                T_ITEM-KSCHL   = TAB_TAX-KSCHL .
              ENDIF.
            WHEN 'JES1' .
              IF TAB_TAX-KBETR IS NOT INITIAL.
                SECESS          = TAB_TAX-KBETR.
                T_ITEM-C_SECESS = TAB_TAX-KONWA.
                T_ITEM-KSCHL    = TAB_TAX-KSCHL .
              ENDIF.
          ENDCASE.
        ENDLOOP.
    ********Get Delivery Date*****************
        read table l_doc-XPEKPO into wa_pekpo with key ebelp = WA_EKPO-EBELP.
        T_ITEM-EINDT = WA_PEKPO-EINDT.
        if l_doc-XEKKO-BSTYP = 'L'.
    Get Price Per Unit For Scheduling agreement********
          concatenate T_ITEM-EBELN T_ITEM-EBELP INTO l_VAKEY.
          SELECT SINGLE KNUMH FROM KONH INTO L_KNUMH
                 WHERE  VAKEY = l_VAKEY.
          SELECT SINGLE KBETR FROM KONP INTO T_ITEM-NETPR
                 WHERE  KNUMH = L_KNUMH AND
                        KSCHL = 'P000'.
    Get Discount For Scheduling agreement  ********
          SELECT SINGLE KBETR KONWA FROM KONP INTO (T_ITEM-DSCNT,T_ITEM-C_DSCNT)
                 WHERE  KNUMH = L_KNUMH AND
                        KSCHL = 'R000'.
          if sy-subrc <> 0.
            SELECT SINGLE KBETR KONWA FROM KONP INTO (T_ITEM-DSCNT,T_ITEM-C_DSCNT)
                   WHERE  KNUMH = L_KNUMH AND
                          KSCHL = 'R001'.
            if sy-subrc <> 0.
              SELECT SINGLE KBETR KONWA FROM KONP INTO (T_ITEM-DSCNT,T_ITEM-C_DSCNT)
                     WHERE  KNUMH = L_KNUMH AND
                            KSCHL = 'R002'.
            endif.
          endif.
          if T_ITEM-DSCNT is not initial.
            T_ITEM-DSCNT = T_ITEM-DSCNT / 10.
          endif.
        endif.
        APPEND T_ITEM.
      endloop.
      IF TNAPR-SFORM IS NOT INITIAL.
    SmartForm from customizing table TNAPR
        lf_formname = tnapr-sform.
    determine smartform function module for PO
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
             EXPORTING  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
             IMPORTING  fm_name            = lf_fm_name
             EXCEPTIONS no_form            = 1
                        no_function_module = 2
                        OTHERS             = 3.
       IF sy-subrc <> 0.
      error handling
         cf_retcode = sy-subrc.
         PERFORM protocol_update.
       ENDIF.
    ENDIF.
        CALL FUNCTION 'SSF_CREATE_COMPOSER_INPUT'
          EXPORTING
            ARCHIVE_PARAMETERS = ls_arc_params
            USER_SETTINGS      = 'X'
            MAIL_SENDER        = ls_sender
            MAIL_RECIPIENT     = ls_recipient
            MAIL_APPL_OBJ      = ls_MAIL_APPL_OBJ
            OUTPUT_OPTIONS     = ls_composer_param
            CONTROL_PARAMETERS = ls_control_param
          IMPORTING
            INPUT              = input.
        CALL FUNCTION 'SSFCOMP_OPEN'
          EXPORTING
            INPUT  = input
          IMPORTING
            RESULT = RESULT
          EXCEPTIONS
            ERROR  = 1
            OTHERS = 2.
        IF SY-SUBRC EQ 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
          ls_control_param-no_open  = 'X'.
          ls_control_param-no_close = 'X'.
          CALL FUNCTION lf_fm_name
            EXPORTING
           ARCHIVE_INDEX              =
           ARCHIVE_INDEX_TAB          =
              ARCHIVE_PARAMETERS         = ls_arc_params
              CONTROL_PARAMETERS         = ls_control_param
              MAIL_APPL_OBJ              = ls_MAIL_APPL_OBJ
              MAIL_RECIPIENT             = ls_recipient
              MAIL_SENDER                = ls_sender
              OUTPUT_OPTIONS             = ls_composer_param
              USER_SETTINGS              = 'X'
              ZXEKKO                     = l_doc-XEKKO
              ZXPEKKO                    = l_doc-XPEKKO
              SECESS                     = SECESS
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
            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                    = l_komk
              T_ITEM                     = T_ITEM
    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.
          CALL FUNCTION 'SSFCOMP_CLOSE'
            IMPORTING
              RESULT        =
            EXCEPTIONS
              ERROR         = 1
              OTHERS        = 2
          IF SY-SUBRC <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        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.                    "entry_neu
    *eject
    Umlagerungsbestellung,  Hinweis 670912                               *
    form entry_neu_sto 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,
            F_STO.                                              "670912
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      F_STO = 'X'.                                              "670912
      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.
      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
          ix_sto         = F_STO                                "670912
        IMPORTING
          ex_retco       = ent_retco.
    endform.                    "entry_neu_sto
    *eject
    Mahnung
    form entry_mahn 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.
      clear ent_retco.
      l_druvo = '3'.
      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.
      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.
    endform.                    "entry_mahn
    *eject
    Auftragsbestätigungsmahnung
    form entry_aufb 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.
      clear ent_retco.
      l_druvo = '7'.
      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.
      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.
    endform.                    "entry_aufb
    *eject
    Lieferabrufdruck für Formular MEDRUCK mit Fortschrittszahlen
    form entry_lphe using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_xfz,
            l_doc   type meein_purchase_doc_print.
      data: l_komk type komk occurs 0 with header line.
      DATA: lf_fm_name            TYPE rs38l_fnam.
      DATA: T_EKET      TYPE TABLE OF EKET WITH HEADER LINE,
            T_EKET_NEW  TYPE TABLE OF EKET WITH HEADER LINE.
      DATA: WA_EKET     TYPE EKET,
            WA_EKET_NEW TYPE EKET.
      DATA: L_DATE    TYPE RM06B-EEIND,
            MAX_ABRUF TYPE EKEK-ABRUF.
      DATA: T_DEL_SCH TYPE TABLE OF ZSTR_DEL_SCH WITH HEADER LINE.
      DATA: WA_EKPO   TYPE EKPO,
            WA_EKEK   TYPE EKEK.
      DATA: TEMP_DATE       LIKE SY-DATUM,
            TEMP_MONTH      TYPE SPMON,
            THIS_MONTH      TYPE SPMON,
            NEXT_MONTH      TYPE SPMON,
            NEXT_NEXT_MONTH TYPE SPMON,
            L_DAY(2)        TYPE N.
      DATA: QTY_TEMP TYPE I.
      DATA: MDPAX TYPE MDPA,
            MDPMX TYPE TABLE OF MDPM WITH HEADER LINE,
            MDSBX TYPE TABLE OF MDSB WITH HEADER LINE.
      DATA: lf_formname           TYPE tdsfname.
      clear ent_retco.
      l_druvo = '9'.
      l_xfz = 'X'.
      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.
    call function 'ME_PRINT_PO'
          exporting
               ix_nast        = l_nast
               ix_druvo       = l_druvo
               doc            = l_doc
               ix_xfz         = l_xfz
               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.
    *T_EKET[] = l_doc-XEKET[].
      LOOP AT l_doc-XEKET INTO WA_EKET.
        CLEAR: WA_EKET_NEW,
               T_EKET_NEW.
        CASE WA_EKET-LPEIN.
          WHEN '2'.
            T_EKET_NEW = WA_EKET.
            WA_EKET_NEW = WA_EKET.
            T_EKET_NEW-MENGE = WA_EKET-MENGE DIV 2.
           QTY_TEMP = WA_EKET-MENGE DIV 2.
           T_EKET_NEW-MENGE =  QTY_TEMP.
            CALL FUNCTION 'COS6_QUANTITY_ROUND'
              EXPORTING
                I_QUANTITY             = T_EKET_NEW-MENGE
                I_UNIT                 = 'EA'
              IMPORTING
                E_QUANTITY             = T_EKET_NEW-MENGE
            EXCEPTIONS
              UNIT_NOT_DEFINED       = 1
              OTHERS                 = 2
            IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            APPEND T_EKET_NEW.
            WRITE WA_EKET-EINDT TO L_DATE USING EDIT MASK '__.__.____'.
            CALL FUNCTION 'DATE_IN_FUTURE'
              EXPORTING
                ANZAHL_TAGE                   = '6'
                IMPORT_DATUM                  = L_DATE
              IMPORTING
              EXPORT_DATUM_EXT_FORMAT       = WA_EKET_NEW-EINDT
                EXPORT_DATUM_INT_FORMAT       = WA_EKET_NEW-EINDT
            WA_EKET_NEW-MENGE = WA_EKET-MENGE - T_EKET_NEW-MENGE.
            APPEND WA_EKET_NEW TO T_EKET_NEW.
          WHEN '3'.
            T_EKET_NEW = WA_EKET.
            WA_EKET_NEW = WA_EKET.
            T_EKET_NEW-MENGE = WA_EKET-MENGE DIV 2.
            APPEND T_EKET_NEW.
            CALL FUNCTION 'MM_ARRANG_GET_END_OF_MONTH'
              EXPORTING
                I_DATUM = WA_EKET-EINDT
              IMPORTING
                E_DATUM = WA_EKET_NEW-EINDT.
            WA_EKET_NEW-MENGE = WA_EKET-MENGE - T_EKET_NEW-MENGE.
            APPEND WA_EKET_NEW TO T_EKET_NEW.
          WHEN OTHERS.
            APPEND WA_EKET TO T_EKET_NEW.
        ENDCASE.
      ENDLOOP.
      THIS_MONTH = SY-DATUM+(6).
      CALL FUNCTION 'HR_BR_ADD_MONTH_TO_DATE'
        EXPORTING
          DMM_DATIN       = SY-DATUM
          DMM_COUNT       = '1'
          DMM_OPER        = '+'
          DMM_POS         = '1'
        IMPORTING
          DMM_DAOUT       = TEMP_DATE
    EXCEPTIONS
      UNKNOWN         = 1
      OTHERS          = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      NEXT_MONTH = TEMP_DATE+(6).
      CLEAR TEMP_DATE.
      CALL FUNCTION 'HR_BR_ADD_MONTH_TO_DATE'
        EXPORTING
          DMM_DATIN       = SY-DATUM
          DMM_COUNT       = '2'
          DMM_OPER        = '+'
          DMM_POS         = '1'
        IMPORTING
          DMM_DAOUT       = TEMP_DATE
    EXCEPTIONS
      UNKNOWN         = 1
      OTHERS          = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      NEXT_NEXT_MONTH = TEMP_DATE+(6).
      LOOP AT l_doc-XEKPO INTO WA_EKPO.
        CLEAR: T_DEL_SCH,
               WA_EKEK.
        MOVE-CORRESPONDING WA_EKPO TO T_DEL_SCH.
        CLEAR MAX_ABRUF.
        LOOP AT l_doc-Xekek INTO WA_EKEK.
          IF WA_EKEK-ABRUF GT MAX_ABRUF.
            MAX_ABRUF = WA_EKEK-ABRUF.
          ENDIF.
        ENDLOOP.
        CLEAR WA_EKEK.
        READ TABLE l_doc-Xekek INTO WA_EKEK
             WITH KEY EBELN = WA_EKPO-EBELN
                      EBELP = WA_EKPO-EBELP
                      ABRUF = MAX_ABRUF.
        T_DEL_SCH-LFNKD = WA_EKEK-LFNKD.
        LOOP AT T_EKET_NEW
             WHERE EBELN = WA_EKPO-EBELN AND
                   EBELP = WA_EKPO-EBELP.
    ****GET COMPONENTS***********************
          REFRESH: mdpmx, mdsbx.
          CLEAR: mdpmx, mdsbx.
          on change of t_eket_new-rsnum.
            mdpax-rsnum = t_eket_new-rsnum.
            mdpax-matnr = wa_ekpo-matnr.
            mdpax-pwwrk = wa_ekpo-werks.
            CALL FUNCTION 'MD_LESEN_KOMPONENTEN'
              EXPORTING
                emdpa = mdpax
              IMPORTING
                imdpa = mdpax
              TABLES
                mdpmx = mdpmx
                mdsbx = mdsbx.
          endon.
          TEMP_MONTH = T_EKET_NEW-EINDT+(6).
          CASE TEMP_MONTH.
            WHEN THIS_MONTH.
              L_DAY = T_EKET_NEW-EINDT+6(2).
              IF L_DAY BETWEEN '01' AND '07'.
                T_DEL_SCH-QTYW1 = T_DEL_SCH-QTYW1 + T_EKET_NEW-MENGE.
              ELSEIF L_DAY BETWEEN '08' AND '14'.
                T_DEL_SCH-QTYW2 = T_DEL_SCH-QTYW2 + T_EKET_NEW-MENGE.
              ELSEIF L_DAY BETWEEN '15' AND '22'.
                T_DEL_SCH-QTYW3 = T_DEL_SCH-QTYW3 + T_EKET_NEW-MENGE.
              ELSE.
                T_DEL_SCH-QTYW4 = T_DEL_SCH-QTYW4 + T_EKET_NEW-MENGE.
              ENDIF.
              T_DEL_SCH-C_QTYM1 = T_DEL_SCH-C_QTYM1 + mdpmx-erfmg.
            WHEN NEXT_MONTH.
              T_DEL_SCH-QTYM2 = T_DEL_SCH-QTYM2 + T_EKET_NEW-MENGE.
              T_DEL_SCH-C_QTYM2 = T_DEL_SCH-C_QTYM2 + mdpmx-erfmg.
            WHEN NEXT_NEXT_MONTH.
              T_DEL_SCH-QTYM3 = T_DEL_SCH-QTYM3 + T_EKET_NEW-MENGE.
              T_DEL_SCH-C_QTYM3 = T_DEL_SCH-C_QTYM3 + mdpmx-erfmg.
          ENDCASE.
          if mdpmx-matnr is not initial.
            T_DEL_SCH-C_MATNR = mdpmx-matnr.
            T_DEL_SCH-C_TXZ01 = mdpmx-maktx.
            T_DEL_SCH-PSTYP = WA_EKPO-PSTYP.
          endif.
        ENDLOOP.
        T_DEL_SCH-QTYTO = T_DEL_SCH-QTYW1 + T_DEL_SCH-QTYW2 + T_DEL_SCH-QTYW3 + T_DEL_SCH-QTYW4.
        APPEND T_DEL_SCH.
        CLEAR T_DEL_SCH.
      ENDLOOP.
    SmartForm from customizing table TNAPR
      lf_formname = tnapr-sform.
    determine smartform function module for PO
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
           EXPORTING  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           IMPORTING  fm_name            = lf_fm_name
           EXCEPTIONS no_form            = 1
                      no_function_module = 2
                      OTHERS             = 3.
       IF sy-subrc <> 0.
      error handling
         cf_retcode = sy-subrc.
         PERFORM protocol_update.
       ENDIF.
    ENDIF.
      CALL FUNCTION lf_fm_name
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
         USER_SETTINGS              = space
          ZXEKKO                     = l_doc-XEKKO
          ZXPEKKO                    = l_doc-XPEKKO
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          L_XEKPO                    = l_doc-XEKPO
          L_XEKPA                    = l_doc-XEKPA
          L_XPEKPO                   = l_doc-XPEKPO
          L_XEKET                    = T_EKET_NEW
          L_XTKOMV                   = l_doc-xtkomv
          L_XEKKN                    = l_doc-Xekkn
          L_XEKEK                    = l_doc-Xekek
          T_DEL_SCH                  = T_DEL_SCH
       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.
      ELSE.
    *- nast-sndex wird als Kennzeichen für Probedruck verwendet
        IF l_nast-kappl  EQ 'EL'    AND ent_screen  IS INITIAL AND
           l_from_memory IS INITIAL AND l_nast-sndex IS INITIAL.
    missing environment for limiting update print dependend data
          IF sy-ucomm NE '9ANZ' AND sy-ucomm NE '9DPR'.
            PERFORM update_release TABLES l_doc-xekpo l_doc-xekek l_doc-xekeh
                                                USING  l_druvo l_nast-kschl.
          ENDIF.
        ENDIF.
      ENDIF.
    endform.                    "entry_lphe
    *eject
    ****SUBROUTINE COPIED FROM INCLUDE LMEDRUCKF1K BY jithendra 28.12.2006***
    *****to change release status of delivery schedule
          FORM update_release                                           *
    -->  t_xekpo                                                       *
    -->  t_xekek                                                       *
    -->  t_xekeh                                                       *
    -->  p_druvo                                                       *
    -->  p_kschl                                                       *
    FORM update_release TABLES t_xekpo STRUCTURE ekpo
                               t_xekek STRUCTURE ekek
                               t_xekeh STRUCTURE ekeh
                        USING  p_druvo
                               p_kschl.
      TABLES: t161m.
      CLEAR t161m.
      SELECT SINGLE druab INTO t161m-druab FROM t161m
                             WHERE kvewe = 'B'
                             AND   kappl = 'EL'
                             AND   druvo = p_druvo
                             AND   kschl = p_kschl.
      IF NOT sy-subrc = 0 OR NOT t161m-druab = 'X'.
        EXIT.
      ENDIF.
      DELETE t_xekek WHERE webrl EQ '1' OR webrl EQ '2'.
      CALL FUNCTION 'ME_UPDATE_FROM_PRINTING'
        TABLES
          i_ekek = t_xekek
          i_ekeh = t_xekeh
          i_ekpo = t_xekpo
        EXCEPTIONS
          OTHERS = 1.
    ENDFORM.                    "update_release
    Lieferabrufdruck für Formular MEDRUCK ohne Fortschrittszahlen
    form entry_lphe_cd 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.
      clear ent_retco.
      l_druvo = '9'.
      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.
      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.
    endform.                    "entry_lphe_cd
    *eject
    Feinabrufdruck für Formular MEDRUCK mit Fortschrittszahlen
    form entry_lpje using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_xfz,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = 'A'.
      l_xfz = 'X'.
      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.
      call function 'ME_PRINT_PO'
        EXPORTING
          ix_nast        = l_nast
          ix_druvo       = l_druvo
          doc            = l_doc
          ix_xfz         = l_xfz
          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.
    endform.                    "entry_lpje
    *eject
    Feinabrufdruck für Formular MEDRUCK ohne Fortschrittszahlen
    form entry_lpje_cd 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.
      clear ent_retco.
      l_druvo = 'A'.
      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.
      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.
    endform.                    "entry_lpje_cd
    *eject
      INCLUDE FM06PE02                                                   *
    form entry_neu_matrix 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.
      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.
      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_mflag       = 'X'
          ix_toa_dara    = toa_dara
          ix_arc_params  = arc_params
          ix_fonam       = tnapr-fonam                          "HW 214570
        IMPORTING
          ex_retco       = ent_retco.
      data: l_komk type komk occurs 0 with header line.
      DATA: lf_fm_name            TYPE rs38l_fnam.
    endform.                    "entry_neu_matrix
    *eject
    Angebotsabsage
    form entry_absa 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.
      l_druvo = '4'.
      clear ent_retco.
      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_dru

    Hi,
    Depending on whether you have a Sales order or Purchase order.
    If sales order -> then go to NACE -> Sales -> check your Zsmartform
    If Purchase order -> go to NACE -> under PO output -> find your Zsmartform.
    In both cases, after u find your smartform name, thru change log.
    At runtime read what are the header text changes  and pass it to the smartform.
    You can use FM read_txt for this.
    Hope this helps.

  • Purchase Order (Medruck)

    Hi Expert:
    I've requirement to print the text / Comment at the left corner of  PO  while  PO printing ( Copy of Medruck)  is being done  as
    1. Reprint :  if again it is being printed 
    2. Changed PO  : if again the printing is being taken after some changes in that particular Purchase order No.
    I have  logic  for 1st case : (processing Status) nast-vstat = '1'   and in the 2nd case  (Change Message Flag) nast-aende = 'X' 
    but the problem is,  Nast table udpates only after processing  I mean after saving.  If anyone come out from purchase order after saving and then takes the print out , it works fine other wise no comment / text come if before saving or processing the print out is being taken.
    -> From anywhere if the 2nd time or after changing the purchase order, any print out would be taken , would have the respective Comments ( Reprint / Changed PO).
    An appreciation for the quick repl and thanks in advance,
    Regards
    Shashi

    //2. Changed PO : if again the printing is being taken after some changes in that particular Purchase order No.
    For this to get printed in your assignment the change log has to be created for that PO and this will update the Corresponding PO tables like EKKO EKPO and EKET tables .
    So the change log for the PO can be handled from tables CDHDR and CDPOS.
    at header (EKKO) and item (EKPO) by comparing the same.
    So when you are printing the form again and u need to confirm that the particular PO has been changed and then pop the text ( Reprint /<b> Changed PO</b>).
    you can access a select on CDHDR and CDPOS , set a flag for this and print the text when the Flag is set .Later clear the Flag.
    hope this helps ,
    regards,
    vijay.

Maybe you are looking for

  • Another usb printer-to-Airport Extreme problem

    This issue is similar to Tanya Howie's, but involves an HP 5440 printer instead of a Pixma. I have the G4 iBook connecting via Airport to the Airport Extreme, the iMac Snowball hardwired to the AE via Ethernet cable, with the HP plugged in via usb to

  • Migrating from Windows Live Photo Gallery to iPhoto

    I'm interested in moving to a Mac, and bringing with me my photo collection, which has been organised (keyworded) using Windows Live Photo Gallery. Has anybody had any experience with this? All the keywords assigned using WLPG are stored in the photo

  • JRun4 updater 6 with JDK1.6

    When trying to compile a jsp page for the first time, the container creates only a .java and .ct file in the WEB-INF/jsp directory. Nothing out of the ordinary in the -err, -event, or -out logfile. This error occured when running JDK1.6.0, I changed

  • Solaris 10: formatting USB floppy diskette

    Hi, Have Solaris 10 installed on a SPARC machine, with a USB floppy drive. With the USB floppy drive plugged in, system detects it: $ rmformat Looking for devices... 1. Volmgt Node: /vol/dev/aliases/rmdisk0 Logical Node: /dev/rdsk/c2t0d0s2 Physical N

  • Repgroup still in "QUIESCED" status after resume_master_activity

    Hi All, i have issue with oracle advanced replication on 10.2.0.3 database. I have a master def side and a master site. There is a problem of data consistency between the master def site and master site. So i have recreate the setup of repgroup again