Problem with PF_STATUS in ALV
Hi
I have the following code written in my report to set PF_STATUS in ALV.But its not working
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
I_CALLBACK_USER_COMMAND = ''
i_structure_name = 'I_BOLACT'
i_grid_title = 'BOL Action Report'(031)
is_layout = gs_layout
i_save = 'A'
it_fieldcat = gt_fieldcat[]
FORM PF_STATUS_SET USING rt_extab TYPE slis_t_extab.
set PF-STATUS 'ZPF_STAT'.
ENDFORM.
Please help where am I going wrong.
Regards
Ishita
If any of the above solution in not working, you can use EVENTS to handle it.
using
* TO Get all the ALV Events
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = it_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.
* FOR THE PF-STATUS EVENT
read table it_events into wa_event with key name = slis_ev_pf_status_set.
if sy-subrc eq 0.
wa_event-form = 'PF_STATUS_SET'.
modify it_events from wa_event
transporting form
where name = wa_event-name.
endif.
and then set your PF Status in Form 'PF_STATUS_SET'
hope this solves your problem.
Jinson.
Similar Messages
-
Problems with checkbox in ALV-GRID OO
Hi,
i have Problems by listing an editable checkbox
in ALV GRID OO and handle the itab with
the marked fields.
Here my Code extract. Has anybody an idea or a short example.
TYPES: BEGIN OF ALV_TAB,
SGTXT LIKE RK23B-SGTXT,
CHECK(1),
END OF ALV_TAB.
DATA: ITAB TYPE TABLE OF ALV_TAB.
Is this Declaration correct??
<b> GS_FIELDCAT-FIELDNAME = 'CHECK'.
GS_FIELDCAT-CHECKBOX = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
GS_LAYOUT-EDIT = 'X'.
GS_LAYOUT-BOX_FNAME = 'CHECK'.</b>
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = PT_EXCLUDE
IS_LAYOUT = GS_LAYOUT
CHANGING
IT_FIELDCATALOG = GT_FIELDCAT
IT_OUTTAB = ITAB.
FORM HANDLE_USER_COMMAND USING E_UCOMM.
CASE E_UCOMM.
WHEN 'REFR'.
<b> Here i will have the itab with the marked checkbox.
how can i refresh?</b>*
WHEN 'EXCEL'.
MESSAGE I010 WITH E_UCOMM.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
Regards, DieterHi, in reference to....
ASE E_UCOMM.
WHEN 'REFR'.
Here i will have the itab with the marked checkbox.
how can i refresh?*
Do you want to get rid of the checks in any checkbox?
If so, just loop at modify.
ASE E_UCOMM.
WHEN 'REFR'.
<b> Loop at itab where check = 'X'.
itab-check = space.
modify itab.
endloop.</b>
Regards,
Rich Heilman -
Problem with sub totals ALV Grid
Hi experts,
I got one requirement, I am using ALV GRID function modules technique. My requirement is, I want to display one value at subtotal line(i.e. like header value). How to display the table values in the subtotal line.
Please give any solution for this.
Thanks in advance.
Sandya.Hi Sandhya,
i will send a sample code for ur problem.And also i will send a entire program about subtotals.Check it once ok..Copy the below prog and execute it and debug it..
*SubTotal on the Field NETWR
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal
wa_fieldcat-fieldname = 'NETWR'. "Field Name
wa_fieldcat-do_sum = 'X'. "Sum
APPEND wa_fieldcat TO gt_fieldcat.
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 = ' '
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
SAMPLE PROGRAM:
*& Report YSALESORDER_ALV_SUBTOTALS *
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : DISPLAYING SUBTOTALS FOR A PARTICULAR SALES DOC NO *
*& CREATION DT: 26/11/2007 *
*& REQUEST : ERPK900035 *
REPORT ysalesorder_alv_subtotals.
Type Pools
TYPE-POOLS:slis.
Tables
TABLES: vbak, "Sales Document: Header Data
vbap. "Sales Document: Item Data
Global Structures
DATA:gt_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
gt_sortcat TYPE slis_t_sortinfo_alv,
wa_sortcat LIKE LINE OF gt_sortcat.
Internal Table
DATA: BEGIN OF gt_salesorder OCCURS 0,
vbeln LIKE vbak-vbeln, " Sales Document Number
posnr LIKE vbap-posnr, " Sales Doc Item
netwr LIKE vbap-netwr, " Net Value
END OF gt_salesorder.
SELECT OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln. " Sales Document Number.
SELECTION-SCREEN END OF BLOCK b1.
Initialization
INITIALIZATION.
PERFORM initialization.
Start Of Selection
START-OF-SELECTION.
PERFORM field_catalog. "For Structure Creation
PERFORM fetch_data. "Get the Data From DB Table
PERFORM sorting USING gt_sortcat.
End Of Selection
END-OF-SELECTION.
PERFORM display_data.
*& Form initialization
text
--> p1 text
<-- p2 text
FORM initialization .
s_vbeln-sign = 'I'.
s_vbeln-option = 'BT'.
s_vbeln-low = '4969'.
s_vbeln-high = '5000'.
APPEND s_vbeln.
ENDFORM. " initialization
*& Form field_catalog
text
--> p1 text
<-- p2 text
FORM field_catalog .
REFRESH : gt_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-col_pos = '1'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table
wa_fieldcat-fieldname = 'VBELN'. "Field Name
wa_fieldcat-key = 'X'. "Blue Color
wa_fieldcat-seltext_m = 'Sales Doc No'. "Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '2'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table Name
wa_fieldcat-fieldname = 'POSNR'. "Field Name
wa_fieldcat-seltext_m = 'Sales Doc Item'."Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
*SubTotal on the Field NETWR
wa_fieldcat-col_pos = '3'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table
wa_fieldcat-fieldname = 'NETWR'. "Field Name
wa_fieldcat-do_sum = 'X'. "Sum
wa_fieldcat-seltext_m = 'Net Value'. "Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " field_catalog
*& Form sorting
text
-->P_IT_SORTCAT text
FORM sorting USING p_it_sortcat TYPE slis_t_sortinfo_alv.
CLEAR wa_sortcat.
wa_sortcat-fieldname = 'VBELN'.
wa_sortcat-up ='X'.
wa_sortcat-subtot = 'X'.
APPEND wa_sortcat TO p_it_sortcat.
ENDFORM. " sorting
*& Form display_data
text
--> p1 text
<-- p2 text
FORM display_data .
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 = ' '
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 = gt_sortcat
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 = gt_salesorder
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 fetch_data
text
--> p1 text
<-- p2 text
FORM fetch_data .
REFRESH : gt_salesorder.
CLEAR : gt_salesorder.
SELECT a~vbeln
posnr
b~netwr
FROM vbak AS a
INNER JOIN vbap AS b ON avbeln = bvbeln
INTO TABLE gt_salesorder
WHERE a~vbeln IN s_vbeln.
ENDFORM. " fetch_data
Reward points if helpful.
Kiran Kumar.G.A
Have a Nice Day.. -
Problem with Footer in ALV Report
Hi Experts,
What is coding for Footer In my ALV Report how can I resolve it.
for example will come in footer like this....
'This Report is created by '
Date is ',
'Time is '
Page No ' *
Please find below the piece of codes
REPORT ZALV2 .
TABLES : MAKT. " Material Description
TYPE-POOLS : SLIS.
TYPES : BEGIN OF TY_MAKT,
MATNR TYPE MATNR, " Material No
SPRAS TYPE SPRAS, " Language Key
MAKTX TYPE MAKTX, " Material Description
MAKTG TYPE MAKTG, " Material des in upper case
END OF TY_MAKT.
DATA : T_MAKT TYPE STANDARD TABLE OF TY_MAKT INITIAL SIZE 0,
T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
T_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA : W_MAKT TYPE TY_MAKT,
W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
W_LISTHEADER TYPE SLIS_LISTHEADER,
W_LAYOUT TYPE SLIS_LAYOUT_ALV.
CONSTANTS : C_MATNR TYPE SLIS_FIELDNAME VALUE 'MATNR',
C_SPRAS TYPE SLIS_FIELDNAME VALUE 'SPRAS',
C_MAKTX TYPE SLIS_FIELDNAME VALUE 'MAKTX',
C_MAKTG TYPE SLIS_FIELDNAME VALUE 'MAKTG'.
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-000.
SELECT-OPTIONS : S_MATNR FOR MAKT-MATNR.
SELECTION-SCREEN END OF BLOCK BLK.
INITIALIZATION.
PERFORM SUB_CLEAR_OBJ.
AT SELECTION-SCREEN. " it is used for validation
PERFORM SUB_VALIDATE_DATA.
START-OF-SELECTION.
PERFORM SUB_FETCH_DATA.
PERFORM SUB_FIELDCAT USING :
C_MATNR TEXT-001 'X',
C_SPRAS TEXT-002 ' ',
C_MAKTX TEXT-003 ' ',
C_MAKTG TEXT-004 ' '.
PERFORM SUB_LAYOUT.
PERFORM SUB_DISPLAY.
END-OF-SELECTION.
TOP-OF-PAGE.
PERFORM SUB_TOP_OF_PAGE.
PERFORM SUB_WRITE_HEADER.
END-OF-PAGE.
PERFORM SUB_SET_PF_STATUS.
*& Form SUB_CLEAR_OBJ
text
--> p1 text
<-- p2 text
FORM SUB_CLEAR_OBJ .
REFRESH : T_MAKT,
T_FIELDCAT,
T_LISTHEADER.
CLEAR : W_MAKT,
W_FIELDCAT,
W_LISTHEADER.
ENDFORM. " SUB_CLEAR_OBJ
*& Form SUB_VALIDATE_DATA
text
--> p1 text
<-- p2 text
FORM SUB_VALIDATE_DATA .
DATA : L_MATNR TYPE MATNR.
SELECT MATNR UP TO 1 ROWS FROM MAKT INTO L_MATNR. " IN S_MATNR.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E000(15) WITH 'IT IS AN INVALID NUMBER'.
ENDIF.
ENDFORM. " SUB_VALIDATE_DATA
*& Form SUB_FETCH_DATA
text
--> p1 text
<-- p2 text
FORM SUB_FETCH_DATA .
SELECT MATNR SPRAS MAKTX MAKTG FROM MAKT INTO TABLE T_MAKT WHERE MATNR
IN S_MATNR.
ENDFORM. " SUB_FETCH_DATA
*& Form SUB_FIELDCAT
text
-->P_C_MATNR text
-->P_TEXT_001 text
-->P_0122 text
-->P_0123 text
FORM SUB_FIELDCAT USING :
FLD TYPE SLIS_FIELDNAME
TXT TYPE SCRTEXT_L
COL TYPE SLIS_FIELDCAT_ALV-OPTIMIZE
HPOT TYPE C.
W_FIELDCAT-TABNAME = 'ZSHEREE2'.
W_FIELDCAT-FIELDNAME = FLD.
W_FIELDCAT-SELTEXT_M = TXT.
*W_FIELDCAT-EMPHASIZE = COL.
W_FIELDCAT-HOTSPOT = HPOT.
APPEND W_FIELDCAT TO T_FIELDCAT.
ENDFORM. " SUB_FIELDCAT
*& Form SUB_LAYOUT
text
--> p1 text
<-- p2 text
FORM SUB_LAYOUT .
W_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
W_LAYOUT-ZEBRA = 'X'.
W_LAYOUT-F2CODE = '&ETA'.
ENDFORM. " SUB_LAYOUT
*& Form SUB_DISPLAY
text
--> p1 text
<-- p2 text
FORM SUB_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZSHEREE2 '
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'SUB_TOP_OF_PAGE '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND '
I_GRID_TITLE = 'Header Item / Data'
I_GRID_SETTINGS = 5
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = T_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN =
I_SCREEN_START_LINE =
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_MAKT
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_DISPLAY
*& Form SUB_TOP_OF_PAGE
text
--> p1 text
<-- p2 text
FORM SUB_TOP_OF_PAGE .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER
I_LOGO =
I_END_OF_LIST_GRID =
REFRESH T_LISTHEADER.
ENDFORM. " SUB_TOP_OF_PAGE
*& Form SUB_WRITE_HEADER
text
--> p1 text
<-- p2 text
FORM SUB_WRITE_HEADER .
W_LISTHEADER-TYP = 'H'.
W_LISTHEADER-INFO = 'PLANT WISE DATA DISPLAYED'.
APPEND W_LISTHEADER TO T_LISTHEADER.
ENDFORM. " SUB_WRITE_HEADER
*& Form SUB_SET_PF_STATUS
text
--> p1 text
<-- p2 text
FORM PF_STATUS_SET USING
RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ZSTATUS1'.
ENDFORM. " SUB_SET_PF_STATUS
If any mistake where i am wrong sorry for that.You create one subroutine for END-OF-PAGE. Call this in the FM,
REUSE_ALV_EVENTS_GET.
Example:
Data: i_event TYPE slis_t_event.
*& Form f_build_eventtab
text
FORM f_build_eventtab USING ps_event TYPE slis_t_event.
DATA: wa_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = ps_event.
READ TABLE ps_event WITH KEY name = slis_ev_end_of_page INTO wa_event.
IF sy-subrc EQ c_0.
MOVE slis_ev_end_of_page TO wa_event-form.
APPEND wa_event TO ps_event.
ENDIF.
ENDFORM. " f_build_eventtab
*& Form END OF PAGE *
*& To display the footer details *
FORM end_of_page .
Write the footer details
ENDFORM. "END_OF_PAGE
I hope this will be useful for you.
Regards,
Joan -
Problem with matchcode in alv for specific field
Hi,
I have created a customer specific data element ZE_CONFTYPE, with a customer specific domain, and in this domain I have defined a value range with 3 possible single values (partial, final, automatic).
Later, I have defined a field: CTYPE type ZE_CONFTYPE, and I'm showing this field in an ALV.
it_fieldcatalog-fieldname = 'CTYPE'.
it_fieldcatalog-seltext_m = 'Confirmation Type'.
it_fieldcatalog-col_pos = 4.
it_fieldcatalog-edit = 'X'.
APPEND it_fieldcatalog.
CLEAR it_fieldcatalog.
Now I was hoping that a matchcode was going to show up in the ALV with the 3 possible values for this field, but apparently I was wrong. What should I do for this matchcode to show up?
THX!Then you may need to use
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_user_command = 'CALLBACK_FOR_DETAIL'
is_layout = is_layout
it_fieldcat = ct_fieldcat
tables
t_outtab = g_itab.
You need to write code in "callback_for_detail" with fm F4IF_INT_TABLE_VALUE_REQUEST
or
Create a structure with the field you mentioned and give structure name as ref_table and field name as ref_fieldname
a® -
Problems with do_sum in ALV-GRID OO
Hi,
i want to sum in ALV-GRID OO, but the sum-line are not displayed.
Here my short extrac.
GS_FIELDCAT-REF_TABLE = 'COEP'.
GS_FIELDCAT-REF_FIELD = 'WKGBTR'.
GS_FIELDCAT-FIELDNAME = 'WKGBTR'.
GS_FIELDCAT-DO_SUM = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = GT_EXCLUDE
IS_LAYOUT = GS_LAYOUT
IS_VARIANT = GS_VARIANT
I_SAVE = 'X'
CHANGING
IT_FIELDCATALOG = GT_FIELDCAT
IT_OUTTAB = ITAB.
Any idea want i'm doing wrong??
Regards, DieterIF that don't work try this little program to find what is missing
report z_what.
TYPE-POOLS slis.
DATA: ct_fieldcat TYPE slis_t_fieldcat_alv,
zt_fieldcat LIKE LINE OF ct_fieldcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'COEP'
CHANGING
ct_fieldcat = ct_fieldcat.
READ TABLE ct_fieldcat INTO zt_fieldcat
WITH KEY fieldname = 'WKGBTR'.
BREAK-POINT.
Regards -
hai ,
I have problem with my interactive alv ,
when i double click the line item the same line item is displaying for all the selections ..
LASS lcl_event_handler IMPLEMENTATION.
METHOD on_double_click.
find out selected line (double click)
READ TABLE i_fd INTO w_fd INDEX e_row-index.
IF sy-subrc NE 0.
MESSAGE i075(bc412). " <-- internal error
EXIT.
ENDIF.
"CLEAR i_popup.
LOOP AT i_trdt INTO w_trdt WHERE deal_number = w_fd-rfha .
IF sy-tabix GT 1.
CLEAR w_trdt-deal_number.
ENDIF.
APPEND w_trdt TO i_popup.
ENDLOOP.
CLEAR : w_fd , w_trdt .
IF i_popup IS NOT INITIAL .
CREATE OBJECT ref_container
EXPORTING
parent =
container_name = 'CONTAINER1'
style =
lifetime = lifetime_default
repid =
dynnr =
no_autodef_progid_dynnr =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT ref_alv
EXPORTING
i_shellstyle = 0
i_lifetime =
i_parent = ref_container
i_appl_events = space
i_parentdbg =
i_applogparent =
i_graphicsparent =
i_name =
i_fcat_complete = space
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
PERFORM form_layout.
PERFORM f_cat.
CALL METHOD ref_alv->refresh_table_display.
CALL METHOD g_alv->refresh_table_display.
ENDIF.
CALL METHOD g_alv->refresh_table_display.
CLEAR i_popup.
ENDMETHOD. "on_double_click
ENDCLASS. "lcl_event_handler IMPLE
Regards,
K,Vinay KumarHi,
Try..
READ TABLE i_fd INTO w_fd INDEX es_row_no-index.
Hope it helps you.
Murthy -
Problems with the "Pre-view" button in an OO ALV!
Hey all,
I have a problem with my OO ALV...when I press the "Pre-View" function button from my ALV I get a dump.
It says "Fieldsymbol not yet assigned".
I check my Fieldcatalog, my out_itab of the ALV....I do not know where is the problem.
When I use the debugger I get the place where the dump occures, but I do not know why it occurs....
When the ALV tries to convert the content of my ALV the dump occurs. The Fieldcatalog does not seemes to be the problem, because SAP convert the catalog correctly, but when he tries to convert the rows of my ALV he crashes...but only after the second row. The first row of the content he convert, but when he tries to convert the second row....bumm!!!
Does somebody has an idea? Or does somebody knows of a generelly problem with OO ALV's which could be the reason for my problem?
I apreciate any help.
Thanks a lot.
Marceloplease reward points if your problem solves.
and try to close the thread.
thansk and regards
vijay
Message was edited by: Vijay Babu Dudla -
Problem in Printing the ALV list
Hi,
I have one problem with printing the ALV list. While printing the ALV list(thro Print Icon on application Tool bar) ,Fist page of my print out contains some other inforamtion.
inforamtions included two tables
first table contains Sort Criteria, Ascdg, Descnd, Subtotal columns.
And second table contains Data statistics , number of
columns.
But from Second page onwards , my alv list printed correctly .
How can i avoid the First page inforamtion and
what is the Reason of coming like this?
Thanks,
Neptune.MI assume you are using function module Reuse_alv_grid_display or reuse_alv_list_display for ALV.
If this is the case, there is a parameter called IS_PRINT that you need to supply while calling the function module.
you can for exapmle declare
data:
printstruc type SLIS_PRINT_ALV.
printstruc-NO_PRINT_LISTINFOS = 'X'.
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_PRINT = printstruc
There are many other flags in is_print structures that you can use to manipulate the printing.
Cheers! -
Problem with the order of the columns of a ALV
I have a problem with a ALV, variants we keep this ALV does not record the order of the columns
Thank youI suppose you want to change the sequence of columns of a ALV. If you can change it by clicking 'settings' of right-top corner of ALV. After done you can save the new settings into a new. If you find some abnormal behaviour, please check the settings by WDA component "wd_analyze_config_user".
FYI.
[http://help.sap.com/saphelp_nw70/helpdata/en/32/f26f73d81e11d1a26f0000e8a5a614/frameset.htm] -
ALV GRID Problem with reading contents
Hi there! I'm quite new with ABAP and I have some problems with the syntax of it. Maybe I should first describe my aim and then I'll show you my code.
1. I read contents from two database tables, called 'zbc_dan_registry' and 'zbc_dan_category'.
'zbc_dan_registry' has 2 columns: name, value.
zbc_dan_category' has 1 column: category.
Now I want to have an ALV Grid, that displays the contents of 'zbc_dan_registry' and one additional column with dropdown fields, where the user can select a category for each row. This is, what my code already does.
Now I want to save the contents of the whole table in a new table 'zbc_dan_registrz' (you see: 'registrz', not 'registry'!) with 3 columns:
name, category, value.
My problem is, how can I read the contents of the ALV Grid, with the user selected category for each row, and save them in an internal table? I've tried to adapt the code of "BCALV_EDIT_04", but I don't get it running.
Some detailled help would be great, you know, I'm really working hard to understand ABAP, but it's really hard for me. Thanks for your support and help!!
Here's my code so far:
*& Report ZBC400_DAN_TESTNO4
REPORT ZBC400_DAN_TESTNO4.
DATA: lt_registrz TYPE TABLE OF zbc_dan_regstrz WITH HEADER LINE,
lt_category TYPE TABLE OF zbc_dan_category WITH HEADER LINE,
ls_category TYPE zbc_dan_category, "Struktur Kategorie
ok_code LIKE sy-ucomm,
container_r TYPE REF TO cl_gui_custom_container,
grid_r TYPE REF TO cl_gui_alv_grid,
gc_custom_control_name TYPE scrfname VALUE 'CONTAINER_REG',
fieldcat_r TYPE lvc_t_fcat,
layout_r TYPE lvc_s_layo,
lt_ddval TYPE lvc_t_drop,
ls_ddval TYPE lvc_s_drop,
c TYPE i.
CLASS lcl_event_receiver DEFINITION DEFERRED.
DATA g_verifier TYPE REF TO lcl_event_receiver.
DATA: BEGIN OF gt_outtab OCCURS 0.
INCLUDE STRUCTURE zbc_dan_regstrz.
DATA: celltab TYPE lvc_t_styl.
DATA: END OF gt_outtab.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF lt_registrz_key. "Struktur mit den Schlüsseln der Tabelle 'Registry'
TYPES: name TYPE zbc_dan_name,
value TYPE zbc_dan_value,
category TYPE zbc_dan_cat.
TYPES: END OF lt_registrz_key.
TYPES: ls_registrz_keys TYPE STANDARD TABLE OF lt_registrz_key,
ls_registrz_table TYPE STANDARD TABLE OF zbc_dan_regstrz.
METHODS: get_inserted_rows EXPORTING inserted_rows TYPE ls_registrz_keys.
METHODS: refresh_delta_tables.
METHODS: handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
* METHODS: get_inserted_rows EXPORTING inserted_rows TYPE registrz_keys.
* METHODS: refresh_delta_tables.
PRIVATE SECTION.
DATA: inserted_rows TYPE ls_registrz_keys.
DATA: error_in_data TYPE c.
METHODS: get_cell_values IMPORTING row_id TYPE int4 pr_data_changed TYPE REF TO cl_alv_changed_data_protocol EXPORTING key TYPE lt_registrz_key.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
DATA: ls_good TYPE lvc_s_modi,
ls_new TYPE lvc_s_moce.
error_in_data = space.
IF error_in_data = 'X'.
CALL METHOD er_data_changed->display_protocol.
ENDIF.
ENDMETHOD.
METHOD get_cell_values.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'NAME'
IMPORTING e_value = key-name.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'VALUE'
IMPORTING e_value = key-value.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'CATEGORY'
IMPORTING e_value = key-category.
ENDMETHOD.
METHOD get_inserted_rows.
inserted_rows = me->inserted_rows.
ENDMETHOD.
METHOD refresh_delta_tables.
clear me->inserted_rows[].
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
SELECT client name value
INTO CORRESPONDING FIELDS OF TABLE lt_registrz FROM zbc_dan_regstry.
SELECT category INTO CORRESPONDING FIELDS OF TABLE lt_category FROM zbc_dan_category.
CALL SCREEN 0100.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK'.
SET SCREEN 0.
MESSAGE ID 'BC400' TYPE 'S' NUMBER '057'.
WHEN 'SAVE'.
PERFORM save_data.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'DYNPRO100'.
SET TITLEBAR 'D0100'.
ENDMODULE.
MODULE display_alv OUTPUT.
PERFORM display_alv.
ENDMODULE.
FORM display_alv.
IF grid_r IS INITIAL.
*----Creating custom container instance
CREATE OBJECT container_r
EXPORTING
container_name = gc_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT grid_r
EXPORTING
i_parent = container_r
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
CREATE OBJECT g_verifier.
SET HANDLER g_verifier->handle_data_changed FOR grid_r.
*----Preparing field catalog.
PERFORM prepare_field_catalog CHANGING fieldcat_r.
*----Preparing layout structure
PERFORM prepare_layout CHANGING layout_r.
*----Here will be additional preparations
*--e.g. initial sorting criteria, initial filtering criteria, excluding
*--functions
CALL METHOD grid_r->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = layout_r
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
CHANGING
it_outtab = lt_registrz[]
it_fieldcatalog = fieldcat_r
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE.
CALL METHOD grid_r->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ENDIF.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
ENDFORM.
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZBC_DAN_REGSTR2'
CHANGING
ct_fieldcat = pt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
LOOP AT pt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'NAME'.
ls_fcat-coltext = 'Name'.
ls_fcat-outputlen = '40'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'VALUE'.
ls_fcat-coltext = 'Wert'.
ls_fcat-outputlen = '30'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'CATEGORY'.
LOOP AT lt_category into ls_category.
ls_ddval-handle = 1.
ls_ddval-value = ls_category-category.
* ls_ddval-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_ddval TO lt_ddval.
ENDLOOP.
CALL METHOD grid_r->set_drop_down_table
EXPORTING it_drop_down = lt_ddval.
ls_fcat-edit = 'X'.
ls_fcat-drdn_hndl = '1'.
ls_fcat-coltext = 'Kategorie'.
MODIFY pt_fieldcat FROM ls_fcat.
ENDCASE.
ENDLOOP.
ENDFORM.
FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
ps_layout-zebra = 'X'.
ps_layout-grid_title = 'Kategorie zur Registry hinzufügen'.
ps_layout-smalltitle = 'X'.
ENDFORM.
FORM save_data.
DATA: ls_ins_keys TYPE g_verifier->ls_registrz_keys,
ls_ins_key TYPE g_verifier->lt_registrz_key,
ls_registrz TYPE zbc_dan_regstrz,
ls_outtab LIKE LINE OF gt_outtab,
lt_instab TYPE TABLE OF zbc_dan_regstrz.
CALL METHOD g_verifier->get_inserted_rows IMPORTING inserted_rows = ls_ins_keys.
LOOP AT ls_ins_keys INTO ls_ins_key.
READ TABLE gt_outtab INTO ls_outtab
WITH KEY name = ls_ins_key-name
value = ls_ins_key-value
category = ls_ins_key-category.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_outtab TO ls_registrz.
APPEND ls_registrz TO lt_instab.
ENDIF.
ENDLOOP.
INSERT zbc_dan_regstrz FROM TABLE lt_instab.
CALL METHOD g_verifier->refresh_delta_tables.
ENDFORM.Hi Hans,
You raised the Question in the Webdynpro ABAP forum. Here its very diffcult to get the answer from this forum. Please close it here and raise the same question in ABAP General Forum there you will get faster and so many anwsers.
Please close the question here.
Warm Regards,
Vijay -
I have a problem with ALV Grid User Command?
Hi Experts,
I have a problem with ALV GRID User Command.
I am calling TCODE IW33 (Order Display) from the ALV output at first time by selecting an order. But, User command is calling IW33 Initial screen with blank value of order. Even I checked in debugging the value what I selected is passing properly, but once that screen (IW33 Initial) displays, value doesn't appear. Then, Manually, I created another session and gone to TCODE IW33 and displayed an order. After that I came out from that order. Then again run my ALV program and selected another order, now order is displaying, but not what I selected current order instead of displaying previous order what I just displayed manually. If I selected any other order, system will display the same order what I dislayed manually.
Here is my code.
FORM user_command_alv USING u_ucomm TYPE sy-ucomm
us_self_field TYPE slis_selfield.
CASE u_ucomm.
WHEN '&IC1'.
READ TABLE it_final INDEX us_self_field-tabindex INTO wa_final.
WHEN 'ORDER'.
IF NOT wa_final-order IS INITIAL.
SET PARAMETER ID 'COK' FIELD wa_final-order.
CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
ENDIF.
endform.
PARAMETER ID 'COK' also the standard one.
Could you please help me out, Where I did wrong?
If I select any order, that order only should display.
Thanks in advance.
Regards,
Sarayu.
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:33 PMhi,
Please check it once the Paramater ID is 'ANR' for IW33 order number.
Hope this may help.
Regards,
Sravanthi -
Hi ,
I am having a problem with Hotspot <<removed_by_moderator>>
I need to Open up SE16 and need to skip the first screen of the Table 'ZLE_WH01' and display the selection screen with the MATNR passed from my ALV Report.
I tried using Call Transaction and Submit commands, but couldn't achive my target.
when I used SUBMIT and pass the MATNR Value to the SE16 selection screen for the corresponding Table, the value is appearing in the MATNR field of the Selection screen but the Execute button is not working.
When I try the Call Transaction Method, the value is not capturing in the 2nd screen. Table name is capturing in the first screen.
Kindly advice me how to resolve this issue.
Regards,
Srinivas
Edited by: Vijay Babu Dudla on Feb 25, 2009 11:08 PMFor se16
Use fm SE16N_INTERFACE
a® -
Problem with ALV grid in edit mode
Hello, gurus!
I have a problem with ALV-grid. Sometimes when I call F4 help for a cell, data is inserted in a different cell. And when I call check_changed_data method, my internal table (passed to ALV-control in set_table_for_first_display) does not updates properly. In what can be a problem?
Thanks,
MikhailHi Prabhu,
MODULE pbo_100 OUTPUT.
SET PF-STATUS 'MAIN100'.
title_of_report = text-010.
SET TITLEBAR '0100' WITH title_of_report.
DATA: g_event_receiver TYPE REF TO lcl_event_handler.
IF z_custom_container IS INITIAL .
CREATE OBJECT z_custom_container
EXPORTING
container_name = 'ALV_ZAC'.
CREATE OBJECT alv_grid
EXPORTING
i_parent = z_custom_container.
g_repid = sy-repid.
gs_variant-report = g_repid.
x_save = 'A'.
PERFORM check_alv_grid_fields.
ps_layout-cwidth_opt = 'X'.
ps_layout-edit = 'X'.
CALL METHOD alv_grid->set_ready_for_input
EXPORTING
i_ready_for_input = '1'.
* CALL METHOD alv_grid->register_edit_event
* EXPORTING
* i_event_id = cl_gui_alv_grid=>mc_evt_enter.
APPEND s_list_rec to it_list_rec.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = ps_layout
is_variant = gs_variant
i_save = x_save
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = it_list_rec[].
CALL METHOD alv_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD alv_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
ENDIF.
FORM check_alv_grid_fields .
DATA: ls_fcat LIKE LINE OF pt_fieldcat.
REFRESH pt_fieldcat .
CLEAR: ps_layout, ls_fcat.
ls_fcat-fieldname = 'VBELN'.
ls_fcat-ref_field = 'VBELN'. ls_fcat-ref_table = 'LIPS'. " .
ls_fcat-outputlen = 9.
* ls_fcat-datatype = 'CHAR'.
* ls_fcat-inttype = 'C'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR: ls_fcat.
ls_fcat-fieldname = 'ERDAT'.
ls_fcat-ref_field = 'ERDAT'. ls_fcat-ref_table = 'LIPS'.
ls_fcat-outputlen = 9.
* ls_fcat-f4availabl = 'X' .
* ls_fcat-datatype = 'DATS'.
* ls_fcat-inttype = 'D'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR: ls_fcat.
ENDFORM. " check_alv_grid_fields
FORM save_p .
CLEAR l_valid.
CALL METHOD alv_grid->check_changed_data
IMPORTING
e_valid = l_valid.
IF l_valid IS INITIAL.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-i01
txt1 = text-i02
txt2 = text-i03
txt3 = text-i04.
ELSE.
i_dat_reg = zrumm_prr-cdprr.
CLEAR is_temp_otc.
freshit i_prrpus_fax.
freshit i_list2_ot.
LOOP AT it_list_rec INTO s_list_rec.
MOVE-CORRESPONDING s_list_rec TO i_list2_ot.
i_list2_ot-fgrup = 'RECE'.
i_list2_ot-prrnu = i_num_prr.
APPEND i_list2_ot.
MOVE-CORRESPONDING s_list_rec TO i_prrpus_fax.
APPEND i_prrpus_fax.
ENDLOOP.
ENDIF.
Edited by: Mikhail Sarychev on Mar 16, 2011 6:41 AM
Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM
Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM -
Problem with printing ALV lists
Hey Guys,
I have a problem with printing ALV lists ,
I created a report with several ALV lists (not grids) on the same screen but when i attempt to print the report
it prints each alv list on a different page..so if i have 3 alv lists in the same report it will print the report on 3 pages
How can i print them all in one page?
Thanks in advance
Noha Salah.Hey Max,
I tried setting the Layout-list_append before my block_list_append function call
And setting the is_print-NO_NEW_PAGE , it printed the 3 lists on one page the only problem i have
is that the lists are truncated and the list formats has totally been messed up..how can i restore them back
to their original format?
Maybe you are looking for
-
Missing Playlists when transferring itunes library to new computer
I have moved my itunes files from my old computer to my new computer. I went into Preferences to link to the new file, but the library and songs do not show up in itunes. I went through the files and added the songs manually to the library, but the p
-
Hi I need to copy all photos from my ipad2 to macpro 2012. We have multiple apple id users in ipad2, so the photo sharing though on, not all photos are picked up in macbook pro. Please can you help
-
No USB storage devices are recognized anymore - Code 28
Hi, since a few weeks except my usb mouse, keyboard, webcam and scanner no storage devices are working anymore. So now flash drives, usb harddisks etc. are working - they just show up in device manager with error code 28. I deleted one of my devices
-
Question on Rebooting RAC Nodes
Hi, I heard that when rebooting all RAC nodes, one has to wait at least 5 minutes between each node reboot. So you would reboot node 1 at 0 time, node 2 5 minutes later etc. However, I could not find any documentation on this, can someone please poin
-
Extracting files form a Sparsebundle
Hi All; My MBPro's GPU recently crashed and I had to copy my HD as a Sparstbundle via TDM on to an external HD. I do not wish to move over the entire HD just various contents, such as photos and mail folders etc. I wish to move said contents to my