ALV Guideline
Hi Yatin Here,
I want to know about Alv ( Abap List Viewer) Report.
Can anyone send me Documentation?
Thanks and Regards
Yatin Mahetaliya.
Hi
Read this link. It will be helpfull to u
http://help.sap.com/erp2005_ehp_04/helpdata/EN/66/bc7aab43c211d182b30000e829fbfe/frameset.htm
Regards
Antony
Similar Messages
-
Not allowing totaling of a field in alv output
hi,
I had made a ALV in which i have to hide 1 field for getting it totaling.
i.e. if somebody try to make total of it ,it should not be allowed on dat field . is dere any solution for this problem?
plzz provide me guidelines for it.Please please it this. I made the total for every field other than RACCT and SUM_COMM.
*& Form sub_prepare_display_output
Display output
--> No Parameter
FORM sub_prepare_display_output .
Local variables
DATA: l_lead_col TYPE char25, " Lead column
l_progname TYPE sy-repid, " Program name
Local internal tables
l_oref_layout TYPE REF TO cl_salv_layout, "Layout
Local work area
l_wa_key TYPE salv_s_layout_key, "Work area for key
l_except1 TYPE REF TO cx_salv_msg,"Exception
l_text1 TYPE string. "Exception msg
If profit center is checked
IF p_prfctr = c_check.
l_lead_col = 'Profit Center'(041).
If product catagory is checked
ELSEIF p_prodc = c_check.
l_lead_col = 'Product Category'(042).
If material is checked
ELSEIF p_smatnr = c_check.
l_lead_col = 'Material No.'(043).
ENDIF.
Create ALV instance with class-method cl_salv_table=>factory
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>false
IMPORTING
r_salv_table = v_oref_table
CHANGING
t_table = i_final.
CATCH cx_salv_msg INTO l_except1.
l_text1 = l_except1->get_text( ).
MESSAGE i000 WITH l_text1.
LEAVE LIST-PROCESSING.
ENDTRY.
Make header of the report
PERFORM sub_header_report USING v_oref_table.
Get the toolbar
v_oref_functions = v_oref_table->get_functions( ).
For activating application toolbar
v_oref_functions->set_all( abap_true ).
v_oref_columns = v_oref_table->get_columns( ).
It populate the key fields which are always displayed
PERFORM sub_fill_fields_of_fcatalog USING:
'SUM_COMM' l_lead_col ' ',
'RACCT' 'Account Number'(035) ' ',
'FOBAC' 'FOB Acrual'(023) 'X',
'EXCESS' 'Excess'(024) 'X',
'OBSOLE' 'Obsolescence'(025) 'X',
'PPV' 'Puchachse Price Var'(026) 'X',
'FR_VAR' 'Freight Variance'(027) 'X',
'PROD_OR_VAR' 'Produc Ord Var'(028) 'X',
'DEP_VAR' 'Dept. Variance'(029) 'X',
'OTH_PROD_VAR' 'Other Prod Var'(030) 'X',
'PR_OR_SCRP_VAR' 'Scrap Variance'(031) 'X',
'COST_OF_ACC' 'Cost of Sales Accnt'(032) 'X',
'INV_ACC' 'Inventory Account'(033) 'X'.
Optimize the columns
v_oref_columns->set_optimize( value = 'X' ).
Setting the layout
get the LAYOUT object
l_oref_layout = v_oref_table->get_layout( ).
set the layout key
l_progname = sy-repid.
l_wa_key-report = l_progname.
l_oref_layout->set_key( value = l_wa_key ).
set save restriction:
none / only user-dependent / only user-independent
l_oref_layout->set_save_restriction(
value = if_salv_c_layout=>restrict_none ).
set: setting of default layout is allowed / isnu2019t allowed
l_oref_layout->set_default( value = 'X' ).
Dispaly the output
v_oref_table->display( ).
ENDFORM. " sub_prepare_display_output
*& Form sub_header_report
Create the header of the report
-->P_v_oref_TABLE table name
FORM sub_header_report USING p_v_oref_table TYPE REF TO
cl_salv_table .
DATA : l_oref_grid TYPE REF TO cl_salv_form_layout_grid.
CREATE OBJECT l_oref_grid.
Add text items for top of page
l_oref_grid->create_text( row = 1 column = 1 text = 'Program'(022)
l_oref_grid->create_text( row = 1 column = 2 text = sy-repid ).
l_oref_grid->create_text( row = 2 column = 1
text = 'User Name'(021) ).
l_oref_grid->create_text( row = 2 column = 2 text = sy-uname ).
l_oref_grid->create_text( row = 3 column = 1 text = 'Date'(020) ).
l_oref_grid->create_text( row = 3 column = 2 text = sy-datum ).
l_oref_grid->create_text( row = 3 column = 3 text = 'Time'(019) ).
l_oref_grid->create_text( row = 3 column = 4 text = sy-uzeit ).
l_oref_grid->create_text( row = 4 column = 1 text = 'System'(018) ).
l_oref_grid->create_text( row = 4 column = 2 text = sy-sysid ).
l_oref_grid->create_text( row = 4 column = 3 text = 'Client'(017) ).
l_oref_grid->create_text( row = 4 column = 4 text = sy-mandt ).
Declare grid as header of list
p_v_oref_table->set_top_of_list( value = l_oref_grid ).
ENDFORM. " sub_header_report
*& Form sub_fill_fields_of_fcatalog
This subroutine populates the field catalog excluding
period fields
-->P_FIELDNAME Table field name
-->P_NAME Field description
-->P_DEC Decimal value flag
FORM sub_fill_fields_of_fcatalog USING p_fieldname TYPE lvc_fname
p_name TYPE c
p_dec TYPE c.
DATA: l_char_l TYPE scrtext_l, "For short text
l_char_m TYPE scrtext_m, "For medium text
l_char_s TYPE scrtext_s, "For long text
l_except1 TYPE REF TO cx_salv_not_found,"Exception
l_text1 TYPE string, "Exception msg
l_orf_aggregs TYPE REF TO cl_salv_aggregations.
Getting the text long/short/medium into variables
l_char_l = p_name.
l_char_m = p_name.
l_char_s = p_name.
Setting the long/short/medium text and fix the key fileds
TRY.
CALL METHOD v_oref_columns->get_column
EXPORTING
columnname = p_fieldname
RECEIVING
value = v_oref_column1.
CATCH cx_salv_not_found INTO l_except1.
l_text1 = l_except1->get_text( ).
MESSAGE i000 WITH l_text1.
LEAVE LIST-PROCESSING.
ENDTRY.
v_oref_column ?= v_oref_column1.
v_oref_column->set_long_text( l_char_l ).
v_oref_column->set_medium_text( l_char_m ).
v_oref_column->set_short_text( l_char_s ).
v_oref_column->set_key( value = 'X' ).
v_oref_columns->set_key_fixation( value = 'X' ).
Set the decimal length
IF p_dec = 'X'.
v_oref_column->set_decimals( value = '2' ).
ENDIF.
IF p_fieldname = 'RACCT' AND p_gl <> c_check.
v_oref_column->set_visible( value = space ).
ENDIF.
IF p_gl = c_check.
v_oref_columns->set_column_position( columnname = 'RACCT'
position = 2 ).
ENDIF.
IF p_fieldname NE 'RACCT' AND p_fieldname NE 'SUM_COMM'.
l_orf_aggregs = v_oref_table->get_aggregations( ).
l_orf_aggregs->add_aggregation( columnname = p_fieldname
aggregation = if_salv_c_aggregation=>total ).
ENDIF.
ENDFORM. " sub_fill_fields_of_fcatalog -
Calling a ALV Report program via a Remote Function module.
H All,
The thing which I am looking out for is ,to know a technique to acheive this,
To start with,
For the transaction MB51-(Material Document List),which is a Report Program "RM07DOCS",I also observed that this uses a ALV to display the output.
Now what I actually require is another extra field (from MARA table ) along with the standard output that is displayed from this report.
Also this needs to be passed to a different UI system(build using VC ).
So I have a RFC eg DisplayList(),where in I need to exeucte this report program ,get the output what it gives ,add my additional information what I want to and pass it as a export parameter,
So this is the structure which I can visualise,
FUNCTION ZFUN_MB51TXN.
I would get all the import parameters here ,from who ever is calling my fun module,
*Call the report program,pass the input parameters required
*get the output from this report program
*send the output to the caller through export parameters
ENDFUNCTION.
So Here I need to know ,Can this be achieved something using Submit report or anything,Any guidelines to move further would be really of great help!Hi All,
It would really be great if you can explain with the reference to the same report program,the same selection screen elemetns or something.
Thanks,
Archies! -
Logic For Subtracting A Given Output In ALV Report
Hi,
I am working on a report in which i am using ALV Concept and there a problem arise i.e. in ALV Report output which always subtotals having values in addition only and i want to know is there any way through which subtraction can also be performed within the output of a ALV Report.
Please provide some guidelines for it.
Regards,
Rickky NVHi,
Thanks to both of you for your value able response. Actually, i am working on customer aging analysis report in which there are 2 columns i.e. debit and credit in which these both values are stored in 2 separate lines and i have to display the difference of them in the 3rd column and facing the problem.
Is it possible to display the required data of it in 3rd column of it?
Regards,
Ricky -
What's the coolest, slickest way to present multiple ALV reports?
Greetings and good day, everyone.
Okay, I'm working on an update program, and the users have identified at least three different reports they would like coming out of this thing. One report is a list of transactions that fail internal logic checking, the second report is a list of transactions that pass internal logic checking but fail to update via a BAPI, and a third report is a list of transactions that pass checks and process correctly (i.e. update the database) via the BAPI.
At first, still being a newbie, I was wondering how I was going to create multiple ALV reports. I know I could do this using the WRITE statement, writing each report one after the other, but they have asked for the ALV report so they can do all the ad-hoc manipulating, sorting, etc. that ALV provides.
I came up with these options:
1. Instead of filling my single screen with the container control for an ALV report, as I usually do, this time I could put three containers on the screen. However, I know that cramps space, and I don't know if they'll be able to adjust or move things around other than scrolling.
2. Display a single ALV report on the screen, but have buttons somehow on the top that somehow take the user to other screens for the other reports.
3. First give the user a screen with all the buttons for the reports. They choose one, and the ALV report displays. They can click back to return to this screen, then choose a different report.
Nobody else in the office has done anything like this yet using the ALV, so I've got a chance to break some new ground internally and do something slick. Which option is best, and if so, do you have examples or general guidelines of how I do it? I've not had dialog programming, although I do understand the concepts from VB/Delphi experience over 10 years ago. I think I lean toward option 2, but I figured this couldn't be new ground in the SAP world and surely someone's done exactly this sort of thing.
Please help! ALL helpful responses, as always, are awarded points! Thanks so much!
DaveDave,
These are all good suggestions. I would just remember to keep in mind when designing your report two different things.
1. Can your program be run in foreground or background? If it has to be run in background due to data volumes you will lose all interactive capabilities of ALV. You might also not be able to do three different ALVs on the screen in background.
2. I am not sure if I understand your option 3 but if you are talking about the user selecting the options before the load the data, they might have to attempt to load the data multiple times to get all of the report.
My recommendation ( I think somebody already mentioned this) is to have a single ALV with a column on your report that the user can then sort or filter by. This way you are not limited to a program that has to be run in foreground.
Chris -
Remove Header when running report with ALV output
Hi,
We are running ITS Version 6200.1022.63326.3, Build 84960 connecting to R/3 Enterprise 4.7 on 6.40 Kernel Patch 196.
I have a situation where I run a report through ITS, starting with a selection screen, I can remove the header part of the ITS generated screen by commenting out:
<!--
`SAP_TemplateHeader()`
-->
in my template. This works great.
Now when I run the report and the output is given in the form of an ALV grid, there is no screen to manipulate as it uses the webgui generated html due to me having set parameter:
GENERATEDYNPRO = 1.
When I receive the report output, the SAP header with "Quit" and "Help" is back, due to it being driven by the standard webgui generated templates.
I have searched on SDN and found some guidelines but no answers are answered and then the thread goes dead so I just wanted to know if someone has ever successfully removed this header.
I have set noheaderokcode = 1 in the service file, in webgui.srvc as well as in global.srvc.
I have also started editing the templatelibrary files but to me it is not a very clean solution.
If someone out there has had this challenge and solved it, please advise.
Thank you very much and regards,
Ronald G. MeyerHi,
Thanks for the feedback.
Does not seem like the Basis team will be patching the ITS landscape soon, so is there anyone who has more input on this?
I have found a programmatical example in this thread:
/thread/76409 [original link is broken]
But none of the examples work like I expect it to.
Just wanted to know if someone has implemented this successfully.
Regards,
Ronald Meyer -
Hi ,
I am facing a problem when ever i am going to donload data from ALV grid to excel file.I am getting CL_SALV_BS_TT_RESULT_TABLE====CP error in GET_CELL_VALUE. Could you please provide me is there any OSS note or any patch required to solve this issue.
Thanks in Advance,
Venkatarao.Hi,
Just refer to OSS note 1356898 for guidelines.
Regards,
Vasanth -
How To Create Header in ALV List Report
Hi All,
I want to create a Header for <b>MY ALV List Report</b>!
How can i achieve the same. It should come above <b>ALV</b>.
ALV report i had already written and it is coming correctly.
Heading should look like this:
<i>1st Line</i>
<b>PROGRAM NAME: XXXXXX CLIENT: XXXXXXXXXX PAGE:XX</b>
<i>2nd Line</i>
<b>RUN DATE/TIME: XXXXX - XXXX REPORT NAME/HEADER</b>
How can i acheive the same in <b>ALV List Report</b>!
I am amking use of <b>REUSE_ALV_LIST_DISPLAY</b> Function module.
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
Use the sample code specified below as the guideline. For more info. refer to the documentation of the FM 'REUSE_ALV_COMMENTARY_WRITE'.
DATA: first(01) type c,
events type slis_t_event,
gt_list_top_of_page type slis_t_listheader,
ls_event type slis_alv_event.
initialization.
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = events
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
read table events with key name = 'TOP_OF_PAGE'
into ls_event.
if sy-subrc = 0.
move: 'TOP_OF_PAGE' to ls_event-form.
append ls_event to events.
clear ls_event.
endif.
End of additions
Start-of-selection
START-OF-SELECTION.
Top-of-page
TOP-OF-PAGE.
PERFORM TOP_OF_PAGE.
FORM TOP_OF_PAGE .
data: ls_line type slis_listheader.
if first is initial.
ls_line-typ = 'S'.
ls_line-key = 'Run Date :'.
write: sy-datum to ls_line-key+10 mm/dd/yyyy.
ls_line-info = 'Billing Date:'.
write: s_fkdat-low to ls_line-info+15 mm/dd/yyyy.
ls_line-info+28 = 'To'.
write s_fkdat-high to ls_line-info+32 mm/dd/yyyy.
append ls_line to gt_list_top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
first = 'N'.
else.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
endif.
ENDFORM. " top_of_page
<b>Please mark helpful answer.</b>
Regards,
Amit Mishra -
Drill Down facility in ALV Report
Hi Guys,
I want to provide Drill down facility based on columns in ALV Report (ALV Web Dynpro Report). Please let me know if you have any sample code or guidelines for this.
Thanks,
PradeepHi,
Pls refer to the example provded by SAP -
WDT_ALV
Pls refer to this link -
Learning what you don't need is as important as learning what you do (Parts 10b-c) of "Event-Driven" Tutorial on WDR_TEST_UI_ELEMENTS) and https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706.
Reward if helpful.
Best Wishes,
Chandralekha -
Reg exporting ALV to PDF in Webdynpro ABAP
Hi All,
I've developed one Webdynpro ABAP portal. There, in one view, I have an ALV for Account Statement. I need to allow this output - as it is - to be Downloaded and Printed as per given Button-choice in PDF Format.
How can I do this? I searched SDN Forum for this. Many an articles are there but, they suggest that data from Internal Table can be exported to PDF. How can we get the data from ALV in one view to internal table?
If there is other way of doing the same, would you please guide me.
Thanks.
Kumar Saurav.Hi Thomas,
Thanks for your guidelines.
In our system, ADS has already been installed. Second, ALV Toolbar is not reqd from Client's side. They need only Print and Download Functionality that too using Button.
Hence, my case came into picture. Further, I have to add Customer Name with address as Header and Net Balance as Footer in my PDF. Therefore I need to fetch all the data that are already in ALV and present it with changed layout.
Please guide me.
Thanks.
Kumar Saurav. -
REG:Exporting ALV in webdynpro
Hi,
one of the user is facing the problem in exporting the excel (processing and not ending) , (remaining users able to export it properly).
can anyone suggest some setting to be made in IE?
Regards
SrinivasHi Thomas,
Thanks for your guidelines.
In our system, ADS has already been installed. Second, ALV Toolbar is not reqd from Client's side. They need only Print and Download Functionality that too using Button.
Hence, my case came into picture. Further, I have to add Customer Name with address as Header and Net Balance as Footer in my PDF. Therefore I need to fetch all the data that are already in ALV and present it with changed layout.
Please guide me.
Thanks.
Kumar Saurav. -
Hi all,
i have to develop a ALV report.
In that report i have to put a open quantity column , so that the user can enter values in that, and that value should get updated in the database.
So please suggest me how to develop such report with open field.
Thanks in advance,
Regards,
PawanHi,
Try executing the below code
REPORT YMS_EDITBLOCKALV.
TABLES : rmmg1,MCHB, mkpf.
DATA: BEGIN OF t_mseg OCCURS 0,
zeile LIKE mseg-zeile,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
charg LIKE mseg-charg,
bwart LIKE mseg-bwart,
END OF t_mseg.
DATA:BEGIN OF t_mchb OCCURS 0.
INCLUDE STRUCTURE mchb.
data flag type c.
matnr LIKE mchb-matnr,
charg LIKE mchb-charg,
werks LIKE mchb-werks,
clabs LIKE mchb-clabs,
DATA END OF t_mchb.
TYPE-POOLS slis.
data: progname like sy-repid,
fieldcattab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
data tabindex type i.
data wa_matnr LIKE mchb-matnr.
progname = sy-repid.
SELECTION-SCREEN BEGIN OF BLOCK b_b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS s_docno FOR mkpf-mblnr. " OBLIGATORY.
PARAMETERS p_docyr LIKE mkpf-mjahr. " OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b_b1.
START-OF-SELECTION.
SELECT zeile
menge
meins
matnr
werks
charg
bwart
FROM mseg
INTO TABLE t_mseg
WHERE mblnr IN s_docno AND mjahr = p_docyr.
CLEAR fieldcattab.
fieldcattab-col_pos = 1.
fieldcattab-fieldname = 'ZEILE'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-fix_column = 'X'.
fieldcattab-seltext_l = 'Item'.
APPEND fieldcattab.
CLEAR fieldcattab.
fieldcattab-col_pos = 2.
fieldcattab-fieldname = 'MENGE'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-seltext_l = 'Quantity'.
APPEND fieldcattab.
CLEAR fieldcattab.
fieldcattab-col_pos = 3.
fieldcattab-fieldname = 'MEINS'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-seltext_l = 'Unit'.
APPEND fieldcattab.
CLEAR fieldcattab.
fieldcattab-col_pos = 4.
fieldcattab-fieldname = 'MATNR'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-seltext_l = 'Material'.
APPEND fieldcattab.
CLEAR fieldcattab.
fieldcattab-col_pos = 5.
fieldcattab-fieldname = 'WERKS'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-seltext_l = 'Plant'.
APPEND fieldcattab.
CLEAR fieldcattab.
fieldcattab-col_pos = 6.
fieldcattab-fieldname = 'CHARG'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-seltext_l = 'Batch No'.
APPEND fieldcattab.
CLEAR fieldcattab.
fieldcattab-col_pos = 7.
fieldcattab-fieldname = 'BWART'.
fieldcattab-tabname = 'T_MSEG'.
fieldcattab-seltext_l = 'Inventory'.
fieldcattab-hotspot = 'X'.
APPEND fieldcattab.
end-of-selection.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = PROGNAME
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USERCOMMAND1'
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 = fieldcattab[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT = fieldcattab
IT_HYPERLINK =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = t_mseg
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 usercommand1 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
tabindex = rs_selfield-tabindex.
read table t_mseg INDEX tabindex.
select * from mchb into table t_mchb where matnr = t_mseg-matnr.
clear fieldcattab.
CLEAR fieldcattab[].
fieldcattab-col_pos = 1.
fieldcattab-fieldname = 'FLAG'.
fieldcattab-tabname = 'T_MCHB'.
fieldcattab-fix_column = 'X'.
fieldcattab-seltext_l = 'Check Box'.
fieldcattab-input = 'X'.
fieldcattab-edit = 'X'.
fieldcattab-checkbox = 'X'.
APPEND fieldcattab.
clear fieldcattab.
fieldcattab-col_pos = 2.
fieldcattab-fieldname = 'MATNR'.
fieldcattab-tabname = 'T_MCHB'.
fieldcattab-fix_column = 'X'.
fieldcattab-seltext_l = 'Material'.
fieldcattab-emphasize = 'C1'.
fieldcattab-input = 'X'.
fieldcattab-edit = 'X'.
fieldcattab-checkbox = 'X'.
APPEND fieldcattab.
clear fieldcattab.
fieldcattab-col_pos = 3.
fieldcattab-fieldname = 'CHARG'.
fieldcattab-tabname = 'T_MCHB'.
fieldcattab-seltext_l = 'Batch No'.
fieldcattab-emphasize = 'C2'.
fieldcattab-input = 'X'.
fieldcattab-edit = 'X'.
APPEND fieldcattab.
clear fieldcattab.
fieldcattab-col_pos = 4.
fieldcattab-fieldname = 'WERKS'.
fieldcattab-tabname = 'T_MCHB'.
fieldcattab-seltext_l = 'Plant'.
fieldcattab-emphasize = 'C30'.
fieldcattab-input = 'X'.
fieldcattab-edit = 'X'.
APPEND fieldcattab.
clear fieldcattab.
fieldcattab-col_pos = 5.
fieldcattab-fieldname = 'CLABS'.
fieldcattab-tabname = 'T_MCHB'.
fieldcattab-seltext_l = 'Stock'.
fieldcattab-emphasize = 'C601'.
fieldcattab-input = 'X'.
fieldcattab-edit = 'X'.
APPEND fieldcattab.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = PROGNAME
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USERCOMMAND2'
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 = FIELDCATTAB[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = t_mchb
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.
endcase.
endform.
FORM usercommand2 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-sel_tab_field = 'T_MCHB-MATNR'.
CALL FUNCTION 'ZALV2'
EXPORTING
CTU = 'X'
MODE = 'E'
UPDATE = 'A'
GROUP =
USER =
KEEP =
HOLDDATE =
NODATA = '/'
MATNR_001 = '200-200'
KZSEL_01_002 = 'X'
IMPORTING
SUBRC =
TABLES
MESSTAB =
SET PARAMETER ID 'RID' FIELD RMMG1-MATNR.
CALL TRANSACTION 'MM03' and skip first screen.
ENDIF.
ENDCASE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = progname
i_callback_user_command = 'USERCOMMAND3'
it_fieldcat = fieldcattab[]
TABLES
t_outtab = t_mchb
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.
endcase.
ENDFORM.
Regards,
chandru -
Unable to capture data in an editable dynamic ALV.
Hi ,
I have created a dynamic editable ALV whose displayed structure can be changed at runtime based on the selection in a drop down list value selector.
Im trying to capture the values entered in the ALV into an internal table before the user changes the structure of the ALV to a different structure.
In the ON_SELECT event handler of the drop down list box , im rasing a data_check event to capture the ALV data.
The problem is that the control is not entering the event handler for the data_check event.
If i raise the data_check event in my save event handler or any other event handler , it works fine.
Can someone please suggest a solution.
Regards,
Newton.Hi ,
I have figured out that the problem is local to my machine , because the code works fine on other machines.
I guess my internet explorer has some bug.
Regards,
Newton. -
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 -
'@' not getting displayed in the ALV report
Hello,
I am facing a strange issue in the ALV report display. A string starting with '@' is not getting displayed and says "default icon " on the report. and this is varying from system to system for the same user.
can anyone please help me in resolving the issue.
Thanks in advance.
Thanks and Regards,
Santhosh Guptha N.@ is a default value as per ALV internal process. This is used in icons .
I think this is causing the confusion.
Check in the fieldcat if there is any adjsutment to be made to handle this.
Br,
Vijay
Maybe you are looking for
-
How extract properties from document saved in blob.
I need extract all document properties from document (any file type) saved in blob. I've tried three ways... - I've tried using relational ORDDoc.getProperties() by example. But this method returned exception ORDSYS.ORDDOCEXCEPTIONS.DOC_PLUGIN_EXCEPT
-
Help!I just bought accessories for ipod mini 4GB and was working fine till battery died and i tried to recharge it. Now it wont switch on at all. i get no response and my computer doesnt register it either. i have been through all the reset/troublesh
-
Can't use"Open With" multiple files Bridge to Premiere
I'm running Vista 32 bit CS3 Bridge and Premiere. According to the Video workshop http://www.adobe.com/designcenter-archive/video_workshop/ under Premiere > all 19 topics > Managing Media in Adobe Premiere Pro > at 02:46 it shows group selecting a bu
-
we are getting a message ,'the ipod cannot be updated at this time because the ipod software update server could not be contacted or is temporarilly unavailable ' . we have been trying for 3-4 weeks now same same ?
-
Label Printing with Deskjet D1660
Having problem printing full page Avery L7160 labels. Have Deskjet D1660. Prints first three labels on top of page then stops printing with page stuck in printer. Will print full page if load with just paper. Have tried to contact HP help desk no luc