In SAP Scripts How to write the fields 90  Degrees to regular format

Hi ,
I am working with SAP Scripts . Sometimes you may want to print text vertically.
I have got a requiremnt in which there we have to write some data which is to be written 90 degres to regular output.
please let me know if there is any printer setting for that .
Regards.
Rohit.

Dear friend,
For printing the text verticaly you need to made a
print controle at printer level.
select a command and in that you have to go in tab general
attribute.
and in front of :Include Printer Control: give the z print controle.
in my company basis people had made one print controle
ZR090.
YOU have to use this command two times between
the text .
first command will move the printer at 90 degree and then
write the text and second will move back to horizental.
I dont know how this ZR090 can be made.
rest wht i have written is very true and currently working.
hope this will solve your problem.
rewards are expected.
Thanks and Regards
vivek kumar srivastava

Similar Messages

  • In sap scripts how to display the driver program

    Hi,
        I Want to know the sap scripts How to display the output to driver program

    Hi,
    Go to NACE Transaction.
    Select application for ex: if sales V1.
    Click on output types.
    Select the output type for ex : BA00
    Double click on Processing routines.
    There you can find the Driver Program name and Script/smart form name.
    Reward if useful.
    Thanks,
    Raju

  • Script : how to change the Field name in standard program(ZM_MEDRUCK)

    Hi Experts,
    I am working with SAP SCRIPT. i need to change the Field Name that is PO NO to Document No & PO DATE to Document Date.
    These are assigned in data declaration as gv_name and gv_date.
    Can anyone help me to change this Fields.
    Regards,
    Vijayan.R

    Hi,
    You can archive this by making change in SAP script only. You don't need to touch the standard prgm.
    Debug the script and find it out which fields (In script editor) are printing these text on layout... then just replace them by creating your own text...
    You can create a text in TTDTG table,, like ZZPO_NAME = ( Document Name),, and use this filed in the script editor.
    &ZZPO_NAME&

  • SAP Script - How to write data in a table format.

    Hi All,
    In my requirement, I need to show item data in a table format ( In a box, with horizental & veritcal lines.
    can somebody pl give me a small code to do this.
    Regards,
    Hardik

    Hi
    SCRIPT BOXES
    POSITION WINDOW
    SIZE WIDTH '160' MM HEIGHT '140' MM
    BOX FRAME 10 TW
    Box
    BOX HEIGHT '11' MM WIDTH '160' MM FRAME 10 TW INTENSITY 35
    linessssssss
    BOX XPOS '20' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '45' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '80' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '120' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    Boxes, Lines, Shading: BOX, POSITION, SIZE
    Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to print particular windows within a form or passages of text within a window in a frame or with shading.
    The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when printing. Line printers and page-oriented printers not supported in the standard ignore these commands. You can view the resulting printer output in the SAPscript print preview.
    Syntax:
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    BOX Command
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.
    XPOS, YPOS
    Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    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
    Width of the box. Default: WIDTH value of the SIZE command.
    HEIGHT
    Height of the box. Default: HEIGHT value of the SIZE command.
    FRAME
    Thickness of frame.
    Default: 0 (no frame).
    INTENSITY
    Grayscale of box contents as %.
    Default: 100 (full black)
    Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    TW (twip)
    PT (point)
    IN (inch)
    MM (millimeter)
    CM (centimeter)
    LN (line)
    CH (character).
    The following conversion factors apply:
    1 TW = 1/20 PT
    1 PT = 1/72 IN
    1 IN = 2.54 CM
    1 CM = 10 MM
    1 CH = height of a character relative to the CPI specification in the form header
    1 LN = height of a line relative to the LPI specification in the form header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shading having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    POSITION Command
    Syntax
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).
    Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
    XORIGIN, YORIGIN
    Origin of the coordinate system.
    WINDOW
    Sets the values for the left and upper edges to match those of the current window (default setting).
    PAGE
    Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
    /: POSITION WINDOW
    Sets the origin for the coordinate system to the upper left corner of the window.
    /: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
    Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
    /: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
    Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
    SIZE Command
    Syntax
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started, the SIZE value is set to the same values as the window itself (default setting).
    Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
    WIDTH, HEIGHT
    Dimensions of the rectangle or line.
    WINDOW
    Sets the values for the width and height to the values of the current window (default setting).
    PAGE
    Sets the values for the width and height to the values of the current output page.
    /: SIZE WINDOW
    Sets WIDTH and HEIGHT to the current window dimensions.
    /: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
    Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
    /: POSITION WINDOW
    /: POSITION XORIGIN -20 TW YORIGIN -20 TW
    /: SIZE WIDTH +40 TW HEIGHT +40 TW
    /: BOX FRAME 10 TW
    A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
    <REMOVED BY MODERATOR>
    Regards
    Anji
    Edited by: Alvaro Tejada Galindo on Jul 8, 2008 10:59 AM

  • How to change the field length in standard sap program.

    Hi All,
    How to change the field length in standard sap program.
    Urgent
    Example:
    Text1 type c length 75,
    To change :
    Text1 type c length 150,
    Point will be rewarded..
    Thank you,
    Vikram.C

    If the only solution is to change the sap standard program, simply change the program, it will prompt for an access key. This key can be retrieved in the SAP support portal (service.sap.com) at keys and requests, sccr keys, register object.
    Sometimes these actions are outsourced to a competence center, so maybe youre not entitled to do this, in any case ask a resident senior developer for support.
    regards, Rob

  • In SAP Script how to hard code my Company address in footer window

    Hi All ,
    In SAP Script how to hard code my Company address in footer window .
    Ex : in YB_F140_ACC_STAT this script i want to keep my company address, i want to hard coad , i dont want to use any field from table.
    Please give me step by step.
    Thanks
    Sridhar

    Hi,
    You can make use of standard text...
    create a standard text in SO10 with your company address
    and in the footer window of your script.. use include text and provide the name of the standard text you created in SO10.
    In the text editor... goto insert > text> standard
    You get popup give the name of the text name id and language
    regards
    padma

  • How to keep the field open for input with error message in report program

    Hi,
      Need a help in solving the below issue.
    "How to keep the field open for input with error message in report program"
    Regards,
    C.Shasiraj.

    Hi...
    you have to use the event:
    <b>AT SELECTION-SCREEN ON <FIELD> EVENT.</b>
    u have to give an error message in this event.
    Consider the following <b>Example:</b>
    <b>PARAMETERS : NUMBER TYPE I.
    AT SELECTION-SCREEN ON NUMBER.
      IF NUMBER = 10.
        MESSAGE 'Number vakue is 10' TYPE 'E'.
      ENDIF.
    START-OF-SELECTION.
      WRITE NUMBER.
    </b>
    in this if u give the value of number = 10, it will not proceed further, if u give some other value other than 10 you will proceed further...
    Execute this program once u will understand....
    also Consider the following links :
    <b>Regarding events:</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a237d9b511d1950e0000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a23ad9b511d1950e0000e8353423/frameset.htm
    <b>Regarding messages:</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/aa575426ad11d2954d0000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/aa575426ad11d2954d0000e8353423/frameset.htm
    This is very useful.......
    Reward points if useful....
    Suresh....

  • How to write the expression when create the calculated column?

    Dear,
           I want to create some calculated column in my attribute view, but I don't know how to write the code in the expression, is there any introduction about this part, how to use those function and how about the grammar in this expression code ?  or is there any example about this calculated column?
       Thanks for your sincerely answer.

    Hi Zongjie,
    you can find some information about the creation of calculated columns in the HANA Modeling Guide (http://help.sap.com/hana/SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en.pdf).
    Within chapter 6.2.1 (Create Analytic Views) you can see under point 7 some basics and also a simple example. The same is also valid for Calculation Views.
    Chapter 8.9 (Using Functions in Expressions) describes the different available functions.
    You also can use the integrated search in the HANA Studio by clicking the "?" button in the button left corner. Then you get some links in the side panel with related information.
    In general you can write your expression manually or you can just drag and drop the functions, elements, operators into the editor window. For example if you drag and drop the "if" function into the editor window you get "if(intarg,arg2,arg3)" inserted. The arguments can be replaced manually or also by drag and drop.
    It is also worse to use the "Validate Syntax" button on top of the editor window. It gives you directly a feedback if your expression syntax is correct. If not you get some helpful information about the problem (ok, sometimes it is a little bit confusing because of the cryptic error message format ).
    Best Regards,
    Florian

  • How to hide the field from the view in the webdynpro application?

    Hi Gurus,
    I got a requirement where in which ,default layout has the field name Time.......To......... which is (2 input box ) and one lable assigned to the container.........
    Now my requirement is to hide this field from the layout for all cases of leave......(all types of leave)....
    I got a few inputs from forum that we can achieve this by implementing the following steps..........
    Create In context => Value attribute => Say Visibility
    Go to its properties
    Select com.sap.ide.webdynpro.uielementdefinitions.Visibility
    In View Layout
    Select UI Element Set Visible property to this context variable Visibility.
    In wdDoModifyView() You can set this property to false
    wdContext.currentContextElement().setVisibility(false);
    Can you people tell me where to create the value attribute........
    In the view context or in the component context...........
    and field that am talking about is assign to the container you want me to assign this context variable property to all ......Like to input box ,label and the container..........
    Please calrify this ASAP...........
    Thanks in Advance,
    Dharani

    Hi Manoj......
    Hi Murutuza,
    As per your guidelines I have created the value attribute in View context (which has the field..... which needs to be hide)inside the value node say FieldVisibility.......and attribute name OldTimeDuration......and I set this value with uidefeneitions Visibility .......
    and I bind this vaule with the field property visible(Time.......To..........)which I need to hide...........
    Now in the view implementation tab ..........I have coded in the doinit method(since my requirement to hide the field from the layout in all cases).........
    wdContext.currentFieldVisibilityElement().setOldTimeDuration(WDVisibility.NONE);
    But if I deploy the application and see still am getting the same field dispalying in the screen.........
    I even tried putting this code in wdmodifyview method.........same results........
    Kindly tell me how to hide the field permenantly from the screen............(without any conditions.)
    Thanks in Advance,
    Dharani

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • Sap script '' how to create table frame in sap script"""

    i have some problem in sap script''  how to create table frame in sap script"""

    Hi,
    you can use BOX command..
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT and FRAME both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.
    1. XPOS, YPOS: Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    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
    2. WIDTH: Width of the box. Default: WIDTH value of the SIZE command.
    3. HEIGHT: Height of the box. Default: HEIGHT value of the SIZE command.
    4. FRAME: Thickness of frame.
    Default: 0 (no frame).
    5. INTENSITY: Grayscale of box contents as % .
    Default: 100 (full black)
    Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    • TW (twip)
    • PT (point)
    • IN (inch)
    • MM (millimeter)
    • CM (centimeter)
    • LN (line)
    • CH (character).
    The following conversion factors apply:
    • 1 TW = 1/20 PT
    • 1 PT = 1/72 IN
    • 1 IN = 2.54 CM
    • 1 CM = 10 MM
    • 1 CH = height of a character relative to the CPI specification in the layout set header
    • 1 LN = height of a line relative to the LPI specification in the layout set header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shadowing having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    check the fallowing link also
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803293454211d189710000e8322d00/content.htm
    Mark the points if u find it useful...
    Regards,
    Omkar.

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to write the JTables Content into the CSV File.

    Hi Friends
    I managed to write the Database records into the CSV Files. Now i would like to add the JTables contend into the CSV Files.
    I just add the Code which Used to write the Database records into the CSV Files.
    void exportApi()throws Exception
              try
                   PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
                   System.out.println("Connected");
                   stexport=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                   rsexport=stexport.executeQuery("Select * from IssuedBook ");
                   ResultSetMetaData md = rsexport.getMetaData();
                   int columns = md.getColumnCount();
                   String fieldNames[]={"No","Name","Author","Date","Id","Issued","Return"};
                   //write fields names
                   String rec = "";
                   for (int i=0; i < fieldNames.length; i++)
                        rec +='\"'+fieldNames[i]+'\"';
                        rec+=",";
                   if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                   writing.println(rec);
                   //write values from result set to file
                    rsexport.beforeFirst();
                   while(rsexport.next())
                        rec = "";
                         for (int i=1; i < (columns+1); i++)
                             try
                                    rec +="\""+rsexport.getString(i)+"\",";
                                    rec +="\""+rsexport.getInt(i)+"\",";
                             catch(SQLException sqle)
                                  // I would add this System.out.println("Exception in retrieval in for loop:\n"+sqle);
                         if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                        writing.println(rec);
                   writing.close();
         }With this Same code how to Write the JTable content into the CSV Files.
    Please tell me how to implement this.
    Thank you for your Service
    Jofin

    Hi Friends
    I just modified my code and tried according to your suggestion. But here it does not print the records inside CSV File. But when i use ResultSet it prints the Records inside the CSV. Now i want to Display only the JTable content.
    I am posting my code here. Please run this code and find the Report.csv file in your current Directory. and please help me to come out of this Problem.
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class Exporting extends JDialog implements ActionListener
         private JRadioButton rby,rbn,rbr,rbnore,rbnorest;
         private ButtonGroup bg;
         private JPanel exportpanel;
         private JButton btnExpots;
         FileReader reading=null;
         FileWriter writing=null;
         JTable table;
         JScrollPane scroll;
         public Exporting()throws Exception
              setSize(550,450);
              setTitle("Export Results");
              this.setLocation(100,100);
              String Heading[]={"BOOK ID","NAME","AUTHOR","PRICE"};
              String records[][]={{"B0201","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0202","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0203","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0204","PRIAM","SELVI","1354"},
                               {"B0205","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0206","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0207","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0208","PRIAM","SELVI","1354"}};
              btnExpots= new JButton("Export");
              btnExpots.addActionListener(this);
              btnExpots.setBounds(140,200,60,25);
              table = new JTable();
              scroll=new JScrollPane(table);
              ((DefaultTableModel)table.getModel()).setDataVector(records,Heading);
              System.out.println(table.getModel());
              exportpanel= new JPanel();
              exportpanel.add(btnExpots,BorderLayout.SOUTH);
              exportpanel.add(scroll);
              getContentPane().add(exportpanel);
              setVisible(true);
          public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              try {
              PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
              if(obj==btnExpots)
                   for(int row=0;row<table.getRowCount();++row)
                             for(int col=0;col<table.getColumnCount();++col)
                                  Object ob=table.getValueAt(row,col);
                                  //exportApi(ob);
                                  System.out.println(ob);
                                  System.out.println("Connected");
                                  String fieldNames[]={"BOOK ID","NAME","AUTHOR","PRICE"};
                                  String rec = "";
                                  for (int i=0; i <fieldNames.length; i++)
                                       rec +='\"'+fieldNames[i]+'\"';
                                       rec+=",";
                                  if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                                  writing.println(rec);
                                  //write values from result set to file
                                   rec +="\""+ob+"\",";     
                                   if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                                   writing.println(rec);
                                   writing.close();
         catch(Exception ex)
              ex.printStackTrace();
         public static void main(String arg[]) throws Exception
              Exporting ex= new Exporting();
    }Could anyone Please modify my code and help me out.
    Thank you for your service
    Cheers
    Jofin

  • How to write the code to send the report output to the local file.

    dear all,
    how to write the code to send the report output to the local file.
    Thanks & Regards,
    Jyothi.

    Hi,
    Try this , it will display report and download the file as well. Just vhange the path and execute
    TYPE-POOLS : SLIS.
    DATA : IT_SCARR TYPE TABLE OF SCARR,
           IT_FCAT  TYPE SLIS_T_FIELDCAT_ALV.
    SELECT *
    FROM SCARR
    INTO TABLE IT_SCARR.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    *   I_PROGRAM_NAME               =
    *   I_INTERNAL_TABNAME           =
        I_STRUCTURE_NAME             = 'SCARR'
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
    *   I_INCLNAME                   =
    *   I_BYPASSING_BUFFER           =
    *   I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = IT_FCAT
    * EXCEPTIONS
    *   INCONSISTENT_INTERFACE       = 1
    *   PROGRAM_ERROR                = 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 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK              = ' '
    *   I_BYPASSING_BUFFER             =
    *   I_BUFFER_ACTIVE                = ' '
    *   I_CALLBACK_PROGRAM             = ' '
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   I_STRUCTURE_NAME               =
    *   IS_LAYOUT                      =
       IT_FIELDCAT                    = IT_FCAT
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
    *   IT_SORT                        =
    *   IT_FILTER                      =
    *   IS_SEL_HIDE                    =
    *   I_DEFAULT                      = 'X'
    *   I_SAVE                         = ' '
    *   IS_VARIANT                     =
    *   IT_EVENTS                      =
    *   IT_EVENT_EXIT                  =
    *   IS_PRINT                       =
    *   IS_REPREP_ID                   =
    *   I_SCREEN_START_COLUMN          = 0
    *   I_SCREEN_START_LINE            = 0
    *   I_SCREEN_END_COLUMN            = 0
    *   I_SCREEN_END_LINE              = 0
    *   IR_SALV_LIST_ADAPTER           =
    *   IT_EXCEPT_QINFO                =
    *   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER        =
    *   ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = IT_SCARR
    * EXCEPTIONS
    *   PROGRAM_ERROR                  = 1
    *   OTHERS                         = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
      EXPORTING
    *    BIN_FILESIZE              =
        FILENAME                  = 'C:\Documents and Settings\sap\Desktop\Hi.xls' " Change path
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      CHANGING
        DATA_TAB                  = IT_SCARR
    *  EXCEPTIONS
    *    FILE_WRITE_ERROR          = 1
    *    NO_BATCH                  = 2
    *    GUI_REFUSE_FILETRANSFER   = 3
    *    INVALID_TYPE              = 4
    *    NO_AUTHORITY              = 5
    *    UNKNOWN_ERROR             = 6
    *    HEADER_NOT_ALLOWED        = 7
    *    SEPARATOR_NOT_ALLOWED     = 8
    *    FILESIZE_NOT_ALLOWED      = 9
    *    HEADER_TOO_LONG           = 10
    *    DP_ERROR_CREATE           = 11
    *    DP_ERROR_SEND             = 12
    *    DP_ERROR_WRITE            = 13
    *    UNKNOWN_DP_ERROR          = 14
    *    ACCESS_DENIED             = 15
    *    DP_OUT_OF_MEMORY          = 16
    *    DISK_FULL                 = 17
    *    DP_TIMEOUT                = 18
    *    FILE_NOT_FOUND            = 19
    *    DATAPROVIDER_EXCEPTION    = 20
    *    CONTROL_FLUSH_ERROR       = 21
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24
    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 METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
      EXPORTING
        DOCUMENT               = 'C:\Documents and Settings\sap\Desktop\Hi.xls' "Change path
    *    APPLICATION            =
    *    PARAMETER              =
    *    DEFAULT_DIRECTORY      =
    *    MAXIMIZED              =
    *    MINIMIZED              =
    *    SYNCHRONOUS            =
    *    OPERATION              = 'OPEN'
    *  EXCEPTIONS
    *    CNTL_ERROR             = 1
    *    ERROR_NO_GUI           = 2
    *    BAD_PARAMETER          = 3
    *    FILE_NOT_FOUND         = 4
    *    PATH_NOT_FOUND         = 5
    *    FILE_EXTENSION_UNKNOWN = 6
    *    ERROR_EXECUTE_FAILED   = 7
    *    SYNCHRONOUS_FAILED     = 8
    *    NOT_SUPPORTED_BY_GUI   = 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.

  • How to validate the fields  and how to display the error messagein presenta

    Hi,
    I am new to OBPM 10g, pls tell me how to validate the fields in a presentation.
    for example if we take login presentation if user enters his user name and password wrongle and submit the form. Then we need to display error message right side of the each field i.e user name and passowrd is wrong and try again.
    Regards
    jaya
    Edited by: 12345 on Aug 12, 2010 10:38 PM

    Hi Jaya,
    You can initially set the validation for empty values.. that is when the user dint enters any value and clicks on submit.
    for these vadliations you need to write a method and call it on submit button click!!
    secondly, you can validate for the format if required.
    thirdly, you can validate against a database for the credentials. For this you need to fetch list of usernames from database and search for user entered value in that list.
    Optimal query would be : if user name not null, query for pwd of the entered user name from database or file storage. if you dont get any value for pwd of given username, its incorrect user name. if you get some pwd value for username, then check against the one user entered in pwd field..
    Write all this logic in a method and call on submit button click event of the login form!!
    HTH
    Sharma

Maybe you are looking for