Smart forms and global data

are parameters defined in global data in smart forms unavailable in form routines to be used
I am working on lbbil_invoice std smart form for invoices and trying to use gs_it_gen type lbbil_it_gen that is been defined in global data. Will I have to define another wa of the same type in my sub routine ?

I am working on a smart form right now
I define in global data
gv_fabrictext type char64
gv_fabriccode type mara-j3afcc
then in my form routines i create a sub routine
FORM fcc_values USING gv_fabrictext.
and making computations to calculate gv_fabrictext
then i use a program code and call perform fcc_values using gv_fabrictext with gv_fabrictext as input and output parameters
Is this correct? Why do I have to define gv_fabriccode type mara-j3afcc  in the form routine even though its been defined in global data

Similar Messages

  • Purchase order smart forms and scripts

    i need to create a smart form and script in simple purchase order there is no requirements has given to me, can any one tell me in detail how i need to do and what are the procedures i need to follow, example code will be usefull and steps to build it.

    Hi,
    Go through the links mentioned below.
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    http://www.sapmaterial.com/smartform_example.html
    Re: Hands on SAP Smart Forms
    smartforms
    A Simple Smartform Tutorial
    SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
    According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    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'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    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.
    Additional Fonts for your SMARTFORMS
    You can create additional fonts and style with transaction SMARTSTYLES
    This can then be define in the paragraph and character formats, which you can then be assign to texts and fields in the Smart Form.
    The character formats includes effects such as superscript, subscript, barcode and font attributes.
    Also, you can refer to the below link for the explanation:
    http://help.sap.com/saphelp_46c/helpdata/en/4b/83fb42df8f11d3969700a0c930660b/frameset.htm
    Reward if helpful.
    Regards,
    Harini.S

  • Smart form and Jet form

    Hi,
    Please let me know the difference betweeen Smart form and jet form and in which scenarios we use them.
    thanks

    HI,
    <b>
    Smart forms</b>
    <u>https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/formPrinting-SAPscript,Smartforms&</u>
    Smartforms: Frequently Asked Questions
    What are the differences between SAP Scripts and Smartforms?
    How can I insert symbols in Smartforms?
    I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no Function module generated for this smartform. As a result my program dumps in PROD?
    How can I make the Smartforms to choose a printer name by default?
    How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?
    How can I display the total number of pages in Smartforms?
    How can I display the total number of pages in Smartforms?
    I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number of pages.
    What are the various text formatting options in Smartforms?
    How can I provide a background shading to the table?
    Where can I provide the input parameters to the smartform?
    Where can I define my own global types for the smartform?
    I have defined my own Program Lines, where I have used a global variable G_TEXT. I get an error G_TEXT is not defined?
    I have created a table node for display. Where can I check the condition which must satisfy to display the table?
    How can I define Page Protect in Smartforms?
    What is the difference between Template and Table in Smartforms?
    Where can I define the paragraph and character format for the smartforms?
    What are the differences between SAP Scripts and Smartforms?
    SAP Scripts are client dependent whereas Smartforms are client independent.
    SAP Scripts require a driver program to display the output whereas in smartforms the form routines can be written so that it is standalone.
    An integrated Form Builder helps to design Smartforms more easily than SAP Scripts
    An Table Painter and Smartstyles to assist in building up the smartforms
    On activation a function module is generated for Smartforms
    It is possible to create a Smartform without a main window
    Smartforms generates XML output which can be viewed through the web
    Multiple page formats is possible in smartforms
    How can I insert symbols in Smartforms?
    Select the Text node.
    Change Editor (Click the button above Check near the Editor)
    Go to menu Include->Characters->SAP Symbols
    Choose the SAP symbol that you want to insert.
    I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no Function module generated for this smartform. As a result my program dumps in PROD?
    The Smartform that is created in the Development may not have the same name in the Production server. So it is always advised to use the Function Module SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the Smartform name.
    DATA: fm_name TYPE rs38l_fnam.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = 'ZSMARTFORM'
      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.
    CALL FUNCTION fm_name
    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.How can I make the Smartforms to choose a printer name by default?
    In the CALL FUNCTION of the Smartform Function Module, set the output options parameter to set the printer name.
    The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the TDDEST field to your default printer name.
    How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?
    In the SSF_OPEN function module,
    Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
    Set the CONTROL PARAMETERS and control parameters as shown below,
    control-preview = 'X'.
    control-no_open = 'X'.
    control-no_close = 'X'.
    control-no_dialog = 'X'.
    control-device = 'PRINTER'.
    control_parameters-no_dialog = 'X'.
    control_parameters-no_open = 'X'.
    control_parameters-no_close = 'X'.
    OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
    OUTPUT_OPTIONS-TDNOPRINT = 'X'.
    CALL FUNCTION 'SSF_OPEN'
      EXPORTING
        output_options     = output_options
        control_parameters = control
        user_settings      = ' '
      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.How can I display the total number of pages in Smartforms?
    Use SFSY-FORMPAGES to display the total number of pages in the Smartforms
    &SFSY-PAGE& Current page number
    &SFSY-FORMPAGE& Total number of pages in the currently formatted layout set
    &SFSY-JOBPAGE& Total number of pages in the currently formatted print request
    &SFSY-COPYCOUNT& Original-1,1st copy-2
    &SFSY-DATE& Date
    &SFSY-TIME& Time
    &SFSY-USERNAME& Username
    I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number of pages.
    There may not be enough space in the window to display the variable, either increase the window dimensions or condense the spaces using &SFSY-FORMPAGES(C)&
    What are the various text formatting options in Smartforms?
    &symbol(Z)& Omit Leading Zeros
    &symbol(S)& Omit Leading Sign
    &symbol(<)& Display Leading Sign to the Left
    &symbol(>)& Display Leading Sign to the Right
    &symbol(C)& Compress Spaces
    &symbol(.N)& Display upto N decimal places
    &symbol(T)& Omit thousands separator
    &symbol(R)& Right justified
    &symbol(I)& Suppress output of the initial value
    How can I provide a background shading to the table?
    In the Table Painter, you can specify the color and shading for the table lines.
    Where can I provide the input parameters to the smartform?
    The input parameters for the smartform can be defined in Global Settings->Form Interface.
    The Associated Type must be defined in the ABAP Dictionary.
    Where can I define my own global types for the smartform?
    The global types(within the smartform) can be defined in Global Settings->Global Definitions->Types
    The types defined here will be global through the entire smartform.
    Also the form routines can be defined Global Settings->Global Definitions->Form Routines
    I have defined my own Program Lines, where I have used a global variable G_TEXT. I get an error G_TEXT is not defined?
    Whenever using the global variables in the Program Lines, enter the variable name in Input Parameters if you are going to use(read) the variable. If you are going to both read/write the variable value enter the same in Output Parameters.
    I have created a table node for display. Where can I check the condition which must satisfy to display the table?
    The conditions can be defined in the Conditions tab. In smartforms all the nodes have a condition tab where you can specify the condition to be satisfied to access the node.
    How can I define Page Protect in Smartforms?
    To define Page Protect for a node go to the Output options and check the Page Protection checkbox.
    What is the difference between Template and Table in Smartforms?
    The Template contains a fixed number of rows and columns, where the output is fixed.
    The Table can have variable number of rows
    Where can I define the paragraph and character format for the smartforms?
    The paragraph and character format for the smartforms can be defined in the transaction SMARTSTYLES
    Mohan
    Award points if it adds information.

  • Smart Form and Module Pool

    Can anybody provide me good step by step procedurehow create smart form and module pool programming.
    My email Id is [email protected]

    hi,
    SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
    According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name    Type assignment   Reference type
    ITAB1               TYPE                  Table Structure
    Global definitions
    Variable name    Type assignment   Reference type
    ITAB2               TYPE                  Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g.  HD_GEN for printing header details,
            IT_GEN  for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by :  SAP Hints and Tips on Configuration and ABAP/4 Programming
                        http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
            INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
       MOVE-CORRESPONDING MKPF TO INT_MKPF.
       APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        FM_NAME                  = FM_NAME
      EXCEPTIONS
        NO_FORM                  = 1
        NO_FUNCTION_MODULE       = 2
        OTHERS                   = 3.
    if sy-subrc <> 0.
       WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    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'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        GS_MKPF                    = INT_MKPF
      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.
    What is SAP Smart Forms?
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms. 
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can 
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time. 
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one. 
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form. 
    PROGRAM YMPSKEL MESSAGE-ID YL.
    DESCRIPTION
    written by !
    TABLES:
    DATA: OK_CODE(4), " ok code - screen 1
    OK_CODE2(4).
    DATA C LIKE SY-INDEX. " Index for screen loop
    *& Module USER_COMMAND_0100 INPUT
    process after input for screen 0100 *
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'SAVE'.
    WHEN 'DISP'.
    WHEN 'LIST'.
    C = 0. "reset loop control
    WHEN OTHERS.
    ENDCASE.
    CLEAR OK_CODE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    process before output for screen 0100 *
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'AMEND'. " set gui status
    SET TITLEBAR '100'. " set title
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form SAVE data
    Save screen details
    FORM SAVE.
    CLEAR OK_CODE.
    ENDFORM.
    *& Form DISPLAY
    FORM DISPLAY.
    ENDFORM.
    *& Module EXIT_COMMAND INPUT
    exit commands are processed before validation *
    defined by E against function in menu painter(function list)
    MODULE EXIT_COMMAND INPUT.
    CASE OK_CODE.
    WHEN 'EXIT'. CLEAR OK_CODE. SET SCREEN 0. LEAVE SCREEN.
    WHEN 'CANC'. CLEAR OK_CODE. SET SCREEN 0. LEAVE SCREEN.
    WHEN 'BACK'. CLEAR OK_CODE. SET SCREEN 0. LEAVE SCREEN.
    ENDCASE.
    ENDMODULE. " EXIT_COMMAND INPUT
    *& Form list
    text *
    FORM LIST.
    CLEAR OK_CODE. SET SCREEN 200. LEAVE SCREEN.
    ENDFORM. " LIST
    *& Module EXIT_COMMAND_200 INPUT
    exit command processing for screen 200 *
    defined by E against function in menu painter(function list)
    MODULE EXIT_COMMAND_200 INPUT.
    CASE OK_CODE2.
    WHEN 'EXIT'. CLEAR OK_CODE2. SET SCREEN 0. LEAVE SCREEN.
    WHEN 'CANC'. CLEAR OK_CODE2. SET SCREEN 0. LEAVE SCREEN.
    WHEN 'BACK'. CLEAR OK_CODE2. SET SCREEN 100. LEAVE SCREEN.
    ENDCASE.
    ENDMODULE. " EXIT_COMMAND_200 INPUT
    *& Module STATUS_0200 OUTPUT
    process before output for screen 200 *
    MODULE STATUS_0200 OUTPUT.
    SET PF-STATUS 'POPUP'.
    SET TITLEBAR 'xxx'.
    ENDMODULE. " STATUS_0200 OUTPUT
    Module pool programs are created in abap development work bench (TCODE: SE80).
    Here we can do all the works whatever you can do in abap.
    Module pool programs are also called dialog programs.
    The module Pool are reports prepared for different screens and to manage the sequence of events of these screens, in the transaction SE80 you can see all the dynpros that you have for this kind of report, add new ones, add all types of element to the report.
    Process Before Output is the part of the dynpro code that is processed before the user can do anything with the data in the screen
    Process After Input is the part of the dynpro code that is processed after the interaction with the user.
    module pool programs are excuted using Tcodes
    regards,
    sreelakshmi

  • Differnace b/w SID and Global data base name

    please tell me what is differance b/w SID and global data base name.

    Hi,
    Oracle System Identifier (SID)
    A name that identifies a specific instance of a running pre-release 8.1 Oracle database. For any database, there is at least one instance referencing the database.
    For pre-release 8.1 databases, SID is used to identify the database. The SID is included in the connect descriptor of a tnsnames.ora file and in the definition of the listener in the listener.ora file.
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/glossary.htm#i433004
    Global database name
    The full name of the database which uniquely identifies it from any other database. The global database name is of the form "database_name.database_domain," for example, sales.us.acme.com.
    The database name portion, sales, is a simple name you wish to call your database. The database domain portion, us.acme.com, specifies the database domain in which the database is located, making the global database name unique. When possible, Oracle Corporation recommends that your database domain mirror the network domain.
    The global database name is the default service name of the database, as specified by the SERVICE_NAMES parameter in the initialization parameter file.
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/glossary.htm#i435858
    Adith

  • Difference between Smart Forms and Adobe Form

    Hi all,
    What are disadvantages of Smart form in SAP ,
    What is difference between Smart Forms and Adobe interactive Form.
    I heard from someone that in future Adobe interactive Form will repalce smart forms. Is it true or not
    Best Regards
    Srikanth

    Hi,
    Companies depend on formal documents that reflect their corporate identities and contain critical business information from live systems. SAP and Adobe partnered for automating and streamlining forms-based communication to support customers who create reusable forms for their business processes.
    SAP Interactive Forms by Adobe will be used more and more as a way of simplifying and automating manual processes.
    There are various advantages of Adobe forms.
    SAP Interactive Forms by Adobe provides all the features and functions you need to create form-based output, such as order confirmations, invoices, or pay slips. You can either print such documents or send them by email or FAX.
    <b>Online Interactive Forms</b>
    A user logs on to the company intranet to fill in a form required by the HR department (for example, a Non-Disclosure Agreement to be signed by a new employee). The form is displayed in the browser.
    As the user is logged on in the background to the company's HR system, his master data is displayed in the form. The user enters the required information in the fillable fields of the interactive form, and sends the data back to the system by pushing a button. The system extracts the data from the form and saves it in the database.
    <b>Offline Interactive Forms</b>
    The purchasing department of a company creates a bid in its Enterprise Resource Planning (ERP) system and selects the potential vendors. Based upon this data, the system automatically creates interactive bidding forms with specific vendor information, such as the address or contact person.
    The forms are transmitted to the vendors by email. The vendors can fill out the forms offline (without being connected to the system that created the forms) and transmit them back to the company. The company then processes the forms automatically, and the data provided by the vendors is written to the ERP system. The purchasing department uses the data to evaluate the quotation and then issues an order.
    <b>With the integration of Adobe PDF technology into its solutions, SAP will be able to further extend its offerings of end-to-end business solutions by:</b>
    Providing for the first time the capabilities of Adobe's interactive PDF-based forms.
    Integrating PDF documents into business processes that are driven by SAP applications.
    Automating the process of moving XML data from SAP applications into interactive forms and vice versa.
    Reducing time to design, manage, and maintain extended forms-based processes through easy-to-use forms design and deployment tools.
    Offering its customers enhanced printing capabilities, in particular for interactive Web applications.
    The focus of new forms technology from SAP is interactive PDF-based forms that can be created in SAP systems as a result of the <b>integration of Adobe technology with Web Dynpro and the SAP NetWeaver Developer Studio.</b> This integration means that adobe is the future technology.
    Regards,
    Kate

  • Smart forms and script

    hi,,
           will u tell what is the difference between smart forms and scripts.

    hI
    Sapscripts are client dependend and smartforms are client independet.
    SAPscript are CLient Dependent, SmartForms are Client Independent. The reason why SmartForms are client independent is because when you activate a SMartForm, SAP actually generates a Function Module (which as you know is client independent). The Print Program (or as SAP likes to refer to them these days - Application Program) calls your generated FM.
    In the "smartforms" transaction, when you are viewing a smartform, you can go to the Environment->Function Module Name menu path to see the FM name.
    Look at the "Application Program" for the Invoice SmartForm (RLB_INVOICE):
    determine smartform function module for invoice
        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.
    call smartform invoice
          CALL FUNCTION lf_fm_name
               EXPORTING
                          archive_index        = toa_dara
                          archive_parameters   = arc_params
                          control_parameters   = ls_control_param
                    mail_appl_obj        =
                          mail_recipient       = ls_recipient
                          mail_sender          = ls_sender
                          output_options       = ls_composer_param
                          user_settings        = space
                          is_bil_invoice       = ls_bil_invoice
                          is_nast              = nast
                          is_repeat            = repeat
         importing  document_output_info =
                    job_output_info      =
                    job_output_options   =
               EXCEPTIONS formatting_error     = 1
                          internal_error       = 2
                          send_error           = 3
                          user_canceled        = 4
                          OTHERS               = 5.
    <b>Difference with SMARTFORMS vs. SapScript (SE71)</b>
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    Contributed by : SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk. 
    It was said that it was provided in CRM 3.0 version, but not available in R/3.  You can download smartforms into Local PC in a XML format.  In the same way you can upload this XML format into Smartform.  From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment. 
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk. 
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people.  What you can do is to create a Transport and then FTP down to your local harddisk.   When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server.  Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it.  Actually, there is something you can do about it.  By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected. 
    i) The main difference is that SAP script is client-dependant, while smartform is independent. Also there are some advanced and intreractive features available in smartforms.
    You can use an External subroutine-call in sapscript editor like:
      /: perform <form_name> in program <program_name>
      /: using <var1>
      /: using <var2>
      /: changing <return1>
      /: changing <return2>
      /:endperform

  • What is the difference between smart forms and scripts.?

    what is the difference between smart forms and scripts.?

    Differences between Smartforms and SAPscript
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Routines can be written in smartforms tool.
    d) Smartforms generates a function module when activated.
    e) Smartforms can create web enable forms like XML
    f) smartforms itself contine subroutine pools need not to main separetly like in case of scripts
    Request you to refer the following links
    www.sap-img.com/smartforms/smartform-sapscripts.htm
    www.erpgenie.com/abap/smartforms_sapscript.htm
    Sapscript vs Smartforms
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated
    Scripts are client dependent whereas smartforms aren't.
    Upto 99 main windows are possible in scripts and only one in smarforms.
    To create multiple main windows in scripts, you just have to give the window type as MAIN whnever you create a window.
    Scripts still exists but smartforms are in use from 4.6c version, now the lastest version of these two is adobe forms
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    Advantages of SAP Smart Forms
    SAP Smart Forms have the following advantages:
    1. The adaptation of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
    2. Displaying table structures (dynamic framing of texts)
    3. Output of background graphics, for form design in particular the use of templates which were scanned.
    4. Colored output of texts
    5. User-friendly and integrated Form Painter for the graphical design of forms
    6. Graphical Table Painter for drawing tables
    7. Reusing Font and paragraph formats in forms (Smart Styles)
    8. Data interface in XML format (XML for Smart Forms, in short XSF)
    9. Form translation is supported by standard translation tools
    10. Flexible reuse of text modules
    11. HTML output of forms (Basis release 6.10)
    12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
    Reward Points if useful.

  • How to get the PO no in the smart form and in the print program from ME23N

    hello all,
                     I am new to smart form printing.I want to make a smartform along with print program that will show PO Details.It has to be created as an o/p type in ME23N. I have created an o/p type ZPO using NACE ..Can some one tell me how to get the PO number in the smart form and in the print program  from ME23N ,so that I can then program the necessary calculations?plz help me with the code.Thanks in advance.
    Subhabrata.

    Hello Everyone,
    I am new to the forum and also to abap.
    Excuse me if it is a basic question.
    I am taking care of the output types.
    This is 1st time SAP will be implemented .
    For purchase order , I go to NACE ---EF----NEU---Processing routines
    print output---SAPFM06P---ENTRY_NEU----MEDRUCK
    FAX-----------SAPFM06P---ENTRY_NEU----MEDRUCK
    EDI------------RANASTED--EDI_PROCESSING
    DISTRIBUTION(ALE)---RANASTED---ALE_PROCESSING
    Are the above settings fine ?
    What are the standard programs for the PO outputs . I am looking for the smartforms and the driver program .
    I searched and found that IN ECC 6 , we have to install OSS notes .
    Gurus, please help  me . Let me know what all oss notes be implemented and how to proceed from here .
    Any help will be greatly appreciated ,
    Monalisa

  • Regarding Smart form and Script

    Hi.
    Can anybody send Full screen short of Smart Form And Script.
    Thanks And Regards
    Gulo.

    Hi Golu singh,
    Pleasae check this link
    Tutorials on SAP Script/Smart Forms
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    SAP SmartForms explained step by step including Table display .
    http://sap.niraj.tripod.com/id67.html
    SMARTFORMS
    [Step br Step Tutorial to create Smartform|http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html]
    Best regards,
    raam

  • Am using a standard smart form and a corresponding program.

    hi
    i  am using a standard smart form and a corresponding program. i did evry possible thing but it is not executing..where could be the error.?
    can any1 suggest

    Hi,
    Dude..!
    you told that you created form and corresponding print program also....!
    but you didn't mentioned what it is..! in the sense to which module..!
    are you changing any standard form or what..! be clear while raising issue..! so that you can get your issue cleared..
    and you have to assign your form and corresponding print program in NACE transaction for the given output type.
    Thanks & regards,
    Sasi Kanth.

  • Smart forms and scripts

    Hi Friends.
    How r u?
         This is Ravinder.
    what r the problems does I get when we generating the layout for checks using smart forms and scripts(also)? There is standard programs r there plz tell me? Plz give an example

    Hi Friends.
    How r u?
         This is Ravinder.
    what r the problems does I get when we generating the layout for checks using smart forms and scripts(also)? There is standard programs r there plz tell me? Plz give an example

  • Month view in smart form depending on date

    if the date is 01.01.08 I want it to display as 01 Jan 08..?and if is
    02.02.08 I want it as 02 Feb 08..
    How to resolve this in smart form field..?
    let me know..
    Thanks,

    Hi,
    You should write code in order to obtain this,
    If v_date is your date field.
    In the porgram logic you check for v_date+4(2)
    If g_date+4(2) = '01'.
    concatenate g_date6(2) 'JAN' g_date0(2) into g_date.
    elseif g_date_4(2) = '02'.
    concatenate g_date6(2) 'FEB' g_date0(2) into g_date.
    elseif...................
    then display g_date.
    Regards
    Madhu G S
    Reward Points if usefull

  • Upload facility for smart forms and expense account rules in oracle iprocurement R12.1.3

    Hi All, 
    We are implementing iprocurement for new operating unit.
    We have many expense account rules and approximately 450 smart forms to be setup for new OU. But as part of R12, the setups are to be done through HTML pages.
    Currently I do not see any option to upload these 2 items, as doing them manually will take lot of manual effort.
    Are there any APIs available to load these 2 items? OR any workaround like using dataloader or isetup?
    I am sure many clients are using R12 for very long time and not sure if there are any issues raised on this?
    Could you please let us know if there are any options avialble to upload them?
    Thanks
    sreenivas

    How to Setup a Valid Vacation Rule for Purchasing Notifications (Doc ID 378023.1)
    Goal
    What steps are required for proper setup of a Vacation Rule for routing of Purchasing Notifications?
    Fix
    1.  Enter the Notification Summary or Worklist for a user
    2.  Select the "Vacation Rule" link
    3.  Select the "Create New Rule" link
    4.  For Item Type select "All" for all Notifications or select the desired Notification Type from List of Values
    5.  Select the "Next" link to proceed to the next setup page for the rule
    6.  Enter both a a valid Start and End Date for the new rule
    7.  Ensure the "Reassign" radio button is selected
    8.  Keep "All Employees and Users" in the menu box
    9.  Select the "Delegate" radio button - Assign/Reassign action is prohibited for Purchasing Notifications
    10.  Select the Flashlight icon next to the blank menu box for selecting a user
    11.  A new sub-screen should pop-up to perform the user search
    12.  For "Search By" select "Username" - (DO NOT search by Name)
    13.  Perform the needed wildcard (%) search at the top of the page to locate the desired username
    14.  Click the radio button next to the desired name of the user to have the notifications sent to
    15.  Press the "Select" button followed by the "Apply" button
    16.  Continue on with the saving of the Vacation Rule for latter use
    Note:
    The key to setting-up a valid Vacation Rule is to ensure the rule is tied to a Username rather then the Full Name of the desired user.  The reason for this is that the Worklist and Notification Summary for the user is linked to their username and not full name record.
    Reference:
    Oracle Workflow User's Guide - Release 2.6.3.5
    Part Number : B12162-02

  • Smart forms and print program needed

    Can anyone provide me with the following print programs and smart forms? I can't find it in my SAP. Thanks.
    Print Program:
    /SMB40/M07DR
    Smart Forms:
    /SMB40/MMGR1_A
    /SMB40/MMGR3_A
    /SMB40/MMGI1_A
    Please kindly email me at [email protected]

    Hi
    I appreciate for your sincierty i cant send through mail but i'm sending directly plz copy all the programs
    INCLUDE /SMB40/M07DRTOP.
    PROGRAM /BPR3PF/m07dr MESSAGE-ID m7.
    DATA  lgortsplit LIKE am07m-xselk.
    DATA  ladr LIKE sadr.
    DATA  *ladr LIKE sadr.
    CONSTANTS: a TYPE c VALUE 'A',
               b TYPE c VALUE 'B',
               c TYPE c VALUE 'C',
               d TYPE c VALUE 'D',
               e TYPE c VALUE 'E',
               f TYPE c VALUE 'F',
               g TYPE c VALUE 'G',
               h TYPE c VALUE 'H',
               i TYPE c VALUE 'I',
               j TYPE c VALUE 'J',
               k TYPE c VALUE 'K',
               l TYPE c VALUE 'L',
               m TYPE c VALUE 'M',
               n TYPE c VALUE 'N',
               o TYPE c VALUE 'O',
               p TYPE c VALUE 'P',
               q TYPE c VALUE 'Q',
               r TYPE c VALUE 'R',
               s TYPE c VALUE 'S',
               t TYPE c VALUE 'T',
               u TYPE c VALUE 'U',
               v TYPE c VALUE 'V',
               w TYPE c VALUE 'W',
               x TYPE c VALUE 'X',
               y TYPE c VALUE 'Y',
               z TYPE c VALUE 'Z'.
    CONSTANTS: plus  TYPE c VALUE '+',
               minus TYPE c VALUE '-',
               punkt TYPE c VALUE '.',
               null  TYPE c VALUE '0',
               eins  TYPE c VALUE '1',
               zwei  TYPE c VALUE '2',
               drei  TYPE c VALUE '3',
               vier  TYPE c VALUE '4',
               fuenf TYPE c VALUE '5',
               sechs TYPE c VALUE '6',
              sieben TYPE c VALUE '7',
               acht  TYPE c VALUE '8',
               neun  TYPE c VALUE '9',
               einsi TYPE i VALUE '1',
               zweii TYPE i VALUE '2',
               dreii TYPE i VALUE '3',
               vieri TYPE i VALUE '4',
               nzwei TYPE i VALUE '02',
               ndrei TYPE i VALUE '03'.
    CONSTANTS: actvt01 LIKE tact-actvt VALUE '01',
               actvt02 LIKE tact-actvt VALUE '02',
               actvt03 LIKE tact-actvt VALUE '03',
               actvt04 LIKE tact-actvt VALUE '04',
               actvt06 LIKE tact-actvt VALUE '06',
               actvt65 LIKE tact-actvt VALUE '65',
               actvt70 LIKE tact-actvt VALUE '70'.
    CONSTANTS: maximum     TYPE f VALUE 9999999999999,
               minimum     TYPE f VALUE -9999999999999,
               maximum_gld TYPE f VALUE  99999999999,
               minimum_gld TYPE f VALUE  -99999999999,
               maxvalue LIKE am07m-maxvalue VALUE 9999999999999,
               minvalue LIKE am07m-maxvalue VALUE -9999999999999,
               cnull(18)   TYPE c VALUE '000000000000000000',
               pf02(4)     TYPE c VALUE 'PF02',
               pf15(4)     TYPE c VALUE 'PF15',
               stern       TYPE c VALUE '*',
               doublestar(2) TYPE c VALUE '**',
               underscore  TYPE c VALUE '_',
               slasch      TYPE c VALUE '/',
               dpunkt      TYPE c VALUE ':',
               curtp00     LIKE smbew-curtp VALUE '00', "Transaktionswährung
               curtp10     LIKE smbew-curtp VALUE '10', "ML in Hauswährung
               auto_best   LIKE mseg-ebeln  VALUE '9999999999',
               modulpool   LIKE sy-repid    VALUE 'SAPMM07M'.
    CONSTANTS: BEGIN OF hlp,
                 b(4) TYPE c VALUE 'HLPB',
                 f(4) TYPE c VALUE 'HLPF',
                 g(4) TYPE c VALUE 'HLPG',
                 m(4) TYPE c VALUE 'HLPM',
                 r(4) TYPE c VALUE 'HLPR',
                 v(4) TYPE c VALUE 'HLPV',
               END OF hlp.
                                           "Equates für Alphabet
    TABLES:
       afko,
       aufk,
       itcpo,
       mkpf,
      *mkpf,
       mseg,
      *mseg,
       ekko,
       ekkn,
      *ekko,
      arc_params,
       ekpo,
       ekbe,
       lfa1,
      *lfa1,
       thead,
       toa_dara,
       am07m,
      *am07m,
       t001,
       t001w,
      *t001w,
       t027b,
       t027c,
       t027d,
       t156,
       t156t,
       t157e,
      *t157e,
       t159m,
       t159n,
       t159o,
       t159p,
       t159s,
       t159e,
       t024,
       t024d,
      *t024,
       t064b,
       nast,
      *nast,
      tnapr.
    TABLES: mabdr,
            mtcom,
            mtcor,
            twlad.
    * Reportinterne Daten                                                 *
    *--- Strukturen ------------------------------------------------------*
    DATA: x_protab TYPE c,
          x_bwart TYPE c,
          bwart LIKE mseg-bwart,
          eintraege LIKE sy-tfill,
          anzahl LIKE mseg-weanz,
          anzahl1(7) TYPE n,
          x_kont TYPE c,                   "Mehrfachkontierung
          x_kont1 TYPE c,              "Einfache Kontierung (WE unbewertet)
          x_form TYPE c,
          x_open TYPE c.
    DATA: BEGIN OF jahr,
            jahr(4) TYPE n,
            monat(2) TYPE n,
            tag(2) TYPE n,
          END OF jahr.
    DATA:
       BEGIN OF we,
         version1 VALUE '1',               "Standardversion
         version2 VALUE '2',               "Version mit Prüftext
         version3 VALUE '3',               "WE-Sammelschein
       END OF we,
       BEGIN OF alt,
          matnr LIKE mseg-matnr,
          bwart LIKE mseg-bwart,
          ebeln LIKE mseg-ebeln,
          usnam LIKE mkpf-usnam,
       END OF alt,
       BEGIN OF kunde,
          kdauf LIKE mseg-kdauf,
          kdpos LIKE mseg-kdpos,
          kdein LIKE mseg-kdein,
       END OF kunde,
       BEGIN OF anlage,
          anln1 LIKE mseg-anln1,
          anln2 LIKE mseg-anln2,
       END OF anlage,
       BEGIN OF belpos,
          mblnr LIKE mseg-mblnr,
          zeile LIKE mseg-zeile,
       END OF belpos,
        xskkz,
        xpsty,
        xkdanr    VALUE 'C',
        xkde      VALUE 'E',
        xfert     VALUE 'F',
        xrvkdanr  VALUE 'A',
        xanlage   VALUE 'A',
        xanln1    VALUE 'I',
        xkostl    VALUE 'K',
        xprojn    VALUE 'P',
        xmunbw    VALUE 'M',
        xumlag    VALUE 'U',
        xvbelg    VALUE 'V',
        xnplan    VALUE 'N',
        xkonsi(2) VALUE 'KB',
        xwabel(2) VALUE 'WA',
        xwibel(2) VALUE 'WI',
        xwebel(2) VALUE 'WE',
         xsele,                            "Position selektiert
         xkont,                            "Kontierungswechsel
         xsamm,                            "Sammel-WE-Schein
         xanha.                            "Mehrfachkontierung
    DATA BEGIN OF theader.
            INCLUDE STRUCTURE thead.
    DATA END OF theader.
    *--- Interne Tabellen -------------------------------------------------*
    DATA:
       BEGIN OF dummy OCCURS 0,
         dummy,
       END OF dummy.
    DATA:
       BEGIN OF ausgabe OCCURS 20,
          mblnr LIKE mseg-mblnr,
       END OF ausgabe.
    DATA: BEGIN OF xekkn OCCURS 50.
            INCLUDE STRUCTURE ekkn.
    DATA: END OF xekkn.
    DATA: BEGIN OF xmseg OCCURS 50.
            INCLUDE STRUCTURE mseg.
    DATA: END OF xmseg.
    DATA: BEGIN OF dtext OCCURS 1.
            INCLUDE STRUCTURE tline.
    DATA: END OF dtext.
    DATA: BEGIN OF dktext OCCURS 1.
            INCLUDE STRUCTURE tline.
    DATA: END OF dktext.
    DATA: BEGIN OF dptext OCCURS 1.
            INCLUDE STRUCTURE thead.
    DATA: END OF dptext.
    DATA: BEGIN OF nast_key,
            mblnr LIKE mkpf-mblnr,
            mjahr LIKE mkpf-mjahr,
            zeile LIKE mseg-zeile,
          END OF nast_key.
    DATA: BEGIN OF beltab OCCURS 20.
            INCLUDE STRUCTURE mseg.
    DATA: vgart LIKE mkpf-vgart,
          blart LIKE mkpf-blart,
          blaum LIKE mkpf-blaum,
          bldat LIKE mkpf-bldat,
          budat LIKE mkpf-budat,
          cpudt LIKE mkpf-cpudt,
          cputm LIKE mkpf-cputm,
          aedat LIKE mkpf-aedat,
          usnam LIKE mkpf-usnam,
          tcode LIKE mkpf-tcode,
          xblnr LIKE mkpf-xblnr,
          bktxt LIKE mkpf-bktxt,
          frath LIKE mkpf-frath,
          frbnr LIKE mkpf-frbnr,
          wever LIKE mkpf-wever,
          kzdru LIKE t156-kzdru,
          END OF beltab.
    DATA: BEGIN OF traptab OCCURS 50.
            INCLUDE STRUCTURE mseg.
    DATA:   vgart LIKE mkpf-vgart,
            blart LIKE mkpf-blart,
            blaum LIKE mkpf-blaum,
            bldat LIKE mkpf-bldat,
            budat LIKE mkpf-budat,
            cpudt LIKE mkpf-cpudt,
            cputm LIKE mkpf-cputm,
            aedat LIKE mkpf-aedat,
            usnam LIKE mkpf-usnam,
            tcode LIKE mkpf-tcode,
            xblnr LIKE mkpf-xblnr,
            bktxt LIKE mkpf-bktxt,
            frath LIKE mkpf-frath,
            frbnr LIKE mkpf-frbnr,
            wever LIKE mkpf-wever,
          END OF traptab.
    DATA: BEGIN OF inthead OCCURS 50.
            INCLUDE STRUCTURE thead.
    DATA: END OF inthead.
    DATA: BEGIN OF intline OCCURS 50.
            INCLUDE STRUCTURE tline.
    DATA: END OF intline.
    DATA: BEGIN OF intline1 OCCURS 50.
            INCLUDE STRUCTURE tline.
    DATA: END OF intline1.
    *-------- Hilfsfelder -------------------------------------------------*
    DATA: index_z LIKE sy-tabix,
          drucker LIKE rm07m-ldest,
          old_tdform LIKE t159o-tdform,
          r_werks LIKE t001w-werks,
          r_name1 LIKE t001w-name1,
          x_form3 TYPE c,
          x_nopdest TYPE c,
          language LIKE t001w-spras,
          zaehler_m LIKE sy-tabix,
          edruck  TYPE c.
    DATA: old_mkpf LIKE mkpf-usnam,
          old_budat LIKE mkpf-budat,
          old_cpudt LIKE mkpf-cpudt,
          old_werks LIKE t001w-werks,
          old_name1 LIKE t001w-name1,
          old_mblnr LIKE mkpf-mblnr,
          old_lifnr LIKE ekko-lifnr,
          old_ebeln LIKE ekko-ebeln,
          old_ekgrp LIKE ekko-ekgrp,
          old_reswk LIKE ekko-reswk,
          old_linam LIKE am07m-name1,
          old_lina2 LIKE am07m-name2,
          old_eknam LIKE t024-eknam,
          old_ektel LIKE t024-ektel,
          old_ematn LIKE mseg-ematn,
          old_lfa1  LIKE lfa1,
          old_lgort LIKE mseg-lgort,
          old_ladr LIKE ladr,
          save_mkpf LIKE mkpf-usnam,
          save_budat LIKE mkpf-budat,
          save_cpudt LIKE mkpf-cpudt,
          save_werks LIKE t001w-werks,
          save_name1 LIKE t001w-name1,
          save_mblnr LIKE mkpf-mblnr,
          save_lifnr LIKE ekko-lifnr,
          save_reswk LIKE ekko-reswk,
          save_ebeln LIKE ekko-ebeln,
          save_ekgrp LIKE ekko-ekgrp,
          save_linam LIKE am07m-name1,
          save_lina2 LIKE am07m-name2,
          save_eknam LIKE t024-eknam,
          save_ektel LIKE t024-ektel,
          save_ematn LIKE mseg-ematn,
          save_lfa1  LIKE lfa1,
          save_lgort LIKE mseg-lgort,
          save_ladr LIKE ladr,
          offwhile TYPE c,
          & TYPE c VALUE '&',
          blank TYPE c VALUE ' ',
          fenster(5) TYPE c VALUE 'WIN  ',
          fcount(2) TYPE c,
          text1(21) TYPE c VALUE 'INTLINE-TDLINE+  (  )',
          text2(22) TYPE c VALUE 'INTLINE1-TDLINE+  (  )',
          text5(22) TYPE c VALUE 'INTLINE1-TDLINE+  (  )',
          hifeld1(21) TYPE c VALUE 'INTLINE-TDLINE+  (10)',
          shift(2) TYPE n,
          fpage LIKE sy-pagno,
          xscreen(1) TYPE c,
          retco LIKE sy-subrc,
          mblnr LIKE mkpf-mblnr,
          zeile LIKE mseg-zeile,
          new_page,
          xkopfdr,                         "Kopf bereits gedruckt
          n_vornr LIKE resb-vornr.         "Netzplanvorgang
    INCLUDE /SMB40/M07DRMTA.
    *------Lesen Tabelle T001----------------------------------------------*
    FORM TAB001_LESEN.
      IF NOT T001-BUKRS = MSEG-BUKRS.
        SELECT SINGLE * FROM T001 WHERE BUKRS = MSEG-BUKRS.
      ENDIF.
    ENDFORM.
    *-------Lesen Tabelle T001w--------------------------------------------*
    FORM TAB001W_LESEN.
      IF NOT T001W-WERKS = MSEG-WERKS.
        SELECT SINGLE * FROM T001W WHERE WERKS = MSEG-WERKS.
      ENDIF.
        R_WERKS = T001W-WERKS.
        R_NAME1 = T001W-NAME1.
    * Sprache für Formular aus Kondition, sonst aus Werk
      IF NOT NAST-SPRAS IS INITIAL.
        LANGUAGE = NAST-SPRAS.
      ELSE.
        LANGUAGE = T001W-SPRAS.
      ENDIF.
      SET LANGUAGE LANGUAGE.
    ENDFORM.
    *-------Lesen Tabelle T001w bei Werkswechsel --------------------------*
    FORM TAB001W_LESEN_2.
      IF NOT MSEG-WERKS = T001W-WERKS.
        SELECT SINGLE * FROM T001W WHERE WERKS = MSEG-WERKS.
      ENDIF.
    ENDFORM.
    *--------Lesen Tabelle T156--------------------------------------------*
    FORM TAB156_LESEN.
      IF NOT T156-BWART = MSEG-BWART.
        SELECT SINGLE * FROM T156 WHERE BWART = MSEG-BWART.
      ENDIF.
    ENDFORM.
    *-------Lesen Tabelle T156t--------------------------------------------*
    FORM TAB156T_LESEN.
      SELECT SINGLE * FROM T156T WHERE SPRAS = LANGUAGE
                                 AND   BWART = MSEG-BWART
                                 AND   SOBKZ = MSEG-SOBKZ
                                 AND   KZBEW = MSEG-KZBEW
                                 AND   KZZUG = MSEG-KZZUG
                                 AND   KZVBR = MSEG-KZVBR.
    ENDFORM.
    *------Lesen Tabelle T024----------------------------------------------*
    FORM TAB024_LESEN.
       IF NOT T024-EKGRP = EKKO-EKGRP.
         SELECT SINGLE * FROM T024 WHERE EKGRP = EKKO-EKGRP.
       ENDIF.
    ENDFORM.
    *------Lesen Tabelle T024D---------------------------------------------*
    FORM TAB024D_LESEN.
       SELECT SINGLE * FROM T024D WHERE WERKS = MSEG-WERKS
                                  AND   DISPO = AFKO-DISPO.
    ENDFORM.
    *---------------------- T027B,C lesen ---------------------------------*
    FORM T027_LESEN.
      SELECT SINGLE * FROM T027B WHERE SPRAS = LANGUAGE
                                 AND   EVERS = MSEG-EVERS.
      CHECK NOT MSEG-EVERE IS INITIAL.
      SELECT SINGLE * FROM T027C WHERE EVERS = MSEG-EVERS
                                 AND   EVERE = MSEG-EVERE.
      IF NOT T027C-EVDRK IS INITIAL.
        SELECT SINGLE * FROM T027D WHERE SPRAS = LANGUAGE
                                   AND   EVERS = MSEG-EVERS
                                   AND   EVERE = MSEG-EVERE.
      ENDIF.
    ENDFORM.
    *------------ Lesen der Tabelle T159P Barcode oder Mehrfachdruck ------*
    *----------------------- gewünscht ? ----------------------------------*
    FORM LESEN_T159P.
      IF NOT T159P-TDDEST = NAST-LDEST.
        SELECT SINGLE * FROM T159P WHERE TDDEST = NAST-LDEST.
      ENDIF.
    ENDFORM.
    *&      Form  T064B_LESEN
    *       Lesen Text zur Bestandsart Qualität/Gesperrt bei WE
    FORM T064B_LESEN.
      DATA: BSTAR LIKE T064B-BSTAR.
      CASE MSEG-INSMK.
        WHEN SPACE.
          CLEAR T064B.
          EXIT.
        WHEN F.
          CLEAR T064B.
          EXIT.
        WHEN X.
          BSTAR = ZWEI.
        WHEN ZWEI.
          BSTAR = ZWEI.
        WHEN S.
          BSTAR = VIER.
        WHEN DREI.
          BSTAR = VIER.
      ENDCASE.
      IF NOT T064B-BSTAR = BSTAR.
        SELECT SINGLE * FROM T064B WHERE SPRAS = LANGUAGE
                                   AND   BSTAR = BSTAR.
      ENDIF.
    ENDFORM.                    " T064B_LESEN
    INCLUDE /SMB40/M07DRMMA.
    *---------Material lesen-----------------------------------------------*
    FORM MATERIAL_LESEN.
      CLEAR MTCOM.
      MTCOM-KENNG = 'MABDR'.
      MTCOM-MATNR = MSEG-MATNR.
      MTCOM-WERKS = MSEG-WERKS.
      MTCOM-LGORT = MSEG-LGORT.
      MTCOM-SPRAS = LANGUAGE.
      MTCOM-NOMUS = 'X'.
      CALL FUNCTION 'MATERIAL_LESEN'
           EXPORTING
                SCHLUESSEL = MTCOM
           IMPORTING
                MATDATEN   = MABDR
                RETURN     = MTCOR
           TABLES
                SEQMAT01   = DUMMY.
      IF NOT T156-KZMHD IS INITIAL.
        IF NOT MABDR-MHDLP IS INITIAL.
          IF T001W-VLFKZ = B.              "Zentrale ?
            PERFORM MHD_BERECHNEN.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.
    *----------------- Mindesthaltbarkeit berechnen  ---------------------*
    FORM MHD_BERECHNEN.
      IF NOT EKPO-MHDRZ IS INITIAL.
        AM07M-MHDAT = MSEG-VFDAT - ( EKPO-MHDRZ * MABDR-MHDLP / 100 ).
      ELSEIF NOT MABDR-MHDRZ IS INITIAL.
        AM07M-MHDAT = MSEG-VFDAT - ( MABDR-MHDRZ * MABDR-MHDLP / 100 ).
      ENDIF.
    ENDFORM.
    *----------------- Prueftext lesen-------------------------------------*
    FORM PRUEFTEXT_LESEN.
      CLEAR  DPTEXT.
      CLEAR  THEADER.
      REFRESH DPTEXT.
      THEADER-TDID             = 'PRUE'.
      THEADER-TDSPRAS          = LANGUAGE.
      THEADER-TDNAME           = MSEG-MATNR.
      THEADER-TDOBJECT         = 'MATERIAL '.
      CALL FUNCTION 'SELECT_TEXT'
           EXPORTING
                ID         = THEADER-TDID
                LANGUAGE   = THEADER-TDSPRAS
                NAME       = THEADER-TDNAME
                OBJECT     = THEADER-TDOBJECT
           IMPORTING
                ENTRIES    = EINTRAEGE
           TABLES
                SELECTIONS = DPTEXT.
    ENDFORM.
    *                Lesen der Herstellerteilenummer                       *
    FORM LESEN_HTN.
      SELECT SINGLE MFRPN FROM MARA
               INTO (AM07M-MFRPN) WHERE MATNR = MSEG-EMATN.
    ENDFORM.
    INCLUDE /SMB40/M07DRMBE.
    *-------------Bestellung lesen-----------------------------------------*
    FORM BESTELLUNG_LESEN."ORDER READING
      DATA: NAME1 LIKE ADDR1_VAL-NAME1.
      DATA: OLD_LIFNR LIKE EKKO-LIFNR.
      CLEAR AM07M-NAME1.
      CLEAR AM07M-NAME2.
      IF EKKO-EBELN NE MSEG-EBELN.
        SELECT SINGLE * FROM EKKO WHERE EBELN = MSEG-EBELN.
      ENDIF.
      SELECT SINGLE * FROM EKPO WHERE EBELN = MSEG-EBELN
                                AND   EBELP = MSEG-EBELP.
    * Purchase order history because of XBLNR read, since from MKPF can
    *deviate
      SELECT SINGLE * FROM EKBE WHERE EBELN = MSEG-EBELN
                                AND   EBELP = MSEG-EBELP
                                AND   VGABE = '1'
                                AND   GJAHR = MSEG-MJAHR
                                AND   BELNR = MSEG-MBLNR
                                AND   BUZEI = MSEG-ZEILE.
      IF NOT SY-SUBRC IS INITIAL.
        CLEAR EKBE.
      ELSE.
        IF NOT EKBE-XBLNR IS INITIAL.
          MKPF-XBLNR = EKBE-XBLNR.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'MM_ADDRESS_GET'
           EXPORTING  I_EKKO    = EKKO
           IMPORTING  E_NAME1   = NAME1
           EXCEPTIONS OTHERS    = 1.
      AM07M-NAME1 = NAME1.
      IF NOT EKKO-LLIEF IS INITIAL.
        OLD_LIFNR = EKKO-LIFNR.
        EKKO-LIFNR = EKKO-LLIEF.
        CALL FUNCTION 'MM_ADDRESS_GET'
             EXPORTING  I_EKKO    = EKKO
             IMPORTING  E_NAME1   = NAME1
             EXCEPTIONS OTHERS    = 1.
        AM07M-NAME2 = NAME1.
        EKKO-LIFNR = OLD_LIFNR.
      ENDIF.
      XPSTY = EKPO-KNTTP.
      CASE XPSTY.
        WHEN B.
          XPSTY = XKDE.
        WHEN D.
          XPSTY = XKDE.
        WHEN G.
          XPSTY = XPROJN.
        WHEN O.
          XPSTY = XPROJN.
        WHEN Q.
          XPSTY = XPROJN.
      ENDCASE.
    ENDFORM.
    *----------Bestelltext lesen, wenn Matnr. = 0--------------------------*
    FORM BESTELLTEXT_LESEN.
       CLEAR:   THEADER,
                THEAD,
                DTEXT.
       REFRESH
                DTEXT.
       THEADER-TDID          = 'F01 '.
       THEADER-TDSPRAS       = EKKO-SPRAS.
       THEADER-TDNAME(10)    = MSEG-EBELN.
       THEADER-TDNAME+10(5)  = MSEG-EBELP.
       THEADER-TDOBJECT      = 'EKPO      '.
       CALL FUNCTION 'READ_TEXT'
          EXPORTING ID          = THEADER-TDID
                    LANGUAGE    = THEADER-TDSPRAS
                    NAME        = THEADER-TDNAME
                    OBJECT      = THEADER-TDOBJECT
         IMPORTING  HEADER      = THEAD
         TABLES     LINES       = DTEXT
         EXCEPTIONS ID          = 1
                    LANGUAGE    = 2
                    NAME        = 3
                    NOT_FOUND   = 4
                    OBJECT      = 5.
    ENDFORM.
    *------------Bestellkopf lesen für WE-Version 2.-----------------------*
    FORM BESTELLKOPF_LESEN.
       CLEAR:   THEADER,
                THEAD,
                DKTEXT.
       REFRESH:
                DKTEXT.
       THEADER-TDID           = 'F01 '.
       THEADER-TDSPRAS        = EKKO-SPRAS.
       THEADER-TDNAME(10)     = MSEG-EBELN.
       THEADER-TDOBJECT       = 'EKKO      '.
       CALL FUNCTION 'READ_TEXT'
          EXPORTING ID        = THEADER-TDID
                    LANGUAGE  = THEADER-TDSPRAS
                    NAME      = THEADER-TDNAME
                    OBJECT    = THEADER-TDOBJECT
         IMPORTING  HEADER    = THEAD
         TABLES     LINES     = DKTEXT
         EXCEPTIONS ID        = 1
                    LANGUAGE  = 2
                    NAME      = 3
                    NOT_FOUND = 4
                    OBJECT    = 5.
    ENDFORM.
    INCLUDE /SMB40/M07DRMFA.
    *------ Auftragskopf lesen --------------------------------------------*
    FORM AUFTRAG_LESEN.
      SELECT SINGLE * FROM AFKO WHERE AUFNR = MSEG-AUFNR.
      IF MSEG-MATNR IS INITIAL.
        SELECT SINGLE * FROM AUFK WHERE AUFNR = MSEG-AUFNR.
        IF NOT SY-SUBRC IS INITIAL.
          MESSAGE E001 WITH 'AUFK' MSEG-AUFNR.
        ELSE.
          MABDR-MAKTX = AUFK-KTEXT.
        ENDIF.
      ENDIF.
    ENDFORM.
    INCLUDE /SMB40/M07DRKON.
    FORM KONTIERUNG_LESEN.
       REFRESH XEKKN. CLEAR XEKKN.
       SELECT * FROM EKKN WHERE EBELN = EKPO-EBELN
                          AND   EBELP = EKPO-EBELP.
         MOVE-CORRESPONDING EKKN TO XEKKN.
         APPEND XEKKN.
    *    x_kont = x.
       ENDSELECT.
       DESCRIBE TABLE XEKKN LINES INDEX_Z.
       IF INDEX_Z GT 1.
         X_KONT = X.
       ELSE.
         X_KONT1 = X.
       ENDIF.
    ENDFORM.
    * Network plan process determine.
    FORM NW_VORGANG_LESEN USING F_AUFPL F_APLZL.
      CALL FUNCTION 'READ_NETWORK_NPLNR_VORNR'
           EXPORTING
                APLZL     = F_APLZL
                AUFPL     = F_AUFPL
           IMPORTING
                VORNR     = N_VORNR
           EXCEPTIONS
                NOT_FOUND = 01.
    ENDFORM.
    *       FORM PSP_CONVERT                                               *
    *       Konvertierung des internen Felds PS_PSP_PNR zur Ausgabe        *
    FORM PSP_CONVERT USING PSPNR LIKE MSEG-PS_PSP_PNR.
      CALL FUNCTION 'CJPN_INTERN_TO_EXTERN_CONV'
           EXPORTING
                INT_NUM = PSPNR
           IMPORTING
                EXT_NUM = AM07M-KONTIERUNG.
    ENDFORM.
    INCLUDE /SMB40/M07DRF01.
    FORM WF01_DRUCK.
       CALL FUNCTION 'START_FORM'
          EXPORTING FORM = TNAPR-FONAM
                LANGUAGE = LANGUAGE.
          BELPOS-MBLNR = MKPF-MBLNR.
          BELPOS-ZEILE = MSEG-ZEILE.
          CONDENSE BELPOS NO-GAPS.
          AM07M-BELPOS = BELPOS.
          IF T156-SHKZG = H.
            AM07M-HDLNE = TEXT-020.
          ELSE.
            AM07M-HDLNE = TEXT-010.
          ENDIF.
          IF NOT T159P-BACOD IS INITIAL.
            CALL FUNCTION 'WRITE_FORM'
                 EXPORTING ELEMENT = 'W1BACOKOPF'.
          ELSE.
             CALL FUNCTION 'WRITE_FORM'
                 EXPORTING ELEMENT = 'W1KOPF'.
          ENDIF.
          IF XPSTY       IS INITIAL.
             IF MSEG-XBLVS IS INITIAL.
                PERFORM WF1_LAGERMATERIAL.             "Lagermaterial
             ELSE.
                PERFORM WF1_LVSMATERIAL.               "LVS-Material
             ENDIF.
          ELSE.
             PERFORM WF1_VERBRAUCHSMATERIAL.
          ENDIF.
       CALL FUNCTION 'END_FORM'.
       PERFORM MKTO_DRUCK.
    ENDFORM.
    *------------ Drucken Lagermaterial ---------------------------------*
    FORM WF1_LAGERMATERIAL.
       CALL FUNCTION 'WRITE_FORM'
          EXPORTING ELEMENT = 'W1LGMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUELGGRUND'.
       ENDIF.
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'LGAUSST'.
    ENDFORM.
    FORM WF1_LVSMATERIAL.
       CALL FUNCTION 'WRITE_FORM'
          EXPORTING ELEMENT = 'W1LVSMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUELVSGRUND'.
       ENDIF.
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'LVSAUSST'.
    ENDFORM.
    *-------------Drucken Verbrauchsmaterial------------------------------*
    FORM WF1_VERBRAUCHSMATERIAL.
       CASE XPSTY.
         WHEN XKDANR.                             "Kundenauftrag
           MOVE SPACE TO KUNDE.
           CLEAR AM07M-KOTXT.
           AM07M-KOTXT = TEXT-030.
           KUNDE-KDAUF = MSEG-KDAUF.
           KUNDE-KDPOS = MSEG-KDPOS.
           KUNDE-KDEIN = MSEG-KDEIN.
           MOVE SPACE TO AM07M-KONTIERUNG.
           CONDENSE KUNDE NO-GAPS.
           AM07M-KONTIERUNG = KUNDE.
         WHEN XANLAGE.                            "Anlage
           MOVE SPACE TO ANLAGE.
           CLEAR AM07M-KOTXT.
           AM07M-KOTXT = TEXT-040.
           ANLAGE-ANLN1 = MSEG-ANLN1.
           ANLAGE-ANLN2 = MSEG-ANLN2.
           MOVE SPACE TO AM07M-KONTIERUNG.
           CONDENSE ANLAGE NO-GAPS.
           AM07M-KONTIERUNG = ANLAGE.
         WHEN XKOSTL.                             "Kostenstelle
           CLEAR AM07M-KOTXT.
           AM07M-KOTXT = TEXT-050.
           AM07M-KONTIERUNG = MSEG-KOSTL.
         WHEN XPROJN.                             "Projekt/Netzplan
           CLEAR AM07M-KOTXT.
           IF MSEG-NPLNR IS INITIAL.
             AM07M-KOTXT = TEXT-060.
             PERFORM PSP_CONVERT USING MSEG-PS_PSP_PNR.
           ELSE.
             AM07M-KOTXT = TEXT-061.
             AM07M-KONTIERUNG = MSEG-NPLNR.
             PERFORM NW_VORGANG_LESEN USING MSEG-AUFPL MSEG-APLZL.
             IF NOT N_VORNR IS INITIAL.
               MOVE '/'     TO AM07M-KONTIERUNG+12.
               MOVE N_VORNR TO AM07M-KONTIERUNG+13.
             ENDIF.
           ENDIF.
       ENDCASE.
       CALL FUNCTION 'WRITE_FORM'
         EXPORTING ELEMENT = 'W1VERBRMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUELVERBRGRUND'.
       ENDIF.
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'VERBRAUSST'.
    ENDFORM.
    INCLUDE /SMB40/M07DRF02.
    FORM WF02_DRUCK.
       T001W-WERKS = R_WERKS.
       T001W-NAME1 = R_NAME1.
       CALL FUNCTION 'START_FORM'
            EXPORTING FORM = TNAPR-FONAM
                  LANGUAGE = LANGUAGE.
       PERFORM PRUEFTEXT_LESEN.
          IF T156-SHKZG = 'H'.           "Kennzeichen Haben ?
            AM07M-HDLNE = TEXT-020.
          ELSE.
            AM07M-HDLNE = TEXT-010.
          ENDIF.
          IF NOT T159P-BACOD IS INITIAL.
            BELPOS-MBLNR = MKPF-MBLNR.
            BELPOS-ZEILE = MSEG-ZEILE.
            CONDENSE BELPOS NO-GAPS.
            AM07M-BELPOS = BELPOS.
            CALL FUNCTION 'WRITE_FORM'
                 EXPORTING ELEMENT = 'WE2BACOKOPF'.
          ELSE.
            CALL FUNCTION 'WRITE_FORM'
                 EXPORTING ELEMENT = 'WE2KOPF'.
          ENDIF.
          IF XPSTY       IS INITIAL.        "Lagermaterial ?
             PERFORM W2_LAGERMATERIAL.
          ELSE.
             PERFORM W2_VERBRAUCHSMATERIAL.
          ENDIF.
       CALL FUNCTION 'END_FORM'.
       PERFORM MKTO_DRUCK.
    ENDFORM.
    *-------------- Lagermaterial WE-Version 2 ---------------------------*
    FORM WF2_LAGERMATERIAL.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING ELEMENT = 'WE2LGMAT'.
      IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
        SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                   AND   GRUND = MSEG-GRUND
                                   AND   SPRAS = LANGUAGE.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING ELEMENT = 'RUELGGRUND'.
      ENDIF.
        THEAD-TDID     = THEADER-TDID.
        THEAD-TDNAME   = THEADER-TDNAME.
        THEAD-TDOBJECT = THEADER-TDOBJECT.
        THEAD-TDSPRAS  = THEADER-TDSPRAS.
        CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'PRTXTLGMAT'.
    ENDFORM.
    *------------ Verbrauchsmaterial WE-Version 2 ----------------------*
    FORM WF2_VERBRAUCHSMATERIAL.
        CASE XPSTY.
           WHEN XKDANR.
              MOVE SPACE TO KUNDE.
              CLEAR AM07M-KOTXT.
              AM07M-KOTXT = TEXT-030.
              KUNDE-KDAUF = MSEG-KDAUF.
              KUNDE-KDPOS = MSEG-KDPOS.
              KUNDE-KDEIN = MSEG-KDEIN.
              MOVE SPACE TO AM07M-KONTIERUNG.
              CONDENSE KUNDE NO-GAPS.
              AM07M-KONTIERUNG = KUNDE.
           WHEN XANLAGE.
              MOVE SPACE TO ANLAGE.
              CLEAR AM07M-KOTXT.
              AM07M-KOTXT = TEXT-040.
              ANLAGE-ANLN1 = MSEG-ANLN1.
              ANLAGE-ANLN2 = MSEG-ANLN2.
              MOVE SPACE TO AM07M-KONTIERUNG.
              CONDENSE ANLAGE NO-GAPS.
              AM07M-KONTIERUNG = ANLAGE.
           WHEN XKOSTL.
              CLEAR AM07M-KOTXT.
              AM07M-KOTXT = TEXT-050.
              AM07M-KONTIERUNG = MSEG-KOSTL.
           WHEN XPROJN.
              CLEAR AM07M-KOTXT.
              IF MSEG-NPLNR IS INITIAL.
                AM07M-KOTXT = TEXT-060.
                PERFORM PSP_CONVERT USING MSEG-PS_PSP_PNR.
              ELSE.
                AM07M-KOTXT = TEXT-061.
                AM07M-KONTIERUNG = MSEG-NPLNR.
                PERFORM NW_VORGANG_LESEN USING MSEG-AUFPL MSEG-APLZL.
                IF NOT N_VORNR IS INITIAL.
                  MOVE '/'     TO AM07M-KONTIERUNG+12.
                  MOVE N_VORNR TO AM07M-KONTIERUNG+13.
                ENDIF.
              ENDIF.
        ENDCASE.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING ELEMENT = 'WE2VERBRMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUEVERBRGRUND'.
       ENDIF.
         THEAD-TDID     = THEADER-TDID.
         THEAD-TDNAME   = THEADER-TDNAME.
         THEAD-TDOBJECT = THEADER-TDOBJECT.
         THEAD-TDSPRAS  = THEADER-TDSPRAS.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'PRTXTVERBRMAT'.
    ENDFORM.
    INCLUDE /SMB40/M07DRE01.
    FORM WE01_DRUCK.
       T001W-WERKS = R_WERKS.
       T001W-NAME1 = R_NAME1.
    ENDFORM.
    *------------ Drucken Lagermaterial ---------------------------------*
    FORM W1_LAGERMATERIAL.
       CALL FUNCTION 'WRITE_FORM'
          EXPORTING ELEMENT = 'W1LGMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUELGGRUND'.
       ENDIF.
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'LGAUSST'.
    ENDFORM.
    FORM W1_LVSMATERIAL.
       CALL FUNCTION 'WRITE_FORM'
          EXPORTING ELEMENT = 'W1LVSMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUELVSGRUND'.
       ENDIF.
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'LVSAUSST'.
    ENDFORM.
    *-------------Drucken Verbrauchsmaterial------------------------------*
    FORM W1_VERBRAUCHSMATERIAL.
       CLEAR: AM07M-KOTXT, AM07M-KONTIERUNG.
       CASE XPSTY.
         WHEN XFERT.                            "Fertigungsauftrag
           AM07M-KOTXT = TEXT-062.
           IF X_KONT1 IS INITIAL.
             AM07M-KONTIERUNG = MSEG-AUFNR.
           ELSE.
             AM07M-KONTIERUNG = EKKN-AUFNR.
           ENDIF.
         WHEN XKDE.                             "Kundeneinzelbest.
           MOVE SPACE TO KUNDE.
           AM07M-KOTXT = TEXT-030.
           IF X_KONT1 IS INITIAL.
             KUNDE-KDAUF = MSEG-KDAUF.
             KUNDE-KDPOS = MSEG-KDPOS.
            ELSE.
             KUNDE-KDAUF = EKKN-VBELN.
             KUNDE-KDPOS = EKKN-VBELP.
            ENDIF.
           MOVE SPACE TO AM07M-KONTIERUNG.
           CONDENSE KUNDE NO-GAPS.
           AM07M-KONTIERUNG = KUNDE.
         WHEN XKDANR.                             "Kundenauftrag
           MOVE SPACE TO KUNDE.
           AM07M-KOTXT = TEXT-030.
           IF X_KONT1 IS INITIAL.
             KUNDE-KDAUF = MSEG-KDAUF.
             KUNDE-KDPOS = MSEG-KDPOS.
             KUNDE-KDEIN = MSEG-KDEIN.
            ELSE.
             KUNDE-KDAUF = EKKN-VBELN.
             KUNDE-KDPOS = EKKN-VBELP.
             KUNDE-KDEIN = EKKN-VETEN.
            ENDIF.
           MOVE SPACE TO AM07M-KONTIERUNG.
           CONDENSE KUNDE NO-GAPS.
           AM07M-KONTIERUNG = KUNDE.
         WHEN XANLAGE.                            "Anlage
           MOVE SPACE TO ANLAGE.
           AM07M-KOTXT = TEXT-040.
           IF X_KONT1 IS INITIAL.
             ANLAGE-ANLN1 = MSEG-ANLN1.
             ANLAGE-ANLN2 = MSEG-ANLN2.
           ELSE.
             ANLAGE-ANLN1 = EKKN-ANLN1.
             ANLAGE-ANLN2 = EKKN-ANLN2.
           ENDIF.
           MOVE SPACE TO AM07M-KONTIERUNG.
           CONDENSE ANLAGE NO-GAPS.
           AM07M-KONTIERUNG = ANLAGE.
         WHEN XKOSTL.                             "Kostenstelle
           AM07M-KOTXT = TEXT-050.
           IF X_KONT1 IS INITIAL.
             AM07M-KONTIERUNG = MSEG-KOSTL.
           ELSE.
             AM07M-KONTIERUNG = EKKN-KOSTL.
           ENDIF.
         WHEN XPROJN.                             "Projekt/Netzplan
           IF X_KONT1 IS INITIAL.
             IF MSEG-NPLNR IS INITIAL.
               AM07M-KOTXT = TEXT-060.
               PERFORM PSP_CONVERT USING MSEG-PS_PSP_PNR.
             ELSE.
               AM07M-KOTXT = TEXT-061.
               AM07M-KONTIERUNG = MSEG-NPLNR.
               PERFORM NW_VORGANG_LESEN USING MSEG-AUFPL MSEG-APLZL.
               IF NOT N_VORNR IS INITIAL.
                 MOVE '/'     TO AM07M-KONTIERUNG+12.
                 MOVE N_VORNR TO AM07M-KONTIERUNG+13.
               ENDIF.
             ENDIF.
           ELSE.
             IF EKKN-NPLNR IS INITIAL.
               AM07M-KOTXT = TEXT-060.
               PERFORM PSP_CONVERT USING EKKN-PS_PSP_PNR.
             ELSE.
               AM07M-KOTXT = TEXT-061.
               AM07M-KONTIERUNG = EKKN-NPLNR.
               PERFORM NW_VORGANG_LESEN USING EKKN-AUFPL EKKN-APLZL.
               IF NOT N_VORNR IS INITIAL.
                 MOVE '/'     TO AM07M-KONTIERUNG+12.
                 MOVE N_VORNR TO AM07M-KONTIERUNG+13.
               ENDIF.
             ENDIF.
           ENDIF.
       ENDCASE.
       CLEAR X_KONT1.
    * User-Exit über Erweiterung MBCF0005
       CALL CUSTOMER-FUNCTION '001'
            EXPORTING
                 I_MKPF  = MKPF
                 I_MSEG  = MSEG
                 I_EKKO  = EKKO
                 I_EKPO  = EKPO
                 I_NAST  = NAST
                 I_TNAPR = TNAPR
            TABLES
                 I_EKKN  = XEKKN
            CHANGING
                 C_AM07M = AM07M
            EXCEPTIONS
                 OTHERS  = 0.
       CALL FUNCTION 'WRITE_FORM'
         EXPORTING ELEMENT = 'W1VERBRMAT'.
       IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
         SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                    AND   GRUND = MSEG-GRUND
                                    AND   SPRAS = LANGUAGE.
         CALL FUNCTION 'WRITE_FORM'
              EXPORTING ELEMENT = 'RUELVERBRGRUND'.
       ENDIF.
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING ELEMENT = 'VERBRAUSST'.
    ENDFORM.
    INCLUDE /SMB40/M07DRE02.
    *       FORM WE02_DRUCK                                               *
    FORM WE02_DRUCK.
      T001W-WERKS = R_WERKS.
      T001W-NAME1 = R_NAME1.
      CALL FUNCTION 'START_FORM'
           EXPORTING
                FORM     = TNAPR-FONAM
                LANGUAGE = LANGUAGE.
      PERFORM PRUEFTEXT_LESEN.
      IF NOT MSEG-VFDAT IS INITIAL.
        AM07M-MHTXT = TEXT-105.
      ENDIF.
      IF NOT AM07M-MHDAT IS INITIAL.
        AM07M-MHZTX = TEXT-106.
      ENDIF.
      IF EKKO-BSART = 'UB'.
        AM07M-LITXT = TEXT-101.
        AM07M-LIBZG = EKKO-RESWK.
      ELSE.
        AM07M-LITXT = TEXT-100.
        AM07M-LIBZG = EKKO-LIFNR.
        IF NOT EKKO-LLIEF IS INITIAL.
          AM07M-LIBZ2 = EKKO-LLIEF.
        ELSE.
          AM07M-LIBZ2 = EKKO-LIFNR.
        ENDIF.
      ENDIF.
      IF T156-SHKZG = 'H'.                 "Kennzeichen Haben ?
        AM07M-HDLNE = TEXT-020.
      ELSE.
        AM07M-HDLNE = TEXT-010.
      ENDIF.
      IF NOT T159P-BACOD IS INITIAL.
        BELPOS-MBLNR = MKPF-MBLNR.
        BELPOS-ZEILE = MSEG-ZEILE.
        CONDENSE BELPOS NO-GAPS.
        AM07M-BELPOS = BELPOS.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  ELEMENT = 'WE2BACOKOPF'.
      ELSE.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  ELEMENT = 'WE2KOPF'.
      ENDIF.
      IF XPSTY       IS INITIAL.           "Lagermaterial ?
    * User-Exit über Erweiterung MBCF0005
        CALL CUSTOMER-FUNCTION '001'
             EXPORTING
                  I_MKPF  = MKPF
                  I_MSEG  = MSEG
                  I_EKKO  = EKKO
                  I_EKPO  = EKPO
                  I_NAST  = NAST
                  I_TNAPR = TNAPR
             TABLES
                  I_EKKN  = XEKKN
             CHANGING
                  C_AM07M = AM07M
             EXCEPTIONS
                  OTHERS  = 0.
        IF MSEG-XBLVS IS INITIAL.
           PERFORM W2_LAGERMATERIAL.             "Lagermaterial
        ELSE.
           PERFORM W2_LVSMATERIAL.               "LVS-Material
        ENDIF.
      ELSE.
        PERFORM W2_VERBRAUCHSMATERIAL.
      ENDIF.
      CALL FUNCTION 'END_FORM'.
      PERFORM MKTO_DRUCK.
    ENDFORM.
    *-------------- Lagermaterial WE-Version 2 ---------------------------*
    FORM W2_LAGERMATERIAL.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'WE2LGMAT'.
      IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
        SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                   AND   GRUND = MSEG-GRUND
                                   AND   SPRAS = LANGUAGE.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  ELEMENT = 'RUELGGRUND'.
      ENDIF.
      THEAD-TDID     = THEADER-TDID.
      THEAD-TDNAME   = THEADER-TDNAME.
      THEAD-TDOBJECT = THEADER-TDOBJECT.
      THEAD-TDSPRAS  = THEADER-TDSPRAS.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'PRTXTLGMAT'.
    ENDFORM.
    *-------------- LVS-Daten     WE-Version 2 ---------------------------*
    FORM W2_LVSMATERIAL.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'W1LVSMAT'.
      IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
        SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                   AND   GRUND = MSEG-GRUND
                                   AND   SPRAS = LANGUAGE.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  ELEMENT = 'RUELVSGRUND'.
      ENDIF.
      THEAD-TDID     = THEADER-TDID.
      THEAD-TDNAME   = THEADER-TDNAME.
      THEAD-TDOBJECT = THEADER-TDOBJECT.
      THEAD-TDSPRAS  = THEADER-TDSPRAS.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'PRTXTLVSMAT'.
    ENDFORM.
    *------------ Verbrauchsmaterial WE-Version 2 ----------------------*
    FORM W2_VERBRAUCHSMATERIAL.
      CLEAR: AM07M-KOTXT, AM07M-KONTIERUNG.
      CASE XPSTY.
        WHEN XFERT.                        "Fertigungsauftrag
          AM07M-KOTXT = TEXT-062.
          IF X_KONT1 IS INITIAL.
            AM07M-KONTIERUNG = MSEG-AUFNR.
          ELSE.
            AM07M-KONTIERUNG = EKKN-AUFNR.
          ENDIF.
        WHEN XKDE.
          MOVE SPACE TO KUNDE.
          AM07M-KOTXT = TEXT-030.
          IF X_KONT1 IS INITIAL.
            KUNDE-KDAUF = MSEG-KDAUF.
            KUNDE-KDPOS = MSEG-KDPOS.
          ELSE.
            KUNDE-KDAUF = EKKN-VBELN.
            KUNDE-KDPOS = EKKN-VBELP.
          ENDIF.
          MOVE SPACE TO AM07M-KONTIERUNG.
          CONDENSE KUNDE NO-GAPS.
          AM07M-KONTIERUNG = KUNDE.
        WHEN XKDANR.
          MOVE SPACE TO KUNDE.
          AM07M-KOTXT = TEXT-030.
          IF X_KONT1 IS INITIAL.
            KUNDE-KDAUF = MSEG-KDAUF.
            KUNDE-KDPOS = MSEG-KDPOS.
            KUNDE-KDEIN = MSEG-KDEIN.
          ELSE.
            KUNDE-KDAUF = EKKN-VBELN.
            KUNDE-KDPOS = EKKN-VBELP.
            KUNDE-KDEIN = EKKN-VETEN.
          ENDIF.
          MOVE SPACE TO AM07M-KONTIERUNG.
          CONDENSE KUNDE NO-GAPS.
          AM07M-KONTIERUNG = KUNDE.
        WHEN XANLAGE.
          MOVE SPACE TO ANLAGE.
          AM07M-KOTXT = TEXT-040.
          IF X_KONT1 IS INITIAL.
            ANLAGE-ANLN1 = MSEG-ANLN1.
            ANLAGE-ANLN2 = MSEG-ANLN2.
          ELSE.
            ANLAGE-ANLN1 = EKKN-ANLN1.
            ANLAGE-ANLN2 = EKKN-ANLN2.
          ENDIF.
          MOVE SPACE TO AM07M-KONTIERUNG.
          CONDENSE ANLAGE NO-GAPS.
          AM07M-KONTIERUNG = ANLAGE.
        WHEN XKOSTL.
          AM07M-KOTXT = TEXT-050.
          IF X_KONT1 IS INITIAL.
            AM07M-KONTIERUNG = MSEG-KOSTL.
          ELSE.
            AM07M-KONTIERUNG = EKKN-KOSTL.
          ENDIF.
        WHEN XPROJN.
          IF X_KONT1 IS INITIAL.
            IF MSEG-NPLNR IS INITIAL.
              AM07M-KOTXT = TEXT-060.
              PERFORM PSP_CONVERT USING MSEG-PS_PSP_PNR.
            ELSE.
              AM07M-KOTXT = TEXT-061.
              AM07M-KONTIERUNG = MSEG-NPLNR.
              PERFORM NW_VORGANG_LESEN USING MSEG-AUFPL MSEG-APLZL.
              IF NOT N_VORNR IS INITIAL.
                MOVE '/'     TO AM07M-KONTIERUNG+12.
                MOVE N_VORNR TO AM07M-KONTIERUNG+13.
              ENDIF.
            ENDIF.
          ELSE.
            IF EKKN-NPLNR IS INITIAL.
              AM07M-KOTXT = TEXT-060.
              PERFORM PSP_CONVERT USING EKKN-PS_PSP_PNR.
            ELSE.
              AM07M-KOTXT = TEXT-061.
              AM07M-KONTIERUNG = EKKN-NPLNR.
              PERFORM NW_VORGANG_LESEN USING EKKN-AUFPL EKKN-APLZL.
              IF NOT N_VORNR IS INITIAL.
                MOVE '/'     TO AM07M-KONTIERUNG+12.
                MOVE N_VORNR TO AM07M-KONTIERUNG+13.
              ENDIF.
            ENDIF.
          ENDIF.
      ENDCASE.
      CLEAR X_KONT1.
    * User-Exit über Erweiterung MBCF0005
      CALL CUSTOMER-FUNCTION '001'
           EXPORTING
                I_MKPF  = MKPF
                I_MSEG  = MSEG
                I_EKKO  = EKKO
                I_EKPO  = EKPO
                I_NAST  = NAST
                I_TNAPR = TNAPR
           TABLES
                I_EKKN  = XEKKN
           CHANGING
                C_AM07M = AM07M
           EXCEPTIONS
                OTHERS  = 0.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'WE2VERBRMAT'.
      IF T156-SHKZG = H AND
        NOT MSEG-GRUND IS INITIAL.
        SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                   AND   GRUND = MSEG-GRUND
                                   AND   SPRAS = LANGUAGE.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  ELEMENT = 'RUEVERBRGRUND'.
      ENDIF.
      THEAD-TDID     = THEADER-TDID.
      THEAD-TDNAME   = THEADER-TDNAME.
      THEAD-TDOBJECT = THEADER-TDOBJECT.
      THEAD-TDSPRAS  = THEADER-TDSPRAS.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'PRTXTVERBRMAT'.
    ENDFORM.
    INCLUDE /SMB40/M07DRE03.
    *       FORM WE03_AUSGABE                                             *
    FORM WE03_AUSGABE using lgortsplit.
    *----------------Drucken WE-Version 3 Überschrift---------------------*
      if lgortsplit is initial.
         ON CHANGE OF MKPF-MBLNR OR MSEG-EBELN OR MSEG-BWART
                                 OR NAST-KSCHL OR MSEG-WERKS.
         CLEAR XKOPFDR.
         endon.
      else.
         ON CHANGE OF MKPF-MBLNR OR MSEG-EBELN OR MSEG-BWART
                                 OR NAST-KSCHL OR MSEG-WERKS
                                 OR MSEG-LGORT.
         CLEAR XKOPFDR.
         endon.
      endif.
      IF XKOPFDR IS INITIAL.
        XKOPFDR = X.
        IF NEW_PAGE = X.
          CALL FUNCTION 'CONTROL_FORM'
               EXPORTING
                    COMMAND = 'NEW-PAGE'.
        ENDIF.
        IF EKKO-BSART = 'UB'.
          AM07M-LITXT = TEXT-101.
          AM07M-LIBZG = EKKO-RESWK.
        ELSE.
          AM07M-LITXT = TEXT-100.
          AM07M-LIBZG = EKKO-LIFNR.
          IF NOT EKKO-LLIEF IS INITIAL.
            AM07M-LIBZ2 = EKKO-LLIEF.
          ELSE.
            AM07M-LIBZ2 = EKKO-LIFNR.
          ENDIF.
        ENDIF.
        IF T156-SHKZG = H.
          AM07M-HDLNE = TEXT-020.
        ELSE.
          AM07M-HDLNE = TEXT-010.
        ENDIF.
        IF XPSTY       IS INITIAL.         "Lagermaterial ?
          IF MSEG-XBLVS IS INITIAL.
            IF T156-SHKZG = H AND
               NOT MSEG-GRUND IS INITIAL.
              IF NOT T159P-BACOD IS INITIAL.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3BACOKOPF'
                          WINDOW  = 'RÜKOPF'.
                NEW_PAGE = X.
              ELSE.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3KOPF'
                          WINDOW  = 'RÜKOPF'.
                NEW_PAGE = X.
              ENDIF.
            ELSE.
              IF NOT T159P-BACOD IS INITIAL.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3BACOKOPF'
                          WINDOW  = 'KOPF'.
                NEW_PAGE = X.
              ELSE.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3KOPF'
                          WINDOW  = 'KOPF'.
                NEW_PAGE = X.
              ENDIF.
            ENDIF.
          ELSE.
            IF T156-SHKZG = H AND
               NOT MSEG-GRUND IS INITIAL.
              IF NOT T159P-BACOD IS INITIAL.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3BACOLVSKOPF'
                          WINDOW  = 'RÜKOPF'.
                NEW_PAGE = X.
              ELSE.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3LVSKOPF'  "RL-Material
                          WINDOW  = 'RÜKOPF'.
                NEW_PAGE = X.
              ENDIF.
            ELSE.
              IF NOT T159P-BACOD IS INITIAL.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3BACOLVSKOPF'
                          WINDOW  = 'KOPF'.
                NEW_PAGE = X.
              ELSE.
                CALL FUNCTION 'WRITE_FORM'
                     EXPORTING
                          ELEMENT = 'WE3LVSKOPF'  "RL-Material
                          WINDOW  = 'KOPF'.
                NEW_PAGE = X.
              ENDIF.
            ENDIF.
          ENDIF.
        ELSE.
          IF T156-SHKZG = H AND
             NOT MSEG-GRUND IS INITIAL.
            IF NOT T159P-BACOD IS INITIAL.
              CALL FUNCTION 'WRITE_FORM'
                   EXPORTING
                        ELEMENT = 'WE3BACOKOPF1'
                        WINDOW  = 'RÜKOPF'.
              NEW_PAGE = X.
            ELSE.
              CALL FUNCTION 'WRITE_FORM'
                   EXPORTING
                        ELEMENT = 'WE3KOPF1'
                        WINDOW  = 'RÜKOPF'.
              NEW_PAGE = X.
            ENDIF.
          ELSE.
            IF NOT T159P-BACOD IS INITIAL.
              CALL FUNCTION 'WRITE_FORM'
                   EXPORTING
                        ELEMENT = 'WE3BACOKOPF1'
                        WINDOW  = 'KOPF'.
              NEW_PAGE = X.
            ELSE.
              CALL FUNCTION 'WRITE_FORM'
                   EXPORTING
                        ELEMENT = 'WE3KOPF1'
                        WINDOW  = 'KOPF'.
              NEW_PAGE = X.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    *------------- Drucken WE-Version 3 Position --------------------------*
    **perform w3_lieferplan.                  "Routine Lieferplan
      CLEAR T157E.
      IF T156-SHKZG = H AND
         NOT MSEG-GRUND IS INITIAL.
        SELECT SINGLE * FROM T157E WHERE BWART = MSEG-BWART
                                   AND   GRUND = MSEG-GRUND
                                   AND   SPRAS = LANGUAGE.
      ENDIF.
      IF MSEG-EBELN IS INITIAL.
        IF NOT MABDR-MAKTX IS INITIAL.
          EKPO-TXZ01 = MABDR-MAKTX.
        ENDIF.
      ENDIF.
      IF MABDR-WERTU IS INITIAL AND
         MABDR-MENGU = X   OR              "Bestandsfuehrung = UNBW oder
         XPSTY       IS INITIAL.           "Lagermaterial ?
    * User-Exit über Erweiterung MBCF0005
        CALL CUSTOMER-FUNCTION '001'
             EXPORTING
                  I_MKPF  = MKPF
                  I_MSEG  = MSEG
                  I_EKKO  = EKKO
                  I_EKPO  = EKPO
                  I_NAST  = NAST
                  I_TNAPR = TNAPR
             TABLES
                  I_EKKN  = XEKKN
             CHANGING
                  C_AM07M = AM07M
             EXCEPTIONS
                  OTHERS  = 0.
        IF MSEG-XBLVS IS INITIAL.
          PERFORM W3_LAGERMATERIAL.        "Routine Lagermaterial
        ELSE.
          PERFORM W3_LVSMATERIAL.          "Routine RL-Material
        ENDIF.
      ELSE.
        PERFORM W3_VERBRAUCHSMATERIAL.     "Routine Verbrauchsmaterial
      ENDIF.
    *-------------- Drucken WE-Version 3 Seitenfuss ----------------------*
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT  = 'WE3FUSS'
                WINDOW   = 'FUSS'
                FUNCTION = 'APPEND'.
    ENDFORM.
    *--------------Unteroutinen für Positionsdruck -----------------------*
    FORM W3_LAGERMATERIAL.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'WE3LGMAT'.
    ENDFORM.
    *       FORM W3_LVSMATERIAL                                           *
    FORM W3_LVSMATERIAL.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'WE3LVSMAT'.
    ENDFORM.
    *       FORM W3_VERBRAUCHSMATERIAL                                    *
    FORM W3_VERBRAUCHSMATERIAL.
      CLEAR: AM07M-KONTIERUNG.
      AM07M-RSTYP = XPSTY.
      CASE XPSTY.
        WHEN XFERT.                        "Fertigungsauftrag
          IF X_KONT1 IS INITIAL.
            AM07M-KONTIERUNG = MSEG-AUFNR.
          ELSE.
            AM07M-KONTIERUNG = EKKN-AUFNR.
          ENDIF.
        WHEN XANLAGE.
          MOVE SPACE TO ANLAGE.
          IF X_KONT1 IS INITIAL.
            ANLAGE-ANLN1 = MSEG-ANLN1.
            ANLAGE-ANLN2 = MSEG-ANLN2.
          ELSE.
            ANLAGE-ANLN1 = EKKN-ANLN1.
            ANLAGE-ANLN2 = EKKN-ANLN2.
          ENDIF.
          MOVE SPACE TO AM07M-KONTIERUNG.
          CONDENSE ANLAGE NO-GAPS.
          AM07M-KONTIERUNG = ANLAGE.
        WHEN   XKDE.                     "Kundeneinzelbestand?
          MOVE SPACE TO KUNDE.
          IF X_KONT1 IS INITIAL.
            KUNDE-KDAUF = MSEG-KDAUF.
            KUNDE-KDPOS = MSEG-KDPOS.
          ELSE.
            KUNDE-KDAUF = EKKN-VBELN.
            KUNDE-KDPOS = EKKN-VBELP.
          ENDIF.
          MOVE SPACE TO AM07M-KONTIERUNG.
          CONDENSE KUNDE NO-GAPS.
          AM07M-KONTIERUNG = KUNDE.
        WHEN   XKDANR.                     "Kundenauftrag ?
          MOVE SPACE TO KUNDE.
          IF X_KONT1 IS INITIAL.
            KUNDE-KDAUF = MSEG-KDAUF.
            KUNDE-KDPOS = MSEG-KDPOS.
            KUNDE-KDEIN = MSEG-KDEIN.
          ELSE.
            KUNDE-KDAUF = EKKN-VBELN.
            KUNDE-KDPOS = EKKN-VBELP.
            KUNDE-KDEIN = EKKN-VETEN.
          ENDIF.
          MOVE SPACE TO AM07M-KONTIERUNG.
          CONDENSE KUNDE NO-GAPS.
          AM07M-KONTIERUNG = KUNDE.
        WHEN   XKOSTL.                     "auf Kostenstelle kontiert
          IF X_KONT1 IS INITIAL.
            AM07M-KONTIERUNG = MSEG-KOSTL.
          ELSE.
            AM07M-KONTIERUNG = EKKN-KOSTL.
          ENDIF.
        WHEN   XPROJN.                     "auf Projekt/Netzplan
          IF X_KONT1 IS INITIAL.
            IF MSEG-NPLNR IS INITIAL.
              PERFORM PSP_CONVERT USING MSEG-PS_PSP_PNR.
            ELSE.
              AM07M-KONTIERUNG = MSEG-NPLNR.
              PERFORM NW_VORGANG_LESEN USING MSEG-AUFPL MSEG-APLZL.
              IF NOT N_VORNR IS INITIAL.
                MOVE '/'     TO AM07M-KONTIERUNG+12.
                MOVE N_VORNR TO AM07M-KONTIERUNG+13.
              ENDIF.
            ENDIF.
          ELSE.
            IF EKKN-NPLNR IS INITIAL.
              PERFORM PSP_CONVERT USING EKKN-PS_PSP_PNR.
            ELSE.
              AM07M-KONTIERUNG = EKKN-NPLNR.
              PERFORM NW_VORGANG_LESEN USING EKKN-AUFPL EKKN-APLZL.
              IF NOT N_VORNR IS INITIAL.
      

