Webdynpro alv display
Hi ,
I have one requirement in webdynpro ALV. I have to display all po header detail in one view and when user click on any po respective item detail from item table should display .
i am facing problem in user interaction means how to handle click event in where i have to call and how its possible.
Hi Abhishek,
Try to post these type of questions in WD ABAP forum.
Please check the below threads for a help on your issue.
http://help.sap.com/saphelp_erp2005/helpdata/EN/f1/177741adb7167de10000000a155106/content.htm
[ALV|https://wiki.sdn.sap.com/wiki/display/WDABAP/GettingtheRowSelectedIntheALV....andMuchMore..]
Search on supply function in SDN, you will find more links.
Thanks,
Sreekanth
Edited by: Sreekanth on Jul 24, 2009 8:30 AM
Similar Messages
-
Webdynpro :: ALV display (fields)
Hello
I am trying to display an ALV list in webdynpro.
In my first column, I need to display Material number and Material description separated by some space.
In my coding, I have added space. But in my display, Material number and Material description are displayed without any space.
Can anyone suggest how I can have space in my ALV column.
Thanks.
Hari Gajulahi,
I have made an Context Attribute of type string and displayed the same .
Code for your reference :
DATA lo_nd_node_flighttab TYPE REF TO if_wd_context_node.
DATA lo_el_node_flighttab TYPE REF TO if_wd_context_element.
DATA lt_node_flighttab TYPE wd_this->elements_node_flighttab.
DATA ls_node_flighttab TYPE wd_this->element_node_flighttab.
data lv type string.
navigate from <CONTEXT> to <NODE_FLIGHTTAB> via lead selection
lo_nd_node_flighttab = wd_context->get_child_node( name = wd_this->wdctx_node_flighttab ).
select * from sflight
into CORRESPONDING FIELDS OF TABLE lt_node_flighttab.
loop at lt_node_flighttab into ls_node_flighttab .
concatenate 'saurav' 'mago' into lv separated by Space.
ls_node_flighttab-new = lv.
MODIFY lt_node_flighttab from ls_node_flighttab TRANSPORTING new.
ENDLOOP.
lo_nd_node_flighttab->bind_table( lt_node_flighttab ).
Here My context node is flighttab with a new Attribute New of type string. It is wokring fine with space.
Check your code once. -
Get Multiple Rows into internal Table using Webdynpro Alv Display ..
Hi guys ,
I need to find out the logic for getting all the selected rows into the internal table.
When i display the ALV Output on webdypro screen .
USer Selects multiple rows for further processing ..
Ineed to get all the rows selected by user into an internal table .
Please let me know how to achive this ...
Thanks in advance for quick reply
Regards
Saurabh GoelHi,
You need to use the method GET_SELECTED of IF_WD_CONTEXT_NODE to get the rows selected. Also ccheck for the paramters of that method, this retruns the element set.
This meets your requirement.
Regards,
Lekha. -
How to code to get intermediate results in webdynpro ALV? Please help!
Hi Experts,
I got following info from help file to generate Intermediate Results(subtotal).
Can somebody help me with sample code to achieve this?
Basically I want to subtotal 'Qty' column based on 'Product' field.
By default, all values in a field are used in the calculation during aggregation. However, you
are also able to generate intermediate results. You group the data records that contain the
values for an intermediate result and display each intermediate result in its own result row.
To generate intermediate results, you have to provide certain information:
● To specify in which field the values from which the intermediate results are calculated
are located, generate an aggregation condition for the desired field. The overall result is
displayed in the result row.
● To specify which data records are contained in an intermediate result, group the data
records: You sort the ALV output by the field that includes the criterion for the
intermediate result.
● To then generate the intermediate results, calculate the intermediate results using the
field with the criterion.
● To then display the intermediate results, switch on the display of intermediate results.
You are able to make the following settings for intermediate results:
● Generate intermediate results
● Display intermediate results
● Setting levels for drilling down intermediate results
● Set the position of the result rows (see Settings for Aggregation [page 196])
● Forbid the generation of intermediate results
Prerequisites
● You have generated an aggregation object for at least one aggregatable field.
● The field with the criterion for intermediate results is not an aggregatable field, and
therefore has an alphanumeric data type.
Generate Intermediate Results
To generate intermediate results in a field that already has an aggregation condition, generate
a sort condition for the field of a column (another column) (see Sorting [page 190]).
In this sort condition, define whether intermediate results are to be generated. To do this, use
the methods of the class CL_SALV_WD_SORT_RULE.
Methods for Generating Intermediate Results
Function Method
Generate intermediate results SET_GROUP_AGGREGATION
Check whether intermediate results are displayed GET_GROUP_AGGREGATION
Display Intermediate Results
Once you have made all settings, to generate intermediate results you have to switch on the
display of these intermediate results. You use the methods of the interface class
IF_SALV_WD_FIELD_SETTINGS for this (implementing class
CL_SALV_WD_CONFIG_TABLE).
Methods for Displaying Intermediate Results
Function Method
Display intermediate results SET_GROUP_AGGR_DISPLAYED
Check whether intermediate results are displayed GET_GROUP_AGGR_DISPLAYED
I have tried a bit but it is not working. here is my code:
get field and create aggregation rule of type total
lr_field = l_value->if_salv_wd_field_settings~get_field( 'Qty' ).
lr_field->if_salv_wd_aggr~create_aggr_rule( ).
lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule( ).
lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).
l_field = l_value->if_salv_wd_field_settings~get_field( 'PRODUCT' ).
l_sortrule = l_field->IF_SALV_WD_SORT~create_sort_rule( ).
l_sortrule~SET_GROUP_AGGREGATION( 'Y').
l_value->if_salv_wd_field_settings~SET_GROUP_AGGR_DISPLAYED( 'Y' ).
Please help
Message was edited by:
gopalkrishna baligaHi Gopalakrishna balgia,
I think i have answered in the below thread. Check it out.
How to show Subtotal in webdynpro ALV(ABAP)? Kindly help!
Regards
Rakesh -
Help,Webdynpro ALV report
Hello,
My Webdynpro ALV report display SFLIGHT all fields .
But I want to show only five fields,
how code?
CODE::
data:node_flights type ref to if_wd_context_node,
it_flights type sflight_tab1,
is_flights type sflight,
it_final type IF_MAIN=>elements_flights,
is_final type IF_MAIN=>element_flights.
select * from sflight into table it_flights up to 10 rows.
node_flights = wd_context->get_child_node( 'FLIGHTS' ).
data:l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data:l_ref_interfacecontroller type ref to iwci_salv_wd_table.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
node_flights = wd_context->get_child_node( name = `NODE_FLIGHT` ).
fill context node
node_flights ->bind_table( it_flight ).
endmethod.
thanksHI,
There is no need to change your code.
Do one thing.
Create a node SFLIGHT and do not add dictionary structure SFLIGHT.
Then create what are the required five attributes under it.
Make sure all these five refer to the dictionary data elements.
example: If you want carrid declare dectionary structure S_CARR_ID.
Like wise.
Now finally goto component usage->ALV->INTERFACECONTROLLER in the
left side tree of web dynpro component.
Then create component usage and drag SFLIGHT node to DATA of the context.
It is one of the way.
Second way is.
Create SFLIGHT node and mention SFLIGHT as stricture and select five required attributes that you need.
Now after creation of SFLIGHT NODE just delete the structure name present in the PROPERTIES of
SFLIGHT NODE.
Now finally goto component usage->ALV->INTERFACECONTROLLER in the
left side tree of web dynpro component.
Then create component usage and drag SFLIGHT node to DATA of the context.
I hope it helped you.
Regards and Best wishes. -
Export and Import functionality in WebDynpro ALV
Hi Experts,
I have done a webdynpro alv application and it is displaying the data as i wanted. However i have a requirement to get the alv displayed data in an excel sheet( which works with the export button on alv) and update that excel sheet which will be updated back in the alv table.(for eg any import button functinality on alv)
Regards,
TashiHi,
For this you need to use file upload to upload the modified excel data back to ALV. Else why dont you make an ALV Editable.!
For upload excel refer this wiki: [Upload excel in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/ExcelFileUploadAndDisplayDataUsingWebDynPro+ABAP]
hope this helps u.,
Thanks & regards,
Kiran. -
Dynamic report output in a webdynpro alv
Hi,
I have created a dynamic report in the R/3 system . In this report, i am creating a report program within the report and subsequently executing this dynamically created report and displaying in the ALV..
Is it possible to handle such a scenario in a webdynpro ALV. One option is to use ITS and display the report in the portal but is there some other way so that i can directly view this report in an alv grid in a view.
all help appreciated!!
regards,
PriyankHi Priyank,
This could be one of the solution:
1] Run the report in background mode (using submit statement, dn't forget to give printer as LOCL), get the spool id programatically. Use the FM's CONVERT_OTFSPOOLJOB_2_PDF or CONVERT_ABAPSPOOLJOB_2_PDF.
Which returns the ouput of table tline, convert this to xtring and bind it to xtring attribute.
In view add a interactive form and bind the xstring attribute to the Interactive form.
By following the above steps, we can display the result in the PDF in WD ABAP.
2] The report result is ALV and in most of the cases we generally do not have function modules or any other easy way to get the output.
In such cases the best approach which we follow is, to run this in background mode and generate the spool and display the ouput in PDF.
3] But if intertactive form is not present in your requirement then we need to debug the logic of the report (if no FM or class present) and get the results and display it in the View.
You can create a service which takes the parameters of the report, submits it and
transfers the result to HTML. In a view you use an IFRame which takes the URL of the service and shows the result HTML.
just additionally read this thread,
Display simple ABAPLIST
Here an IFrame is used to display HTML output of report. But as IFRame gets obsolete the Suresh's solution seems to be pretty cool.
Hope this will help you!
Cheers,
Darshna. -
How to make all the rows editable in webdynpro alv output
Hi,
How to make all the rows editable in webdynpro alv output.
Thanks
RaksharHi Rakshar,
Check this wiki:
http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP
Regards -
F4 for Editable field in ALV, display Name but capture ID
Hi Friends,
I have a ALV for which i have defined a Structure, which is passed to Fieldcatlog.
I have defined a Search help - ZUSER_NAME which has following fields to display.
USERID - USR02-BNAME
FNAME
LNAME
FULLNAME
So my structure for fieldcatalog has User-id which is linked to this search help with Domain XUBNAME.
So in my report i made this User-Id as editable and F4 available, everything is working fine.
when user does a F4, its displaying Userid,Fname,Lname and complete name.upon selection and save i am capturing the id and storing in the ztable.
But now i have a requirement that when user selects a value from this search help on F4, i need to display Fullname but capture the User Id. How can i do that?
This is something similar to the one we have in BSP- key-value pair.
how to do this in ALV.
Appreciate if someone can guide me thru.
Thanks,
Simha
Edited by: Simha on Sep 6, 2008 2:24 PMhai , this is example code for editing the F4 display .. check out this
REPORT zalv_editf4display.
*Type pools for alv
TYPE-POOLS : slis.
*structure for t582a tbale
TYPES : BEGIN OF ty_table,
infty TYPE infty,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_table.
*Structure for infotype text
TYPES : BEGIN OF ty_itext,
infty TYPE infty,
itext TYPE intxt,
sprsl TYPE sprsl,
END OF ty_itext.
*Structure for output display
TYPES : BEGIN OF ty_output,
infty TYPE infty,
itext TYPE intxt,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_output.
*internal table and work area declarations
DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
wa_table TYPE ty_table,
wa_output TYPE ty_output,
wa_ittext TYPE ty_itext.
*Data declarations for dropdown lists for f4
DATA: it_dropdown TYPE lvc_t_drop,
ty_dropdown TYPE lvc_s_drop,
*data declaration for refreshing of alv
stable TYPE lvc_s_stbl.
*Global variable declaration
DATA: gstring TYPE c.
*Data declarations for ALV
DATA: c_ccont TYPE REF TO cl_gui_custom_container, "Custom container object
c_alvgd TYPE REF TO cl_gui_alv_grid, "ALV grid object
it_fcat TYPE lvc_t_fcat, "Field catalogue
it_layout TYPE lvc_s_layo. "Layout
*ok code declaration
DATA:
ok_code TYPE ui_func.
*initialization event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*select the infotypes maintained
SELECT infty
pnnnn
zrmkz
zeitb
dname
davo
davoe
FROM t582a UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE it_table.
*Select the infotype texts
IF it_table[] IS NOT INITIAL.
SELECT itext
infty
sprsl
FROM t582s
INTO CORRESPONDING FIELDS OF TABLE it_ittext
FOR ALL ENTRIES IN it_table
WHERE infty = it_table-infty
AND sprsl = 'E'.
ENDIF.
*Apppending the data to the internal table of ALV output
LOOP AT it_table INTO wa_table.
wa_output-infty = wa_table-infty.
wa_output-pnnnn = wa_table-pnnnn.
wa_output-zrmkz = wa_table-zrmkz.
wa_output-zeitb = wa_table-zeitb.
wa_output-dname = wa_table-dname.
wa_output-davo = wa_table-davo.
wa_output-davoe = wa_table-davoe.
For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
wa_output-itext = wa_ittext-itext.
APPEND wa_output TO it_output.
CLEAR wa_output.
ENDLOOP.
Calling the ALV screen with custom container
CALL SCREEN 0600.
*On this statement double click it takes you to the screen painter SE51.
*Enter the attributes
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen ,
Here we can give a title and customized menus
*create 2 buttons with function code 'SAVE' and 'EXIT'.
GIVE A SUITABLE TITLE
*& Module STATUS_0600 OUTPUT
text
MODULE status_0600 OUTPUT.
SET PF-STATUS 'DISP'.
SET TITLEBAR 'ALVF4'.
ENDMODULE. " STATUS_0600 OUTPUT
calling the PBO module ALV_GRID.
*& Module PBO OUTPUT
text
MODULE pbo OUTPUT.
*Creating objects of the container
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CCONT'.
create object for alv grid
create object c_alvgd
exporting
i_parent = c_ccont.
SET field for ALV
PERFORM alv_build_fieldcat.
Set ALV attributes FOR LAYOUT
PERFORM alv_report_layout.
CHECK NOT c_alvgd IS INITIAL.
Call ALV GRID
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout = it_layout
i_save = 'A'
CHANGING
it_outtab = it_output
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 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.
ENDIF.
ENDMODULE. " PBO OUTPUT
*& Form alv_build_fieldcat
text
<--P_IT_FCAT text
*subroutine to build fieldcat
FORM alv_build_fieldcat.
DATA lv_fldcat TYPE lvc_s_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '1'.
lv_fldcat-fieldname = 'INFTY'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 8.
lv_fldcat-scrtext_m = 'Infotype'.
lv_fldcat-icon = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '2'.
lv_fldcat-fieldname = 'PNNNN'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Structure'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '3'.
lv_fldcat-fieldname = 'ITEXT'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 60.
lv_fldcat-scrtext_m = 'Description'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '5'.
lv_fldcat-fieldname = 'ZRMKZ'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 1.
lv_fldcat-scrtext_m = 'PERIOD'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '6'.
lv_fldcat-fieldname = 'ZEITB'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 5.
lv_fldcat-scrtext_m = 'Time constraint'.
lv_fldcat-edit = 'X'.
*To avail the existing F4 help these are to
*be given in the field catalogue
lv_fldcat-f4availabl = 'X'.
lv_fldcat-ref_table = 'T582A'.
lv_fldcat-ref_field = 'ZEITB'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '7'.
lv_fldcat-fieldname = 'DNAME'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Dialogmodule'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '8'.
lv_fldcat-fieldname = 'DAVO'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Start'.
lv_fldcat-edit = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '9'.
lv_fldcat-fieldname = 'DAVOE'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'End'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
*To create drop down for the field 'DAVO'
with our own f4 help
ty_dropdown-handle = '1'.
ty_dropdown-value = ' '.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '1'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '2'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '3'.
APPEND ty_dropdown TO it_dropdown.
CALL METHOD c_alvgd->set_drop_down_table
EXPORTING
it_drop_down = it_dropdown.
LOOP AT it_fcat INTO lv_fldcat.
CASE lv_fldcat-fieldname.
To assign dropdown in the fieldcataogue
WHEN 'DAVO'.
lv_fldcat-drdn_hndl = '1'.
lv_fldcat-outputlen = 15.
MODIFY it_fcat FROM lv_fldcat.
ENDCASE.
ENDLOOP.
ENDFORM. " alv_build_fieldcat
*& Form alv_report_layout
text
<--P_IT_LAYOUT text
*Subroutine for setting alv layout
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-col_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM. " alv_report_layout
PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes
*and based on the user command we can do the coding.
*& Module PAI INPUT
text
MODULE pai INPUT.
*To change the existing values and refresh the grid
*And only values in the dropdown or in the default
*F4 can be given , else no action takes place for the dropdown
*and error is thrown for the default F4 help and font changes to red
*and on still saving, value is not changed
c_alvgd->check_changed_data( ).
*Based on the user input
*When user clicks 'SAVE;
CASE ok_code.
WHEN 'SAVE'.
*A pop up is called to confirm the saving of changed data
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'SAVING DATA'
text_question = 'Continue?'
icon_button_1 = 'icon_booking_ok'
IMPORTING
answer = gstring
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
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.
*When the User clicks 'YES'
IF ( gstring = '1' ).
MESSAGE 'Saved' TYPE 'S'.
*Now the changed data is stored in the it_pbo internal table
it_pbo = it_output.
*Subroutine to display the ALV with changed data.
PERFORM redisplay.
ELSE.
*When user clicks NO or Cancel
MESSAGE 'Not Saved' TYPE 'S'.
ENDIF.
**When the user clicks the 'EXIT; he is out
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
CLEAR: ok_code.
ENDMODULE. " PAI INPUT
*& Form REDISPLAY
text
--> p1 text
<-- p2 text
FORM redisplay .
*Cells of the alv are made non editable after entering OK to save
CALL METHOD c_alvgd->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
*Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable
EXCEPTIONS
finished = 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. " REDISPLAY -
In ALV display model ,how to accept the ENTER key event?
Dear All,
I have used ALV by GRID DISPLAY model ,not class model.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'T_ITAB'
is_layout = gs_layout
it_fieldcat = t_fieldcat[]
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
For example :
IN ALV DISPLAY, there are two fields, one is MATNR, the other is MAKTX.
When user input the material value in MATNR field and press ENTER, then ALV can run my code to select the MAKTX into MAKTX field and display it synchronization.
Now I have realized update edit in ALV,but I found only I double click ALV row, then the MAKTX can update.
Please give me help,
Thanks
SunThis is the document written by me on Interactive ALV.. hope this maybe helpful for u..
When an Interactive Report is needed in Classical Display, we go for AT LINE-SELECTION. But when the same is needed in ALV Display, this method won't work. Instead, we need to use other way which is explained below:
We use REUSE_ALV_GRID_DISPLAY for ALV Display. Now, normally we call that FM in the following way:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'PROGRAM_NAME'
it_fieldcat = tb_fieldcat
TABLES
t_outtab = tb_output.
When it is needed to get an Interactive ALV, call the same FM in the following manner:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST75599_1'
it_fieldcat = tb_fieldcat
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = tb_output.
Now, in the report, create a subroutine with the name USER_COMMAND as follows:
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
CASE p_ucomm.
WHEN '&IC1'. " &IC1 - SAP standard code for double-clicking
Based on the requirement, write the logic *
ENDCASE.
ENDFORM.
No need to call the subroutine as PERFORM user_command. This will be takane care by REUSE_ALV_GRID_DISPLAY. We need to just write the subroutine in the report. That suffices.
Some more useful points for Interactive ALV:
1. If Hotspot is needed, then that should be done by declaring hotspot (one field in slis_t_fieldcat_alv) as 'X' in tb_fieldcat which is of type slis_t_fieldcat_alv. When hotspot is active, single click will be enough or else you should double click on the output data.
2. In Classical Display, when it is needed to read the record on which we double clicked, we do that in following way:
AT LINE-SELECTION.
GET CURSOR LINE wf_line. " wf_line gives the line number on which it has been clicked
READ LINE wf_line OF CURRENT PAGE.
But this won't work for ALV. Instead, the following logic can be used:
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
CASE p_ucomm.
WHEN '&IC1'. " &IC1 - SAP standard code for double-clicking
READ TABLE tb_output INTO wa_output INDEX p_selfield-tabindex.
IF sy-subrc EQ 0.
Based on the requirement, write the logic *
ENDIF.
ENDCASE.
ENDFORM. -
Hi all.
we are phasing a problem.
I am using alv to display in output.
I am using a Quantiti field (BDMNG),.
in this field if nodata is there then it is showing 0.000(that is the default value).
I don't want those zeros.I want only space(blank only).
Can any body help me to solve this issue.
Thanks in advance
Eswar.Hai,
While building field catalog For quantity field Set the NO-ZERO attribute to 'X'.
Or you can change the quantity filed to character in the alv display.
Mark points if helpful.
Regards,
Umasankar -
After refreshing ALV display, set it to the current cell that was modified.
Hello Experts,
I am currently using cl_gui_alv_grid for my ALV grid display. I have 1 editable column
which lets users input values. Now, When users press 'ENTER' in the keyboard I refresh
the ALV display to reflect the changes done. But the display always "moves back" to the first column
so it is tiresome to find the current cell that was modified. My question is, how do I set the ALV
display to just "stay put" in the current cell that was modified after pressing 'ENTER'?
Hope you can help me guys.Thank you and take care!Check this link
ALV scroll bar -
How to add an extra field in the alv display(Scope of List:ALV) for me55.
Hello..
I've to display 2 fields- (wbs element description) and (network description) along with the standard ALV display, for the Account Assignment type 'Q' and 'N' of all purchase requisitions being displayed.
I was suggested to modify the standard program RM06BF00.
Can you please let me know where and how should I modify the program RM06BF00. Is there any userexit or badi to add my fields??
Thanks in advance.
With Regards,
HimHello,
If we create a Z report for this program, can anyone please tell me where can I find the function "REUSE_ALV_GRID_DISPLAY" in the given program so that I can add my fields along with the default filelds displayed...
Thanks
~Him -
End of page in ALV display using OOPS
Hi all,
How can i display end of page or footer in ALV display using OOPS concept.
Thanks,
vinitHi ,
Try using this code.
First add a handler method in your handler class definition as:
e.g. METHOD handle__end_of_page
FOR EVENT print_end_of_page OF cl_gui_alv_grid .
Then implement the method in the implementation part of your local class.
e.g. METHOD handle_print_end_of_page .
WRITE:/ 'Flights Made on ', sy-datum .
ENDMETHOD .
And register this method as the handler.
SET HANDLER gr_event_handler->handle_print_end_of_page FOR gr_alvgrid .
Hope this helps.
Regards,
Janaki. -
Code for hr-abap report in alv display
Hi Gurus,
I am new to hr-abap and I want some sample code to display a hr report in an alv.
Thanks,
Raj.This is one such...
REPORT yh_rep_hr_certified_instructor MESSAGE-ID yh_messages NO STANDARD
PAGE
HEADING .
Program : YH_REP_HR_CERTIFIED_INSTRUCTOR *
Description : Certified Instructor Eligibility Criteria *
TABLES *
TABLES :hrp1000 ,hrp1001, pa0000.
TYPE-POOLS *
*Type Pool for ALV display
TYPE-POOLS :slis. " Global types for generic cunning components
INTERNAL TABLES *
*Internal Table to keep Selection Screen field values
DATA : BEGIN OF t_validation OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA END OF t_validation.
*Internal Table for Business Event Groups
DATA : BEGIN OF t_bgrp OCCURS 0,
objid TYPE hrobjid,
blank(1),
stext TYPE stext,
END OF t_bgrp.
*Internal Table for Business Event Type IDs with text for selected Event
*GROUPS
DATA : BEGIN OF t_btyp OCCURS 0,
objid TYPE hrobjid,
blank(1),
stext TYPE stext,
END OF t_btyp.
*Internal Table for Business Event Type IDs for selected Event Groups
DATA : BEGIN OF t_eventtypelist OCCURS 0,
objid TYPE hrobjid,
END OF t_eventtypelist.
*Internal table to store the business Groups
DATA : BEGIN OF t_group OCCURS 0,
objid LIKE hrp1001-objid,
sobid LIKE hrp1001-sobid,
sclas LIKE hrp1001-sclas,
END OF t_group.
*Internal table to hold the business event group and/or bus. event types
DATA : BEGIN OF t_eventgroup OCCURS 0,
objid LIKE hrp1001-objid,
END OF t_eventgroup.
*Internal Table for FieldCatalog used for ALV Display
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
*Work Area for Checking Business Event Group Validity
DATA: BEGIN OF wa_bgrp,
objid TYPE hrobjid,
stext TYPE stext,
END OF wa_bgrp.
*Internal table to fetch object id for Qualification
DATA: BEGIN OF t_objid OCCURS 0,
objid TYPE hrp1000-objid,
sobid TYPE hrp1001-sobid,
sobid_copy TYPE hrp1001-objid,
END OF t_objid.
*Internal table to fetch Id of related object
*Fetches Pernr of Certified Instructors
DATA: BEGIN OF t_sobid OCCURS 0,
objid TYPE hrp1000-objid,
sobid TYPE hrp1001-sobid,
adatanr TYPE hrpad31-adatanr,
sobid_copy TYPE hrp1001-objid,
END OF t_sobid.
*Internal table to fetch skill rating
*of the Instructor
DATA: BEGIN OF t_prof OCCURS 0,
adatanr TYPE hrpad31-adatanr,
chara TYPE hrpad31-chara,
END OF t_prof.
*Internal table to fetch grade
*of the Insturctor
DATA: BEGIN OF t_grade OCCURS 0,
pernr TYPE pa0008-pernr,
yysalgr TYPE pa0008-yysalgr,
END OF t_grade.
*Internal table which contains all information about the Person like
*Name Project Project Manager Name Account and Vertical Name
DATA: t_projdetails TYPE zbapi_projdetails OCCURS 0 WITH HEADER LINE.
*Final Internal table which contains all information
*about the Instructors
DATA: BEGIN OF t_final OCCURS 0,
empid TYPE pa0000-pernr,
empname(84) TYPE c,
grade TYPE pa0008-yysalgr,
atndttt(3) TYPE c,
sklrate TYPE hrpad31-chara,
pgmng TYPE pa0001-ename,
accname TYPE hrp1000-stext,
vertname TYPE hrp1000-stext,
END OF t_final.
VARIABLES *
*ALV layout
DATA: gs_layout TYPE slis_layout_alv, "alvtot test
gt_events TYPE slis_t_event,
gt_list_top_of_page TYPE slis_t_listheader,
gs_variant LIKE disvariant, "For Layout
g_save. "For Layout Save
DATA: w_pos TYPE i VALUE 1, " Position of Fields in ALV
w_sort TYPE slis_t_sortinfo_alv, "ITab for Sorting Options
w_flag TYPE i,
w_repid TYPE sy-repid,
w_lineno TYPE sy-tabix.
DATA: l_short TYPE hrp1000-short. "variable to check the heirarchy
SELECTION-SCREEN DESIGN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. "NO INTERVALS .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-009 MODIF ID xyz.
PARAMETERS : p_bgrp TYPE hrobjid OBLIGATORY,
p_bgrp1 TYPE stext .
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS :s_btyp FOR hrp1000-objid OBLIGATORY NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION *
INITIALIZATION.
*Assign Program Name into a variable
w_repid = sy-repid.
*Build layout for list display
gs_layout-detail_popup = 'X'.
*To get All Events in TOP-OF-PAGE
perform eventtab_build using gt_events[].
gs_variant-report = w_repid.
g_save = 'A'.
AT SELECTION SELECTION *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bgrp.
PERFORM get_bgrp.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_btyp-low.
IF NOT p_bgrp IS INITIAL .
PERFORM get_btyp USING 'l'.
ELSE .
MESSAGE s999 WITH text-e09.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_btyp-high.
IF NOT p_bgrp IS INITIAL .
PERFORM get_btyp USING 'h'.
ELSE .
MESSAGE s999 WITH text-e09.
ENDIF.
AT SELECTION-SCREEN ON p_bgrp.
SELECT SINGLE objid stext
FROM hrp1000
INTO wa_bgrp
WHERE objid = p_bgrp AND
otype = 'L' AND
plvar = '01' AND
( short = 'ROLE' OR
short = 'TECH_PROGRAM' ).
IF sy-subrc EQ 0.
p_bgrp1 = wa_bgrp-stext.
ELSE.
MESSAGE e999 WITH text-e09.
ENDIF.
AT SELECTION-SCREEN ON s_btyp.
CLEAR : t_eventtypelist, t_group, t_eventgroup.
REFRESH : t_eventtypelist, t_group, t_eventgroup.
CLEAR : w_flag.
*Fetch all the subordinates under given Event Group - L/D
SELECT objid
sobid
sclas
FROM hrp1001
INTO TABLE t_group
WHERE objid = p_bgrp
AND plvar = '01'
AND rsign = 'B'
AND relat = '003'
AND ( sclas = 'L' OR sclas = 'D' ).
WHILE w_flag <> 1.
PERFORM get_objids.
ENDWHILE.
IF NOT t_eventtypelist[] IS INITIAL.
*Get only valid Event Types from input Event Types, for given Event
*Group - by deleting others..
LOOP AT t_eventtypelist.
IF t_eventtypelist-objid IN s_btyp.
EXIT.
ELSE.
DELETE t_eventtypelist.
ENDIF.
AT LAST.
*since we r checking Event Types, All other fields will be locked
*but we need Event Group field to be unlocked to edit again,
*if theres no theres no valid Event Types in given input
LOOP AT SCREEN.
CHECK screen-name = 'P_bgrp'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
MESSAGE e999 WITH text-e04.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
CHECK screen-name = 'P_bgrp'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
MESSAGE e999 WITH text-e03.
ENDIF.
FORM get_bgrp *
FORM get_bgrp .
SELECT objid stext
FROM hrp1000
INTO CORRESPONDING FIELDS OF TABLE t_bgrp
WHERE plvar = '01' AND
otype = 'L' AND
short = 'ROLE' OR
short = 'TECH_PROGRAM' .
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 75
endpos_row = 20
startpos_col = 30
startpos_row = 05
titletext = 'Select Business Event Group'
IMPORTING
choise = w_lineno
TABLES
valuetab = t_bgrp
EXCEPTIONS
break_off = 1
OTHERS = 2.
IF sy-subrc EQ 0 .
READ TABLE t_bgrp INDEX w_lineno.
IF sy-subrc EQ 0.
p_bgrp = t_bgrp-objid.
p_bgrp1 = t_bgrp-stext.
ENDIF .
CLEAR t_bgrp .
REFRESH t_bgrp .
ENDIF .
ENDFORM . "get_bgrp
****subroutine for business eventtype input criteria
FORM get_btyp USING f_range.
CLEAR : t_validation,
t_btyp,
t_eventtypelist,
t_group,
t_eventgroup,
w_flag.
REFRESH : t_validation,
t_btyp,
t_eventtypelist,
t_group,
t_eventgroup.
t_validation-fieldname = 'P_BGRP'.
APPEND t_validation.
CLEAR t_validation.
*Getting Screen Values
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = w_repid
dynumb = '1000'
TABLES
dynpfields = t_validation
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
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.
READ TABLE t_validation WITH KEY fieldname = 'P_BGRP'.
IF NOT t_validation-fieldname IS INITIAL.
*Getting Event Group ID that entered
LOOP AT t_validation.
IF t_validation-fieldname = 'P_BGRP'.
p_bgrp = t_validation-fieldvalue.
ENDIF.
ENDLOOP.
CLEAR t_validation.
REFRESH t_validation.
*To fetch the business event groups and business event types that belong
to the input business event group.Since a business group can have a
*business groups as well as business event types we have pick all of
*them
*Getting all subordinates - Event Group/Type under given Event Group
SELECT objid
sobid
sclas
FROM hrp1001
INTO TABLE t_group
WHERE objid = p_bgrp
AND plvar = '01'
AND rsign = 'B'
AND relat = '003'
AND endda = '99991231'
AND ( sclas = 'L' OR sclas = 'D' ).
*Getting all Event Types
WHILE w_flag <> 1.
PERFORM get_objids.
ENDWHILE.
IF NOT t_eventtypelist[] IS INITIAL.
SORT t_eventtypelist BY objid.
*Getting Names of Event Types
SELECT objid
stext
FROM hrp1000
INTO CORRESPONDING FIELDS OF TABLE t_btyp
FOR ALL ENTRIES IN t_eventtypelist
WHERE objid = t_eventtypelist-objid
AND otype = 'D' AND plvar = '01'
AND endda = '99991231'.
IF sy-subrc = 0.
*PopUp Display for Event Types
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 75
endpos_row = 20
startpos_col = 30
startpos_row = 05
titletext = 'Select Business Event Type ID'
IMPORTING
choise = w_lineno
TABLES
valuetab = t_btyp
EXCEPTIONS
break_off = 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.
ELSE.
*Since the Table returned by function module will have data in Header,
*clear the Header
*Retreive Selected Event Type into Select Option
READ TABLE t_btyp INDEX w_lineno.
IF sy-subrc EQ 0.
IF f_range = 'l'.
s_btyp-low = t_btyp-objid.
ELSE.
s_btyp-high = t_btyp-objid.
ENDIF.
ENDIF.
ENDIF.
ELSE.
MESSAGE s999 WITH text-e03.
ENDIF.
ELSE.
MESSAGE s999 WITH text-e01.
ENDIF.
ENDIF.
ENDFORM. " EVNTTY
FORM get_objids *
FORM get_objids.
*To delete the business event types that are found and push it in
*another table
IF NOT t_group[] IS INITIAL.
LOOP AT t_group.
*If event type
IF t_group-sclas = 'D'.
t_eventtypelist-objid = t_group-sobid.
APPEND t_eventtypelist.
CLEAR t_eventtypelist.
DELETE t_group.
*If event group
ELSEIF t_group-sclas = 'L'.
t_eventgroup-objid = t_group-sobid.
APPEND t_eventgroup.
CLEAR t_eventgroup.
DELETE t_group.
CLEAR t_group.
ENDIF.
ENDLOOP.
ELSE.
w_flag = 1.
ENDIF.
IF NOT t_eventgroup[] IS INITIAL.
*To get the second level of business groups and business event type
SELECT objid sobid sclas
FROM hrp1001
INTO TABLE t_group
FOR ALL ENTRIES IN t_eventgroup
WHERE objid = t_eventgroup-objid
AND plvar = '01'
AND rsign = 'B'
AND relat = '003'
AND endda = '99991231'
AND ( sclas = 'L' OR sclas = 'D' ).
CLEAR t_eventgroup.
REFRESH t_eventgroup.
ENDIF.
ENDFORM. " GET_OBJIDS
Start of Selection *
START-OF-SELECTION.
*Pass the Event Type and fetch the Related Id
*for the Qualification imparted by the Event
SELECT objid sobid
FROM hrp1001
INTO TABLE t_objid
WHERE objid IN s_btyp AND
otype = 'D' AND
plvar = '01' AND
relat = '028' AND
rsign = 'A' AND
sclas = 'Q'.
IF sy-subrc EQ 0.
*Pass the Qualification Id and fetch Object Id of the
*person who fulfills this Qualification
SELECT objid sobid adatanr
FROM hrp1001
INTO TABLE t_sobid FOR ALL ENTRIES IN t_objid
WHERE sobid = t_objid-sobid AND
otype = 'P' AND
plvar = '01' AND
relat = '032' AND
rsign = 'A' AND
sclas = 'Q' .
IF sy-subrc = 0.
*Fetch only the Person along with the skillrating
*who has skill rating as '0001' or '0003'
SELECT adatanr chara
FROM hrpad31
INTO TABLE t_prof
FOR ALL ENTRIES IN t_sobid
WHERE adatanr = t_sobid-adatanr AND
( chara = '0001' OR chara = '0003' ).
IF sy-subrc NE 0.
MESSAGE s999 WITH text-s01.
EXIT .
ELSE .
*Fetch only Employee Id's who meets the required skill rating
*which inturn has the EMPID who are all are Certified Instructors
LOOP AT t_sobid.
READ TABLE t_prof WITH KEY adatanr = t_sobid-adatanr.
IF sy-subrc NE 0.
DELETE t_sobid .
ENDIF.
ENDLOOP.
SORT t_sobid BY objid.
DELETE ADJACENT DUPLICATES FROM t_sobid.
ENDIF.
ENDIF.
ENDIF.
IF NOT t_sobid[] IS INITIAL.
data: begin of it_trgpernr occurs 0,
objid type hrp1000-objid,
sobid type hrp1001-sobid,
end of it_trgpernr.
select objid sobid
from hrp1001
into table it_trgpernr for all entries in t_sobid
where otype ='P' and
objid = t_sobid-objid and
sclas = 'D' and
sobid = '50008220'.
*Fetch Grade of the Certified Instructors by passing their EmpId's
SELECT pernr yysalgr
FROM pa0008
INTO TABLE t_grade
FOR ALL ENTRIES IN t_sobid
WHERE pernr = t_sobid-objid AND endda = '99991231'.
ENDIF.
For Heading in the Output Display Layout
PERFORM heading USING gt_list_top_of_page[].
End of Selection *
END-OF-SELECTION.
Populating data into Final Table which contains all information aboutthe Certified Instructors
*Retrieve Employee Id for the Certified Instructors only if he is active
LOOP AT t_sobid.
SELECT SINGLE *
FROM pa0000
WHERE pernr = t_sobid-objid AND
begda <= sy-datum AND
endda >= sy-datum AND
stat2 ='3'.
IF sy-subrc = 0.
t_final-empid = t_sobid-objid.
SELECT SINGLE *
FROM hrp1001
WHERE otype = 'P' AND
objid = t_sobid-objid AND
rsign = 'B' AND
relat = '25' AND
sclas = 'D' AND
sobid = '50008220'.
*DATA:W_SOBID TYPE HRP1001-SOBID.
*W_SOBID = t_sobid-objid. .
SELECT SINGLE *
FROM hrp1001
WHERE otype = 'D' AND
objid = '50008220' AND
rsign = 'B' AND
relat = '25' AND
sclas = 'P' AND
sobid = W_SOBID.
IF sy-subrc EQ 0.
t_final-atndttt = 'YES'.
ELSE.
t_final-atndttt = 'NO'.
ENDIF.
*Retrieve Employee SkillRating for the Certified Instructors
*by passing the adatanr value which inturn is fetched based on the empid
READ TABLE t_prof WITH KEY adatanr = t_sobid-adatanr.
IF sy-subrc EQ 0.
t_final-sklrate = t_prof-chara.
ENDIF.
*Retrieve Employee Grade for the given id
READ TABLE t_grade WITH KEY pernr = t_sobid-objid.
IF sy-subrc EQ 0.
t_final-grade = t_grade-yysalgr.
ENDIF.
REFRESH t_projdetails.
CLEAR t_projdetails.
*function which fetches the name project name account and
*vertical name of the person for the given empid
CALL FUNCTION 'ZBAPI_PROJDETAILS'
EXPORTING
pernr = t_sobid-objid
TABLES
it_finaltab = t_projdetails.
IF NOT t_projdetails[] IS INITIAL.
SHIFT t_sobid-objid LEFT DELETING LEADING '0'.
READ TABLE t_projdetails WITH KEY pernr = t_sobid-objid.
IF sy-subrc EQ 0.
t_final-empname = t_projdetails-ename.
IF NOT t_projdetails-proj IS INITIAL.
t_final-pgmng = t_projdetails-pmname.
ELSE.
t_final-pgmng = t_projdetails-gmname.
ENDIF.
t_final-accname = t_projdetails-accname.
t_final-vertname = t_projdetails-vertname.
ENDIF.
ENDIF.
APPEND t_final.
ENDIF.
CLEAR t_final.
ENDLOOP.
SORT t_final BY empid.
DELETE ADJACENT DUPLICATES FROM t_final.
*Enabling Sort by PERNR & Global ID in ALV display
PERFORM sub_sort_info.
*Form to Populate Field Catalog
PERFORM populate_fieldcatalog.
For the ALV ROW Optimize Width
gs_layout-colwidth_optimize = 'X' .
*perform alv_display tables final fieldcatalog.
IF NOT t_final[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = gs_layout
it_fieldcat = t_fieldcatalog[]
it_sort = w_sort
i_save = 'A'
it_events = gt_events[]
TABLES
t_outtab = t_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.
ELSE.
MESSAGE s000(vz) WITH 'No Records found for Given Input Criteria'.
ENDIF.
TOP OF PAGE *
*Outputs formatted simple header information at TOP-OF-PAGE.
TOP-OF-PAGE.
PERFORM top_of_page.
Subroutines *
*& Form eventtab_build
text`
-->P_GT_EVENTS[] text
FORM eventtab_build USING rt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
DATA: g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = rt_events.
READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE g_top_of_page TO ls_event-form.
APPEND ls_event TO rt_events.
ENDIF.
ENDFORM. " eventtab_build
*& Form HEADING
text
FORM heading USING lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
*Layout Display Text - "Caritor ( India ) Pvt.Ltd "
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = text-h01.
APPEND ls_line TO lt_top_of_page.
*Layout Display Text - "Certified Instructor Eligibility List "
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = text-h02.
APPEND ls_line TO lt_top_of_page.
ENDFORM. " HEADING
*& Form top_of_page
text
--> p1 text
<-- p2 text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. " top_of_page
*& Form sub_sort_info
text
--> p1 text
<-- p2 text
FORM sub_sort_info.
DATA : l_sort TYPE slis_sortinfo_alv .
CLEAR l_sort.
Employee ID
l_sort-fieldname = 'EMPID'.
l_sort-up = 'X'.
APPEND l_sort TO w_sort.
ENDFORM. " sub_sort_info
*& Form populate_fieldcatalog
text
--> p1 text
<-- p2 text
FORM populate_fieldcatalog.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'EMPID' ' ' text-011 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'EMPNAME' ' ' text-002 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'GRADE' ' ' text-003 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'ATNDTTT' ' ' text-004 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'PGMNG' ' ' text-006 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'ACCNAME' ' ' text-007 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'VERTNAME' ' ' text-008 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'SKLRATE' ' ' text-005 20 w_pos.
ENDFORM. " populate_fieldcatalog
*& Form FILL_FIELDS_OF_FIELDCATALOG
text
-->P_T_FIELDCATALOG text
-->P_0870 text
-->P_0871 text
-->P_0872 text
-->P_TEXT_001 text
-->P_20 text
-->P_W_POS text
FORM fill_fields_of_fieldcatalog TABLES fp_t_fieldcatalog STRUCTURE
t_fieldcatalog
USING fp_table
fp_field
fp_key
fp_text
fp_out_len
fp_pos.
fp_t_fieldcatalog-tabname = fp_table.
fp_t_fieldcatalog-fieldname = fp_field.
fp_t_fieldcatalog-seltext_l = fp_text.
fp_t_fieldcatalog-key = fp_key.
fp_t_fieldcatalog-outputlen = fp_out_len.
fp_t_fieldcatalog-col_pos = fp_pos.
APPEND fp_t_fieldcatalog.
CLEAR: fp_t_fieldcatalog.
fp_pos = fp_pos + 1.
ENDFORM. " FILL_FIELDS_OF_FIELDCATALOG
10.249.11.136\SAP-StudyMaterial
Maybe you are looking for
-
Importing clips from iMovie project (they keep ending up in the trash)
I have never tried to import other clips from another iMovie project before and I just tried it yesterday. This is what I did: -I went into the other project and clicked on each individual clip from that project that I wanted (one at a time). -I copi
-
Ical no longer syncs with macbook
so with the option to sync to the new super duper icloud, there is no longer any sync with the macbook, even though i have "sync with this ipad over wifi" checked. is there something else i need to do to get the ipad and macbook to sync properly? i s
-
Got new iPhone, tried to move iTunes library to different iMac, no luck?
OK, so this is a complicated situation. My wife and I went out to get ourselves new iPhone 5s today. When we got home, we discovered that our laptops, which we had been using as our backups on iTunes, was considered out of date. We already traded in
-
Okay so I used v7 of the installer on Novation's site (so the Novation OS is on 1.015), but the Logic automapping doesn't seem to work right. I read that one thread on it, but nobody seemed to have a clearcut way to get it to work. Am I supposed to d
-
Suddenly (after Maverick?) I can not open iPhoto on my MacBook. I have now upgraded to Yosemite but it still won´t open. When I try to open a pop-up comes up which says "Do you want to open this version of iPhoto you must first prepare it. Do so by u