ALV Display Problem
Dear Experts,
I m working on ALV Report,
User has 3 options : Open item, Clear Item and All item.
ALV output is fine for open and clear item.
but when user choose All item, it displays every column twice.
For reference code is like
IF r_open = 'X'.
PERFORM get_data_open.
PERFORM display_data.
ELSEIF r_clear = 'X'.
PERFORM get_data_cleared.
PERFORM display_data.
ELSEIF r_all = 'X'.
PERFORM get_data_open.
PERFORM display_data.
PERFORM get_data_cleared.
PERFORM display_data.
ENDIF.
Can anyone help me in this.
Regards,
Hi Maverick,
IF r_open = 'X'.
PERFORM get_data_open.
PERFORM display_data.
ELSEIF r_clear = 'X'.
PERFORM get_data_cleared.
PERFORM display_data.
ELSEIF r_all = 'X'.
PERFORM get_data_open.
PERFORM display_data.
PERFORM get_data_cleared.
PERFORM display_data.
ENDIF.
<li>When you select radiobutton for all, you have clubbed open items and clear items together. that is fine .
But the thing is your building fieldcatalog internal table twice for open items and cleared items.
<li> For both open and cleared items if you have same columns,, you can just do like below
DELETE ADJACENT DUPLICATES FROM it_fieldcat COMPARING fieldname.
Thanks
Venkat.O
Similar Messages
-
hi guys,
while executing my ALV report i had got this error message.
You attempted to access an unassigned field symbol
(data segment "-1").
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
Reg,
HariharanHi Sunitha,
In ALV Filter problem , Please refer below SAP Note 381360.
SAP Note 381360 : For Filter issues
check this link
https://service.sap.com/sap/support/notes/381360
Regards,
GJ
Edited by: Shankar GJ on Apr 26, 2010 6:23 PM -
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 -
Download to excel from alv display
Hi,
How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no contents.Can anyone tell me how to overcome this problem.
Regards,
Sowmya.Hi Sowmya,
Just put break point near FM reuse_alv_grid_display and check if internal table which is used to display output is popullated or not.
Regards Sachin. -
hi experts,
well i am having a problem regarding ALV display...the requirement is :
ALV DISPLAY SHOULD BE LIKE THIS
Open Balance 12345
SY-DATUM POSTING DATE DOC. NUMBER LOCAL CURRENCY AMOUNT
now the sum of the amount is displayed in front of open balance field, which is displayed in a first row of ALV display. And below are the columns with heading are having a details of the GL-ACCOUNT.
Is this possible using a same ALV grid display or i have to use 2 ALV grid display? In both cases plz let me know to get this sort of output?
regards,
Yahya Shoaib.In the heading part you can display the total..
*& Report ZTRN_ALV1
REPORT ZTRN_ALV1.
TYPE-POOLS: SLIS.
DATA: REPID LIKE SY-REPID,
FCAT TYPE SLIS_T_FIELDCAT_ALV,
GCAT TYPE SLIS_FIELDCAT_ALV,
FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
GCAT1 TYPE SLIS_FIELDCAT_ALV,
LAYOUT TYPE SLIS_LAYOUT_ALV,
T_EVENTS TYPE SLIS_T_EVENT,
EVENTS TYPE SLIS_ALV_EVENT,
HEADING TYPE SLIS_T_LISTHEADER,
HEADER TYPE SLIS_LISTHEADER.
PARAMETERS: CCODE LIKE LFB1-BUKRS.
DATA: BEGIN OF ITAB OCCURS 0,
lifnr LIKE LFA1-LIFNR,
BUKRS LIKE LFB1-BUKRS,
NAME1 LIKE LFA1-NAME1,
END OF ITAB.
DATA: BEGIN OF JTAB OCCURS 0,
EBELN LIKE EKKO-EBELN,
lifnr LIKE LFA1-LIFNR,
AEDAT LIKE EKKO-AEDAT,
END OF JTAB.
*DATA: JTAB LIKE STANDARD TABLE OF EKKO WITH HEADER LINE INITIAL SIZE 0.
START-OF-SELECTION.
REPID = SY-REPID.
PERFORM FETCH.
PERFORM FIELDCAT.
PERFORM LAYOUT.
PERFORM GET_EVENTS.
PERFORM EVENTS.
PERFORM OUTPUT.
*& Form FETCH
text
--> p1 text
<-- p2 text
FORM FETCH .
SELECT ALIFNR ANAME1 BBUKRS INTO CORRESPONDING FIELDS OF TABLE ITAB FROM LFA1 AS A JOIN LFB1 AS B ON ALIFNR EQ B~LIFNR WHERE
B~BUKRS EQ CCODE.
ENDFORM. " FETCH
*& Form FIELDCAT
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
GCAT-COL_POS = '1'.
GCAT-FIELDNAME = 'BUKRS'.
GCAT-TABNAME = ITAB.
GCAT-SELTEXT_M = 'COMPANY CODE'.
APPEND GCAT TO FCAT.
GCAT-COL_POS = '2'.
GCAT-FIELDNAME = 'LIFNR'.
GCAT-TABNAME = ITAB.
GCAT-SELTEXT_M = 'VENDOR NUMBER'.
APPEND GCAT TO FCAT.
GCAT-COL_POS = '3'.
GCAT-FIELDNAME = 'NAME1'.
GCAT-TABNAME = ITAB.
GCAT-SELTEXT_M = 'VENDOR NAME'.
APPEND GCAT TO FCAT.
ENDFORM. " FIELDCAT
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
LAYOUT-ZEBRA = 'X'.
ENDFORM. " LAYOUT
*& Form GET_EVENTS
text
--> p1 text
<-- p2 text
FORM GET_EVENTS .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = T_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. " GET_EVENTS
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
READ TABLE T_EVENTS INTO EVENTS WITH KEY NAME = 'TOP_OF_PAGE'.
EVENTS-FORM = 'TOP_OF_PAGE'.
MODIFY TABLE T_EVENTS FROM EVENTS TRANSPORTING FORM.
READ TABLE T_EVENTS INTO EVENTS WITH KEY NAME = 'USER_COMMAND'.
EVENTS-FORM = 'USER_COMMAND'.
MODIFY TABLE T_EVENTS FROM EVENTS TRANSPORTING FORM.
ENDFORM. " EVENTS
*& Form OUTPUT
text
--> p1 text
<-- p2 text
FORM OUTPUT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
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 = LAYOUT
IT_FIELDCAT = FCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = T_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 = ITAB
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. " OUTPUT
*& Form TOP_OF_PAGE
text
--> p1 text
<-- p2 text
FORM TOP_OF_PAGE .
CLEAR HEADING[]. <----IN THIS INTERNAL TABLE YOU EASILY DISPLAY TOTAL...
HEADER-TYP = 'H'.
HEADER-INFO = 'WIPRO TECHNOLOGIES'.
APPEND HEADER TO HEADING.
HEADER-TYP = 'S'.
HEADER-INFO = 'ADVANCED ABAP TRAINING'.
APPEND HEADER TO HEADING.
HEADER-TYP = 'A'.
HEADER-INFO = 'LIST OF VENDORS'.
APPEND HEADER TO HEADING.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. -
Hello all,
When a workflow work item is executed, a function module is called that displays a screen. The workitem calls a function module that displays an ALV on a screen. The same ALV is displayed for 3 different workitems.
I am changing the field catalog based on certain criteria to set an individual field to be editable/non-editable. I can see that the edit field in the field catalog contains the appropriate value, but the grid does not reflect what is in the field catalog.
The first workitem displays the ALV correctly.
The second and third workitems display the ALV using fieldcat values from the first workitem. The fieldcat contains the correct values when the grid is displayed using method "set_table_for_first_display".
If I log off of SAP and log back on, the second workitem ALV displays with the correct value. But the third workitem now display with the fieldcat values from the second workitem.
If I log off of SAP and log back on, the third workitem ALV displays with the correct value.
Any thought on what I need to do to correct this problem?
This is the logic that creates and displays the ALV in the PBO of the screen of the function module.
clear: il_fieldcat, l_layout.
refresh: il_fieldcat.
free: il_fieldcat.
submit balvbufdel and return. " clear ALV buffer
submit bcalv_buffer_del_shared and return. " clear ALV buffer
* Create an instance for the event handler
create object gr_event_handler .
* Create an instance of the container displayed on screen 1400
create object w_custom_container_1400
exporting container_name = w_container_1400.
* Create an instance of the grid displayed in the container
create object w_grid_1400
exporting i_parent = w_custom_container_1400.
* Build fieldcat - edit enabled.
perform build_fieldcat_1400 changing il_fieldcat.
* >> call method w_alv->set_frontend_fieldcatalog after modifying the field ctalog <<
call method w_grid_1400->set_frontend_fieldcatalog
exporting
it_fieldcatalog = il_fieldcat.
* Disable generic ALV toolbar functions
perform exclude_tb_functions_1400 changing lt_exclude.
* Set layout options:
l_layout-grid_title = 'ZFXXU003'.
l_layout-zebra = 'X'.
l_layout-edit_mode = 'X'.
set handler gr_event_handler->handle_user_command for w_grid_1400 .
set handler gr_event_handler->handle_toolbar for w_grid_1400 .
set handler gr_event_handler->handle_menu_button for w_grid_1400 .
set handler gr_event_handler->handle_data_changed for w_grid_1400 .
data: w_is_variant type disvariant.
w_is_variant-report = sy-cprog.
w_is_variant-variant = '/DEFAULT'.
call method w_grid_1400->set_table_for_first_display
exporting
i_buffer_active = 'X'
i_bypassing_buffer = 'X'
is_layout = l_layout
it_toolbar_excluding = lt_exclude
i_save = 'A' " enable save option
is_variant = w_is_variant
changing
it_fieldcatalog = il_fieldcat
it_outtab = il_outtab.
* set editable cells to ready for input
call method w_grid_1400->set_ready_for_input
exporting
i_ready_for_input = 1.
* Register ENTER to raise event DATA_CHANGED.
call method w_grid_1400->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
create object w_event_receiver_1400.
set handler w_event_receiver_1400->handle_data_changed
for w_grid_1400.
Edited by: Bruce Tjosvold on Dec 8, 2010 4:21 PM
Edited by: Bruce Tjosvold on Dec 8, 2010 4:24 PM
Edited by: Bruce Tjosvold on Dec 8, 2010 5:04 PMHi Bruce,
You should avoid the creation of the ALV everytime that you need to change the fieldcatalog by calling the method "set_table_for_first_display". Instead, you should call the "refresh_table_display" method.
Regarding the code that you provide to us, it should be something like this:
if ...
* Build fieldcat - edit enabled.
perform build_fieldcat_1400 changing il_fieldcat.
call method w_grid_1400->set_table_for_first_display
exporting
i_buffer_active = 'X'
i_bypassing_buffer = 'X'
is_layout = l_layout
it_toolbar_excluding = lt_exclude
i_save = 'A' " enable save option
is_variant = w_is_variant
changing
*it_fieldcatalog = il_fieldcat* "Here you are specifying your first catalog
it_outtab = il_outtab.
else.
call method w_grid_1400->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2 .
endif.
If you want at this point change the catalog, you should modify the values of it_fieldcat and update it on the existing ALV
call method w_grid_1400->set_frontend_fieldcatalog
exporting
it_fieldcatalog = il_fieldcat.
Best regards,
Eric -
Reg: Check boxes in ALV Display
Hi Experts,
I have a problem with ALV Display. I am able to display the contents in output.
But my client requirement is, they need to insert 'check boxes' before each record.
I hope you understood. any way let me explain some thing...
I am displaying records in ALV, but they need check boxes before each record. Like.... you can see database tables. in database tables like MARA.. it will display
check box client field1 field2 field3.......................
Please help me in this regard.....
Thanks in Advance
Sai babuHi This is my code,
As of you people suggested me, i write like this.... but it is not working....
please guide me....
FORM SUB_DISP_REP .
PERFORM SUB_FIELD_DEF USING :
' ' '1' 'PERNR' 'Personnel Number' ' ' ' ' ' ' ,
' ' '2' 'STAT2' 'Employee Status' '' '' '' ,
' ' '3' 'STELL' 'Job Title' '' '' '' ,
' ' '4' 'VORNA' 'First Name' '' '' '' ,
' ' '5' 'NACHN' 'Last Name' '' '' '' ,
' ' '6' 'KTART' 'Absence Quota Type' '' '' '' ,
' ' '7' 'ANZHL' 'Number of Employee Time Quota' '' '' '' ,
' ' '8' 'KVERB' 'Deduction of Employee Time Quota' '' '' '' ,
' ' '9' 'QUONR' 'Counter for time quotas' '' '' '' ,
' ' '10' 'DESTA' 'Start Date for Quota Deduction' '' '' '' ,
' ' '11' 'DEEND' 'Quota Deduction to' '' '' '' .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-CPROG
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'X'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'TRVPICTURE08'
I_GRID_TITLE = 'EMPLOYEE ABSENCE QUOTA'
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = T_FCAT
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
IT_SORT = T_SUBTOT
* 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_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = T_OUTPUT
* 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. " SUB_DISP_REP
form SUB_FIELD_DEF using P_chk TYPE char1
P_COL TYPE CHAR2
P_NAME TYPE CHAR10
P_TEXT TYPE CHAR40
P_SUM TYPE CHAR1
P_EDIT TYPE CHAR1
P_OUT TYPE CHAR1.
W_FCAT-checkbox = 'X'.
W_FCAT-COL_POS = P_COL .
W_FCAT-FIELDNAME = P_NAME .
W_FCAT-SELTEXT_M = P_TEXT .
W_FCAT-DO_SUM = P_SUM .
W_FCAT-EDIT = P_EDIT .
W_FCAT-NO_OUT = P_OUT .
APPEND W_FCAT TO T_FCAT .
CLEAR W_FCAT .
endform. " SUB_FIELD_DEF -
Hi,
I have encountered one problem.
I am displaying the records in the alv. let there are 5 records, The record that i choosed from the ALV display( let first one out of those 5) is updating or inserted in the Ztable.
what should i do so that , the record that was choosen for updating
should not get displayed on the screen once it get updated or inserted in the
ZTABLEHi,
In the USER-COMMAND Subroutine where u actually save the record, you can set the flag as to SELFIELD-REFRESH = 'X' and delete the record that you have saved from the Internal table. This will refresh you ALV Grid also.
regards,
Mahesh -
SQ01 ALV DISPLAY WHEN USING LOGOCAL DATABASE
Dear All,
I'm using a logical database (EMM) to build a query in SQ01, I need an ALV display.
If I use only three tables of the logical database hierarchy it works fine, but as soon as I try to use a fourth one, then the ALV display does not work anymore.
At the parameter selection screen, instead of the usual "Sap List Viewer" field I've got a "Save with ID" tick box, and on the result screen, it is not possible to select "Alv display" (no such buton).
Is this normal way of is there anything I could do ?
Please note that if using a "simple" join between the 4th tables instead of the logical database , then it works fine.
Regards
FrancoisHi,
Its only because of Fieldcatalog problem.
Only one thing you need to take care is that when you refer any dictionary field do not use TYPE Instead use LIKE statement, then It works.
You can have a example..
TYPE-POOLS: SLIS.
DATA: PROGNAME LIKE SY-REPID,
GT_FCAT0 TYPE SLIS_T_FIELDCAT_ALV,
GT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: IT_MARA0 TYPE TABLE OF MARA.
DATA: BEGIN OF IT_MARA1 OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
END OF IT_MARA1.
PROGNAME = SY-REPID.
* internal table definition with type of a structure
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'IT_MARA0'
I_STRUCTURE_NAME = 'MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = GT_FCAT0[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
* own internal table definition
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'IT_MARA1'
I_INCLNAME = PROGNAME
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = GT_FCAT1[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
Thanks
Arbind -
hi abaprs,
i have displayed my alv in container using cl_gui_alv_grid->set_table_for_first_display, now i have 'edit' button on my screen, i want to make certaion fields of a raw selected by user to editable mode when user
push that button, i have got few refrences but i cant get the solution, i m looking for some subroutine where i can catch the index of the row selected and switch it to editable mode.
sample code will be a bonus, and useful answer will be rewarded.
thanks
devender.Hi,
Here are a few classes used in ALV, just read through their documentation or look at how they've been implemented in your system and you'll get a good idea on how to use them:
CL_ALV_EVENT_DATA (Changing Data Container for Events)
CL_ALV_EVENT_TOOLBAR_SET (ALV Context menu)
CL_ALV_TABLE_CREATE (Dynamic Creation of ALV Data Table)
CL_ALV_TREE_BASE (Basis Class ALV Tree Control)
CL_CK_ALVTREE_NKEY_2_OBJECT (Converter Node Key Object)
CL_COST_COSTINGVERSION_ALV (Display Costing Versions)
CL_GUI_ALV_GRID (List Viewer)
CL_GUI_ALV_GRID_BASE (Basis Class for ALV grid)
CL_GUI_ALV_TREE (ALV Tree Control)
CL_GUI_ALV_TREE_SIMPLE (Simple ALV Tree)
check the below links lot of info and examples r there for OOPS
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Check these sample code
data : begin of it_mara occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara.
data : begin of it_mara1 occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara1.
data : begin of it_mara2 occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara2.
data : t_fieldcat type lvc_t_fcat,
t_fieldcat1 type lvc_t_fcat,
s_fieldcat like line of t_fieldcat.
data : s_layout type lvc_s_layo.
data : control type ref to cl_gui_custom_container,
grid type ref to cl_gui_alv_grid.
data: begin of wa ,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of wa.
class lcl_events_box definition.
public section.
methods :
*Handler_Data_Changed for event Data_Changed of cl_gui_alv_grid
*imporTing er_data_changed,
Handler_User_Command for event User_Command of cl_gui_alv_grid
imporTing e_ucomm,
Handler_ToolBar for event ToolBar of cl_gui_alv_grid
importing E_object E_interactive.
endclass.
class lcl_events_box implementation.
method Handler_user_command.
PERFORM FORM_USERCOMMAND CHANGING E_UCOMM.
endmethod.
method Handler_ToolBar.
PERFORM FORM_TOOLBAR CHANGING E_OBJECT E_INTERACTIVE
E_OBJECT->MT_TOOLBAR.
endmethod.
ENDCLASS.
start-of-selection.
data : w_events type ref to lcl_events_box.
select matnr mtart meins from mara into corresponding fields of table
it_mara.
call screen 100.
*& Module pbo_module OUTPUT
text
MODULE pbo_module OUTPUT.
if GRID is initial.
CREATE OBJECT CONTROL
EXPORTING
CONTAINER_NAME = 'CUST_CTRL'.
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONTROL.
PERFORM BUILD_CATALOG.
PERFORM BUILD_CATALOG1.
PERFORM BUILD_LAYOUT.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = s_layout
CHANGING
IT_OUTTAB = it_mara[]
IT_FIELDCATALOG = t_fieldcat.
CREATE OBJECT W_EVENTS.
SET HANDLER : W_EVENTS->HANDLER_TOOLBAR FOR GRID,
W_EVENTS->HANDLER_USER_COMMAND FOR GRID.
CALL METHOD GRID->SET_TOOLBAR_INTERACTIVE.
ELSE.
call method grid->refresh_table_display.
ENDIF.
ENDMODULE. " pbo_module OUTPUT
*& Form BUILD_CATALOG
FORM BUILD_CATALOG .
S_FIELDCAT-COL_POS = '1'.
S_FIELDCAT-FIELDNAME = 'MARK'.
S_FIELDCAT-CHECKBOX = 'X'.
S_FIELDCAT-eDIT = 'X'.
APPEND S_FIELDCAT TO T_FIELDCAT.
CLEAR S_FIELDCAT.
S_FIELDCAT-COL_POS = '2'.
S_FIELDCAT-FIELDNAME = 'MATNR'.
S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
APPEND S_FIELDCAT TO T_FIELDCAT.
S_FIELDCAT-COL_POS = '3'.
S_FIELDCAT-FIELDNAME = 'MTART'.
S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
APPEND S_FIELDCAT TO T_FIELDCAT.
S_FIELDCAT-COL_POS = '4'.
S_FIELDCAT-FIELDNAME = 'MEINS'.
S_FIELDCAT-SCRTEXT_M = 'UOM'.
APPEND S_FIELDCAT TO T_FIELDCAT.
ENDFORM. " BUILD_CATALOG
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
FORM BUILD_LAYOUT .
S_LAYOUT-ZEBRA = 'X'.
S_LAYOUT-CWIDTH_OPT = 'X'.
S_LAYOUT-GRID_TITLE = 'Material Details'.
ENDFORM.
" BUILD_LAYOUT////////////////////////////////////
" USER_COMMAND_0100 INPUT
*& Form FORM_USERCOMMAND
text
<--P_E_UCOMM text
form FORM_USERCOMMAND changing p_e_ucomm.
CASE P_E_UCOMM.
WHEN 'INT1'.
DO.
READ TABLE IT_MARA INDEX SY-INDEX TRANSPORTING MARK MATNR.
IF SY-SUBRC 0.
EXIT.
ENDIF.
IF IT_MARA-MARK = 'X'.
read table it_mara into wa TRANSPORTING MATNR MTART MEINS .
MOVE-CORRESPONDING WA TO IT_MARA1.
READ TABLE IT_MARA1 TRANSPORTING MATNR MTART MEINS .
MOVE-CORRESPONDING IT_MARA1 TO IT_MARA2.
APPEND IT_MARA2.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = s_layout
CHANGING
IT_OUTTAB = it_mara2[]
IT_FIELDCATALOG = t_fieldcat1.
SET PARAMETER ID 'MAT' FIELD IT_MARA-MATNR.
CALL TRANSACTION 'MM02'.
. ENDIF.
ENDIF.
ENDDO.
ENDCASE.
endform. " FORM_USERCOMMAND
*& Form FORM_TOOLBAR
text
<--P_E_OBJECT text
<--P_E_INTERACTIVE text
<--P_E_OBJECT_>MT_TOOLBAR text
FORM FORM_TOOLBAR CHANGING P_E_OBJECT TYPE REF TO
CL_ALV_EVENT_TOOLBAR_SET
P_E_INTERACTIVE
MT_TOOLBAR TYPE TTB_BUTTON.
DATA WAL_BUTTON TYPE STB_BUTTON.
*WAL_BUTTON-ICON = ICON_status_reverse.
WAL_BUTTON-TEXT = 'GO'.
WAL_BUTTON-QUICKINFO = 'PROCEED'.
waL_button-FUNCTION = 'INT1'.
WAL_BUTTON-BUTN_TYPE = 0.
WAL_BUTTON-DISABLED = SPACE.
insert WAL_BUTTON INTO P_E_OBJECT->MT_TOOLBAR index 1.
endform. " FORM_TOOLBAR
*& Module PF-STATUS OUTPUT
text
module PF-STATUS output.
set pf-status 'Z7PSTAT'.
endmodule. " PF-STATUS OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0100 INPUT
*& Form BUILD_CATALOG1
text
--> p1 text
<-- p2 text
form BUILD_CATALOG1 .
S_FIELDCAT-COL_POS = '1'.
S_FIELDCAT-FIELDNAME = 'MATNR'.
S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
S_FIELDCAT-COL_POS = '2'.
S_FIELDCAT-FIELDNAME = 'MTART'.
S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
S_FIELDCAT-COL_POS = '3'.
S_FIELDCAT-FIELDNAME = 'MEINS'.
S_FIELDCAT-SCRTEXT_M = 'UOM'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
endform. " BUILD_CATALOG1
check the below link may be useful for you
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
Regards,
Shiva -
How to go back to an ALV display.
hello there,
i need to create an ALV report then in this ALV when i click on a custom made button,the system call a transaction. if the user press the back button,the system must redirect to the previous ALV display.
my question is how can i perform this task.
i cant access the code of the transaction been called.
thanks in advance.thank Aditi Wason.
i have one more question. the thing is that i have not done the entire coding yet,am still investigating on my problem because i thought to be able to perform the back operation i should create a module pool.
when i call the required transaction in the first screen i must input some details and by pressing enter the system call another screen. so my second question is, will it works, as you kindly replied previously, in this situation also; that is the back operation will bring me back to the alv from the second screen in the transaction?
thank again.
Edited by: click_17 on Aug 23, 2009 7:01 AM -
ALV displays a maximum of 130 characters for field
Hi all!
I have a problem with the ALV display and Debug textbox.
I have a var which has 220 of length but alv only displays the first 130.
Also, debugging, this var is showed in the textbox with the first 130 characters, but if I write l_message+100 i can see that the rest of message exists.
The ALV is Ok. I have changed the length of the field to 200 chars instead the l_message type but it still happens. I think that there is any routine or something that is forcing the vision of 130 characters in the ALV and DEBUG.
Do u know anything?
Thanks!I am able to get upto 255 characters. Are you doing grid or ALV list.
check whether you gave line size in report line.
check the fieldcatalog output length what you gave and if any reference table name filed name you gave. -
ALV report problem. empty catalog.
Hi everybody,
I'm having a lot of problems with the ALV displaying stuff, i can see no problems in the code but the alv doesnt display anything at all, the catalog is built but any data is displayed in the list, i even took the function call out of the perform and called REUSE_ALV_GRID_DISPLAY directly to avoid posting any parametres...but the list is still empty.
here i post the code, is really simple alv example. take info from it001, 002 and 006 and (try to )display that in a alv list.
If someone see something wrong i would really apreciate it.
Thanks in advance,
Ruben.
REPORT ZPRR3_12.
TYPE-POOLS
CONSTANTS: C_CHECK TYPE c VALUE 'X'.
DATA : v_rep_id TYPE sy-repid.
DATA: BEGIN OF t_employee OCCURS 0,
pernr TYPE persno,
begda TYPE begda,
endda TYPE endda,
bukrs TYPE bukrs,
werks TYPE persa,
persg TYPE persg,
persk TYPE persk,
orgeh TYPE orgeh,
plans TYPE plans,
stell TYPE stell,
nachn TYPE pad_nachn,
vorna TYPE pad_vorna,
gesch TYPE gesch,
gbdat TYPE gbdat,
pstlz TYPE pstlz_hr,
ort02 TYPE pad_ort02,
END OF t_employee.
" for alv functions.
TYPE-POOLS: slis, truxs.
DATA: gs_layout TYPE slis_layout_alv,
it_field TYPE slis_t_fieldcat_alv,
tt_fieldcat TYPE slis_fieldcat_alv.
TYPES: tt_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv.
INITIALIZATION.
v_rep_id = sy-repid.
SELECTION-SCREEN BEGIN OF BLOCK parametres WITH FRAME TITLE text-001.
SELECT-OPTIONS: persnum FOR t_employee-pernr DEFAULT 000.
SELECT-OPTIONS: ccode FOR t_employee-bukrs DEFAULT 'ES01'.
SELECT-OPTIONS: date FOR sy-datum.
SELECTION-SCREEN END OF BLOCK parametres.
SELECTION-SCREEN BEGIN OF BLOCK options WITH FRAME TITLE text-002.
PARAMETERS:
op_alv TYPE c AS CHECKBOX,
op_excel TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK options.
INITIALIZATION.
"initialize select-options
op_alv = C_CHECK.
op_excel = ''.
START-OF-SELECTION.
PERFORM data_request.
END-OF-SELECTION.
IF op_excel EQ C_CHECK.
*PERFORM excel_save.
ENDIF.
IF op_alv EQ C_CHECK.
PERFORM display_alv.
ELSE.
PERFORM write_raw USING t_employee.
ENDIF.
FORMS
*& Form CHARGE_DATA
FORM data_request.
SELECT pa0001pernr pa0001begda pa0001endda pa0001bukrs pa0001~werks
pa0001persg pa0001persk pa0001orgeh pa0001plans pa0001~stell
pa0002nachn pa0002vorna pa0002gesch pa0002gbdat
pa0006pstlz pa0006ort02
INTO CORRESPONDING FIELDS OF t_employee
FROM pa0001 JOIN pa0002 ON pa0001pernr = pa0002pernr
JOIN pa0006 ON pa0002pernr = pa0006pernr
WHERE pa0001~pernr IN persnum AND
pa0001~bukrs IN ccode AND
pa0001~begda IN date.
ENDSELECT.
ENDFORM. " CHARGE_DATA
*& Form display_alv
FORM display_alv.
PERFORM build_header.
PERFORM build_layout.
write t_employee-pernr.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'g_repid'
is_layout = gs_layout
it_fieldcat = it_field
TABLES
t_outtab = t_employee
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE i799(cu) WITH 'Error creando el ALV'(008) 'Código'(009) sy-subrc.
ENDIF.
PERFORM call_alv using t_employee.
ENDFORM. "display_alv
*& Form build_HEADER
form build_header.
DATA: wa_field TYPE slis_fieldcat_alv. "work area for field catalog
wa_field-fieldname = 'pernr'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 10. " output length on screen
wa_field-checkbox = c_check. " print as checkbox
wa_field-edit = c_check. " make field open for input
wa_field-seltext_l = text-006. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'begda'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-003. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'endda'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-004. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'bukrs'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-005. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'werks'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-007. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'persg'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-008. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'persk'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-009. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'orgeh'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-010. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'plans'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-011. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'stell'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-012. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'nachn'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-013. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'vorna'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-014. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'gesch'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-015. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'gbdat'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-016. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'pstlz'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-017. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
wa_field-fieldname = 'ort0z'. " name of field from internal table
wa_field-tabname = 't_employee'. " internal table name
wa_field-outputlen = 12. " output length on screen
wa_field-seltext_l = text-018. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
endform. " PREPARE_FIELD_CATALOG
*& Form build_layout
text
FORM build_layout.
gs_layout-colwidth_optimize = 'X'. "Optimizar ancho del listado
gs_layout-zebra = 'X'. "Mostrar líneas tipo cebra.
gs_layout-detail_popup = 'X'. "Mostrar opción de información detalle
ENDFORM. "build_layout
*& Form call_alv
text
-->ALV_EMPLOYEE text
*FORM call_alv using alv_employee LIKE t_employee.
ABAP List Viewer
**WRITE: alv_employee-pernr.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'g_repid'
is_layout = gs_layout
it_fieldcat = it_field[]
TABLES
t_outtab = alv_employee
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE i799(cu) WITH 'Error creando el ALV'(008) 'Código'(009) sy-subrc.
ENDIF.
*ENDFORM. "CALL_ALV
FORM write_raw USING p_ta_employee LIKE t_employee.
WRITE: p_ta_employee-pernr,p_ta_employee-begda,p_ta_employee-endda,p_ta_employee-bukrs,p_ta_employee-werks,p_ta_employee-persg,
p_ta_employee-persk,p_ta_employee-orgeh,p_ta_employee-plans,p_ta_employee-stell,p_ta_employee-nachn,p_ta_employee-vorna,
p_ta_employee-gesch,p_ta_employee-gbdat,p_ta_employee-pstlz,p_ta_employee-ort02.
ENDFORM. " WRITE_RAWHi,
Past the code in between code option <> so that every one can read it clearly.
1) Instead of using SELECT and ENDSELECT use below syntax,
SELECT pa0001~pernr
pa0001~begda
pa0001~endda
pa0001~bukrs
pa0001~werks
pa0001~persg
pa0001~persk
pa0001~orgeh
pa0001~plans
pa0001~stell
pa0002~nachn
pa0002~vorna
pa0002~gesch
pa0002~gbdat
pa0006~pstlz
pa0006~ort02
INTO CORRESPONDING FIELDS OF TABLE t_employee " use TABLE
FROM ( ( pa0001 inner JOIN pa0002 ON pa0001~pernr = pa0002~pernr )
INNER JOIN pa0006 ON pa0002~pernr = pa0006~pernr )
WHERE pa0001~pernr IN persnum AND
pa0001~bukrs IN ccode AND
pa0001~begda IN date.
2) In FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_rep_id "you were using 'g_repid' which is not at all declared
is_layout = gs_layout
it_fieldcat = it_field
TABLES
t_outtab = t_employee
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i799(cu) WITH 'Error creando el ALV'(008) 'Código'(009) sy-subrc.
ENDIF.
3) Check wether the Table t_employee is consisting any data or not, by keeping a BREAK-POINT after the SELECT statement.
4) If possible while filling the field catalog fill ROW_POS and COL_POS, and always use capital letters when ever you give any value in single quotes.
wa_field-row_pos = '1'.
wa_field-col_pos = '1'.
wa_field-fieldname = 'PERNR'. " name of field from internal table
wa_field-tabname = 'T_EMPLOYEE'. " internal table name
wa_field-outputlen = 10. " output length on screen
wa_field-checkbox = c_check. " print as checkbox
wa_field-edit = c_check. " make field open for input
wa_field-seltext_l = text-006. " header information
APPEND wa_field TO it_field. " append field catalog internal table
CLEAR wa_field. " clear field catalog work area
Regards
Bala Krishna -
Tranfering data from alv display to a transaction with table control.
Hi all,
I am having some problem transfering data from my alv display to a trasaction which needs to display some values in a table control base on criterias which I have selected from my alv report.
When selecting an entry in my alv report.
1. The program should check whether there is an entry in a z table(already created), if so it retrieves data fro the z table base on the selected criteria.
2.otherwise it search from the data from other tables and then saves it in the z table and display the values in the tc.
my program is as follows.
FORM button_click USING p_ucomm TYPE sy-ucomm
p_selfield TYPE slis_selfield.
CASE p_ucomm.
WHEN 'SALES'.
READ TABLE gt_alvdisplay
INDEX p_selfield-tabindex
INTO gs_alvdisplay.
SET PARAMETER ID: *I dont know how to pass the para to the tc.....
CALL TRANSACTION 'ztrans_test".
ENDFORM.
Note: TC is already created and it retrieves data from the z table but am having prob just to pass the parameters.
Ill be very grateful to you allHello,
Yes you can create text field without using screen painter as follows:
PARAMETERS P1 TYPE CHAR12 MEMORY ID mid.
Here, this code will create text box with name P1 and parameter id "mid"
You can assign meaning text to p1 using menu link GO TO --> TEXT ELEMENTS --> SELECTION TEXTS.
So before call transaction which contains this field you can write below statement.
SET PARAMETER ID mid VALUE <value variable>.
* Here vlaue variable is the variable from which you want to pass value to parameter id mid.
Refer [SAP Help|http://help.sap.com/saphelp_nw70/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm] for more information.
Hope this helps!
Thanks,
Augustin. -
Wierd lines on my display and frequent lock-ups w/ and w/o display problems
When booting I sometimes get weird lines and blocks on my display (the GRAY Apple screen) and then it hangs, other times the computer will boot and run fine for 20-30 minutes and then the display goes wonkers with blocks and lines and the computer does not respond. The only way I can get it to boot is to reset the PRAM by letting it CHIME 3x and then occasionally it will boot without issue and run, while other times I still get the blocks and lines on the display.
When I am able to get it to recover and re-boot after the lock-up and display problems and occasionally the box in the middle asking me to re-boot similar to a kernel panic the OPS gives me the option to REPORT the error and here is the error for others who would know more...
Thank you in advance,
Darren
Interval Since Last Panic Report: 104960 sec
Panics Since Last Report: 5
Anonymous UUID: 7D1AEF43-7E19-4F58-A1E0-48FA992A2814
Wed Nov 18 15:49:50 2009
panic(cpu 0 caller 0x9cdb10): NVRM[0/1:0:0]: Read Error 0x00009410: CFG 0xffffffff 0xffffffff 0xd2000000, BAR0 0xd2000000 0x5d3e2000 0x084700a2, D0, P1/4
Backtrace (CPU 0), Frame : Return Address (4 potential args on stack)
0x5c99b7d8 : 0x21b2bd (0x5cf868 0x5c99b80c 0x223719 0x0)
0x5c99b828 : 0x9cdb10 (0xbb7fec 0xc209c0 0xbc3660 0x0)
0x5c99b8c8 : 0x147690d (0x8b5ac04 0x7edf004 0x9410 0xabd962)
0x5c99b908 : 0x1534e6a (0x7edf004 0x9410 0x5c99b968 0x9)
0x5c99b948 : 0xb51ca5 (0x7edf004 0x91ed004 0x0 0x0)
0x5c99b968 : 0xac155b (0x91ed004 0x5c99baa4 0x0 0x0)
0x5c99b9b8 : 0x145f290 (0x7edf004 0x3d0900 0x5c99baa4 0x0)
0x5c99bad8 : 0xab2821 (0x7edf004 0x91cf004 0x815200c 0x200)
0x5c99bb18 : 0xb1f172 (0x7edf004 0x91cf004 0xeb9bcc0 0xeb9bc04)
0x5c99bbc8 : 0xb202db (0x7edf004 0x91f0404 0x0 0x0)
0x5c99bc58 : 0x14bb7a3 (0x7edf004 0x91f0404 0x9 0x2)
0x5c99bd68 : 0x14ed407 (0x7edf004 0x91cf404 0x0 0x0)
0x5c99be98 : 0xad3934 (0x7edf004 0x91ca404 0x0 0x0)
0x5c99bec8 : 0x9d61fb (0x7edf004 0x91ca404 0x0 0x0)
0x5c99bf08 : 0x5491b5 (0x0 0x9499680 0x1 0x29c50a)
0x5c99bf58 : 0x5481e6 (0x9499680 0x1 0x5c99bf88 0x547d9d)
0x5c99bf88 : 0x548640 (0x8abaf00 0x7e9ecc0 0xe780850c 0x2a6e5f)
0x5c99bfc8 : 0x29d68c (0x8abaf00 0x0 0x10 0x88bbfc4)
Kernel Extensions in backtrace (with dependencies):
com.apple.nvidia.nv50hal(6.0.6)@0x136b000->0x17f1fff
dependency: com.apple.NVDAResman(6.0.6)@0x96f000
com.apple.NVDAResman(6.0.6)@0x96f000->0xc21fff
dependency: com.apple.iokit.IOPCIFamily(2.6)@0x932000
dependency: com.apple.iokit.IONDRVSupport(2.0)@0x961000
dependency: com.apple.iokit.IOGraphicsFamily(2.0)@0x943000
BSD process name corresponding to current thread: kernel_task
Mac OS version:
10C540
Kernel version:
Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
System model name: MacBookPro3,1 (Mac-F4238BC8)
System uptime in nanoseconds: 3788331456483
unloaded kexts:
com.apple.driver.AppleFileSystemDriver 2.0 (addr 0xf02000, size 0x12288) - last unloaded 94521475551
loaded kexts:
org.virtualbox.kext.VBoxNetAdp 2.2.2
org.virtualbox.kext.VBoxNetFlt 2.2.2
org.virtualbox.kext.VBoxUSB 2.2.2
org.virtualbox.kext.VBoxDrv 2.2.2
com.bresink.driver.BRESINKx86Monitoring 5.0
com.pctools.iantivirus.kfs 1.0.1
com.apple.driver.AppleHWSensor 1.9.2d0 - last loaded 31800108689
com.apple.filesystems.ntfs 3.1
com.apple.filesystems.autofs 2.1.0
com.apple.driver.AppleHDA 1.7.9a4
com.apple.driver.AirPort.Atheros 412.19.4
com.apple.kext.AppleSMCLMU 1.4.5d1
com.apple.driver.SMCMotionSensor 3.0.0d4
com.apple.DontSteal_Mac_OSX 7.0.0
com.apple.driver.AudioIPCDriver 1.1.2
com.apple.driver.AppleIntelMeromProfile 19
com.apple.driver.ACPISMCPlatformPlugin 4.0.1d0
com.apple.driver.AppleLPC 1.4.9
com.apple.driver.AppleBacklight 170.0.14
com.apple.driver.AppleUpstreamUserClient 3.1.0
com.apple.GeForce 6.0.6
com.apple.driver.AppleUSBTrackpad 1.8.0b4
com.apple.driver.AppleUSBTCKeyEventDriver 1.8.0b4
com.apple.driver.AppleUSBTCKeyboard 1.8.0b4
com.apple.iokit.SCSITaskUserClient 2.6.0
com.apple.BootCache 31
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
com.apple.iokit.IOAHCIBlockStorage 1.6.0
com.apple.iokit.AppleYukon2 3.1.14b1
com.apple.driver.AppleAHCIPort 2.0.1
com.apple.driver.AppleSmartBatteryManager 160.0.0
com.apple.driver.AppleIntelPIIXATA 2.5.0
com.apple.driver.AppleUSBHub 3.8.4
com.apple.driver.AppleFWOHCI 4.4.0
com.apple.driver.AppleUSBEHCI 3.7.5
com.apple.driver.AppleUSBUHCI 3.7.5
com.apple.driver.AppleEFINVRAM 1.3.0
com.apple.driver.AppleRTC 1.3
com.apple.driver.AppleHPET 1.4
com.apple.driver.AppleACPIButtons 1.3
com.apple.driver.AppleSMBIOS 1.4
com.apple.driver.AppleACPIEC 1.3
com.apple.driver.AppleAPIC 1.4
com.apple.security.sandbox 0
com.apple.security.quarantine 0
com.apple.nke.applicationfirewall 2.1.11
com.apple.driver.AppleIntelCPUPowerManagementClient 96.0.0
com.apple.driver.AppleIntelCPUPowerManagement 96.0.0
com.apple.driver.DspFuncLib 1.7.9a4
com.apple.driver.AppleProfileReadCounterAction 17
com.apple.driver.AppleProfileTimestampAction 10
com.apple.driver.AppleProfileThreadInfoAction 14
com.apple.driver.AppleProfileRegisterStateAction 10
com.apple.driver.AppleProfileKEventAction 10
com.apple.driver.AppleProfileCallstackAction 20
com.apple.iokit.IOFireWireIP 2.0.3
com.apple.iokit.IO80211Family 310.6
com.apple.iokit.IOSurface 73.0
com.apple.iokit.IOBluetoothSerialManager 2.2.4f3
com.apple.iokit.IOSerialFamily 10.0.3
com.apple.iokit.IOAudioFamily 1.7.2fc1
com.apple.kext.OSvKernDSPLib 1.3
com.apple.driver.AppleHDAController 1.7.9a4
com.apple.iokit.IOHDAFamily 1.7.9a4
com.apple.iokit.AppleProfileFamily 41
com.apple.driver.AppleSMC 3.0.1d2
com.apple.driver.IOPlatformPluginFamily 4.0.1d0
com.apple.nvidia.nv50hal 6.0.6
com.apple.NVDAResman 6.0.6
com.apple.iokit.IONDRVSupport 2.0
com.apple.iokit.IOGraphicsFamily 2.0
com.apple.driver.CSRUSBBluetoothHCIController 2.2.4f3
com.apple.driver.AppleUSBBluetoothHCIController 2.2.4f3
com.apple.iokit.IOBluetoothFamily 2.2.4f3
com.apple.iokit.IOUSBHIDDriver 3.8.4
com.apple.driver.AppleUSBMergeNub 3.8.5
com.apple.driver.AppleUSBComposite 3.7.5
com.apple.iokit.IOSCSIMultimediaCommandsDevice 2.6.0
com.apple.iokit.IOBDStorageFamily 1.6
com.apple.iokit.IODVDStorageFamily 1.6
com.apple.iokit.IOCDStorageFamily 1.6
com.apple.driver.XsanFilter 402.1
com.apple.iokit.IONetworkingFamily 1.9
com.apple.iokit.IOATAPIProtocolTransport 2.5.0
com.apple.iokit.IOSCSIArchitectureModelFamily 2.6.0
com.apple.iokit.IOAHCIFamily 2.0.2
com.apple.iokit.IOATAFamily 2.5.0
com.apple.iokit.IOUSBUserClient 3.8.5
com.apple.iokit.IOFireWireFamily 4.1.7
com.apple.iokit.IOUSBFamily 3.8.5
com.apple.driver.AppleEFIRuntime 1.3.0
com.apple.iokit.IOHIDFamily 1.6.1
com.apple.iokit.IOSMBusFamily 1.1
com.apple.kext.AppleMatch 1.0.0d1
com.apple.security.TMSafetyNet 6
com.apple.driver.DiskImages 281
com.apple.iokit.IOStorageFamily 1.6
com.apple.driver.AppleACPIPlatform 1.3
com.apple.iokit.IOPCIFamily 2.6
com.apple.iokit.IOACPIFamily 1.3.0
Model: MacBookPro3,1, BootROM MBP31.0070.B07, 2 processors, Intel Core 2 Duo, 2.2 GHz, 4 GB, SMC 1.16f11
Graphics: NVIDIA GeForce 8600M GT, GeForce 8600M GT, PCIe, 128 MB
Memory Module: global_name
AirPort: spairportwireless_card_type_airportextreme (0x168C, 0x87), Atheros 5416: 2.0.19.4
Bluetooth: Version 2.2.4f3, 2 service, 0 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
PCI Card: pci168c,24, sppci_othernetwork, PCI Slot 5
Serial ATA Device: ST9320421ASG, 298.09 GB
Parallel ATA Device: MATSHITADVD-R UJ-857E
USB Device: Built-in iSight, 0x05ac (Apple Inc.), 0x8502, 0xfd400000
USB Device: Apple Internal Keyboard / Trackpad, 0x05ac (Apple Inc.), 0x021a, 0x5d200000
USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x8205, 0x1a100000
Anyone know what is causing my problems? I thought it was heat so I downloaded a CPU and FAN temperature monitor and the CPU was getting VERY HOT at first so I then ramped-up the CPU FAN SPEED to maximum - it turns out the CPU FAN was not rotating well at low speed - since then I have cleaned and checked the fans and they all work as they should and blow on high(er) when the CPU temperature is above a certain level.S.U.
Is there a kb article or something that would illuminate what to look for in these logs, or is it a matter of learning by osmosis?
Both. I am not skilled in reading logs. It is a very technical and time consuming task for the uninitiated (me!) In scanning a log I look for the backtrace and loading dependencies. The first item in the backtrace is usually the roadblock.
Beyond that you can look at the Technical Note TN2063: Understanding and Debugging Kernel Panics
Should make for good bedtime reading. Puts you right to sleep.
c
Maybe you are looking for
-
HT204053 how do i change credit card charge
I would like to change the credit card to where I charge my purchases. How do i do this?
-
Thousand separator in MS Excel 2010
I recently upgraded to Microsoft Excel 2010 and I am having an issue in the formatting of my numbers. The thousands separator (comma in my country) is only being applied to the last thousand bucket but all other thousands above that are not being sep
-
"Couldn't Contact Spell Checker"
What does this error mean? Why won't it go away! I do not want to change the language region every time I open a word document from the Internet.. This is a problem that needs a permanent fix... I am a few days shy of buying MS Office 08 because of t
-
Removing norton from an imac dv running 10.3.9
I wanted to load a new viral program from my employers take home program called virex. The norton subscription expired and I never liked its constant updating. I tried deleting the folders that stood out and rebooting. I then tried to install virex a
-
Hi, What is a grid agent? What does it do and is it needed? Does it work with Enterprise Manager? Any documentations on this??? Thx.