How to add header in ALV
Hi Friends,
How to add a header in ALV, Can you please tell me.
Regards,
Venu.
hi,
chk this sample code.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
<b>i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM</b>
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
rgds
anver
if hlped mark points
Similar Messages
-
Hi,
How To add Logo in ALV Report?
I need step by step explanation.Hi uday,
go through this hope u can understand.
*&amp; Report Z_OOALV_LOGO
*&--Sample Program using ooalv-> by SrikanthV--
REPORT z_ooalv_logo.
****DECLARATION FOR LOGO INSERT
CONSTANTS: cntl_true TYPE i VALUE 1,
cntl_false TYPE i VALUE 0.
DATA:h_picture TYPE REF TO cl_gui_picture,
h_pic_container TYPE REF TO cl_gui_custom_container.
DATA: graphic_url(255),
graphic_refresh(1),
g_result LIKE cntl_true.
DATA: BEGIN OF graphic_table OCCURS 0,
line(255) TYPE x,
END OF graphic_table.
DATA: graphic_size TYPE i.
CALL SCREEN 100.
*&----
*& Module PICTURE OUTPUT
text
MODULE picture OUTPUT.
DATA: l_graphic_xstr TYPE xstring,
l_graphic_conv TYPE i,
l_graphic_offs TYPE i.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = 'EDS'"IMAGE NAME - Image name from SE78
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
OTHERS = 2.
graphic_size = XSTRLEN( l_graphic_xstr ).
CHECK graphic_size > 0.
l_graphic_conv = graphic_size.
l_graphic_offs = 0.
WHILE l_graphic_conv > 255.
graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
APPEND graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
ENDWHILE.
graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
APPEND graphic_table.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'
size = graphic_size
lifetime = cndp_lifetime_transaction "'T'
TABLES
data = graphic_table
CHANGING
url = graphic_url
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_put_table = 2
dp_error_general = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
CREATE OBJECT h_pic_container
EXPORTING container_name = 'LOGO'.
CREATE OBJECT h_picture EXPORTING parent = h_pic_container.
CALL METHOD h_picture->load_picture_from_url
EXPORTING
url = graphic_url
IMPORTING
RESULT = g_result.
ENDMODULE. " PICTURE OUTPUT
Reward points if helpful.
Thanks -
How to Add Header and Footer in Flat file
HI All,
I am using ODI 11g.
MY interface is populating data from joining to 2 tables through sql query and Loads in to Flat file.
But i need to add Header and Footer in the Flat file.
In the below 3 lines
The 1st line is header ....2nd line is Data ....3rd line is Footer.
Any ideas how to work on this.
HSB9KT.KTPRTO.EBSDATA.D0000000 20120626020636
CFFE00263 SOLGSR014991340000527894536058173880207SOLNE06242012072420120000009048382650000247MRS
T00000000000000000000
Thanks,
LonyHi Drieux,
i am able to add Header and Footer in this.
But i want the header like Its like HSB9KT.KTPRTO.EBSDATA.D0000000 || SYSDATE (YYYYMMDDHHMMSS)
In my Out put i only see header as HSB9KT.KTPRTO.EBSDATA.D0000000 .
I have added a Variable where i am using SELECT to_char(sysdate,'YYYYMMDDHHMMSS') FROM DUAL query.
create header (HSB9KT.KTPRTO.EBSDATA.D0000000 #v_DATE)
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=FFT_SOLSNP$CRLOAD_FILE=/home/tarak/FFT_SOL.datSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=descrSNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=1SNP$CRLENGTH=994SNP$CRPRECISION=994SNP$CR$$SNPS_END_KEY*/
Any idea why this sysdate part is not showing in Header. -
i want to add header to my ALV report
i am using cl_salv_table method
i want to write a few sentences.
in addition i want to add a button to my report,
which will display the values the user put in the selection screen.
please give me detailed explenation
thanksDisplay header:--steps
1. call the factory method and it reruns the ref variable..
try.
call method cl_salv_table=>factory
exporting
list_display = list_display
importing
r_salv_table = vref_alv
changing
t_table = i_sflight.
catch cx_salv_msg into oref_error.
l_text_alv_e = oref_error->get_text( ).
message i000 with l_text_alv_e.
leave list-processing.
endtry.
2. Create header object and attached it with ALV
data: lr_grid type ref to cl_salv_form_layout_grid.
1st step: create the grid object
create object lr_grid.
2nd step: add some text items
lr_grid->create_header_information( row = 1 column = 1
text = 'Flight List Grp ##'(fll) ).
lr_grid->create_text( row = 2 column = 1
text = 'Please check utilization'(uti) ).
3rd step: declare grid as header of list
vref_alv->set_top_of_list( value = lr_grid ).
Display - button steps:
1. Create pf status and Set pf status:
Create pf-status and add ur custom button with a fcode then set this status with alv.
vref_alv->set_screen_status( pfstatus = 'SALV_TABLE_STANDARD'
report = sy-repid
set_functions = p_alv->c_functions_all ).
2. Get all the events and set the event handler for this added button.
data: lr_event type ref to cl_salv_events_table.
get the EVENT object
lr_event = p_alv->get_event( ).
set handler :
lcl_handler=>on_added_function for lr_event,
2. Create the local class to handle this event:
class lcl_handler definition.
public section.
class-methods:
on_added_function for event added_function of cl_salv_events_table
importing e_salv_function, " type salv_de_function
endclass. "lcl_handler definition
CLASS lcl_handler IMPLEMENTATION
class lcl_handler implementation.
method on_added_function.
data: l_oref_columns type ref to cl_salv_columns_table,
l_oref_column type ref to cl_salv_column_table,
l_oref_column1 type ref to cl_salv_column,
l_except1 type ref to cx_salv_not_found, "Exception
l_text1 type string, "Exception msg
l_lvc_s_colo type lvc_s_colo.
case e_salv_function.
when '<fcode of ur button>'.
write ur logic here.
endcase.
endmethod.
endclass. "lcl_handler IMPLEMENTATION
Regards,
Joy.
Edited by: Joyjit Ghosh on Jul 13, 2008 12:16 PM -
How to add header and footer to a file through ODI?
hi,
I want to add header and footer to my file..............footer should contain a counter so that page number can be displayed...................
Can anyone please guide me .................
Thanks .............
Ritikawhat is the utility you are using to create file . Interface or OdiSqlUnload ?
and what do you want to have Header and Footer as and how are you concluding the File as page 1 and page 2 etc ... ? -
How to add radiobuttons in ALV Grid
Hi,
I refered the threads in SDN but i am not able to get proper solution for my requirement.
I am displaying output in ALV Grid format. After displaying the output i mean in the output screen i need few buttons and radio buttons . when user selects the record and clicks the radio button accordingly my logic should work. Anybody can tell me how to add the radiobuttons in the output of the screen. Please find the below output format for the requirement is
Push button1 Pushbutton2 Radiobutton1 Radio button2
MY program output in Grid format.
Anybody can suggest me how to approach.
Regards,
MaheedharCheck if this link helps..
http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT -
WCF request with utl_dbws how to add Header into SOAP envelope
I’m trying to make WCF (Windows Communication Foundation) request and using for that utl_dbws package.
After making request (calling utl_dbws.invoke) it will give error “ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect t”
I turned on logging (utl_dbws.set_logger_level) I see that system sends standard SOAP envelope and does not have Header at all. How can I use my own SOAP envelope and/or add Header.
All info that logging give is:
ServiceFacotory: oracle.j2ee.ws.client.ServiceFactoryImpl@eec8c59c
WSDL: null
Service: oracle.j2ee.ws.client.BasicService@7c110d23
*** Created service: -677524827 - oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@562bd0c4 ***
ServiceProxy.get(-677524827) = oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@562bd0c4
getOperationInfo return NULL: port={http://tempuri.org/Service/}BasicHttpBinding_Service, operation={http://tempuri.org/Service/}GetLov
setProperty(javax.xml.rpc.soap.http.soapaction.use, true)
setProperty(javax.xml.rpc.soap.http.soapaction.uri, http://tempuri.org/Service/GetLov)
setProperty(javax.xml.rpc.encodingstyle.namespace.uri, http://www.w3.org/2005/08/addressing)
setProperty(javax.xml.rpc.security.auth.username, DefaultUser)
setProperty(javax.xml.rpc.security.auth.password, MySecretPassword)
<GetLOV xmlns="http://tempuri.org/"> <request xmlns:d4p1="http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <d4p1:AgentCode>AGENT</d4p1:AgentCode> <d4p1:Language>ENG</d4p1:Language> <d4p1:ProcessName>test</d4p1:ProcessName> </request></GetLOV>
Attribute 0: http://tempuri.org/: xmlns, http://tempuri.org/
createElement(GetLOV,null,http://tempuri.org/)
Attribute 0: http://tempuri.org/: xmlns, http://tempuri.org/
dbwsproxy.element.node.child.0: 1, null
dbwsproxy.add.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
Attribute 0: http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request: xmlns:d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
dbwsproxy.add.map: i, http://www.w3.org/2001/XMLSchema-instance
Attribute 1: http://www.w3.org/2001/XMLSchema-instance: xmlns:i, http://www.w3.org/2001/XMLSchema-instance
createElement(request,null,http://tempuri.org/)
dbwsproxy.add.soap.element.namespace: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
Attribute 0: http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request: xmlns:d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
dbwsproxy.add.soap.element.namespace: i, http://www.w3.org/2001/XMLSchema-instance
Attribute 1: http://www.w3.org/2001/XMLSchema-instance: xmlns:i, http://www.w3.org/2001/XMLSchema-instance
dbwsproxy.element.node.child.0: 1, null
dbwsproxy.lookup.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
createElement(d4p1:AgentCode,null,http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request)
dbwsproxy.text.node.child.0: 3, E01306
dbwsproxy.element.node.child.1: 1, null
dbwsproxy.lookup.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
createElement(d4p1:Language,null,http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request)
dbwsproxy.text.node.child.0: 3, ENG
dbwsproxy.element.node.child.2: 1, null
dbwsproxy.lookup.map: d4p1, http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request
createElement(d4p1:ProcessName,null,http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request)
dbwsproxy.text.node.child.0: 3, tesr
request:
<GetLOV xmlns="http://tempuri.org/">
<request xmlns:d4p1="http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
<d4p1:AgentCode>AGENT</d4p1:AgentCode>
<d4p1:Language>ENG</d4p1:Language>
<d4p1:ProcessName>test</d4p1:ProcessName>
</request>
</GetLOV>
13.05.2010 14:17:28 oracle.j2ee.ws.client.ClientMessages infoAboutToInvokeCallForEndpoint
INFO: Trying to connect to URL: https://x.y.z/WS/ Service.svc
13.05.2010 14:17:30 oracle.j2ee.ws.client.StreamingSender _sendImpl
FINE: StreamingSender.request:<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><GetLOV xmlns="http://tempuri.org/"><request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d4p1="http://schemas.datacontract.org/2004/07/x.y.z.LOV.Request"><d4p1:AgentCode>AGENT</d4p1:AgentCode><d4p1:Language>ENG</d4p1:Language><d4p1:ProcessName>test</d4p1:ProcessName></request></GetLOV></env:Body></env:Envelope>
13.05.2010 14:17:30 oracle.j2ee.ws.client.StreamingSender _sendImpl
FINE: StreamingSender.response:<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode><faultstring xml:lang="et-EE">The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</faultstring></s:Fault></s:Body></s:Envelope>
Exception in thread "Root Thread" javax.xml.rpc.soap.SOAPFaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:559)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
at oracle.j2ee.ws.client.dii.CallInvokerImpl.directInvoke(CallInvokerImpl.java:705)
at oracle.j2ee.ws.client.dii.BasicCall.directInvoke(BasicCall.java:692)
at oracle.j2ee.ws.client.dii.BasicCall.invoke(BasicCall.java:598)
at oracle.jpub.runtime.dbws.DbwsProxy$CallProxy.invokeProxy(Unknown Source)
at oracle.jpub.runtime.dbws.DbwsProxy$CallProxy.access$2600(Unknown Source)
at oracle.jpub.runtime.dbws.DbwsProxy.invokeProxy(Unknown Source)HTTP is HTPP... mostly.
In other words, the application protocol is stand and specified in RFC2616 (http://www.w3.org/Protocols/rfc2616/rfc2616.html)
The exception is specific proprietary extensions.. like for example Microsoft's NTLM authentication handshake.
The UTL_HTTP interface supports the protocol pretty well as per the protocol's specification. So using it to interact with a a web service should not be a major issue. The protocol is standard (e.g. POST command is used to supply the payload to the web service). The only real issue is formatting the payload for that as per what the web service expect. And that has nothing to do with HTTP itself - or UTL_HTTP. It is simply the delivering mechanism.
Getting that mechanism to work is fairly easy and should not pose a problem. Instead I suggest you focus on exactly how the HTTP payload needs to look like. Does that web service expects any specific name-values in the header? What does it expect in the body? Etc. -
Global Navigation: How to add heading as non active link?
Dear guys,
I really want to add non active link in global navigation. How it will be done?
I tried to add heading without any link but it's appearing in current navigation, how can i add it in global (front menu) navigation.
Please tell me the solution to resolve this problem.
The basic objective to apply this function is: I have various non constructed pages, but i want to show hirarachi in navigation.
Br,
AyeshaClick on Modify Navigation -> click on Global Navigation -> Click Add Heading --> Give only title , no need to give the url.
By the way i think you are also following the same procedure.
Let me know if you mean something else. -
How to add header and fooder in text file
Hi,
i have created simple application for generate report from database into text file.
But i need to add header and fooder in text file. I dont know is there any API for adding these.
Can anyone help me to create header and fooder in text file.
the below text are needs to be print in the header
name of the table :
Recorder type :
file creation time:
the below text are needs to be print in the footer
Recorder Number:
Record Type;
the actual code is
pst = con.prepareStatement("select REQUEST, DOMAIN_NAME, TRUNC(DATE_OF_CONFIGURATION) AS dateofConfig FROM employee where id=300");
rs = pst.executeQuery();
while (rs.next()) {
request = rs.getString("REQUEST");
domain_name = rs.getString("DOMAIN_NAME");
dateofconfig = rs.getString("dateofConfig");
System.out.println(request + " " + domain_name + " " + dateofconfig);
data.add(request + " " + domain_name + " " + dateofconfig);
System.out.println("before calling method");
writeToFile(data, "c:/Employee.txt");
System.out.println("file created successfull");
rs.close();
pst.close();
private static void writeToFile(List list, String path) {
BufferedWriter out = null;
try {
File file = new File(path);
out = new BufferedWriter(new FileWriter(file, true));
for (Object obj : list) {
String s= obj.toString();
out.write(s);
out.newLine();
out.close();
} catch (IOException e) {
}Thanks
Jasmin
Edited by: user13836688 on Mar 21, 2011 4:06 AM
Edited by: user13836688 on Mar 21, 2011 4:07 AM
Edited by: user13836688 on Mar 21, 2011 4:08 AMuser13836688 wrote:
i have created simple application for generate report from database into text file.First off, when posting code, use [code]...[/code]. or '' tags, not '<code>'.
But i need to add header and fooder in text file. I dont know is there any API for adding these.
Can anyone help me to create header and fooder in text file.Well you plainly have the code to write the file contents; and furthermore your report seems to be contained in a List called 'data'. Why not just add the header and footer lines to it? I'd also suggest making 'data' a LinkedList. That way you can add the header afterwards with no performance hit, just in case the information it contains isn't available at the start of your report loop.
Winston -
How to add header line in a file from XI system using file adapters
Hi All,
I need to add header line (Column names) in a file coming from XI system.
I am using file adapters.
Thanks & Regards,
Gaurav MittalThe Receiver File Adapter is configured, using the following settings:
1) Choose File Content Conversion as the Message Protocol.
2) You give the addHeaderLine parameter as 1
3) For the fieldSeparator parameter you need to give field separator for both list and substructure (referring to the data type above). For eg: it may be a , (comma) for substructure in a comma separated file.
4) The endSeparator parameter needs to given for substructure only. For eg: it may be a nl (new line)
5) Give the file name, the directory and the Construction mode. Activate all the settings. Receiver File Adapter with F.C.C. is configured.
please visit the blog.
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 -
How to add header to a file in mapping
Hi,
I need to add header to a file , the header information i am getting is dynamic , it is an IP address of the m/c from where i received the file and keeps on changing.
Can we add this information in the header in mapping or there is any other way to acheive this.This IP is used to make a lookup at a latter stage for verification purpose.
Regards,
SRiHi Sri,
Write Java class or an ABAP class
in Java class or ABAP class write logic to find the first word or line
once you find that word in your incoming file, you need to replace with a string which has the static header+firstword what you have searched
for exmple
Incoming file
abcd
<abc>123</abc>
<def>321</def>
Your logic should find "abcd"
String Header = "http://www.sap.sdn.com"
String A = "abcd" (bcoz u kow u r searching for this word)
now concat A+Header and return the string
IF you are writing an ABAP or Java class include this in Interface Mapping
Hope this helps. -
How to add header in flash builder 4
Hi,
I want to add header to my code in flashbuilder (sdk4.1) for the purpose of accessibilty . the Flex Theme of my project is Halo(2). and I cannot see any header tags in properties of any of my components. I need something like htm header tags , so screen reader can read the header of each page and the user has an idea what the structure of the page is.
I appreciate a lot if someone could help meI have used FormHeading with accessibiltyEnabled =true. is this formHeading like the header in html? is this good approach for screen readers like JAWS?
-
hallow i use alv grid from se83 and i wont to add a header . how can i do that ?. my alv is basic. did i need to change all the alv code or just to add some code to my code? thankes
HALLOW ANVER I DO LIKE U TELL AND IS NOT WORKING IT BRING ME A TABLE empty and heder empty
*& Form create_field_cat
text
--> p1 text
<-- p2 text
FORM create_field_cat .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'YHR_Q4_STR' "STRUCTRE NAME
CHANGING
ct_fieldcat = ct_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = ct_fieldcat
i_save = 'X'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
LOOP AT ct_fieldcat INTO wa_fieldcat.
MOVE-CORRESPONDING wa_fieldcat TO wa_fcat.
CASE wa_fieldcat-fieldname.
WHEN 'OBJID'.
wa_fcat-coltext = text-001.
wa_fcat-outputlen = 9.
WHEN 'STEXT'.
wa_fcat-coltext = text-002.
wa_fcat-outputlen = 15.
WHEN 'YYOBJID_TXT'.
wa_fcat-coltext = text-004.
wa_fcat-outputlen = 30.
WHEN 'STEXT2'.
wa_fcat-coltext = text-003.
wa_fcat-outputlen = 11.
ENDCASE.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
ENDLOOP.
*PERFORM top-of-page.
ENDFORM. " create_field_cat
*& Form top-of-page
text
--> p1 text
<-- p2 text
form top-of-page .
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
endform. -
How to add button in ALV report (Class method )?
Hello experts,
I have developed one ALV report using classes.
I want to add one more button on the report like already is there named DISPLQUA
How ca i do that here?
Following the code of CLASS definition & implimentation
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
handle_on_user_command FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function.
ENDCLASS. "lcl_handle_events DEFINITION
CLASS lcl_handle_events IMPLEMENTATION
CLASS lcl_handle_events IMPLEMENTATION.
METHOD handle_on_user_command.
CASE e_salv_function.
WHEN 'DISPLQUA'.
PERFORM show_quant_record.
WHEN 'DISPQM03'. " Here i want to add button
PERFORM display_quality_notification.
WHEN OTHERS.
ENDCASE.
ENDMETHOD. "handle_on_user_command
ENDCLASS. "lcl_handle_events IMPLEMENTATIONHI Ronny.
Code snippet for reference.
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION.
METHODS :
*--Toolbar control
HANDLE_TOOLBAR FOR EVENT TOOLBAR
OF CL_GUI_ALV_GRID IMPORTING E_OBJECT
E_INTERACTIVE,
ENDCLASS
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*--handle toolbar
METHOD HANDLE_TOOLBAR.
* append a separator to normal toolbar
CLEAR G_TOOLBAR.
G_TOOLBAR-BUTN_TYPE = 3.
APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR G_TOOLBAR.
G_TOOLBAR-FUNCTION = 'SAVE'.
G_TOOLBAR-ICON = ICON_SYSTEM_SAVE.
G_TOOLBAR-BUTN_TYPE = 0.
G_TOOLBAR-QUICKINFO = 'Save the Customer'(203).
APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
ENDMETHOD. "HANDLE_TOOLBAR
Hope this helps.
Gary.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:41 PM -
How to add Icons to ALV Reprt?
Hi,
I need to display icons (red, yellow) in my ALV Report in the first column in my report.
In my field catalog fieldcat-icon = 'X' has been taken into consideration, but still I am not able to see in my report. In the final internal table that is to display I created a field for this Icon type ICON_D. Is this the correct procedure to work with or else kindly let me know how to proceed?
Regards,
Raghu Ram.This is the code that has been incorporated in order to display Icon in the ALV Report.
* TABLES Declarations *
Tables: PROJ, " Project definition
PRPS, " WBS (Work Breakdown Structure) Element Master Data
ICON.
* TYPE POOLS *
TYPE-POOLS: SLIS, " Globale Typen für generische Listbausteine
ICON.
* ALV Data Declarations *
DATA:
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GT_REPID TYPE SY-REPID.
* Type Declarations *
TYPES:
* STRUCTURE OF TABLE PROJ
BEGIN OF TY_PROJ,
PSPNR TYPE PROJ-PSPNR,
PSPID TYPE PROJ-PSPID,
POST1 TYPE PROJ-POST1,
OBJNR TYPE PROJ-OBJNR,
VERNR TYPE PROJ-VERNR,
VERNA TYPE PROJ-VERNA,
END OF TY_PROJ,
* STRUCTURE OF TABLE PRPS
BEGIN OF TY_PRPS,
PSPNR TYPE PRPS-PSPNR,
POSID TYPE PRPS-POSID,
POST1 TYPE PRPS-POST1,
OBJNR TYPE PRPS-OBJNR,
PSPHI TYPE PRPS-PSPHI,
VERNR TYPE PRPS-VERNR,
END OF TY_PRPS,
BEGIN OF TY_FINAL,
LIGHT TYPE ICON_D,
PSPNR TYPE PROJ-PSPNR,
PSPID TYPE PROJ-PSPID,
POST1 TYPE PROJ-POST1,
OBJNR TYPE PROJ-OBJNR,
VERNR TYPE PROJ-VERNR,
VERNA TYPE PROJ-VERNA,
PSPNR_1 TYPE PRPS-PSPNR,
POSID TYPE PRPS-POSID,
POST1_1 TYPE PRPS-POST1,
OBJNR_1 TYPE PRPS-OBJNR,
PSPHI TYPE PRPS-PSPHI,
VERNR_1 TYPE PRPS-VERNR,
END OF TY_FINAL.
* Internal Table Declarations *
DATA:
IT_PROJ TYPE STANDARD TABLE OF TY_PROJ,
IT_PRPS TYPE STANDARD TABLE OF TY_PRPS,
IT_FINAL TYPE STANDARD TABLE OF TY_FINAL.
* Work Area Declarations *
DATA:
WA_PROJ TYPE TY_PROJ,
WA_PRPS TYPE TY_PRPS,
WA_FINAL TYPE TY_FINAL.
* Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME.
SELECT-OPTIONS: S_PSPNR FOR PROJ-PSPNR.
SELECTION-SCREEN END OF BLOCK BLK.
* Start Of Selection *
START-OF-SELECTION.
PERFORM DATA_RETREVIAL.
PERFORM BUILD_FIELDCAT.
PERFORM DISPLAY_ALV.
* Data Retrevial Logic *
*& Form DATA_RETREVIAL
form DATA_RETREVIAL .
DATA: status_icon TYPE icons-text,
icon_name(20) TYPE c,
icon_text(10) TYPE c.
ICON_NAME = 'ICON_RED_LIGHT'.
ICON_TEXT = 'RED'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = ICON_NAME
TEXT = ICON_TEXT
* INFO = ' '
ADD_STDINF = 'X'
IMPORTING
RESULT = STATUS_ICON
EXCEPTIONS
ICON_NOT_FOUND = 1
OUTPUTFIELD_TOO_SHORT = 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.
SELECT PSPNR
PSPID
POST1
OBJNR
VERNR
VERNA
FROM PROJ
INTO TABLE IT_PROJ
WHERE PSPNR IN S_PSPNR.
SELECT PSPNR
POSID
POST1
OBJNR
PSPHI
VERNR
FROM PRPS
INTO TABLE IT_PRPS
FOR ALL ENTRIES IN IT_PROJ
WHERE PSPHI EQ IT_PROJ-PSPNR.
LOOP AT IT_PROJ INTO WA_PROJ.
LOOP AT IT_PRPS INTO WA_PRPS.
WA_FINAL-PSPNR = WA_PROJ-PSPNR.
WA_FINAL-PSPID = WA_PROJ-PSPID.
WA_FINAL-POST1 = WA_PROJ-POST1.
WA_FINAL-OBJNR = WA_PROJ-OBJNR.
WA_FINAL-VERNR = WA_PROJ-VERNR.
WA_FINAL-VERNA = WA_PROJ-VERNA.
WA_FINAL-PSPNR_1 = WA_PRPS-PSPNR.
WA_FINAL-POSID = WA_PRPS-POSID.
WA_FINAL-POST1_1 = WA_PRPS-POST1.
WA_FINAL-OBJNR_1 = WA_PRPS-OBJNR.
WA_FINAL-PSPHI = WA_PRPS-PSPHI.
WA_FINAL-VERNR_1 = WA_PRPS-VERNR.
WA_FINAL-light = STATUS_ICON.
APPEND WA_FINAL TO IT_FINAL.
CLEAR: WA_FINAL.
ENDLOOP.
ENDLOOP.
endform. " DATA_RETREVIAL
* Field Catalog *
*& Form BUILD_FIELDCAT
form BUILD_FIELDCAT .
* DATA: FIELDCAT TYPE GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'LIGHTS'.
GT_FIELDCAT-SELTEXT_M = 'STAUTS'.
GT_FIELDCAT-COL_POS = 0.
GT_FIELDCAT-ICON = 'X'.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPNR'.
GT_FIELDCAT-SELTEXT_M = 'PROJECT DEFINITION(INTERNAL)'.
GT_FIELDCAT-COL_POS = 1.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPID'.
GT_FIELDCAT-SELTEXT_M = 'PROJECT DEFINITION'.
GT_FIELDCAT-COL_POS = 2.
GT_FIELDCAT-OUTPUTLEN = 24.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'POST1'.
GT_FIELDCAT-SELTEXT_M = 'PROJECT DESC'.
GT_FIELDCAT-COL_POS = 3.
GT_FIELDCAT-OUTPUTLEN = 40.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'OBJNR'.
GT_FIELDCAT-SELTEXT_M = 'Object number'.
GT_FIELDCAT-COL_POS = 4.
GT_FIELDCAT-OUTPUTLEN = 22.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'VERNR'.
GT_FIELDCAT-SELTEXT_M = 'Responsible Person'.
GT_FIELDCAT-COL_POS = 5.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'VERNA'.
GT_FIELDCAT-SELTEXT_M = 'Responsible Person Desc'.
GT_FIELDCAT-COL_POS = 6.
GT_FIELDCAT-OUTPUTLEN = 25.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPNR_1'.
GT_FIELDCAT-SELTEXT_M = 'WBS Element'.
GT_FIELDCAT-COL_POS = 7.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'POSID'.
GT_FIELDCAT-SELTEXT_M = 'WBS Element'.
GT_FIELDCAT-COL_POS = 8.
GT_FIELDCAT-OUTPUTLEN = 24.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'POST1_1'.
GT_FIELDCAT-SELTEXT_M = 'WBS DESC'.
GT_FIELDCAT-COL_POS = 9.
GT_FIELDCAT-OUTPUTLEN = 40.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'OBJNR_1'.
GT_FIELDCAT-SELTEXT_M = 'Object number'.
GT_FIELDCAT-COL_POS = 10.
GT_FIELDCAT-OUTPUTLEN = 22.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPHI'.
GT_FIELDCAT-SELTEXT_M = 'Currnet Projct'.
GT_FIELDCAT-COL_POS = 11.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'VERNR_1'.
GT_FIELDCAT-SELTEXT_M = 'Responsible Person'.
GT_FIELDCAT-COL_POS = 12.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
endform. " BUILD_FIELDCAT
* Display ALV Grid *
*& Form DISPLAY_ALV
form DISPLAY_ALV .
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = GT_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = GT_FIELDCAT[]
* 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
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_FINAL
* 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.
endform. " DISPLAY_ALV
Maybe you are looking for
-
Does not open http or https pages but youtube opens?
My any browser is not able to open http or https pages but opens youtube or any other vedio site. Only Internet Explorer on my pc opens google and none other browsers ( Opera and Mozilla Aurora ) do so. I'm having this problem from a very long time,
-
Hp zv5242qv laptop with windows vista will not run on battery but will run on power adapter
Hello, I have a HP zv5242qv pavilion zv5000 series laptop with windows vista installed. I can run it on the power adapter with and without the battery installed but it will not power up on just the battery, the battery is new and fully charged. When
-
Create an context menu item to open a file on a specific display
Hello, I have an external display connected to my MBP, but I don't always need to use it so it's not always on. I'd like to have a way to open a file (or application) on a specified display on a case by case basis. I know that I can assign an applica
-
Firefox icon not showing up after installing and...
I installed Firefox and there is no icon for it. I must manually enter "firefox" in the terminal. Also, when I run the java command, it says it cannot be found. I just installed java from the AUR package. Also, how do I make files without an extensio
-
My Gal tries to face time me and nothing comes through to tell me she is doing this period. She then sends a message to tell me. I then have to FaceTime her back. Can somebody help me with this?