Printing Boxes in sap-script

Hi,
I want to display boxes for line items of a purchase order in the output of a sapscript.I wrote the box command under text-element for display line item.Now
my problem is these boxes should come in output multiple times means how many line items with corresponding line items.
How i'll be able to do this?Please suggest on this.
Thanks
Bprakash Soni

Hi prakash,
FORM SCRIPT .
select single ersda from mara into v_ersda
  WHERE MATNR = IT_MATERIAL-MATNR.
SELECT pstat
        werks
        EKGRP
        PRCTR
        MINLS
        MAXLS INTO  corresponding fields of TABLE IT_SCRIPT FROM
        MARC
        WHERE MATNR = IT_MATERIAL-MATNR.
CALL FUNCTION 'OPEN_FORM'
  EXPORTING
   APPLICATION                       = 'TX'
   ARCHIVE_INDEX                     =
   ARCHIVE_PARAMS                    =
   DEVICE                            = 'PRINTER'
   DIALOG                            = 'X'
    FORM                              = 'ZFINAL_13688'
    LANGUAGE                          = SY-LANGU
  EXCEPTIONS
    CANCELED                          = 1
    DEVICE                            = 2
    FORM                              = 3
    OPTIONS                           = 4
    UNCLOSED                          = 5
    MAIL_OPTIONS                      = 6
    ARCHIVE_ERROR                     = 7
    INVALID_FAX_NUMBER                = 8
    MORE_PARAMS_NEEDED_IN_BATCH       = 9
    SPOOL_ERROR                       = 10
    CODEPAGE                          = 11
    OTHERS                            = 12
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 'WRITE_FORM'
                    EXPORTING
                      ELEMENT                        = 'TOP'
                    FUNCTION                       = 'SET'
                      TYPE                           = 'TOP'
                      WINDOW                         = 'MAIN'
                    EXCEPTIONS
                      ELEMENT                        = 1
                      FUNCTION                       = 2
                      TYPE                           = 3
                      UNOPENED                       = 4
                      UNSTARTED                      = 5
                      WINDOW                         = 6
                      BAD_PAGEFORMAT_FOR_PRINT       = 7
                      SPOOL_ERROR                    = 8
                      CODEPAGE                       = 9
                      OTHERS                         = 10
                   IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                   ENDIF.
LOOP AT IT_SCRIPT.
  CALL FUNCTION 'WRITE_FORM'
   EXPORTING
     ELEMENT                        = 'NEW'
    FUNCTION                       = 'SET'
     TYPE                           = 'BODY'
     WINDOW                         = 'MAIN'
   EXCEPTIONS
     ELEMENT                        = 1
     FUNCTION                       = 2
     TYPE                           = 3
     UNOPENED                       = 4
     UNSTARTED                      = 5
     WINDOW                         = 6
     BAD_PAGEFORMAT_FOR_PRINT       = 7
     SPOOL_ERROR                    = 8
     CODEPAGE                       = 9
     OTHERS                         = 10
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
  RESULT                         =
  RDI_RESULT                     =
TABLES
  OTFDATA                        =
EXCEPTIONS
   UNOPENED                       = 1
   BAD_PAGEFORMAT_FOR_PRINT       = 2
   SEND_ERROR                     = 3
   SPOOL_ERROR                    = 4
   CODEPAGE                       = 5
   OTHERS                         = 6
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.
/E   TOP
   plant,,status,,GROUP,,Profit,,Min.Size,,Max.Size
