NAST contents in printing program

Hi,
I'm having problems in a printing program associated to an output type of the billing document. The functional team has customized the printing program, the entry form and the sapscript form but in the printing program i'm reading the billing document number from NAST-OBJKY but it seams that NAST-OBJKY has no value. Does anyone had already this problem and knows how to solve it ? Does anyone know if it's necessary to do some aditional customizing in order to have access to the contents of NAST ? Does anyone knows if any procedure is necessary in the printing program in order to have access to NAST contents ( something like the way the printing program is strucured ) ?
Thanks,
Paulo Sousa

Hi,
The problem was i filled options parameter in OPEN_FORM function module and i've forgot to fill the field ITCPO-TDPROGRAM.
Thank you anyway, i'll close this message.
Best regards,
Paulo Sousa

Similar Messages

  • Contents of a custom print program for a custom smartform

    Hi...
    Can you please tell me if we are writing a custom print program from scratch for a custom smartform for which there is no standard form available what are all the things that need to be coded in the print program..
    My doubts on this are if we are configuring this form for output types of PO purchase order for mediums 1,2, 5 and 6 does any extra coding need to be done in the print program that is related to these mediums or is it just a configuration issue..
    Apart from data retrieval part and call the function modules to send the data to smartforms what are the other things that we need to code in a custom smartform..  Anything that we need to code related to printing issues..
    It would be great if someone can post a custom print program for any output type valid for mediums 1, 2, 5 and 6.
    Also my last doubt is do we need to do anything in SE11 in designing a smartform and in what context do we need it...
    Thanks and appreciate your help... Surely will reward for all the helpful answers..
    Thanks again..
    Kanthi..

    Hi,
    yes you need to create your own print program. You need to catch printing information and to send data to your smartforms.
    To send data to your smartforms you need to use structure describe in the data dictionnary.
    This is a peace of code for sending information to a smartform that will be print used an external program (Esker)
      DATA: it_data       LIKE TABLE OF zssf_bl WITH HEADER LINE,
            w_formname TYPE tdsfname ,
            w_fm_name  TYPE rs38l_fnam ,
            is_output  TYPE ssfcompop ,
            is_control TYPE ssfctrlop ,
            is_job_out TYPE ssfcresop .
    *  Récupère le nom du module fonction.
      MOVE 'Z_BL_STT' TO w_formname.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = w_formname
        IMPORTING
          fm_name                  = w_fm_name
        EXCEPTIONS
          OTHERS                   = 3.
    * Prépare les paramètres d'impression.
      is_output-xsfcmode   = 'X'.
      is_output-xsf        = 'X'.
      is_output-xsfoutmode = 'S'.
      is_output-xsfoutdev  = 'DOCL'.
      is_output-xsfformat  = 'X'.
      is_output-tdnoprev   = 'X'.
      is_output-tdnoprint  = ' '.
      is_output-tddest     = 'DOCL'.
      is_output-tdprinter  = 'PLAIN'.
      is_output-tdnewid    = 'X'.
      is_output-tdimmed    = 'X'.
      is_output-tddelete   = 'X'.
      is_control-no_dialog = 'X'.
      is_control-preview   = ' '.
      is_control-no_open   = 'X'.
      is_control-no_close  = ' '.
    * Prepare le formulaire
      CALL FUNCTION 'SSF_OPEN'
        EXPORTING
          user_settings      = ' '
          output_options     = is_output
          control_parameters = is_control
        IMPORTING
          job_output_options = is_job_out
        EXCEPTIONS
          OTHERS             = 5.
    * Appels du formulaire.
      CALL FUNCTION w_fm_name
        EXPORTING
          control_parameters = is_control
          output_options     = is_output
          is_bl              = zbl_soustrait
        TABLES
          it_data            = it_data
        EXCEPTIONS
          OTHERS             = 5.
    You need to catch information from the NAST table maybe
    Rgd
    Frédéric

  • How to use NAST entry inside a printing program.

    Hi,
         I am writing a program to print an invoice using smartform.
    I am refering NAST-OBJKY to get the invoice No.
    My program throwing syntax error that NAST-OBJKY is unknown.
    But if I copy a standard printing program, and use it different name, there is no error.
    Thank U for Ur time.
    Cheers,
    Sam

    hi
    u r using the correct on but first movethe value to another varable like
    VBRK-VBELN
    USE THIS INCLUDE IN U R PROGRAM <b>RVADTABL</b>
    SAM the reason for u r problem is NAST is not declared in u r program... but in the sandard program they have declared it in the include RVADTABL
    Message was edited by:
            Naresh Reddy

  • Detect print program name from within Sapscript. Is this possible?.

    We have a situation whereby for the single and group delivery we have two print programs printing to one Sapscript form. This is exactly what we need, with one exception being the title. What I would like to do is detect the print program and change the title accordingly. Does anyone know if this is possible?.
    regards
    Jason

    Hi Jason,
    hhhmm, the obvious answer sy-repid is of course bogus, because that would contain the program from the SAPscript environment. I wonder though if sy-cprog is of any use - probably not, but was too lazy to test this...
    In general though I'd recommend though to use some better marker than program name. E.g. don't you have any existing global field that can be used (e.g. are you using the same delivery type, same output type, ...)? If you don't have one, maybe you should consider putting a global variable in both print programs that you fill to indicate which type you're processing.
    In theory you could of course determine the program name, even from SAPscript, with the help of a ABAP form routine that evaluates the call stack and returns the program name of the print program. Or you could evaluate TNAPR as suggested by the previous poster, but I'm not sure if that's available by default (like the NAST record); I thought not, but my memory might serve me wrong. If not, I'd personally go with the markup variable (ideally existing content, if not available new one) as this seems the cleaner approach.
    Cheers, harald

  • Runtime error in print program of a smartform

    Hi,
    While trying to execute the print program of a smartform I am getting the following runtime error.
    The reason for the exception is:
    The call to the function module "/1BCDWB/SF00000288" is incorrect:
    In the function module interface, you can specify only
    fields of a specific type and length under "IT_BOOKINGS".
    Although the currently specified field
    "IT_BOOKINGS" is the correct type, its length is incorrect.
    In the form interface of the smartform under tables parameters I have declared like this.
    IT_BOOKINGS      LIKE      SBOOK
    IT_SCHEDULE      LIKE      SPFLI
    Can anyone tell me why do we get this error?
    Regards,
    Hema

    Hello,
    program to call smartform is really simple :
    -> function SSF_FUNCTION_MODULE_NAME give you the name of the function link to your sapscript.
    -> function WFMC_PREPARE_SMART_FORM help your to prepare your options to your smartform.
    -> function xxx  to call your smartform (find with the first function).
    Sometimes you have to play with values of NAST (for ex) to find the language (set in control_parameters) or for example if you want to print without display (when it ask you for print / print preview  and the name of the print device) .....
    Frédéric

  • Purchase order print program error

    hi experts!
    am facing a problem in my purchase order print program. the problem is that when i am trying to see the print preview the following dump error is throughing, which am not able to understand.
    the P.O total amount should be change into words( like one million then thousand thirty three kuwait dinars)
    but the total amount is not converting into as mentioned, instead the dump is encountered.
    please give me solution,
    thnaks
    *DUMP*
    Runtime Errors         CONVT_NO_NUMBER                                                             
    Exception                CX_SY_CONVERSION_NO_NUMBER                                                  
    Date and Time          05.05.2008 19:04:43                                                         
    Short text                                                                               
    Unable to interpret "1760,778.71 " as a number.                                               
    What happened?                                                                               
    Error in the ABAP Application Program                                                                               
    The current ABAP program "ZMM_SUBROUTINES" had to be terminated because it has                
        come across a statement that unfortunately cannot be executed.                                
    What can you do?                                                                               
    Note down which actions and inputs caused the error.                                                                               
    To process the problem further, contact you SAP system                                        
        administrator.                                                                               
    Using Transaction ST22 for ABAP Dump Analysis, you can look                                   
        at and manage termination messages, and you can also                                          
        keep them for a long time.                                                                    
    Error analysis                                                                               
    An exception occurred that is explained in detail below.                                      
        The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not               
         caught in                                                                               
    procedure "GET_AMT_IN_WORDS" "(FORM)", nor was it propagated by a RAISING                     
         clause.                                                                               
    Since the caller of the procedure could not have anticipated that the                         
        exception would occur, the current program is terminated.                                     
        The reason for the exception is:                                                              
        The program attempted to interpret the value "1760,778.71 " as a number, but                  
        since the value contravenes the rules for correct number formats,                             
        this was not possible.                                                                        
    How to correct the error                                                                               
    Whole numbers are represented in ABAP as a sequence of numbers, possibly                      
         with an algebraic sign.                                                                      
        The following are the possibilities for the representation of floating                        
        point numbers:                                                                               
    [algebraic sign][mantissa]E[algebraic sign][exponent]                                       
          [algebraic sign][whole number part].[fraction part]                                         
        For example, -12E+34, +12E-34, 12E34, 12.34                                                   
        If the error occurred in your own ABAP program or in an SAP                                   
        program you modified, try to remove the error.                                                                               
    If the error occures in a non-modified SAP program, you may be able to                        
        find an interim solution in an SAP Note.                                                      
        If you have access to SAP Notes, carry out a search with the following                        
        keywords:                                                                               
    "CONVT_NO_NUMBER" "CX_SY_CONVERSION_NO_NUMBER"                                                
        "ZMM_SUBROUTINES" or "ZMM_SUBROUTINES"                                                        
        "GET_AMT_IN_WORDS"                                                                               
    If you cannot solve the problem yourself and want to send an error                            
        notification to SAP, include the following information:                                                                               
    1. The description of the current problem (short dump)                                                                               
    To save the description, choose "System->List->Save->Local File                            
        (Unconverted)".                                                                               
    2. Corresponding system log                                                                               
    Display the system log by calling transaction SM21.                                        
           Restrict the time interval to 10 minutes before and five minutes                           
        after the short dump. Then choose "System->List->Save->Local File                             
        (Unconverted)".                                                                               
    3. If the problem occurs in a problem of your own or a modified SAP                           
        program: The source code of the program                                                       
           In the editor, choose "Utilities->More                                                     
        Utilities->Upload/Download->Download".                                                                               
    4. Details about the conditions under which the error occurred or which                       
        actions and input led to the error.                                                                               
    The exception must either be prevented, caught within proedure                                
        "GET_AMT_IN_WORDS" "(FORM)", or its possible occurrence must be declared in the               
        RAISING clause of the procedure.                                                              
        To prevent the exception, note the following:                                                 
    System environment                                                                               
    SAP-Release 700                                                                               
    Application server... "EHPAP1"                                                                
        Network address...... "10.100.150.103"                                                        
        Operating system..... "AIX"                                                                   
        Release.............. "5.3"                                                                   
        Hardware type........ "00C3B3F04C00"                                                          
        Character length.... 16 Bits                                                                  
        Pointer length....... 64 Bits                                                                 
        Work process number.. 1                                                                       
        Shortdump setting.... "full"                                                                               
    Database server... "EHPDB"                                                                    
        Database type..... "DB6"                                                                      
        Database name..... "EHP"                                                                      
        Database user ID.. "SAPEHP"                                                                               
    Char.set.... "C"                                                                               
    SAP kernel....... 700                                                                         
        created (date)... "Mar 19 2007 20:40:49"                                                      
        create on........ "AIX 2 5 005DD9CD4C00"                                                      
        Database version. "DB6_81 "                                                                               
    Patch level. 102                                                                               
    Patch text.. " "                                                                               
    Database............. "DB6 08.02., DB6 09."                                                 
        SAP database version. 700                                                                     
        Operating system..... "AIX 1 5, AIX 2 5, AIX 3 5"                                                                               
    Memory consumption                                                                               
    Roll.... 16192                                                                               
    EM...... 29328936                                                                               
    Heap.... 0                                                                               
    Page.... 1359872                                                                               
    MM Used. 19180992                                                                               
    MM Free. 1764848                                                                               
    User and Transaction                                                                               
    Client.............. 400                                                                      
        User................ "FADISULAIMAN"                                                           
        Language key........ "E"                                                                      
        Transaction......... "ME22N "                                                                 
        Program............. "ZMM_SUBROUTINES"                                                        
        Screen.............. "SAPLMEGUI 0014"                                                         
        Screen line......... 22                                                                       
    Information on where terminated                                                                   
        Termination occurred in the ABAP program "ZMM_SUBROUTINES" - in                               
         "GET_AMT_IN_WORDS".                                                                               
    The main program was "RM_MEPO_GUI ".                                                                               
    In the source code you have the termination point in line 398                                 
        of the (Include) program "ZMM_SUBROUTINES".                                                   
        The termination is caused because exception "CX_SY_CONVERSION_NO_NUMBER"                      
         occurred in                                                                               
    procedure "GET_AMT_IN_WORDS" "(FORM)", but it was neither handled locally nor                 
         declared                                                                               
    in the RAISING clause of its signature.                                                                               
    The procedure is in program "ZMM_SUBROUTINES "; its source code begins in line                
        358 of the (Include program "ZMM_SUBROUTINES ".                                               
    Source Code Extract                                                                               
    Line  SourceCde                                                                               
    368   DATA: lt_spell LIKE spell.                                                                
      369                                                                               
    370   READ TABLE in_tab WITH KEY 'CURR'.                                                        
      371   IF sy-subrc = 0.                                                                          
      372     lf_curr = in_tab-value.                                                                 
      373   ENDIF.                                                                               
    374                                                                               
    375   READ TABLE in_tab WITH KEY 'NETWR'.                                                       
      376   IF sy-subrc = 0.                                                                          
      377     lf_netpr_01 = in_tab-value.                                                             
      378     REPLACE ',' IN lf_netpr_01 WITH ' '.                                                    
      379     CONDENSE lf_netpr_01 NO-GAPS.                                                           
      380                                                                               
    381     IF lf_curr = 'KWD'.                                                                     
      382       lf_netpr_kwd = lf_netpr_01.                                                           
      383                                                                               
    384       CALL FUNCTION 'SPELL_AMOUNT'                                                          
      385         EXPORTING                                                                           
      386           amount    = lf_netpr_kwd                                                          
      387           currency  = lf_curr                                                               
      388           filler    = ''                                                                    
      389           language  = sy-langu                                                              
      390         IMPORTING                                                                           
      391           in_words  = lt_spell                                                              
      392         EXCEPTIONS                                                                          
      393           not_found = 1                                                                     
      394           too_large = 2                                                                     
      395           OTHERS    = 3.                                                                    
      396                                                                               
    397     ELSE.                                                                               
    >>>>>       lf_netpr = lf_netpr_01.                                                               
      399       CALL FUNCTION 'SPELL_AMOUNT'                                                          
      400         EXPORTING                                                                           
      401           amount    = lf_netpr                                                              
      402           currency  = lf_curr                                                               
      403           filler    = ''                                                                    
      404           language  = sy-langu                                                              
      405         IMPORTING                                                                           
      406           in_words  = lt_spell                                                              
      407         EXCEPTIONS                                                                          
      408           not_found = 1                                                                     
      409           too_large = 2                                                                     
      410           OTHERS    = 3.                                                                    
      411     ENDIF.                                                                               
    412     IF sy-subrc <> 0.                                                                       
      413 *          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO                                
      414 *          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.                                        
      415                                                                               
    416     ELSE.                                                                               
    417                                                                               
    Contents of system fields                                                                         
    Name     Val.                                                                               
    SY-SUBRC 0                                                                               
    SY-INDEX 17                                                                               
    SY-TABIX 1                                                                               
    SY-DBCNT 18                                                                               
    SY-FDPOS 1                                                                               
    SY-LSIND 0                                                                               
    SY-PAGNO 0                                                                               
    SY-LINNO 1                                                                               
    SY-COLNO 1                                                                               
    SY-PFKEY NORMAL                                                                               
    SY-UCOMM PREVOUTPUT                                                                               
    SY-TITLE Held Imp. Pur. O r - ESG 5000000021 Created by Fadi Sulaiman                             
    SY-MSGTY A                                                                               
    SY-MSGID TD                                                                               
    SY-MSGNO 426                                                                               
    SY-MSGV1 NEXTPAGE                                                                               
    SY-MSGV2 ZMEDRUCK_PO                                                                               
    SY-MSGV3                                                                               
    SY-MSGV4                                                                               
    SY-MODNO 0                                                                               
    SY-DATUM 20080505                                                                               
    SY-UZEIT 190441                                                                               
    SY-XPROG SAPCNVE                                                                               
    SY-XFORM CONVERSION_EXIT

    Hi Prasad,
    Check the FM's
    SPELL_AMOUNT --> for display in millions
    HR_IN_CHG_INR_WRDS --> for display in lakhs and crores

  • Print program for delivery output printing

    Hi,
    I need help with creating a custom smart form and print program for outbound delivery.
    1. i want to know how to select data in my print program ? i mean how to i get the delivery number when the output type is executed.
    2. What parameters are to be passed so that delivery opens as soon as the output type is processed.
    Thank you.
    Usha

    Details of output triggered can be obtained from nast. By default structure nast is populated with the values when the print program is being processed. Field OBJKY is used for the delivery number; Application : V2
    It could be enough to pass an internal table with item level details and an header structure. This more or less is dependent on the output desired.
    Rgds,
    Karthik

  • Script Print Program Logic.......

    Hi All
    This is the print program of my script, i am not getting the logic..can any body help me with this..
    INCLUDE rvadtabl.
    TABLES: vbuk,                          "Vertriebsbeleg (Kopf)-Status
            vbco3,                         "Schlüsselfelder Vertriebsbeleg
            vbpla,                         "Allgemeine Transportdaten
            vbplk,                         "Versandelement Kopfdaten
            vbplp,                         "Versandelement Positionsdaten
            vbpls,                         "Verpackung Summendaten
            vekp,
            adrc,
            vbfa.                                               "DEVK937590
    TABLES: vbkd.                                               "DEVK942078
    *DEVK9A0EB4 - Add define
    TYPES:
      ty_itcsy TYPE STANDARD TABLE OF itcsy.
    start of change for DEVK937590
    DATA:   BEGIN OF t_deliveryflow OCCURS 0, "VBFA delivery flow
              vbeln LIKE vbfa-vbeln,          "Subsequent sales and distribu
            END OF t_deliveryflow.
    DATA:  v_lin      TYPE i.
    CONSTANTS: c_x(1) TYPE c VALUE 'X'.
    end of change for DEVK937590
    DATA: BEGIN OF xvbplk OCCURS 10.
            INCLUDE STRUCTURE vbplk.
    DATA: END OF xvbplk.
    DATA : BEGIN OF vbdkl OCCURS 10.
            INCLUDE STRUCTURE vbdkl.
    DATA : END OF vbdkl.
    DATA: BEGIN OF tvbdpl OCCURS 0.        "Internal table for items
            INCLUDE STRUCTURE vbdpl.
    DATA: END OF tvbdpl.
    DATA: BEGIN OF xvbplp OCCURS 50.
            INCLUDE STRUCTURE vbplp.
    DATA: END OF xvbplp.
    DATA: BEGIN OF xvbpls OCCURS 10.
            INCLUDE STRUCTURE vbpls.
    DATA: END OF xvbpls.
    DATA: retcode LIKE sy-subrc.
    DATA: xscreen(1) TYPE c.         "Ausgabe auf Drucker oder Bildschirm
    DATA: t_vepo LIKE vepo OCCURS 0 WITH HEADER LINE, "VEPO internal table
    BEGIN OF t_cartons OCCURS 0,     "Internal table for cartons
      venum LIKE vepo-venum,         "Shipping unit # for carton
    END OF t_cartons,
    BEGIN OF t_boxes OCCURS 0,       "Internal table for BOXES
      venum LIKE vepo-venum,         "Shipping unit # for BOXES
      laeng LIKE vekp-laeng,
      breit LIKE vekp-breit,
      hoehe LIKE vekp-hoehe,
      meabm LIKE vekp-meabm,
    END OF t_boxes,
    BEGIN OF t_pack_dim OCCURS 0,
      laeng LIKE vekp-laeng,
      breit LIKE vekp-breit,
      hoehe LIKE vekp-hoehe,
      meabm LIKE vekp-meabm,
      box_qty TYPE i,
    END OF t_pack_dim,
    v_venum LIKE vepo-venum,         "Shipping unit number
    i_cartons TYPE i,                "# of cartons (Integer type)
    i_boxes TYPE i,                  "# of boxes (Integer type)
    i_box_count TYPE i,              "# of boxes/carton   "DEVK926768
    c_cartons(4) TYPE c,             "# of cartons (Character type)
    c_boxes(4) TYPE c,               "# of boxes (Character type)
    c_bolnr(35) TYPE c,
    v_tel_number LIKE adrc-tel_number,
    v_adrnr LIKE adrc-addrnumber,
    v_kdmat LIKE lips-kdmat,
    v_btgew LIKE likp-btgew,
    v_gewei LIKE likp-gewei,
    v_arktx LIKE lips-arktx.
    ******DEVK9A0IK7 Addition by RAMARAJG Starts here
    types : BEGIN OF t_item ,
             posnr1 type vbplp-posnr,
             material1 TYPE mara-matnr,
             brgew1 type vbplp-brgew,
             vemeh1 type vbplp-vemeh,
             item_weight1 TYPE n,
             arktx1 type vbplp-arktx,
             vboxcnt type n,
           end of t_item.
    *types : BEGIN OF t_item1 ,
            posnr1 type vbplp-posnr,
            material1 TYPE mara-matnr,
            vemng1 type vbplp-brgew,
            vemeh1 type vbplp-vemeh,
            item_weight1 TYPE n,
            arktx1 type vbplp-arktx,
            v_boxcnt type n,
          end of t_item1.
    DATA: it_item TYPE TABLE OF t_item,
          wa_item TYPE t_item.
    data: it_item1 type table of t_item,
          wa_item1 type t_item.
    *data: wa_itab1 like itab1.
    data: v_grwt type lips-brgew,     "Gross Weight in KG
          v_gunit type likp-gewei,     "Gross Weight Unit
          v_netwt type lips-ntgew,    "Net Weight
          v_unit type likp-gewei.     "Net Weight Unit
         v_tboxes type i,
    ******DEVK9A0IK7 Addition by RAMARAJG ends here
    A. Nachricht (allgemein)                                             *
    FORM entry USING return_code us_screen.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing USING us_screen.
      IF retcode NE 0.
        return_code = 1.
      ELSE.
        return_code = 0.
      ENDIF.
    ENDFORM.                    "entry
          FORM PROCESSING                                               *
    -->  PROC_SCREEN                                                   *
    FORM processing USING proc_screen.
      PERFORM get_data.                    " <-- speziell
      PERFORM form_open USING proc_screen vbpla-land1.
      CHECK retcode = 0.
      PERFORM shipping_point_tel_no.
      PERFORM boxes_and_cartons.
      PERFORM gross_weight.
    ***********DEVK9A0IK7 starts here
    *******Perform to get the Net weight
    *******Perform to get Total weight for each line item
      Perform net_weight.                                   "DEVK9A0IK7
    Perform Total_weight.                                 "DEVK9A0IK7
    ***********DEVK9A0IK7 ends here
      PERFORM bill_of_lading.
      CHECK retcode = 0.
      PERFORM check_repeat.
      PERFORM text_print.                  " <-- speziell
    begin shb
      PERFORM get_end_customer_po.
    *end shb
      PERFORM packing_dimensions.
      PERFORM remarks.
      CHECK retcode = 0.
      PERFORM form_close.
      CHECK retcode = 0.
    ENDFORM.                    "processing
          FORM FORM_OPEN                                                *
    -->  US_SCREEN                                                     *
    -->  US_COUNTRY                                                    *
    FORM form_open USING us_screen us_country.
      INCLUDE rvadopfo.
    ENDFORM.                    "form_open
          FORM FORM_CLOSE                                               *
    FORM form_close.
      CALL FUNCTION 'CLOSE_FORM'           "...Ende Formulardruck
           EXCEPTIONS OTHERS = 1.
      IF sy-subrc NE 0.
        retcode = 1.
        PERFORM protocol_update.
      ENDIF.
      SET COUNTRY space.
    ENDFORM.                    "form_close
          FORM CHECK_REPEAT                                             *
    FORM check_repeat.
      SELECT * INTO *nast FROM nast WHERE kappl = nast-kappl
                                    AND   objky = nast-objky
                                    AND   kschl = nast-kschl
                                    AND   spras = nast-spras
                                    AND   parnr = nast-parnr
                                    AND   parvw = nast-parvw
                                    AND   nacha BETWEEN '1' AND '4'.
        CHECK *nast-vstat = '1'.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'REPEAT'
            window  = 'REPEAT'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
        EXIT.
      ENDSELECT.
    ENDFORM.                    "check_repeat
          FORM PROTOCOL_UPDATE                                          *
    FORM protocol_update.
      CHECK xscreen = space.
      CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
        EXPORTING
          msg_arbgb = syst-msgid
          msg_nr    = syst-msgno
          msg_ty    = syst-msgty
          msg_v1    = syst-msgv1
          msg_v2    = syst-msgv2
          msg_v3    = syst-msgv3
          msg_v4    = syst-msgv4
        EXCEPTIONS
          OTHERS    = 1.
    ENDFORM.                    "protocol_update
    B. Packliste (speziell)                                              *
    Die Verpackung von Lieferungen wird durch Versandelemente (VSE)
    realisiert. Technisch ist ein Versandelement ein Beleg mit Kopf-
    und Positionsdaten (Strukturen VBPLK/XVBPLK und VBPLP/XVBPLP).
    Eine Position in einem VSE ist entweder wieder ein VSE oder Teil
    eine Lieferposition (also mit den zum VSE gehörenden Materialen/
    Versandhilftsmitteln verpackt). Der Zusammenhang zur Lieferung
    wird durch die beiden Felder VBELN (Lieferung) und POSNR (Position)
    in der Struktur VBPLP realisiert. Es ist zu beachten, daß ein VSE
    keine Positionsdaten enthalten muß: Die Lieferung wurde dann nicht
    vollständig verpackt.
    Mathematisch gesehen stellen die VSE einen Wald (aus Bäumen) dar.
    An den Knoten können noch Lieferpositionsdaten hängen. Um zu
    erkennen ob ein Knoten eine Wurzel oder (und) ein Blatt ist, gibt
    es im VSE-Kopf Kennzeichen. Ist KZOBE gesetzt, so ist das VSE ein
    oberes Element, also eine Wurzel. Ist KZUNT gesetzt, stellt das VSE
    ein unteres Element dar, also ein Blatt. Ist keines der beiden
    Kennzeichen gesetzt dann ist das VSE ein innerer Knoten. Es ist
    zu beachten, daß beiden Kennzeichen gesetzt sein können: Der Baum
    besteht aus einem Knoten. Die Tiefe eines Knotens durch das Feld
    TIVEL gegeben.
    Weiterhin ist der Baum doppelt verkettet. Es ist also möglich,
    nicht nur einen Weg von der Wurzel (eines Teilbaums) zu einem
    Blatt zu finden, sondern auch umgekehrt von einem Blatt zur Wurzel
    zu gelangen. Dazu existiert (im VSE-Kopf) das Feld UEVEL, also
    das übergeordnete VSE.
    Um schließlich zu entscheiden, ob ein VSE-Position ein VSE oder
    eine Lieferposition ist, wird das Feld POSNR ausgewertet. Ist
    das Feld initial, stellt die Position ein VSE dar, im anderen Fall
    enthält es die Lieferposition. Ist die Position ein VSE, steht im
    Feld UNVEL das zugehörige untergeordnete VSE.
    FORM get_data.
      vbco3-vbeln = nast-objky.
      vbco3-spras = nast-spras.
      vbco3-kunde = nast-parnr.
      vbco3-parvw = nast-parvw.
    *mod+
      CALL FUNCTION 'RV_DELIVERY_PRINT_VIEW'
        EXPORTING
          comwa = vbco3
        IMPORTING
          kopf  = vbdkl
        TABLES
          pos   = tvbdpl.
      CALL FUNCTION 'SD_PACKING_PRINT_VIEW'
        EXPORTING
          comwa     = vbco3
        IMPORTING
          vbpla_wa  = vbpla
        TABLES
          vbplk_tab = xvbplk
          vbplp_tab = xvbplp
          vbpls_tab = xvbpls
        EXCEPTIONS
          OTHERS    = 01.
      LOOP AT xvbplk WHERE kzobe = 'X'.
        EXIT.
      ENDLOOP.
      IF sy-subrc > 0.
        syst-msgid = 'VL'.
        syst-msgno = '490'.
        syst-msgty = 'E'.
        PERFORM protocol_update.
        retcode = 1.
      ENDIF.
    ENDFORM.                    "get_data
          FORM TEXT_PRINT                                               *
    FORM text_print.
    Die Kopfdaten werden implizit ausgegeben, ...
    ... dann die Überschriften der Positionen ...
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'HEADER'
          type    = 'TOP'.
    ... und schließlich die Positionen ausgeben ...
      LOOP AT xvbplk WHERE kzobe = 'X'.
        PERFORM packing_tree USING xvbplk-venum.
      ENDLOOP.
    ENDFORM.                    "text_print
    Rekursive Prozedur
    FORM packing_tree USING value(shenr).
    Daten des Versandelements shenr ausgeben, also Wurzel des Teilbaums
      MOVE space TO xvbplk.
      xvbplk-venum = shenr.
      READ TABLE xvbplk.
      vbplk = xvbplk.
      READ TABLE t_cartons WITH KEY venum = vbplk-venum.
      IF sy-subrc = 0.
        IF vbplk-brgew <> 0.
          PERFORM set_textsymbol USING '&CARTON_WEIGHT&'
                                       vbplk-brgew.
        ELSE.
          PERFORM set_textsymbol USING '&CARTON_WEIGHT&'
        ENDIF.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'SHELEM'.
      ENDIF.
    Nun die Positionen abarbeiten (Teilbäume durchlaufen).
    Hier wäre eventuell ein Sortierung zwischen Lieferpositionen
    und weiteren Versandelementen sinnvoll. Alle nachgeordneten
    Positionen liegen eine Stufe tiefer.
      LOOP AT xvbplp WHERE venum = shenr.
        IF xvbplp-posnr IS INITIAL.
        Versandelement
          PERFORM packing_tree USING xvbplp-unvel.
        ELSE.
        Lieferposition (Anteil)
          vbplp = xvbplp.
          PERFORM customer_material.
    ***ramarajg starts.
          perform item_list.
    ***ramarajg end.
          IF vbplp-brgew <> 0.
            PERFORM set_textsymbol USING '&ITEM_WEIGHT&'
                                         vbplp-brgew.
          ELSE.
            PERFORM set_textsymbol USING '&ITEM_WEIGHT&'
          ENDIF.
             CALL FUNCTION 'WRITE_FORM'
              EXPORTING
              element = 'DELPOS'.
        ENDIF.
      ENDLOOP.
    ***ramarajg starts.
    perform TOTAL_WEIGHT.
    loop at it_item into wa_item.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEMPOS'.
    endloop.
    break ramarajg.
    ***ramarajg end.
    ENDFORM.                    "packing_tree
          FORM SET_TEXTSYMBOL                                           *
    FORM set_textsymbol USING text_symbol
                              text_value.
      CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
        EXPORTING
          name  = text_symbol
          value = text_value.
    ENDFORM.                    "set_textsymbol
    *&      Form  BOXES_AND_CARTONS
          text
    -->  p1        text
    <--  p2        text
    FORM boxes_and_cartons.
      CLEAR: t_cartons,
             t_boxes,
             i_cartons,
             i_boxes.
      REFRESH: t_cartons,
               t_boxes.
    start of change for DEVK937590
      CLEAR t_deliveryflow[].
      SELECT vbeln
      FROM vbfa
      INTO CORRESPONDING FIELDS OF TABLE t_deliveryflow
      WHERE vbelv = vbpla-vbeln AND vbtyp_n = c_x.
    Select data
      DESCRIBE TABLE t_deliveryflow LINES v_lin.
      CHECK v_lin GT 0.
      SELECT venum vbeln
      FROM vepo
      INTO CORRESPONDING FIELDS OF TABLE t_vepo
      FOR ALL ENTRIES IN t_deliveryflow
      WHERE venum = t_deliveryflow-vbeln.
    SELECT VENUM
           VBELN
      FROM VEPO
      INTO CORRESPONDING FIELDS OF TABLE T_VEPO
      WHERE VBELN = VBPLA-VBELN.
    end of change for DEVK937590
      SORT t_vepo BY venum.
      DELETE ADJACENT DUPLICATES FROM t_vepo COMPARING venum.
    Determine the number of cartons and boxes to be shipped.
    To determine the number of cartons, shipping unit number (VENUM) is
    checked if it a lower-level shipping unit. This is done by reading
    table VEPO and checking if VENUM exist in UNVEL (Lower-level shipping
    unit). If it does, this means that VENUM is contained within
    another container. If it does not exist, it is considered the highest
    level of packing for that specific delivery.
      LOOP AT t_vepo.
    check if VENUM is a lower level shipping unit.
        SELECT SINGLE venum INTO v_venum
        FROM vepo
        WHERE unvel =  t_vepo-venum.
    If shipping unit number is found, count as carton.
        IF sy-subrc = 0.
        check if carton already exist for the carton.
          READ TABLE t_cartons WITH KEY venum = v_venum.
        if carton does not exist, append table
          IF sy-subrc <> 0.
            t_cartons-venum = v_venum.
            APPEND t_cartons.
          ENDIF.
        ENDIF.
      ENDLOOP.
    count boxes and cartons
      DESCRIBE TABLE t_vepo LINES i_boxes.
      DESCRIBE TABLE t_cartons LINES i_cartons.
    Convert cartons and boxes field values to CHARACTER type FORMAT.
    In order to save the output values to the output fields, the
    fields are converted to CHARACTER type formats.
      MOVE: i_cartons TO c_cartons,
            i_boxes TO c_boxes.
      PERFORM set_textsymbol USING '&BOXES&'
                                   c_boxes.
      PERFORM set_textsymbol USING '&CARTONS&'
                                   c_cartons.
    ENDFORM.                               " BOXES_AND_CARTONS
    *&      Form  BILL_OF_LADING
          text
    -->  p1        text
    <--  p2        text
    FORM bill_of_lading.
      SELECT SINGLE bolnr
          FROM likp
          INTO c_bolnr
          WHERE vbeln = vbpla-vbeln.
      PERFORM set_textsymbol USING '&BILL_OF_LADING&'
                                   c_bolnr.
    ENDFORM.                               " BILL_OF_LADING
    *&      Form  PACKING_DIMENSIONS
          text
    -->  p1        text
    <--  p2        text
    FORM packing_dimensions.
    CLEAR: T_BOXES,
            T_PACK_DIM.
    REFRESH: T_BOXES,
              T_PACK_DIM.
    SELECT VENUM
            LAENG
            BREIT
            HOEHE
            MEABM
    FROM VEKP
    INTO CORRESPONDING FIELDS OF TABLE T_BOXES
    FOR ALL ENTRIES IN T_VEPO
    WHERE VENUM = T_VEPO-VENUM.
    LOOP AT T_BOXES.
       READ TABLE T_PACK_DIM WITH KEY LAENG = T_BOXES-LAENG
                                      BREIT = T_BOXES-BREIT
                                      HOEHE = T_BOXES-HOEHE
                                      MEABM = T_BOXES-MEABM.
       IF SY-SUBRC = 0.
         T_PACK_DIM-BOX_QTY = T_PACK_DIM-BOX_QTY + 1.
         MODIFY T_PACK_DIM INDEX SY-TABIX.
       ELSE.
         T_PACK_DIM-LAENG = T_BOXES-LAENG.
         T_PACK_DIM-BREIT = T_BOXES-BREIT.
         T_PACK_DIM-HOEHE = T_BOXES-HOEHE.
         T_PACK_DIM-MEABM = T_BOXES-MEABM.
         T_PACK_DIM-BOX_QTY = 1.
         APPEND T_PACK_DIM.
       ENDIF.
    ENDLOOP.
    LOOP AT T_PACK_DIM.
       AT FIRST.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'PACKING_DIMENSIONS_HEADER'.
       ENDAT.
       CLEAR: VEKP,
              C_BOXES.
       VEKP-LAENG = T_PACK_DIM-LAENG.
       VEKP-BREIT = T_PACK_DIM-BREIT.
       VEKP-HOEHE = T_PACK_DIM-HOEHE.
       VEKP-MEABM = T_PACK_DIM-MEABM.
       MOVE: T_PACK_DIM-BOX_QTY TO C_BOXES.
       PERFORM SET_TEXTSYMBOL USING '&BOX_QTY&'
                                    C_BOXES.
       IF VEKP-LAENG <> 0 AND
          VEKP-BREIT <> 0 AND
          VEKP-HOEHE <> 0.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'PACKING_DIMENSIONS'.
       ENDIF.
    ENDLOOP.
    ENDFORM.                               " PACKING_DIMENSIONS
    *&      Form  REMARKS
          text
    -->  p1        text
    <--  p2        text
    FORM remarks.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'REMARKS'.
    ENDFORM.                               " REMARKS
    *&      Form  SHIPPING_POINT_TEL_NO
          text
    -->  p1        text
    <--  p2        text
    FORM shipping_point_tel_no.
      SELECT SINGLE adrnr
      FROM tvst
      INTO v_adrnr
      WHERE vstel = vbpla-vstel.
      SELECT SINGLE tel_number
      FROM adrc
      INTO adrc-tel_number
      WHERE addrnumber = v_adrnr.
    ENDFORM.                               " SHIPPING_POINT_TEL_NO
    *&      Form  CUSTOMER_MATERIAL
          text
    -->  p1        text
    <--  p2        text
    FORM customer_material.
      CLEAR: v_kdmat.
    begin of mod*
      IF vbdkl-lfart = 'LO'.
        SELECT SINGLE kdmat postx
          INTO (v_kdmat , v_arktx)
            FROM knmt
            WHERE vkorg = vbdkl-vkorg
            AND   vtweg = '01'
            AND   kunnr = vbdkl-kunag
            AND   matnr = vbplp-matnr.
        IF NOT v_kdmat IS INITIAL.
          vbplp-matnr = v_kdmat.
          vbplp-arktx = v_arktx.
        ENDIF.
      ELSE.
        SELECT SINGLE kdmat
          FROM lips
          INTO v_kdmat
          WHERE vbeln = vbplp-vbeln AND
                posnr = vbplp-posnr AND
                matnr = vbplp-matnr.
      ENDIF.
    **ramarajg
    IF v_kdmat <> ' '.
       PERFORM set_textsymbol USING '&MATERIAL&'
                                   v_kdmat.
    ELSE.
       PERFORM set_textsymbol USING '&MATERIAL&'
                                   vbplp-matnr.
    ENDIF.
    ENDFORM.                               " CUSTOMER_MATERIAL
          FORM ITEM_WEIGHTS                                             *
    -->  IN_TAB4                                                       *
    -->  OUT_TAB4                                                      *
    FORM item_weights TABLES in_tab4 STRUCTURE itcsy
    out_tab4 STRUCTURE itcsy.
      DATA: n_vbeln(10) TYPE n,
           v_btgew LIKE likp-btgew,
            v_ntgew1 LIKE vekp-ntgew,
            v_btgew1 LIKE likp-btgew,
            v_ntgew2 LIKE likp-ntgew,
            v_btgew2 LIKE likp-btgew,
            BEGIN OF t_venum OCCURS 0,
              venum LIKE vepo-venum,
            END OF t_venum.
      READ TABLE in_tab4 INDEX 1.
      CHECK sy-subrc = 0.
      MOVE in_tab4-value TO n_vbeln.       "convert to numeric type.
    start of change for DEVK937590
    *break ramarajg.
      CLEAR t_deliveryflow[].
      SELECT vbeln
      FROM vbfa
      INTO CORRESPONDING FIELDS OF TABLE t_deliveryflow
      WHERE vbelv = n_vbeln AND vbtyp_n = c_x.
    Select data
      DESCRIBE TABLE t_deliveryflow LINES v_lin.
      CHECK v_lin GT 0.
      SELECT venum
      FROM vepo
      INTO CORRESPONDING FIELDS OF TABLE t_venum
      FOR ALL ENTRIES IN t_deliveryflow
      WHERE venum = t_deliveryflow-vbeln.
    SELECT VENUM
    FROM VEPO
    INTO CORRESPONDING FIELDS OF TABLE T_VENUM
    WHERE VBELN = N_VBELN.
    end of change for DEVK937590
      CLEAR v_btgew.
      DESCRIBE TABLE t_venum LINES v_lin.                       "DEVK937590
      CHECK v_lin GT 0.                                         "DEVK937590
      SELECT ntgew
      FROM vekp
      INTO v_btgew
      FOR ALL ENTRIES IN t_venum
      WHERE venum = t_venum-venum.
        v_btgew1 = v_btgew1 + v_btgew.
      ENDSELECT.
      SELECT SUM( ntgew )
      FROM lips
      INTO v_ntgew1
      WHERE vbeln = n_vbeln.
      SELECT SINGLE ntgew
                    btgew
      FROM likp
      INTO (v_ntgew2, v_btgew2)
      WHERE vbeln = n_vbeln.
      IF v_ntgew1 = v_ntgew2 AND
         v_btgew1 = v_btgew2.
        READ TABLE out_tab4 WITH KEY name = 'PRINT_WEIGHT'.
        IF sy-subrc = 0 .
          out_tab4-value = 'X'.
        ELSE.
          out_tab4-value = ' '.
        ENDIF.
        MODIFY out_tab4 INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "item_weights
    *&      Form  GROSS_WEIGHT
          text
    -->  p1        text
    <--  p2        text
    FORM gross_weight.
      CLEAR: v_btgew.
      SELECT SINGLE btgew
                    gewei
      FROM  likp
      INTO (v_btgew, v_gewei)
      WHERE vbeln = vbpla-vbeln.
      PERFORM set_textsymbol USING '&GROSS_WEIGHT&'
                                   v_btgew.
      PERFORM set_textsymbol USING '&GROSS_WEIGHT_UNIT&'
                                   v_gewei.
    changes added by RAMARAJG starts here
      clear v_grwt.
      clear v_gunit.
      v_grwt = v_btgew.
      v_gunit = v_gewei.
      if v_gunit = 'G'.
         v_grwt = v_grwt / 1000.
         v_gunit = 'KG'.
      endif.
      PERFORM set_textsymbol USING '&GROSS_WEIGHT1&'
                                   v_grwt.
      PERFORM set_textsymbol USING '&GROSS_WEIGHT_UNIT1&'
                                   v_gunit.
    changes added by RAMARAJG ends here
    ENDFORM.                               " GROSS_WEIGHT
    *&      Form  GET_END_CUSTOMER_PO
          Retrieve End Customer PO#
    -->  p1        text
    <--  p2        text
    FORM get_end_customer_po.
      DATA: v_zvgbel LIKE lips-vgbel.
      DATA v_bstkd_e TYPE bstkd_e.
      CLEAR: v_bstkd_e, v_zvgbel.
      SELECT SINGLE vgbel INTO v_zvgbel
        FROM lips
          WHERE vbeln = vbpla-vbeln.
      SELECT SINGLE bstkd_e INTO v_bstkd_e
      FROM vbkd
      WHERE vbeln = v_zvgbel
      AND bstkd_e > ''.
      PERFORM set_textsymbol USING '&V_BSTKD_E&'
                                v_bstkd_e.
    ENDFORM.                    " GET_END_CUSTOMER_PO
    *DEVK9A0EB4 - Add a form
    *&      Form  shipper_acct
          Get shipper account at customer
    FORM shipper_acct TABLES in_tab1 TYPE ty_itcsy
                            out_tab1 TYPE ty_itcsy.
      DATA: v_kunag TYPE likp-kunag,  " Sold to party
            v_eikto TYPE knvv-eikto.  "Shipper account number at customer
    DATA v_strlen(10) TYPE c.
      DATA wa_tab1 TYPE itcsy.
      DATA n_vbeln(10) TYPE n.
    Get kunnr  from likp
      CLEAR wa_tab1.
      READ TABLE in_tab1 INTO wa_tab1 WITH KEY name = 'VBPLA-VBELN'.
      IF sy-subrc = 0.
        n_vbeln = vbpla-vbeln.
      ENDIF.
      CHECK sy-subrc = 0.
      SELECT kunag
      FROM likp
      INTO v_kunag
      WHERE vbeln = n_vbeln.
      ENDSELECT.
      IF sy-subrc = 0.
    Get shipper account
        SELECT eikto INTO v_eikto
        FROM knvv
        WHERE kunnr = v_kunag.
        ENDSELECT.
        IF sy-subrc = 0.
    *append  the field  to the out_tab1 printing output
          wa_tab1-name = 'VKNN-EIKTO'.
          wa_tab1-value = v_eikto.
          APPEND wa_tab1 TO out_tab1.
        ENDIF.
      ENDIF.
    ENDFORM.                    "shipper_acct
    ***********DEVK9A0IK7 starts here
    *&      Form  net_weight
          text
    -->  p1        text
    <--  p2        text
    form net_weight .
      CLEAR: v_btgew.
      SELECT SINGLE ntgew
                    gewei
      FROM  likp
      INTO (v_netwt, v_unit)
      WHERE vbeln = vbpla-vbeln.
      if v_unit = 'G'.
        v_netwt = v_netwt / 1000.
        v_unit = 'KG'.
      endif.
      PERFORM set_textsymbol USING '&NET_WEIGHT&'
                                   v_netwt.
      PERFORM set_textsymbol USING '&NET_WEIGHT_UNIT&'
                                   v_unit.
    endform.                    " net_weight
    ***********DEVK9A0IK7 ends here
    *&      Form  item_list
          text
    -->  p1        text
    <--  p2        text
    form item_list.
    move vbplp-posnr to wa_item-posnr1.
    *move material to wa_itab1-material1.
    move vbplp-brgew to wa_item-brgew1.
    move vbplp-vemeh to  wa_item-vemeh1.
    *move item_weight to wa_itab1-item_weight1.
    *move gross_weight_unit to wa_itab1-gross_weight_unit1.
    move v_arktx to wa_item-arktx1.
    if v_kdmat <> ' '.
    move v_kdmat to wa_item-material1.
    else.
    move vbplp-matnr to wa_item-material1.
    endif.
    wa_item-vboxcnt = 1.
    append wa_item TO it_item.
      CLEAR : wa_item1, wa_item.
      it_item1[] = it_item[].
      REFRESH it_item[].
    break-point.
    endform.                    " item_list
    *&      Form  TOTAL_WEIGHT
          text
    -->  p1        text
    <--  p2        text
    form TOTAL_WEIGHT .
      LOOP AT it_item1 into wa_item1.
        READ TABLE it_item INTO wa_item WITH KEY material1 = wa_item1-material1 posnr1 = wa_item1-posnr1.
        IF sy-subrc NE 0.
          APPEND wa_item1 TO it_item.
        ELSE.
          wa_item1-brgew1 =   wa_item1-brgew1 +  wa_item-brgew1.
          Wa_item1-vboxcnt = wa_item1-vboxcnt + wa_item-vboxcnt.
          MODIFY it_item FROM wa_item1 TRANSPORTING brgew1 vboxcnt
                         WHERE material1 = wa_item1-material1
                              AND posnr1 = wa_item1-posnr1.
        ENDIF.
      ENDLOOP.
    endform.                    " TOTAL_WEIGHT

    the Logic to be added is this
    b.     Remove the carton ID & box ID from the print out,  the line item should just print the total delivery quantity, do not split the printing by different box ID or carton ID.
    i.     Delivery Item= LIPS-POSNR
    ii.     Delivery Qty for Item = LIPSD-G_LFIMG= LIPSD-PIKMG
    c.     Add Total Boxes for each item, this should be a calculation field for each material HUMV4-MATNR, count how many handling unit  VEKPVB-EXIDV has been used to pack the same material , output the total boxes for each delivery item.
    d.     Add Gross Weight for each  item , retrieve data from LIPS-BRGEW
    e.     Add Net weight to the print out, below the gross weight – retrieve data from LIKP-NTGEW

  • How to use   RLB_INVOICE standard print program

    my program is copy of  RLB_INVOICE
    when i press execute i m not getting any output
    how can i see print preview by executing print program.

    hi,
    check this
    REPORT  ZRE_SD_INVOICE.
    *&      Form  ENTRY
          text
         -->P_ENT_RETCO   text
         -->P_ENT_SCREEN  text
    FORM ENTRY  USING    P_ENT_RETCO
                         P_ENT_SCREEN.
      DATA: lf_formname TYPE TDSFNAME,
            lf_fm_name  TYPE RS38L_FNAM,
            g_adrnr LIKE ADRC-ADDRNUMBER.
                      TABLES DECLARATIONS                                *
      TABLES: NAST,                          "Messages
              *NAST,                         "Messages
              TNAPR,                         "Programs & Forms
              ITCPO,                         "Communicationarea for Spool
              ARC_PARAMS,                    "Archive parameters
              TOA_DARA,                      "Archive parameters
              ADDR_KEY,                      "Adressnumber for ADDRESS
              T005U ,                        "FOR RETRIVAL OF STATE
              ADRC .                         "FOR RETRIVAL OF ADDRESS
                      DATA DECLARATIONS                                  *
      DATA:   RETCODE   LIKE SY-SUBRC.         "Returncode
      DATA:   XSCREEN(1) TYPE C.               "Output on printer or screen
      DATA:   REPEAT(1) TYPE C.
    DATA: NAST_ANZAL LIKE NAST-ANZAL.      "Number of outputs (Orig. + Cop.)
      DATA: NAST_TDARMOD LIKE NAST-TDARMOD.  "Archiving only one time
      DATA: GF_LANGUAGE LIKE SY-LANGU.
      DATA: L_FMNAME    TYPE   rs38l_fnam.
      data: CS_BIL_INVOICE  type  LBBIL_INVOICE.
      data: IS_PRINT_DATA_TO_READ type LBBIL_PRINT_DATA_TO_READ value
      'XXXXXXXXXXXXXXXXXXXXXXXX'.
      DATA: BILL_DOC_EXP    LIKE     VBCO3.
      DATA: BILL_DOC_IMP_H  LIKE     VBDKR.
      DATA: BILL_DOC_IMP_I  LIKE VBDPR OCCURS 0 WITH HEADER LINE.
      DATA: T_RC  LIKE ADRC OCCURS 0 WITH HEADER LINE.
      DATA: T_T00  LIKE T005U OCCURS 0 WITH HEADER LINE.
      DATA: L_WERKS LIKE J_1IEXCHDR-WERKS.
    DATA: I_LIKP     LIKE     LIKP OCCURS 0 WITH HEADER LINE,
         I_VBAK     LIKE     VBAK OCCURS 0 WITH HEADER LINE,
         I_LIPS     LIKE     LIPS OCCURS 0 WITH HEADER LINE,
         I_VBKD     LIKE     VBKD OCCURS 0 WITH HEADER LINE,
         I_EIKP     LIKE     EIKP OCCURS 0 WITH HEADER LINE,
         I_MARC     LIKE     MARC OCCURS 0 WITH HEADER LINE,
         I_KNA1     LIKE     KNA1 OCCURS 0 WITH HEADER LINE,
         I_T604T     LIKE     T604T OCCURS 0 WITH HEADER LINE,
         I_KONV     LIKE     KONV OCCURS 0 WITH HEADER LINE,
         I_VBRK     LIKE     VBRK OCCURS 0 WITH HEADER LINE,
          I_VBRP     LIKE     VBRP OCCURS 0 WITH HEADER LINE.
         I_T685T     LIKE     T685T OCCURS 0 WITH HEADER LINE,
         I_KONV1     LIKE     KONV OCCURS 0 WITH HEADER LINE.
    *types begin of t_vbrp.
    *include structure vbrp.
    *types grp_counter type i .
    *types end of t_vbrp.
    *data i_vbrp type standard table of t_vbrp with header line.
    *NAST-OBJKY = BILL_DOC .
      DATA : inv_code LIKE vbak-vbeln.
      BILL_DOC_EXP-SPRAS = 'E'.
      BILL_DOC_EXP-VBELN = nast-objky(10).
      inv_code = nast-objky(10).
      SELECT SINGLE WERKS INTO L_WERKS FROM J_1IEXCHDR WHERE  RDOC =
    inv_code.
    select * from vbrp into table i_vbrp where vbeln = inv_code.
    lf_formname = tnapr-sform.
    IF L_WERKS = '2000'.
        tnapr-sform = 'ZSF_SD_INVOICE'.
    ELSE.
       tnapr-sform = 'ZSD_FACTORY_EXCISE_INVOICE_PAT'.
    ENDIF.
    Read print data
      CALL FUNCTION 'LB_BIL_INV_OUTP_READ_PRTDATA'
        EXPORTING
          IF_BIL_NUMBER         = NAST-OBJKY
          IF_PARVW              = NAST-PARVW
          IF_PARNR              = NAST-PARNR
          IF_LANGUAGE           = NAST-SPRAS
          IS_PRINT_DATA_TO_READ = IS_PRINT_DATA_TO_READ
        IMPORTING
          ES_BIL_INVOICE        = CS_BIL_INVOICE
        EXCEPTIONS
          RECORDS_NOT_FOUND     = 1
          RECORDS_NOT_REQUESTED = 2
          OTHERS                = 3.
    GET THE DATA RELATED TO THE BILLING DOCUMENT BASED ON THE BILLING
    *DOCUMENT NUMBER
      CALL FUNCTION 'RV_BILLING_PRINT_VIEW'
        EXPORTING
          COMWA                              = BILL_DOC_EXP
       IMPORTING
         KOPF                               = BILL_DOC_IMP_H
        TABLES
          POS                                = BILL_DOC_IMP_I
    EXCEPTIONS
      TERMS_OF_PAYMENT_NOT_IN_T052       = 1
      OTHERS                             = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME                 = tnapr-sform
        VARIANT                  = ' '
        DIRECT_CALL              = ' '
       IMPORTING
         FM_NAME                  = L_FMNAME
      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 L_FMNAME
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
      ITAB_LANDX                 =
      ITAB_ZOLLA                 =
      ITAB_AZOLL                 =
      ITAB_KZGBE                 =
      ITAB_IEVER                 =
      ITAB_LADEL                 =
      ITAB_LANDX50               =
      ITAB_VTEXT                 =
      ITAB_EXPVZ                 =
      I_KZABE                    =
      NN_LINES                   =
      S                          =
      D                          =
      I_TOTAL                    =
      I_MAKTG                    =
      I_CAL_NET                  =
          IS_BIL_INVOICE             = CS_BIL_INVOICE
          IS_KOPF                    = BILL_DOC_IMP_H
      IS_NAST                    =
      IS_REPEAT                  =
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
       I_LIKP                     = I_LIKP
       I_VBAK                     = I_VBAK
       I_LIPS                     = I_LIPS
       I_VBKD                     = I_VBKD
       I_EIKP                     = I_EIKP
       I_MARC                     = I_MARC
       I_KNA1                     = I_KNA1
       I_T604T                    = I_T604T
       I_KONV                     = I_KONV
       I_VBRK                     = I_VBRK
         I_VBRP                     = I_VBRP
       I_T685T                    = I_T685T
       I_KONV1                    = I_KONV1
          IS_PO                      = BILL_DOC_IMP_I
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR          `   = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "ENTRY
    Regards
    Santosh.

  • SAPscript print program

    Hi All
    I have the SAPscript form name. I need to find out the name of the print program.
    The table TNAPR gives the standard program name attached to the SAPscript.
    But, I need to find out the Z* program name associated with the SAPscript.
    Pls do help on this.
    Thanks,
    Zahabia.

    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.
    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.
    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

  • Purchase order SAPFM06P print program

    Dear all,
    Does anyone know how this print program works? In standard I seems that there are only two includes and when I look inside it the ME_READ_PO_FOR_PRINTING function module is repeated several times. My goal is to add field at the item level but I did even not identified where the open_form FM is declared...
    Best regards.
    NC.

    Hi Milind,
    Hereafter is the code I find within FM06PF02 include.
      INCLUDE FM06PE02                                                   *
    form entry_neu using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Umlagerungsbestellung,  Hinweis 670912                               *
    form entry_neu_sto using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print,
            F_STO.                                              "670912
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      F_STO = 'X'.                                              "670912
      call function 'ME_READ_PO_FOR_PRINTING'
           EXPORTING
                ix_nast        = nast
                ix_screen      = ent_screen
           IMPORTING
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           CHANGING
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           EXPORTING
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam                    "HW 214570
                ix_sto         = F_STO                          "670912
           IMPORTING
                ex_retco       = ent_retco.
    endform.
    *eject
    Mahnung
    form entry_mahn using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '3'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Auftragsbestätigungsmahnung
    form entry_aufb using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '7'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Lieferabrufdruck für Formular MEDRUCK mit Fortschrittszahlen
    form entry_lphe using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_xfz,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '9'.
      l_xfz = 'X'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_xfz         = l_xfz
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Lieferabrufdruck für Formular MEDRUCK ohne Fortschrittszahlen
    form entry_lphe_cd using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '9'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Feinabrufdruck für Formular MEDRUCK mit Fortschrittszahlen
    form entry_lpje using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_xfz,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = 'A'.
      l_xfz = 'X'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_xfz         = l_xfz
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Feinabrufdruck für Formular MEDRUCK ohne Fortschrittszahlen
    form entry_lpje_cd using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = 'A'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
      INCLUDE FM06PE02                                                   *
    form entry_neu_matrix using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_mflag       = 'X'
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Angebotsabsage
    form entry_absa using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      l_druvo = '4'.
      clear ent_retco.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Lieferplaneinteilung
    form entry_lpet using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '5'.
      else.
        l_druvo = '8'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Lieferplaneinteilung
    form entry_lpfz using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '5'.
      else.
        l_druvo = '8'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_xfz         = 'X'
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    *eject
    Mahnung
    form entry_lpma using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '6'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    Now I would like to know how does this get the purchase order title from transparent table t166u in order to copy the procedure within my client customized program.
    Does this include refers to the MEDRUCK function module?
    Regards.
    NC.

  • Standard print program for Adobe Forms

    Hi all -
    Does anyone know if there was a standard print program delivered for the predelivered Adobe form F110_AVIS_INT?  And if there is - what is it?  Is there any document anywhere to determine predelivered print programs for Adobe forms?
    Your help is much appreciated!
    Thanks
    Abby

    Hi
    In SAP you can check for the Print Programs in Tcode <b>OB96</b>
    which gives assignment of programs to script layouts
    see the links related to Adobe forms
    look at the Adobe page here in SDN:
    https://www.sdn.sap.com/sdn/developerareas/was.sdn?page=AdobeForms.htm
    Check these links on Adobe forms
    http://help.sap.com/saphelp_nw04/helpdata/en/1e/05853ff8ec2c17e10000000a114084/content.htm
    https://www.sdn.sap.com/irj/sdn/interactiveforms
    http://www.sap.com/solutions/solutionextensions/pdf/BWP_Interactive_Forms_Adobe.pdf
    It contains lots of useful information, documentation, and e-learning materials teaching you the basics.
    Reward points for useful Answers
    Regards
    Anji

  • Using standard PO Printing Program for Smartforms

    Hi Experts,
    I am some hiccups coding my print program for a PO Smartform that am currently working on.The requirement was to use the standard print program to trigger my Smartform PO. I have read alot of threads on this, but am still clueless.
    Some says to comment out the functions like "OPEN_FORM" ,"WRITE_FORM" and having your block of codes inside the "NEU_" routine.
    But I noticed, there are even some conditions and logic checking before the "write_form" is called and sometimes the table entries are also cleared. In this kind of situation, how should I be passing the table data to the Smartform function module?By copying the contents to an internal table? And there are many include programs which currently the standard program has, should I be using all that too?
    Appreciate your input and advice on this.
    Thanks very much.

    Hi Neesha,
    Can you check this once
    [Migrating Forms|http://help.sap.com/saphelp_nw04/helpdata/en/9d/9599386185c064e10000009b38f8cf/content.htm]
    Regards,
    Madhu.
    Edited by: madhurao123 on Dec 21, 2011 9:18 AM

  • Search print program and sap script

    hii , how can i find  trigring print program and sap script  for a particular  purchase order.
            regards  Aditya
    Edited by: aditya shrivastaba on Apr 14, 2008 9:59 AM

    Hey,
    First go with Me22 or 23 with po that you had, and then check with output type for that in the transaction. After that go to TNAPR table and check the corresponding form and print program.
    Or else, go with NAST table in that put PO num in 123456 and put in OBJKY field in nast table. It will give you the output type of it, so that u can find the print program and lay out in TNAPR
    Many thanks,
    Raghu.

  • Smartform print program for order confirmation

    Hi experts.
    I am looking for a smartform print program for order confirmation.
    The order confirmation in standard is a script with the name RVADOR01 and I tried to copy and change but I don't know which to eliminate and whcih to keep it.
    If any body written the program already please provide me or provide the link to check.
    Thanks in advance
    Sai

    this is the processing form.
    form processing.
      data: lf_fm_name            type rs38l_fnam.
      data: ls_control_param      type ssfctrlop.
      data: ls_composer_param     type ssfcompop.
      data: ls_recipient          type swotobjid.
      data: ls_sender             type swotobjid.
      data: lf_formname           type tdsfname.
      data: ls_addr_key           like addr_key.
      data: document_output_info type  ssfcrespd,
            job_output_info type ssfcrescl,
            job_output_options type ssfcresop.
      perform get_data.
      check retcode = 0.
      perform set_print_param using      addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         retcode.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        message e001(/smb40/ssfcomposer).
      endif.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
        exporting
          formname           = lf_formname
        importing
          fm_name            = lf_fm_name
        exceptions
          no_form            = 1
          no_function_module = 2
          others             = 3.
      if sy-subrc <> 0.
      error handling
        retcode = sy-subrc.
        if sy-subrc = 1.
          message e001(/smb40/ssfcomposer).
        endif.
        if sy-subrc = 2.
          message e002(/smb40/ssfcomposer) with lf_formname.
        endif.
        perform protocol_update.
      endif.
      call function lf_fm_name
        exporting
          archive_index        = toa_dara
          archive_parameters   = arc_params
          control_parameters   = ls_control_param
          mail_recipient       = ls_recipient
          mail_sender          = ls_sender
          output_options       = ls_composer_param
          user_settings        = ' '
          is_nast              = nast
          is_vbdka             = vbdka
          is_addres            = addr_key
        importing
          document_output_info = document_output_info
          job_output_info      = job_output_info
          job_output_options   = job_output_options
        tables
          it_vbdpa             = tvbdpa    "Item information
          it_vbdpau            = tvbdpau   "Subitem numbers
          it_vedpa             = tkomservp  "Contract Item Validity
          it_vedka             = tkomservh  "Contract Header Validity
          it_vedpn             = tkomservpn "Contract Item Cancellation Data
          it_vedkn             = tkomservhn "Contract Header Cancellation DA
        exceptions
          formatting_error     = 1
          internal_error       = 2
          send_error           = 3
          user_canceled        = 4
          others               = 5.
      if sy-subrc <> 0.
        retcode = sy-subrc.
        perform protocol_update.
    get SmartForm protocoll and store it in the NAST protocoll
        perform add_smfrm_prot.
      endif.
    endform.                    "processing

Maybe you are looking for

  • Re: what is difference between sap locking and database locking

    hi,     what is difference between sap locking and database locking. Iam locked the table mara by using lock objects. But iam unable to unlock the mara table. I give u the coding. Please check it. REPORT zlock . CALL FUNCTION 'ENQUEUE_EZTEST3' EXPORT

  • Red Giant transitions no longer work in Mac OS 10.9.5

    I recently updated my Mac Pro to 10.9.5 and now my Red Giant Universe transitions, such as Swish Pan (works like Wind Blur in Final Cut) have all stopped working.  Not only do they no longer work, but they make my project crash and I have to create a

  • PDF not opening in Adobe Reader using openWithDefaultApplication

    Hello all, I'm having a huge problem. I've developed an application that opens pdf files from the desktop using openWithDefaultApplication(). It works great on my development PC which has Acrobat Pro. The files open in Acrobat Pro flawlessly. It DOES

  • Itunes Update

    Hi all here is my Problems: I have a Macbook air 13'' bought on agust 2013. today when i opened itunes it tell me to update to 11.1 version so i clicked on "download now" and it opened the apple store update page. when apple store app loaded the new

  • All the Text is presented in bold

    Suddenly, on every site I visit all the screen text is bold. I've done the three recommended troubleshooting steps to no avail.