Maybe you are looking for

  • How to upload site created with Dreamweaver via FTP to the iWEB server?

    Hi everyone, I recently created a site on Dreamweaver and want to upload the site, via FTP to the iWEB server. My questions are the following: 1. What is the FTP host address? 2. How do I connect to my website via FTP? Any help on the following quest

  • Print presenter notes under slides...multiple slides on page

    Somehow, I was able to print out 6 slides to a page with the presenter notes underneath each slide, at work. Now, at home, I cannot recreate that. Adding presenter notes to the "Handouts" option results in too many pages and checking the presenter no

  • The exposed service is in the right lane in BPEL converted from JPD

    Hi, Now I'm working on a project that requires using Fusion to replace the old WLI. My major job is to convert JPD code in WLI to BPEL in fusion. (The JPD code was developed based on Weblogic Integration 8.1 ) I use a plugin for WebLogic Workshop 8.1

  • Flash Player repeatedly downloads to Chrome even though installed.

    Windows 7 Home Premium 64 bit Flash player 11.6.202.171 Chrome:  25.0.1364.152 m Flash updater asked if I wanted to install update. I said yes. It installed Flash + McAfee. I do not want McAfee. I have Norton. I uninstalled McAfee. Every time I close

  • Leopard Default User Template

    Hi, I used to be able to create a customised default user template in Tiger by copying my customised account to the /System/Library/User\ Template/English.lproj folder. In leopard however new accounts are not getting the customised settings. My metho