/:   BOX FRAME 10 TW
/:   BOX YPOS 2 CH HEIGHT 0 CM FRAME 10 TW
/*   BOX XPOS 15 CH WIDTH 0 CM FRAME 10 TW
/*   BOX XPOS 28 CH WIDTH 0 CM FRAME 10 TW
/*   BOX XPOS 35 CH WIDTH 0 CM FRAME 10 TW
/*   BOX XPOS 42 CH WIDTH 0 CM FRAME 10 TW
/*   BOX XPOS 55 CH WIDTH 0 CM FRAME 10 TW
/E   NEW
   &IT_SCRIPT-pstat(C)&,,&IT_SCRIPT-werks(C)&,,
=    &IT_SCRIPT-EKGRP(C)&,,&IT_SCRIPT-PRCTR(C)&,,
=    &IT_SCRIPT-MINLS(C)&,,&IT_SCRIPT-MAXLS(C)&
/:   BOX FRAME 10 TW
/:   BOX YPOS 2 CH HEIGHT 0 CM FRAME 10 TW
/:   BOX YPOS 4 CH HEIGHT 0 CM FRAME 10 TW
/:   BOX XPOS 15 CH WIDTH 0 CM FRAME 10 TW
/:   BOX XPOS 28 CH WIDTH 0 CM FRAME 10 TW
/:   BOX XPOS 35 CH WIDTH 0 CM FRAME 10 TW
/:   BOX XPOS 42 CH WIDTH 0 CM FRAME 10 TW
/:   BOX XPOS 55 CH WIDTH 0 CM FRAME 10 TW
do this in main window.
also write the command
/:   BOX YPOS 2 CH HEIGHT 0 CM FRAME 10 TW
as many times as the no. of line items that can fit in the table by increasinf height of box from to 2 to 4 or 6 ...
hope this helps.
do reward if helpful.
regards,
keerthi.

Similar Messages

  • Problem printing box in sap script

    i am printing the main window in a box in sap script, the box is appearing on page one but it does not seem to appear on the later pages, how do i get it to appear on all the pages? is there any setting that i'm missing?

    Hi,
    Can you elobrate your question.
    if your question is like this.
    -> You have only one page you are displaying the data in that box and that data is exceeding the main window and printing in
    the second page and you are not getting the BOX in the second page .
    a) If it is your question check whether there is any if condition
    before the BOX command like
    /:   if &page& = 1.
    /:  BOX height 5 ln width 50 ch
    /:   Endif.
    remove the if condition there.
    or
    /E  ele1.
    /:  BOX height 5 ln width 50 ch
    place the Box statement in the first line  of that window.
    -> You have two pages .
    a) If it is so check wheter the box command is there in both
    pages.
    Thanks,
    NN.

  • How to increase size of check box in sap script

    Hi All,
    I need to include check box in sap script. I included check box using insert>character->sap symbols. I cant able to view check box in print preview but i can able to get check box in print out.Size of check box printed in the paper is not having enough size. I need to increase size of the check box. Give me suggestion for increasing size of check box.
    Regards,
    Peranandam

    Chk the link.
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/80318f454211d189710000e8322d00/frameset.htm

  • How to display Lines and Boxes in SAP Script

    hi,
    Can any one help me how to display Lines and Boxes in SAP Script.
    Regards
    kiran

    The SAP printer drivers based on page-oriented printers use these commands when creating output whereas the line printers and non-supported page-oriented printers ignore these commands.
    Syntax:/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    This command draws a box of the specified size at the specified position.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    WIDTH determines the width of the box.
    Default: WIDTH value of the SIZE command.
    HEIGHT determines height of the box.
    Default: HEIGHT value of the SIZE command.
    FRAME determines the thickness of frame.
    Default: 0 (no frame).
    INTENSITY determines the box contents as a grayscale percentage.
    Default: 100 (full black)
    The other details I guess is provided by friends who have posted before me.
    Regards,
    K.Sibi

  • How to print u0080 in SAP Script

    Hi Experts,
       I have one small issue, i want to print €  symbol in sap script. If i puts this an hardcode vallue, but its not accepting this symbol.
      Plz anyone guide this, how to display and print the above symbel in script.
      This symbol is not available in displayable charactor area also.
    Point will be sure.
    Regards,
    Mohana

    Form to translate unicode symbol € to superscript €
    you can use this in subroutine i think this may be usefull to you before that you need to select the radio button of super script in charecter format for that perticular format
    FORM FORM_NAME TABLES  inttab STRUCTURE itcsy
                               outtab STRUCTURE itcsy.
    *Data Declaration.
      DATA : V_TEXT1(320).
      DATA: BEGIN OF ITAB OCCURS 0,
            WORD(40),
            END OF ITAB.
      READ TABLE inttab INDEX 1.
      V_TEXT1 = inttab-value.
      REPLACE ALL OCCURRENCES OF '€' IN V_TEXT1 WITH '<SP>€</>'.
      READ TABLE outtab INDEX 1.
      IF SY-SUBRC = 0.
        MOVE V_TEXT1 TO outtab-value.
        MODIFY outtab INDEX 1.
      ENDIF.
    ENDFORM

  • How to use print control in Sap script

    I would like to use print control in Sap script.Actualy my problem I have security font Troy ECF. Using this font I would like to print amount field in Check printing.
    we count download this font with sap .we talked to customer care they told we should hard code in sapscript. pls can any1 help on this how to do and how to use print control for this fonts.

    call this funcation. crate_text.
    CALL FUNCTION 'CREATE_TEXT'
             EXPORTING
               FID               =
               FLANGUAGE         =
               FNAME             =
               FOBJECT           =
             SAVE_DIRECT       = 'X'
             FFORMAT           = '*'
             TABLES
               FLINES            =
           EXCEPTIONS
             NO_INIT           = 1
             NO_SAVE           = 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.

  • How to Hide Print Privew Option (Sap Script)

    hi friends,
    i dont want print privew option (SAP SCRIPT) after executing the program the report shows output directly insted of showing print privew option.
    please reply.
    thanks in advance.
    regards,
    bhaskar

    Hello,
    When using the OPEN_FORM
    Set the field of the <b>
    ITCPO-TDNOPREV = 'X'
    </b>
    VAsanth

  • Printing checkboxes in SAP script

    Hi,
    I have a requirement where I need to print checkboxes for all the items displayed in SAP Script output.
    Is there any way to print checkboxes in the output document?
    Regards,
    Rajesh Bhogi

    Hi Rajesh,
    Below link can be useful for you:
    How to print u0080 in SAP Script
    Hope this will help.
    Regards,
    Nitin.

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

  • How to know print program for SAP Script

    Hi friends,
    how to know print program for SAP Script form name ?

    Hi ,
      You can use the following code changes in the layout & see..
    You have to create a program Z_BC460_EX4_HF for that..
    /:PERFORM GET_NAME IN PROGRAM Z_BC460_EX4_HF
    /:  USING &CUST&
    /:  CHANGING &NAME&
    /:ENDPERFORM.
    Dear &NAME&
    The ABAP routine could be defined as follows:
    IMPORTANT: The structure itcsy must be used for the parameters.
    REPORT Z_HENRIKF_SCRIPT_FORM .
      tables scustom.
      form get_name tables in_tab structure itcsy
                           out_tab structure itcsy.
      read table in_tab index 1.
      select single * from scustom
        where id = in_tab-value.
      if sy-subrc = 0.
        read table out_tab index 1.
        move scustom-name to out_tab-value.
        modify out_tab index sy-tabix.
      else.
        read table out_tab index 1.
        move 'No name' to out_tab-value.
        modify out_tab index sy-tabix.
      endif.
    You could also fill the ouput parameter table this way
       READ TABLE out_par WITH KEY 'NAME1'.
       out_par-value = l_name1.
       MODIFY out_par INDEX sy-tabix.
    endform.

  • What is print program for sap script?

    some of the print program of sap script.
    and also guide me to use that program

    for which sapscript ?
    you can use table TNAPR to find the print program and layoutset for output types. Maybe it will help you.
    regards,
    Hans

  • How to print check box in sap script

    I have a requirement in SAP Script to print a Check bok.
    I tried using SAP symbols in the script, but it does not print. It inserts <679> for checkbox &  <697> for marked checkbox. Any special command to be passed?
    Regards,
    Prabhu Rajesh.

    Hi,
    Are you sure your printer is capable of printing graphics ?
    Cheers
    Colin.

  • How to print those check boxes in SAP scripts?

    Hi experts,
    I have to create sap script form in which i have to create check boxes and at run time according to some condition i have to
    check those check boxes.how this can be done?
    Thanks in advance
    Rohit

    Check out the below related threads
    check box
    Re: check box in script
    Regards,
    Santosh

  • Unequal height in BOX in SAP Script??

    Hi Experts,
    In the SAP Script, am defining a BOX with the below code,
    /: POSITION WINDOW
    /: POSITION XORIGIN '-0.5' CH YORIGIN '-0.25' LN
    /: SIZE WIDTH '+0.4' CH HEIGHT +2 LN
    /:BOX FRAME 10 TW
    /:BOX HEIGHT '1.7' LN INTENSITY 20
    WINDOW size is,
    left: 50 CH
    upper: 14 LN
    width: 28 CH
    height: 11 LN
    am getting the print it as below,
                              I
                              I
    I                         I
    I                         I
    I                         I
    I                         I
    I                         I
    I----
    I
    left and right vertical lines are continuous lines, as my laptop dont hv required keys, am typing just upper case "i", so, actually, there is no gap, think that, its a continuoas vertical line
    issue: when u see the left vertical column(height), its 6 hieght, but when u see the right vertical comun its 8 height........so, why the left is shorter than right vertical column?
    thanq
    Edited by: SAP ABAPer on Nov 24, 2008 5:37 PM

    Try merging both BOX commands into one.

  • Printing Footer in Sap script

    Hi,
    though seems very simple but I am stick:(
    I want to add a a table in a existing sapscript which shold always print on the last page.
    I am not very good in sap script and text element so all the text elements are defined with right form I defined mine.
    but when I am executing the form getting the error Element 705 window FOOTER is not defined for form ...
    one weird thing when I am changing something to window othe text element go negative i.e. 700 becomes -700 and next time another error...
    Anybody any Idea??

    Might be printing from which written like this fasion:
    INCLUDE 'SD_RVADIN01' OBJECT TEXT ID SDVD PARAGRAPH ZB.
    Search it and see text in SO10

Maybe you are looking for

  • Error in Solar02 " Error - No system found for component SAP LEARNING.....

    Hi, I have selected the Business repository from the Tcode Solar01c, and i can see the list of configuration under Business Scenario, when i am trying to execute any Tcode,(My understanding is that this Tcode must execute in Development system) it gi

  • Whenever I start the tomcat server, Im getting an error in netbeans?

    Whenever I start the tomcat server, Im getting an error in netbeans? Starting of Tomcat failed. '127.0.0.1' is not recognized as an internal or external command, operable program or batch file. Even I set the path & catalina_home in Environment varia

  • Problem in PA30 with custom infotype

    Hi, I created a custom infotype 9001 and i  want to check the correctness of the infotype in PA30 but when enter the personnel no and infotype as 9001 and click on create it goes to short dump and an error arises "Dialog module "RP_9001 " not found".

  • Sun ONE Portal Server 6.1 - Reporting features

    Hi, I am just curious whether the Portal Server has any built-in feature for adhoc reporting (based on the user selection). If yes please suggest me on how to enable the same / use the same. Thank you, V

  • ERROR IN OUTPUT WITH  CONDITIONS IN SMARTFORM

    I have   two conditions in smartform. if i_final-konrth NE g_temp9.    i_final-ssign eq g_temp10. then we need to print text1 in the output. There are no program lines in the  text. g_temp9 and g_temp10 are passed from the program. text1 is not getti