Change in the ALV Output Screen field
Dear All,
How can I change or Edit the output apperared in the ALV report.
My requirement is that,
Consider Report have given Output in ALV as 213.00 in quantity field that I want to change at run time manualy as per my requirement.
Pls. Suggest.
Aniruddha
Dear Sir,
I AM CALLING THIS SUBROUTINE IN FOLLOWING SEQUENCE...AND I WANT MY QUANTITY FIELD SHOULD BE EDITABLE IN RUNTIME .PLZ SOLVE MY PROBLEM.
PERFORM top_of_page.
PERFORM fieldcat_init USING gt_fieldcat[].
PERFORM sub_comment_build USING t_list_top_of_page.
PERFORM ALV .
FORM fieldcat_init USING rt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: pos TYPE i VALUE 1.
CLEAR ls_fieldcat.
pos = pos + 1.
lCLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'GSMNG'.
ls_fieldcat-seltext_m = 'QUANTITY'.
ls_fieldcat-tabname = 'MATRIX1'.
ls_fieldcat-outputlen = 18.
ls_fieldcat-EDIT = 'A'.
APPEND ls_fieldcat TO rt_fieldcat.
FORM ALV .
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND =
I_CALLBACK_TOP_OF_PAGE = '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 = 'A'
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 = matrix1
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.
Pls. suggest the changes inthe above coding
Thanking you in anticipation
Aniruddha
Similar Messages
-
How we can add the 2 buttons on the alv out screen.
I have a requirement, i want to add two buttons on the application bar on the ALV report out.
with the use of grid functional module.
for example: i want to buttons details and balance on the ALV output screen. if i click on detail it will display the details and if i click on balance it will show the balance data in report.
and if i use the back and exit that time it will come out the selection screen.
please send me any exiting report its very urgent.Hi frnd,
To add additional button in the application toolbar,
First copy the std toolbar from std sap program,
In se 41 give
program name = SAPLKKBL
copy staus.
Use own status (Copy STANDARD from SAPLKKBL)
SET PF-STATUS 'STANDARD_NEW' .(in this new user defined status add ur buttons)
steps:
then in the ''REUSE_ALV_GRID_DISPLAY' function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gv_repid
i_callback_user_command = EVENT_USER_COMMAND
i_callback_pf_status_set = EVENT_SET_STATUS_01
i_grid_title = gc_tit
is_layout = gt_layout
it_fieldcat = gt_fieldcat[]
TABLES
t_outtab = gt_lfa1
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.
FORM event_set_status_01 USING lt_excl TYPE slis_t_extab.
Use own status (Copy STANDARD from SAPLKKBL)
SET PF-STATUS 'STANDARD' .
ENDFORM. "EVENT_SET_STATUS_01
*& Form Name: event_user_command *
*& Form Desc: For Handling USER_COMMAND *
FORM event_user_command USING
if_ucomm TYPE sy-ucomm
is_selfield TYPE slis_selfield.
CASE if_ucomm.
WHEN 'PRINT'.
endcase.
endform -
How to change the attributes of screen fields dynamically
<b></b>
well i have created a table by name empmaster_data with following fields.
*emp_id.
*emp_fname.
*emp_lname
*dob.
*doj.
*dept.
*desig.
now using a single screen i want to create,change and display the information.even i am using save and exit button.
now i want to change the attributes of screen fields dynamically like active,input,output,invisible.Hi,
Have Different Radio Buttons for the purposes what you have and use AT Selection Screen Output, Under the event Use loop at screen and with continue with your requirement.
Hope This Info Helps YOU.
<i>Reward Points If It Helps YOU.</i>
Regards,
Raghav -
Some fields are missing in the ALV output
Hi ,
I have created a normal ALV report using REUSE_ALV_GRID_DISPLAY . It shows the output correctly. But when I take the prin out or download to an excel sheet some fields are not there. Can I know how to solve this issue ?
Regards,
Beenahi Beena,
If you are downloading the ALV output to excel, please make sure that the DDIC structure is passed as a parameter to the REUSE_ALV. I doubt you are creating field catalog from the program and that DDIC structure is not used.
Hope this helps,
Sajan Joseph. -
Function Module to edit the ALV Output
Hi,
I have an ALV report output.I need the edit values based on some conditions in the ALV output and
save the changes. Is there any function module to edit the output and proceed further.
Thanks in advance.
Regards,
NavasFirst create the field catalog of the field that you want to edit in this way
WA_fieldcat-fieldname = 'MENGE'.
WA_fieldcat-qfieldname = 'MEINS'.
WA_fieldcat-seltext_m = 'PO Quan.'
WA_fieldcat-edit = 'X' .
Secondly you keep a custom button like 'SAVE' in the toolbar and also try to keep a checkbox in your ALV.
for checkbox you have to keep a following code snippet in your finallly displayed interanal table:
chk(1) TYPE c, and in the fieldcatalog you have to write following piece of code
WA_fieldcat-fieldname = 'CHK'.
WA_fieldcat-seltext_m = 'CheckBox'.
WA_fieldcat-checkbox = 'X'.
WA_fieldcat-edit = 'X' .
WA_fieldcat-input = 'X'.
WA_fieldcat-tabname = 'IT_FINAL'.
WA_fieldcat-col_pos = 1.
then you have to set the parameter i_callback_user_command = 'USER_COMMAND'
of FM REUSE_ALV_GRID_DISPLAY.
Then write a subroutine like the following one to handle the SAVE operation
FORM user_command USING I_r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA:l_cntr TYPE i.
CASE I_r_ucomm.
WHEN '&ZXZ'.
CLEAR l_cntr.
CLEAR WA_final.
LOOP AT IT_final INTO WA_final.
IF WA_final-chk = 'X'.
l_cntr = l_cntr + 1.
ENDIF.
ENDLOOP.
IF l_cntr GT 1.
MESSAGE i011.
ELSEIF l_cntr = 1.
READ TABLE IT_final INTO WA_final WITH KEY chk = 'X'.
MODIFY IT_final FROM WA_final TRANSPORTING menge
WHERE chk = 'X'.
CLEAR WA_final.
PERFORM disp_alv. <<<This is to display the refreshed alv after saving your data
endif.
ENDCASE.
ENDFORM. -
Total is not getting displayed in the ALV output.
Hi,
Total is not getting displayed in the ALV output.
I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY
Are there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY
source code:
DATA: layout TYPE slis_layout_alv,
IT_eventS TYPE slis_t_event,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
rec_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
TYPES: BEGIN OF ty_tab,
belnr TYPE dberchz-belnr,
belzart TYPE dberchz-belzart,
net TYPE dberchz-nettobtr,
END OF ty_tab.
DATA: lt_tab TYPE STANDARD TABLE OF ty_tab.
SELECT belnr belzart nettobtr
FROM dberchz
INTO TABLE lt_tab[]
WHERE belnr eq '000000000001'.
if sy-subrc ne 0.
ENDIF.
* defining layout
layout-colwidth_optimize = 'X'.
layout-def_status = 'X'.
*defning event
*event
*defining field catalog
fcat-col_pos = 1.
fcat-fieldname = 'BELNR'.
fcat-tabname = 'LT_TAB'.
APPEND fcat.
fcat-col_pos = 2.
fcat-fieldname = 'BELZART'.
fcat-tabname = 'LT_TAB'.
APPEND fcat.
fcat-col_pos = 3.
fcat-fieldname = 'NET'.
fcat-tabname = 'LT_TAB'.
fcat-do_sum = 'X'.
APPEND fcat.
*calling alv
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = 'YZ_PLR'
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = layout
it_fieldcat = fcat[]
i_tabname = 'LT_TAB'
it_events = IT_EVENTS[]
* IT_SORT =
* I_TEXT = ' '
tables
t_outtab = lt_tab[]
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 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_BLOCK_LIST_DISPLAY'
Thanks,
GauravHi
No I don't think, this is my code (based on your code) and it works fine:
TYPE-POOLS SLIS.
DATA: BEGIN OF LT_TAB OCCURS 0,
BELNR LIKE BSEG-BELNR,
GJAHR LIKE BSEG-GJAHR,
WRBTR LIKE BSEG-WRBTR,
WAERS LIKE BKPF-WAERS,
END OF LT_TAB.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT,
FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
REC_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
START-OF-SELECTION.
FCAT-COL_POS = 1.
FCAT-FIELDNAME = 'BELNR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'BELNR'.
FCAT-REF_TABNAME = 'BSEG'.
APPEND FCAT.
FCAT-COL_POS = 2.
FCAT-FIELDNAME = 'GJAHR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'GJAHR'.
FCAT-REF_TABNAME = 'BSEG'.
APPEND FCAT.
FCAT-COL_POS = 3.
FCAT-FIELDNAME = 'WRBTR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-CFIELDNAME = 'WAERS'.
FCAT-REF_FIELDNAME = 'WRBTR'.
FCAT-REF_TABNAME = 'BSEG'.
FCAT-DO_SUM = 'X'.
APPEND FCAT.
FCAT-COL_POS = 4.
FCAT-FIELDNAME = 'WAERS'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'WAERS'.
FCAT-REF_TABNAME = 'BKPF'.
FCAT-DO_SUM = SPACE.
APPEND FCAT.
SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE LT_TAB
WHERE BUKRS = 'MAAB'
AND BELNR = '0000000001'.
LT_TAB-WAERS = 'EUR'.
MODIFY LT_TAB FROM LT_TAB TRANSPORTING WAERS WHERE WAERS = SPACE.
*CALLING ALV
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = 'ZPROVAMAX5'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT[]
I_TABNAME = 'LT_TAB'
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = LT_TAB[].
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
I've also inserted a currency field
Max -
How to put the alv output into the spool request?
Hi guys,
How to put the alv output into the spool request?
Thanks!Hi
Sending an ALV List screen output to SPOOL
Convert ALV list to PDF and send mails to respective persons
Regards
Pavan -
Avoid ALV output screen in submit statement
hello,
I have created one FM.in that FM i am calling one zreport using submit statement as i want to access that zreport's internal table.so i have done that using IMPORT and EXPORT statement and i am getting values in my FM.
but my problem is when i execute that FM it stops and display the ALV output of zreport and then when i press back button it gives me FM's output.i dont want that ALV output.can anybody help me that how to omit this output screen?
regards
soniya s.Hi,
Use option EXPORTING LIST TO MEMORY with statement SUBMIT.
Regards,
Nikhil
Edited by: Nikhil Kayal on May 13, 2009 1:32 PM -
How to extract in the ALV output the old data using EXTRACT
Dear Friends,
I have requiremnt where the user executes the report -
using REUSE_ALV_GRID_DISPLAY FM. On the output
i have given an option to user to edit values on the output. So user will edit the values and updating to the data base this
the functionality which we have given to the custom report till now . Now the user came back and asking to provide a SAVE
option on the ALv output so that before updating the total records to the database he can re edit the values which he
has entered previous day . To do this functionality i have read in ALV documentation using the EXTRACT- INCLUDE vex01top.
I have added this but iam not getting exactly how to do this option when the user saves on the ALV output how can he retrive back the saved data on to the output again( i.e on the ouput screen) using the Extract functionality . If any body has done this
do help me . I would like to know should we maintain any custom table for this,for saving the records when user press
save button? .
Thanks & Regards
Madhuri.> i have read in ALV documentation using the EXTRACT- INCLUDE vex01top.
I don't know where you got that. You have to define your own GUI status (first, copy it from standard status STANDARD_FULLSCREEN of function group SLVC_FULLSCREEN) with your button, and define as follows:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'USER_STATUS' EXCLUDING rt_extab.
ENDFORM. "set_pf_status
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm = 'SAVE'.
ENDIF.
ENDFORM.
> I would like to know should we maintain any custom table
Of course. Create your own custom table. Where else do you want to store data? -
hi friends,
Here is my query on a Alv Report output display
I have two internal tables i_vbak and i_vbap
i_vbak contains the fields and value as
vbeln kunnr auart audat bstnk vkorg
1000066 1000071 ze0r 20070918 Itest1 PA11
1000067 1000072 ze0r 20070919 SLA-Test1 PA11
i_vbap contains the field and value as
VBELN MATNR ARKTX
1000066 SAMPLE MATERIAL1 Sample Material for reports
1000066 SAMPLE MATERIAL Sample Material for reports
1000066 TEST MATERIAL Test Material for reports
1000067 SAMPLE MATERIAL Sample Material for reports
1000067 TEST MATERIAL Test Material for reports
1000067 SAMPLE MATERIAL1 Sample Material for reports
I have a another internal table called inv_final which contain all these fields and respective values to display in the alv output.Here i am giving only two field how it whould come in alv output.
Sold to Patry(kunnr) Sales Doc No(vbap-vbeln) Material Name(matnr)
1000071 1000066 Sample Material1
1000071 1000066 Sample Material
1000071 1000066 Test Material
1000072 1000067 Sample Material
1000072 1000067 Test Material
1000072 1000067 Sample Material1
If anybody have done similay kind of repore than help me with the code,or else if anybody having any idea to solve this out than help me.I have only prob with the logic bofore the final table display in the alv output.
Helpful answer will be rewardad generously.
Thanks a lot
mrutyun^Hi
Put all the fields in to an internal table and disply only your required fields.
Kuntal -
How to insert blank lines in the ALV output.
Hi Friends,
Could any body help me out How to insert blank lines in the ALV output.?? Any Code pls...
Thank you,
Vikram.Chi vikram
do like this
In the fieldcatalog table all the fields should be in editable mode
ie lw_fcat-edit = 'X'.
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'
is_layout = lv_layout
it_fieldcat = lt_fcat[]
i_save = 'A'
is_variant = lv_variant
TABLES
t_outtab = lt_license[]
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_data
*& Form user_command
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'ADD'. "
data: lv_ind type i.
data: lv_line type i.
describe table lt_license lines lv_line.
loop at lt_license into lw_license.
lv_ind = sy-tabix.
if lv_ind = lv_line.
append initial line to lt_license.
endif.
endloop.
ENDCASE.
ENDFORM. "user_command
reward points if useful
Rohan -
Dump while downloding the ALV output
Hi,
My requirement is to Develop an ALV report with new Function Keys in the Application Toolbar of the ALV.
For that I have copied the Status of the program 'SAPLSLVC_FULLSCREEN' Status - 'STANDARD_FULLSCREEN' and added few more Function Key's on the Application Toolbar. The new Key's added are working fine but when I try to download the ALV Output using the Download file option on the application toolbar its giving and dump saying 'Field symbol has not yet been assigned'
Runtime Errors GETWA_NOT_ASSIGNED.
Regards,
Ramu N.Hi, Add this code to the alv report. the report will get downlaoded as an excel sheet to ur hard drive.
FORM DOWNLOAD .
DFILENAME = 'D:\log.xls'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = DFILENAME
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ','
TABLES
DATA_TAB = IT_MDKP
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " DOWNLOAD
REWARD POINTS IF USEFUL -
Holding the value in screen-field
Dear All,
I m facing the problem ,while i m putting the value in screen-field and then pressing enter,
value in that screen-field is becoming null automatically.
wht shld i do for holding the value even after PAI.
Thanks in advance.Hi,
You should define a corresponding variable for that screen field in your program.
data: my_input_field type ... "same name and type as the one used in screen for field
so when you enter data to that field and press ENTER, the data will be transported to that variable and in PAI you have its value there.
Regards
Marcin -
Is it possible to create the ALV output with dropdown list for the columns
Hi forum experts,
Could the ALV output contain the dropdown list for the column names? if yes, then how we can acheive this to happen.
Thanks in advance,
Regards,
Samad.
Edited by: Samad arif on Aug 21, 2009 4:40 PMHi Arif,
Yes we can .FOr the codding check the article,
[dropdowns in ALV|https://wiki.sdn.sap.com/wiki/display/Snippets/DropdownsinALV]
regards,
Archana
Edited by: Archana Kumari on Aug 21, 2009 1:22 PM -
Problem while downloading the alv output to excel file.
Hii,
While downloading the alv output to an excel file i am facing a problem. Either the output comes as 1.23456E+11 or the values get cut .
Cant put in txt file as the users require to calculate directy and i have even tried to increase the output length .But both doesnt help.
So what are the other ways to do so.
Edited by: mansi_v27 on Mar 24, 2010 12:35 PMHi,
Welcome to SCN!!!.
Please go through the forum rules. This has been discussed many times. You can search in the forum for this.
Infact there is no problem. Just expand that excel cell. You can see the full value. This is standard excel property.
Thanks,
Vinod.
Maybe you are looking for
-
How to format Lion OS X 10.7.5?
I Don't figure out a lot from computers but my MacBook has been hacked I suppose and I want to format it in a cvery easy way. What is the simplest way to do it?
-
I am fairly new to network programming. All help is very appreciated! I know how to work with sockets and serversockets, and how to transmit data between the host and the clients. My problem is that I have no idea how to get my working program to wor
-
Calling a JavaScript function from my class
Here's the situation. I am trying to access a website (not my own) through a class I am writing. Some information that I need to pull off the page can only be seen when a JavaScript function is called. How can I make the page call the function from m
-
Hi all... I'm running OS 10.4.11 on my non-Intel dual 2.3 G5 silver tower w 2 gigs of RAM. Honestly, is it worth it for me to upgrade to 10.5? If "yes" then how far in updating should I go, since I seem to notice people having issues with 10.5.2? Tha
-
Convert 2 columns into multiple column table
Hi, I have table with two columns. See below. I need to create a kind of matrix presentation of the table, so that values in row B become column titles, see second table. Amount of data is too big to create this manually. TC1 Req2 TC2 Req1 TC3 Req0 T