How to write heading in bold on a simple list?
On a simple list, I want to write a heading in bold. How to write one in bold?
Thanks.
Hello,
Format intensified on.
Write: / l_header_text.
Format intensified off.
Message was edited by: Cyrill Smirnov
Similar Messages
-
Hi everybody how to save the inputed data in one simple list output .
here am wrting the description of the requirement ...
am displaying one report output in that output i have all my fields open so that user can directly chage the dats what ever needed or he needs.
then after changing when he will press the save button the changed data should be saved to one of the database tables ..
so can anybody please help me out how to do this requirement
this is a simple report with all fields in the output screen in input modehiiii
if you want to save the data that user have updated then use following statement on SAVE button.
UPDATE ztable1
SET C1 = 2
WHERE C2 IN ( SELECT C3
FROM T2
WHERE C4 = 0)
reward if useful
thx
twinkal -
How to write Header and Footer elements in Write file Adapter
Hi,
I have a requirement to write the file.The write file contains header and footer elements ,how we can write these elements. These elements are fixed for all files.these are not come from any input.below is the sample file.
$begintable
name,Id,Desg
ad,12,it
$endtableHi,
I have created the XSD for you, and i created a sample SOA Composite which writes the file same like what you want, the below XSD can write a file with one header record, multiple data records and one trailer record.
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/WriteFile"
targetNamespace="http://TargetNamespace.com/WriteFile"
elementFormDefault="qualified" attributeFormDefault="unqualified"
nxsd:version="NXSD" nxsd:stream="chars" nxsd:encoding="UTF-8">
<xsd:element name="Root-Element">
<xsd:complexType>
<!--xsd:choice minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="terminated" nxsd:terminatedBy=","-->
<xsd:sequence>
<xsd:element name="RECORD1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="header" type="xsd:string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"
nxsd:quotedBy='"'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RECORD2" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="data1" type="xsd:string"
nxsd:style="terminated" nxsd:terminatedBy=","
nxsd:quotedBy='"'/>
<xsd:element name="data2" type="xsd:string"
nxsd:style="terminated" nxsd:terminatedBy=","
nxsd:quotedBy='"'/>
<xsd:element name="data3" type="xsd:string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"
nxsd:quotedBy='"'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RECORD4" nxsd:conditionValue="$endtable">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="trailer" type="xsd:string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"
nxsd:quotedBy='"'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Hope this helps,
N -
How to write heading in the xls file with each of the channel in each column?
Dear All,
While writing the data into the xls file through .lvm method I want the Headong for each channel to be include on each of the column, but i dint know how to do this? is this possible in the LabVIEW from any of the file writing method? if yes how can i do that? please help me.........
Thanks,
Nishant DesaiThanks Chilly,
Its a really fantastic idea, and it works for me too, but the thing inside was every time once it writes the heading and then it write the data again after that it wirtes the heading and write the data, but i ve copup with dat and i ve modified the vi which u ve given to me, i am attaching that vi to with this.
wat i ve done is just putting the write to spreadsheet data vi into the while loop and other all are outside the while loop, which makes the heading to write once and data to write continuosly.
Thanks & Regards,
Nishant Desai
Attachments:
Write channel names_yours.vi 25 KB
Write channel names_mine.vi 31 KB -
How to write a script to cycle through a list of search terms and download PDF files
I need to download ~2500 PDF files.
Each one is accessible by entering a search term on a website and clicking a link in the search result to download the PDF.
How can I create an automated process to do the following?
(1) select the first search term from a list in Excel
(2) Enter it into the search field on a specified website
(3) Download a PDF file from a link in the search results.
(4) Repeat using the next search term in the listI need to download ~2500 PDF files.
Each one is accessible by entering a search term on a website and clicking a link in the search result to download the PDF.
How can I create an automated process to do the following?
(1) select the first search term from a list in Excel
(2) Enter it into the search field on a specified website
(3) Download a PDF file from a link in the search results.
(4) Repeat using the next search term in the list -
How To: write a logo image in a list display report
I have a simple list report that I create with a bunch of write statements. How can I insert a Logo image on this report ?
I have my Logo image loaded in SE78 as a bitmap graphic.
Not sure if with the write statement, I can write out this logo on my report.
I would think this should be able to be done, just not sure how.
Thanks,
DavidHi David, check this code.
REPORT zdem_555 .
DATA: docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c .
DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
html_table LIKE w3html OCCURS 1,
return_code LIKE w3param-ret_code,
content_type LIKE w3param-cont_type,
content_length LIKE w3param-cont_len,
pic_data LIKE w3mime OCCURS 0,
pic_size TYPE i.
START-OF-SELECTION.
PERFORM show_pic.
WRITE : /'hello see the picture ........'.
*& Form show_pic
FORM show_pic.
DATA: repid LIKE sy-repid. repid = sy-repid.
CREATE OBJECT picture_control_1
EXPORTING parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 100
left = 700
top = 1
width = 200.
*CHANGE POSITION AND SIZE
IF url IS INITIAL.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
*CHANGE IMAGE NAME BELOW
query_table-value = 'BIKER'.
APPEND query_table.
CALL FUNCTION 'WWW_GET_MIME_OBJECT'
TABLES
query_string = query_table
html = html_table
mime = pic_data
CHANGING
return_code = return_code
content_type = content_type
content_length = content_length
EXCEPTIONS
object_not_found = 1
parameter_not_found = 2
OTHERS = 3.
IF sy-subrc ne 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-*msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown
size = pic_size
lifetime = cndp_lifetime_transaction
TABLES
data = pic_data
CHANGING
url = url
EXCEPTIONS
OTHERS = 1.
ENDIF.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = url.
ENDFORM. "show_pic -
How to write and what is the G/L Distribution Report (AP)?
Hi all,
I am anticipating to write some abap reports..Here is one of them..Anyone can help me with writing a Report , how to write 'G/L Distribution Report (AP) -
But since I am new to Abap , if you wish to reply, please use a little more detail and simple explanation, step by step so I can understand what is the idea(The Business use, and business idea of doing such report?), how it can be acheived...what kind of report should be used , techniques, tables etc..?.:)
Appreciate your help!
Regards,
BobyHi ,
i am get your exact report requirements , nay , i will give you the brief expalin.
AP -> Accoutns Payable . so it deals with in Finnance to Vendor . it means you are maintain the transcations of the payment s to the vendor . so thae table's are .
vendor master tables :
LFA1 -> Vendor Master (General Section),
ADRC -> Addresses (Business Address Services)
LFB1-> Vendor Master (Company Code) ....etc .
for finance data
BKPF -> Accounting Document Header
BSEG->Accounting Document Segment
BSIS->Accounting: Secondary Index for G/L Accounts
PAYR->Payment Medium File
WITH_ITEM->Witholding tax info per W/tax type and FI line item ,
REGUP-> Processed items from payment program ,
REGUH-> Settlement data from payment program ,....etc
with abouve given table you can do the report for vendor .
Start selecting data from the bseg , because it will have all the data ...... then if it is payement , then go to the regup for processed item ..... it means payment happpend data ......... then go to reguh for the payment method (check, draft ,etc) then to the payr for check data.etc .... if you want vedor address go to lfa1 there ADRNR is there primary key to adrc table for detail addresss..
if it is use full , reward points ...........
Girish -
How To Create Header in ALV List Report
Hi All,
I want to create a Header for <b>MY ALV List Report</b>!
How can i achieve the same. It should come above <b>ALV</b>.
ALV report i had already written and it is coming correctly.
Heading should look like this:
<i>1st Line</i>
<b>PROGRAM NAME: XXXXXX CLIENT: XXXXXXXXXX PAGE:XX</b>
<i>2nd Line</i>
<b>RUN DATE/TIME: XXXXX - XXXX REPORT NAME/HEADER</b>
How can i acheive the same in <b>ALV List Report</b>!
I am amking use of <b>REUSE_ALV_LIST_DISPLAY</b> Function module.
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
Use the sample code specified below as the guideline. For more info. refer to the documentation of the FM 'REUSE_ALV_COMMENTARY_WRITE'.
DATA: first(01) type c,
events type slis_t_event,
gt_list_top_of_page type slis_t_listheader,
ls_event type slis_alv_event.
initialization.
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = events
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
read table events with key name = 'TOP_OF_PAGE'
into ls_event.
if sy-subrc = 0.
move: 'TOP_OF_PAGE' to ls_event-form.
append ls_event to events.
clear ls_event.
endif.
End of additions
Start-of-selection
START-OF-SELECTION.
Top-of-page
TOP-OF-PAGE.
PERFORM TOP_OF_PAGE.
FORM TOP_OF_PAGE .
data: ls_line type slis_listheader.
if first is initial.
ls_line-typ = 'S'.
ls_line-key = 'Run Date :'.
write: sy-datum to ls_line-key+10 mm/dd/yyyy.
ls_line-info = 'Billing Date:'.
write: s_fkdat-low to ls_line-info+15 mm/dd/yyyy.
ls_line-info+28 = 'To'.
write s_fkdat-high to ls_line-info+32 mm/dd/yyyy.
append ls_line to gt_list_top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
first = 'N'.
else.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
endif.
ENDFORM. " top_of_page
<b>Please mark helpful answer.</b>
Regards,
Amit Mishra -
How to write a file using mod pl/sql
hi,
i am having a submit button in my procedure. which should inturn create .sql file in a file path.
is there any way to create a fileusing htp and htf methods.
Thanks in advance
Hari>
i am having a submit button in my procedure. which should in turn create .sql file in a file path.
is there any way to create a file using htp and htf methods.
>
Why are you wasting your time coding from scratch using the PL/SQL Web Toolkit instead of the APEX framework?
From Re: how to write a file using mod pl/sql it appears that you are not using APEX, so a number of the approaches APEX offers are not relevant. You appear to be looking for a file download solution using the <tt>wpg_docload.download_file</tt> method, such as:
create or replace procedure download_file (
p_filename in varchar2
, p_mimetype in varchar2
, p_content in out nocopy blob)
is
begin
-- Set up HTTP header.
-- Use "application/octet" as default MIME type.
owa_util.mime_header(nvl(p_mimetype, 'application/octet'), false);
-- Set the size so the browser knows how much to download.
htp.p('Content-length: ' || dbms_lob.getlength(p_content));
-- Filename will be used as default by the browser in "Save as..."
htp.p('Content-Disposition: attachment; filename="' || p_filename || '"');
-- Close header.
owa_util.http_header_close();
-- Stream the file content to the browser.
wpg_docload.download_file(p_content);
end download_file; -
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
JofinHi 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 get header data in ME_PROCESS_REQ_CUST
Hi all,
how to get header data in badi ME_PROCESS_REQ_CUST-process_itemIsn't it available in the parameters of the method that you are tyring to write.
Regards,
Ravi
Note - Please mark all the helpful answers -
How to write macro's in hr abap
Hi,
All
I am new to HR ABAP .Does any body give links to write macro's in HR ABAP
Thanks in advance.
regards
Ramh,
adding to the aboce post.
chk this.
Macros:
Introduction
Programs that process the cluster data (for example, RX) do not access the cluster independently. The data is accessed using a defined interface created with macros.
Macro contains some part of source code which it will be useful for number of applications. Macro is module which is stored
Naming Conventions of Macro:
RP-aaa-bb-cc
aaa is the type of Macro. It takes two values
o IMP Import Macro
o EXP Export Macro
bb is the Database table where the data is saved:
o C1 Database object PCL1
o C2 Database object PCL2
o C3 Database object PCL3
o C4 Database object PCL4
Cc is the cluster, it may take
o RX Cluster object RX
o RD Cluster object RD
o B2 Cluster object B2 and so on.
Defining and Calling the Macros
Defining:
There are two options for defining the Macros
Macros are defined using the ABAP Commands DEFINE .END-OF-DEFINITION. A macro can be used within a report or within include. If a macro is used in a report, and the macro is defined in include with the DEFINE command, include must be integrated.
Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC. The coding is grouped under a specific name in the table key.
According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
Difference between the two methods is:
If a macro is changed, each report using this macro is automatically regenerated when it is executed.
When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
Standard HR Macros
o The macro RP-PROVIDE-FROM-FRST retrieves the first(start) data record which is valid in the data selection period.
o The macro RP-PROVIDE-FROM-LAST retrieves the last(latest) data record which is valid in the data selection period.
o The macro RP-READ-INFOTYPE retrieves the data record(s) which is valid in the data selection period.
How to check whether the macro operation is successful or not
For every macro, whether the operation was successful or not will be checked with
PNP-SW-FOUND.
If PNP-SW-FOUND = 1, then the operation is successful.
Where exactly the Macro code is stored
The program code pertaining to this macro is stored in the control table RMAC
Guidelines for how and when to use the Standard Macros
o RP_PROVIDE_FROM_FRST
Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the first data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry that might not necessarily correspond to the first time entry.
Features
The first entry for a specified period is placed in the table header entry from an internal infotype table.
Parameters
RP_PROVIDE_FROM_FRST inftytab subty beg end
IN : 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity start date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the initial table header entry if PNP-SW-FOUND = 0
Example
(RP_PROVIDE_FROM_FRST inftytab subty beg end)
RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
ENDIF.
or
RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing' REJECT.
ENDIF.
o RP_PROVIDE_FROM_LAST
You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
Features
The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list.
Parameters
RP_PROVIDE_FROM_LAST inftytab subty beg end
IN : 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity begin date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the cleared table header entry if PNP-SW-FOUND = 0
Example:
RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
ENDIF.
OR
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing'. REJECT.
ENDIF.
RP_READ_INFOTYPE
You can use the macro in all programs at any point. You can also use it in function modules. In database PNP, an infotype is usually read with GET PERNR. Using macro RP_READ_INFOTYPE is an exception.
You can also use the function module HR_READ_INFOTYPE. For information on how to use the function module, see the documentation on Function Modules.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity begin and end are correct date specifications (preferably of the type DATE).
The infotype table must match the infotype number.
The program using the macro must contain the include DBPNPMAC.
Features
The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period are placed in an internal infotype table.
Parameters
RP_READ_INFOTYPE pernr infty inftytab beg end
IN : 1) Personnel number of the person requested
2) Infotype number of the required infotype
3) Name of the internal infotype table
4) Validity start date of the time interval
5) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND = 0, if there is no matching record in the dataset
PNP-SW-FOUND = 1, if there is no matching record in the dataset
2) PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records due to incorrect authorizations.
PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one record due to lack of authorization
3) Internal infotype table, containing all matching records for which the user is authorized (this table can also be empty).
Example
(RP_READ_INFOTYPE pernr infty inftytab beg end)
INFOTYPES: 0001.
RP-LOWDATE-HIGHDATE.
DATA: PERNR LIKE P0001-PERNR.
DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-ENDDA.
PERNR = '12345678'.
BEGDA = LOW-DATE + 15
ENDDA = HIGH-DATE - 5.
RP-READ-INFOTYPE PERNR 0001 P0001 BEGDA ENDDA.
IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'.
WRITE: / 'Insufficient authorization'. STOP.
ENDIF.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Infotype 0001 missing'. STOP.
ENDIF. -
How to write a JAVA program to execute the SQL queries
I have a database in the Microsoft Access queries and I need to execute the query by some how write the Java program to make it execute the query. because I need to get the different of time so I know how fast each query run.
Thank youYou need jdbc-driver for MSAccess for run this example:
JDBCClient.java
import java.util.Properties;
import java.lang.String;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.BufferedOutputStream;
import java.lang.System;
import java.lang.Class;
import java.sql.SQLException;
import java.util.Date;
import java.util.Locale;
import java.text.DateFormat;
import java.sql.Time;
public class JDBCClient{
private String DriverName = new String();
private String DatabaseURL = new String();
private String UserName = new String();
private String Password = new String();
private String SQLFile = new String();
private String OutputFile = new String();
private String Separator = new String();
private boolean NeedColumnHeaders;
private String EncodingParamName = new String();
private String EncodingValue = new String();
private String OutputEncoding = new String();
private boolean AfterLastColumnSeparator;
JDBCClient( String propfilename){
System.out.println( "Initializing...");
Properties properties = new Properties();
try{
properties.load( new FileInputStream( propfilename));
catch( Exception e){
System.out.println( "Error: " + e.toString());
System.exit( 0);
DriverName = properties.getProperty( "DriverName");
DatabaseURL = properties.getProperty( "DatabaseURL");
UserName = properties.getProperty( "UserName");
Password = properties.getProperty( "Password");
SQLFile = properties.getProperty( "SQLFile");
OutputFile = properties.getProperty( "OutputFile");
Separator = properties.getProperty( "Separator");
if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "yes") == 0 ||
properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "true") == 0)
NeedColumnHeaders = true;
else
if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "no") == 0 ||
properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "false") == 0)
NeedColumnHeaders = false;
else{
System.out.println( "Invalid value for \"NeedColumnHeaders\" property (logical expected)");
System.exit( 0);
EncodingParamName = properties.getProperty( "EncodingParamName");
EncodingValue = properties.getProperty( "EncodingValue");
OutputEncoding = properties.getProperty( "OutputEncoding");
if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "yes") == 0 ||
properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "true") == 0)
AfterLastColumnSeparator = true;
else
if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "no") == 0 ||
properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "false") == 0)
AfterLastColumnSeparator = false;
else{
System.out.println( "Invalid value for \"AfterLastColumnSeparator\" property (logical expected)");
System.exit( 0);
try{
byte[] EOL = new byte[2];
EOL[0] = 13;
EOL[1] = 10;
Class.forName( DriverName);
Properties connInfo = new Properties();
connInfo.put( "user", UserName);
connInfo.put( "password", Password);
if( EncodingParamName.length() != 0 && EncodingValue.length() != 0)
connInfo.put( EncodingParamName, EncodingValue);
Connection connection = DriverManager.getConnection( DatabaseURL, connInfo);
FileInputStream in = new FileInputStream( SQLFile);
byte[] buffer = new byte[in.available()];
in.read( buffer);
in.close();
String SQL = new String( buffer);
PreparedStatement statement = connection.prepareStatement( SQL);
Date d1 = new Date();
System.out.println( "Database connected at " + d1 + " Executing statement...");
ResultSet resultSet = null;
if( statement.execute())
resultSet = statement.getResultSet();
else{
System.out.println( "Script updates " + statement.getUpdateCount() + " records.");
System.exit( 0);
ResultSetMetaData metaData = resultSet.getMetaData();
BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( OutputFile));
if( NeedColumnHeaders && metaData.getColumnCount() > 0){
String head = new String();
for( int i = 1; i < metaData.getColumnCount(); i++)
head += metaData.getColumnName( i) + Separator;
head += metaData.getColumnName( metaData.getColumnCount());
out.write( head.getBytes( OutputEncoding), 0, head.length());
out.write( EOL, 0, 2);
String record = new String();
while( resultSet.next()){
record = "";
for( int i = 1; i < metaData.getColumnCount(); i++)
record += resultSet.getString( i) + Separator;
record += resultSet.getString( metaData.getColumnCount());
if( AfterLastColumnSeparator)
record += Separator;
out.write( record.getBytes( OutputEncoding), 0, record.length());
out.write( EOL, 0, 2);
out.close();
Date d2 = new Date();
System.out.println( "Done at " + d2);
System.out.println( "Executing time " + new Time( d2.getTime() - d1.getTime() - 10800000));
catch( ClassNotFoundException e){
System.out.println( e.toString());
catch( SQLException e){
System.out.println( e.toString());
catch( java.io.IOException e){
System.out.println( e.toString());
System.exit( 0);
public static void main( String args[]){
if( args.length == 1)
new JDBCClient( args[0]);
else
System.out.println( "Usage JDBCClient <properties_file>");
}JDBCClient.properties ( for Oracle database)
DriverName=oracle.jdbc.driver.OracleDriver
DatabaseURL=jdbc:oracle:thin:@192.168.1.1:1521:test
UserName=test
Password=test
SQLFile=test.sql
OutputFile=test.csv
Separator=*
NeedColumnHeaders=yes
EncodingParamName=
EncodingValue=
OutputEncoding=windows-1251
AfterLastColumnSeparator=yestest.sql
select * from users; -
How to write print program for smartforms
Hi all
I need to develop new smartform and its print program.
But Im not experience in writing print program for smartform.
Ive gone through the simple print program sample that use only one table as input and one table for output.
But my smartforms require few tables for input and output.
How should I define the Data?
Can anyone guide me on how to write it.
Thanks & Regards
azTransaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Reward points...
Maybe you are looking for
-
SMS error 3 on nearly every text. Possibly due to other company towers?
Carrier: South Central Communications Blackberry 8530 v5.0.0.395 (platform 4.2.0.167) <<< I think that's what I'm supposed to be posting. I've never done this before How do I find free space? The only apps I've installed are MSN messenger & Facebook
-
Nokia Music sign in not there on Windows 8.1
Where is the sign in for Nokia Music for Windows 8.1 app? I paid for the service but am only getting standard definition music
-
Can we create a custompage component using trinidad
Hi all, We are developing a application where we need to support IE6 so we are using trinidad components for JSF. In our application all the pages have tha same look n feel. Only the central part of the page changes. I wanted to create a template and
-
Access to view without a blocked
Hi, i need access a view by sm30 2 or more times without a blocked thanks
-
Hi All I ve created a elementary search help for my ABAP program, the elementary search help contains 2 fields which has values in it,, im selecting one of the filed in parameter selection, but i want the other field to be populated in a variable in