ALV LAYOUT Related question
I am developing an ALV report where I have 3 (basic, secondary 1 and secondary 2)lists.
Here can I use only one LAYOUT for all the 3 lists or I have to maintain 3 layout declarations for 3 lists. Give me one example.
Thanks for your precious time.
Regards,
K B Ram
this is an example of interactive list where I am using same layouts for the two screens I am going to display...
Check the bolded part, dont forget to mark helpful answers
REPORT Z_50657_ALV_EX5 NO STANDARD PAGE HEADING
LINE-COUNT 65(3)
LINE-SIZE 220
MESSAGE-ID ZZ.
Type Pools *
TYPE-POOLS: SLIS, ICON.
Tables *
TABLES : VBRK, "Billing Master table
VBRP. "Billing Item table
VARIABLES DECLARATION *
DATA: STR_DATE LIKE SY-DATUM.
DATA: X_FIELDCAT_VBRK TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT_VBRK TYPE SLIS_T_FIELDCAT_ALV.
DATA: X_FIELDCAT_VBRP TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT_VBRP TYPE SLIS_T_FIELDCAT_ALV.
DATA: L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: CUR_VBELN(15), CUR_VBELN_VALUE(15).
DATA: TEMP_VBELN(10).
DATA: CTAB LIKE SY-TABIX.
Internal Tables *
Internal table to hold data from VBRK
DATA: BEGIN OF IT_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN,
WAERK LIKE VBRK-WAERK,
VKORG LIKE VBRK-VKORG,
FKDAT LIKE VBRK-FKDAT,
BUKRS LIKE VBRK-BUKRS,
BUTXT LIKE T001-BUTXT,
CHECK(1) TYPE C,
END OF IT_VBRK.
Internal table to hold data from VBRP
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN LIKE VBRP-VBELN,
POSNR LIKE VBRP-POSNR,
FKIMG LIKE VBRP-FKIMG,
VRKME LIKE VBRP-VRKME,
NETWR LIKE VBRP-NETWR,
MATNR LIKE VBRP-MATNR,
ARKTX LIKE VBRP-ARKTX,
END OF IT_VBRP.
DATA: BEGIN OF IT_T001 OCCURS 0,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
END OF IT_T001.
Selection-Screen *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
S_FKDAT FOR VBRK-FKDAT,
S_MATNR FOR VBRP-MATNR.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
PARAMETERS : LIST RADIOBUTTON GROUP G1,
GRID RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
INITIALIZATION ********************
INITIALIZATION.
STR_DATE = SY-DATUM - 200.
S_FKDAT-LOW = STR_DATE.
S_FKDAT-HIGH = SY-DATUM.
S_FKDAT-SIGN = 'I'.
APPEND S_FKDAT.
At Selection-Screen Output *
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_FKDAT-HIGH'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
At Selection-Screen *
AT SELECTION-SCREEN.
PERFORM VALIDATION.
Start of Selection *
START-OF-SELECTION.
*POPULATION OF DATA INTO INTERNAL TABLE IT_VBRK AND IT_VBRP
PERFORM GET_DATA_VBRK.
PERFORM FIELDCATALOG_CHANGE.
*ALV GRID/LIST DISPLAY
PERFORM FIRST_SCREEN_DISPLAY.
*& Form VALIDATION
text
FORM VALIDATION.
IF S_VBELN[] IS NOT INITIAL.
SELECT SINGLE VBELN
FROM VBRK
INTO VBRK-VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'PLEASE ENTER CORRECT BILLING DOCUMENT'.
STOP.
ENDIF.
ENDIF.
IF S_FKDAT[] IS INITIAL.
MESSAGE I000 WITH 'PLEASE ENTER ALL THE MANDATORY FIELDS'.
STOP.
ENDIF.
IF S_MATNR[] IS NOT INITIAL.
SELECT SINGLE MATNR
FROM MARA
INTO VBRP-MATNR
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'PLEASE ENTER CORRECT MATERIAL NUMBER'.
STOP.
ENDIF.
ENDIF.
ENDFORM. "VALIDATION
*& Form GET_DATA_VBRK
text
FORM GET_DATA_VBRK.
SELECT VBELN
WAERK
VKORG
FKDAT
BUKRS
FROM VBRK INTO TABLE IT_VBRK
WHERE VBELN IN S_VBELN
AND FKDAT IN S_FKDAT.
SORT IT_VBRK BY VBELN BUKRS.
SELECT BUKRS
BUTXT
FROM T001 INTO TABLE IT_T001
FOR ALL ENTRIES IN IT_VBRK
WHERE BUKRS = IT_VBRK-BUKRS.
LOOP AT IT_VBRK.
CTAB = SY-TABIX.
LOOP AT IT_T001 WHERE BUKRS = IT_VBRK-BUKRS.
IF SY-SUBRC = 0.
IT_VBRK-BUTXT = IT_T001-BUTXT.
MODIFY IT_VBRK INDEX CTAB.
CLEAR CTAB.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. "GET_DATA
*& Form FIELDCATALOG_CHANGE
text
FORM FIELDCATALOG_CHANGE.
*Layout Change
<b> L_LAYOUT-ZEBRA = 'X'.</b>
L_LAYOUT-BOX_FIELDNAME = 'CHECK'.
*Define seperate Color for the fields
X_FIELDCAT_VBRK-COL_POS = 1.
X_FIELDCAT_VBRK-FIELDNAME = 'CHECK'.
X_FIELDCAT_VBRK-SELTEXT_M = 'chek'.
X_FIELDCAT_VBRK-CHECKBOX = 'X'.
X_FIELDCAT_VBRK-INPUT = 'X'.
X_FIELDCAT_VBRK-EDIT = 'X'.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-COL_POS = 2.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'VBELN'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C301'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'WAERK'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C201'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'VKORG'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C300'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'FKDAT'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C600'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'BUKRS'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C400'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'BUTXT'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C500'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
ENDFORM. "FIELDCATALOG_CHANGE
*& Form FIRST_SCREEN_DISPLAY
text
FORM FIRST_SCREEN_DISPLAY.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_VBRK'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT_VBRK
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
CHECK RADIO BUTTON SELECTION AND ACCORDINGLY DISPLAY LIST OR GRID ALV
IF LIST = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT</b>
IT_FIELDCAT = IT_FIELDCAT_VBRK
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRK
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.
CLEAR LIST.
ENDIF.
IF GRID = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT</b>
IT_FIELDCAT = IT_FIELDCAT_VBRK
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRK
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.
CLEAR GRID.
ENDIF.
ENDFORM. "FIRST_SCREEN_DISPLAY
*& Form STATUS
text
-->P_EXTAB text
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STATUS' EXCLUDING P_EXTAB.
ENDFORM. "STATUS
*& Form USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'BACK' OR 'CANC' OR 'EXIT'.
LEAVE TO SCREEN 0.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = RS_SELFIELD-VALUE
IMPORTING
OUTPUT = TEMP_VBELN.
TEMP_VBELN = RS_SELFIELD-VALUE.
PERFORM GET_DATA_VBRP.
PERFORM GET_SECOND_SCREEN_DISPLAY.
ENDIF.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form GET_DATA_VBRP
text
FORM GET_DATA_VBRP.
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP INTO TABLE IT_VBRP
WHERE VBELN = TEMP_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH ' NO BILLING DETAILS FOUND'.
EXIT.
ENDIF.
ENDFORM. "GET_DATA_VBRP
*& Form GET_SECOND_SCREEN_DISPLAY
text
FORM GET_SECOND_SCREEN_DISPLAY.
FIELDCATALOG CALL
X_FIELDCAT_VBRP-TABNAME = 'IT_VBRP'.
X_FIELDCAT_VBRP-FIELDNAME = 'VRKME'.
X_FIELDCAT_VBRP-EMPHASIZE = 'C500'.
X_FIELDCAT_VBRP-OUTPUTLEN = 10.
APPEND X_FIELDCAT_VBRP TO IT_FIELDCAT_VBRP.
CLEAR X_FIELDCAT_VBRP.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_VBRP'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT_VBRP
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
CHECK RADIO BUTTON SELECTION AND ACCORDINGLY DISPLAY LIST OR GRID ALV
IF LIST = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT</b>
IT_FIELDCAT = IT_FIELDCAT_VBRP
I_SCREEN_START_COLUMN = 1
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 10
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRP
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.
ENDIF.
IF GRID = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT </b>
IT_FIELDCAT = IT_FIELDCAT_VBRP
I_SCREEN_START_COLUMN = 1
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 10
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRP
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.
ENDIF.
ENDFORM. "GET_SECOND_SCREEN_DISPLAY
Similar Messages
-
Hi,
Can anybody explain the significnace of these....
ls_layout-get_selinfos = 'X'.
ls_layout-info_fieldname = 'COLOR'.
ls_layout-detail_popup = 'X'.
ls_layout-detail_initial_lines = 'X'.
ls_layout-coltab_fieldname = 'COLOR'.
ls_print-no_coverpage = 'X'.
ls_print-no_print_selinfos = 'X'.
ls_print-no_print_listinfos = 'X'
Thanks in advance
AnindyaHi,
Can anybody explain the significnace of these....
ls_layout-get_selinfos = 'X'.
ls_layout-info_fieldname = 'COLOR'.
ls_layout-detail_popup = 'X'.
ls_layout-detail_initial_lines = 'X'.
ls_layout-coltab_fieldname = 'COLOR'.
ls_print-no_coverpage = 'X'.
ls_print-no_print_selinfos = 'X'.
ls_print-no_print_listinfos = 'X'
Thanks in advance
Anindya -
Setting alv layout as defualt for all usres
Hi,
Is it possible to set the webdynpro alv layout set as default for all users.
I need your input if this is possible in WD ABAP ALV setting.
Thanks in advance !
AlokI found the answer to my question on my own by just digging into the options available in ALV.
Thanks,
Alok -
Dragging one cell value(copy) across columns or across rows in ALV layout
Hi friends,
In bps layouts, data is displayed in ALV grid as interface. At plng folder level, can i incorporate excel feature like dragging one cell value across columns or across rows? Simply if user enter one value in cell of ALV grid, that should be copied automatically across rows/columns while dragging?
Second question, even i chose in layout builder excel as interface, that layout showed in plng folder as ALV grid layout. Why it happens so. I read documentation in UPSPM of that particular plng folder, it tells same thing(even if u choose excel, it will show in ALV only). So how can i get excel interface in plng folder?
Regards,
Kumarrequested property is not possible at ALV layout level. Provided text document load facility to user. So user can directly load excel to plng folder.
Issue resolved. -
Can't save ALV layout as user-specific
Hi!
Whenever I try to save an ALV layout the option User-specific is grayed out, so all variants will be public.
Users would like to save their own layouts safe from other users, as happens with program variants.
First of all then, is there any authorization object related to the User-specific option that my roles are missing?
I read somewhere that 'user-specific' option is controlled by auth. S_ALV_LAYO, ACTVT = 23, yet I have
this auth object with ACTVT = *.
Second, if this option was available, would this let users create their own layouts so that other users don't
overwrite them?
thanks
gracias
xiè xièin the resue FM check the I_SAVE which value are you passing:
Value range
' ' = Display variants cannot be saved
Defined display variants (such as delivered display variants) can be selected for presentation regardless of this indicator. However, changes cannot be saved.
'X' = Standard save mode
Display variants can be saved as standard display variants.
Saving display variants as user-specific is not possible.
'U' = User-specific save mode
Display variants can only be saved as user-specific.
'A' = Standard and user-specific save mode
Display variants can be saved both as user-specific and as standard
variants. Users make their choice on the dialog box for saving the
display variant. -
Button, or other panel related question
so, if any of you have read my previous topic about painting rectangles in a panel, that worked great, but now i need to mkae those rectangles components so that when someone hovers over it or clicks on it it displays information at a certain area. I know how to make listeners and how to add buttons in a panel, BUT how do I add buttons at a specific coordinate. This program graphs data on a specific scale and therefore adding a button in the approximate area using a grid layout will not be good enough. Is there anyway for me to place the the button/component/object at the extact location that I want?
thanks in advanceIn future GUI related questions should be posted in the appropriate GUI forum (likely Swing).
so, if any of you have read my previous topic about
painting rectangles in a panel, that worked great,
but now i need to mkae those rectangles components so
that when someone hovers over it or clicks on it it
displays information at a certain area. What? -
ALV layout variant missing in background job.
hi guys,
Having problem on getting the default ALV layout variant when run the job in backgorund. Please advise any correction needed in the following code.
Thanks.
*& Include Z_MM_KBR_AGSUBCONINV_MOD2 *
MODULE status_0100 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module display_data OUTPUT
text
MODULE display_data OUTPUT.
IF sy-batch IS INITIAL. "Foreground
IF w_container IS INITIAL.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
*Creating the container
CREATE OBJECT w_container
EXPORTING
container_name = c_container
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.
ENDIF.
*Creating the ALV GRID
CREATE OBJECT w_grid
EXPORTING
i_parent = w_container
i_appl_events = c_check
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.
else.
exit.
ENDIF.
ELSE.
*Creating the ALV GRID
CREATE OBJECT w_grid
EXPORTING
i_parent = go_dock_container
i_appl_events = c_check
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
WRITE:/ 'Error in grid'.
ENDIF.
CREATE OBJECT w_grid
EXPORTING i_parent = go_dock_container.
ENDIF.
*getting the variant option
wa_variant-report = sy-repid.
wa_variant-username = sy-uname.
wa_layout-grid_title = sy-title.
wa_layout-cwidth_opt = c_check.
wa_layout-zebra = c_check.
wa_layout-no_f4 = c_check.
wa_layout-sel_mode = 'D'.
*Excluding the unwanted buttons
PERFORM exclude_toolbar_buttons.
build field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_buffer_active = c_check
i_structure_name = c_fcat_str
i_bypassing_buffer = c_check
CHANGING
ct_fieldcat = t_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 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.
loop at t_fieldcat into w_fieldcat.
if w_fieldcat-FIELDNAME = 'AGING1'.
W_FIELDCAT-NO_ZERO = 'X'.
MODIFY t_fieldcat FROM W_FIELDCAT INDEX SY-TABIX.
ENDIF.
endloop.
Generate sort critria
PERFORM generate_sort.
Create object of class lcl_event_receiver.
CREATE OBJECT w_event.
Handler for events.
SET HANDLER w_event->handle_top_of_page FOR w_grid.
SET HANDLER w_event->handle_print_top_of_page FOR w_grid.
SET HANDLER w_event->handle_print_end_of_list FOR w_grid.
SET HANDLER w_event->handle_hotspot_click FOR w_grid.
*Displaying the alv
IF NOT sy-batch IS INITIAL.
PERFORM create_snp.
ENDIF.
t_data = i_final.
CALL METHOD w_grid->set_table_for_first_display
EXPORTING
i_save = 'A'
is_layout = wa_layout
is_variant = wa_variant
CHANGING
it_outtab = t_data
it_fieldcatalog = t_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
ENDMODULE. " display_data OUTPUT
*& Module user_command_0100 INPUT
text
MODULE user_command_0100 INPUT.
DATA: lt_rows TYPE lvc_t_row,
w_rows TYPE lvc_s_row.
CASE sy-ucomm.
WHEN c_back.
LEAVE TO SCREEN 0.
WHEN c_exit.
LEAVE TO SCREEN 0.
WHEN c_cancel.
LEAVE TO SCREEN 0.
WHEN 'BILDET'.
CALL METHOD w_grid->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc EQ 0.
READ TABLE lt_rows INTO w_rows INDEX 1.
READ TABLE i_vbfa INTO w_vbfa INDEX w_rows-index.
IF sy-subrc EQ 0.
CLEAR i_zbw_br_nf4.
LOOP AT i_zbw_br_nf3 INTO w_zbw_br_nf3 WHERE
refkey = w_vbfa-v_vbeln.
APPEND w_zbw_br_nf3 TO i_zbw_br_nf4.
ENDLOOP.
call dialog screen and display new alv control
CALL SCREEN 101 STARTING AT 10 5.
ENDIF.
ENDIF.
WHEN 'NOTAF'.
CALL METHOD w_grid->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc EQ 0.
READ TABLE lt_rows INTO w_rows INDEX 1.
READ TABLE i_zbw_br_nf3 INTO w_zbw_br_nf3 INDEX w_rows-index.
DATA docnum LIKE j_1bdydoc-docnum.
docnum = w_zbw_br_nf3-docnum.
SET PARAMETER ID 'JEF' FIELD docnum.
CALL TRANSACTION 'J1B3N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDMODULE. " user_command_0100 INPUT
*& Form modify_col_name
text
-->P_<FCAT> text
-->P_TEXT_H01 text
FORM modify_col_name USING pwa_fcat TYPE lvc_s_fcat
value(pw_text) TYPE any.
pwa_fcat-coltext = pw_text.
pwa_fcat-scrtext_l = pw_text.
pwa_fcat-scrtext_m = pw_text.
pwa_fcat-scrtext_s = pw_text.
ENDFORM. " modify_col_name
FORM display_hotspot *
FORM display_hotspot USING pw_row_id TYPE lvc_s_row
pw_column_id TYPE lvc_s_col.
FIELD-SYMBOLS <l_data> TYPE zbrforecast.
READ TABLE t_br_nf_acum ASSIGNING <l_data> INDEX pw_row_id-index.
CHECK sy-subrc = 0.
IF pw_column_id = ' '.
ENDIF.
ENDFORM. "display_hotspot
*& Form generate_sort
Genereate Sort criteria
FORM generate_sort.
Local variables
DATA: wal_sort TYPE lvc_s_sort,
wl_pos TYPE numc2.
wl_pos = 01.
sort ORDER
wal_sort-spos = wl_pos.
wal_sort-fieldname = c_aufnr.
wal_sort-up = c_check.
APPEND wal_sort TO t_sort.
ENDFORM. "generate_sort
*& Form f4_variant
text
<--PW_VARI text
FORM f4_variant CHANGING pw_vari TYPE disvariant-variant.
wa_variant-report = sy-cprog.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = c_u
IMPORTING
es_variant = wa_variant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc IS INITIAL.
pw_vari = wa_variant-variant.
ELSE.
MESSAGE s208(00) WITH text-t04.
ENDIF.
ENDFORM. " f4_variant
*& Form validate_layout
*This subroutine is to validate the layout
No parameters are passed to this subroutine
FORM validate_layout.
IF NOT p_layout IS INITIAL.
Check Layout
wa_variant-report = sy-repid.
wa_variant-username = sy-uname.
wa_variant-variant = p_layout.
CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'
EXPORTING
i_save = c_u
CHANGING
cs_variant = wa_variant
EXCEPTIONS
OTHERS = 01.
IF NOT sy-subrc IS INITIAL.
SET CURSOR FIELD 'P_LAYOUT'.
MESSAGE s001(00) WITH text-t06 p_layout.
STOP.
ENDIF.
ELSE.
clear wa_variant.
ENDIF.
ENDFORM. " validate_layout
*& Form validate_data
text
FORM validate_data .
PERFORM validate_layout.
ENDFORM. " validate_dataHi,
Before the call to method set_table_for_first_display, populate
wa_variant-report = sy-repid.
Best regards,
Prashant -
How to display long text in SAP Query ALV layout? It only show 129 char now
I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
thanks very much in addvance.Hi,
ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
Regards, -
I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.Please help me for that.
1.)If i am using the continuous output mode.and the size of generated data is less than 32 MB.If i want to preload the memory,what should i do?I want that first of all i load all my data to onboard memory & then i want to make start the transfer between 6534 & peripheral.Is it possible?As per me it should be.Plz tell me how should i do this?I think that in normal procedure the transfer between 6534-peripheral & outputting data from pc buffer to onboard memory works parallely.But i don't want this.Is it poss
ible?
(2).Similarly in finite input operation(pattern I/O) is it possible to preload the memory and then i read it?Because i think that the PC memory will be loaded automatically when 6534 acquires the data and then when we use DIO read vi the pc buffer data will be transferred to application buffer.If this is true,i do not want this.Is it possible?
(3) One more question is there if i am using normal operation onboard memory will be used bydefault right?Now if i want to use DMA and if i have data of 512 bytes to acquire.How will it work and how should i do it?Please tell me the sequence of operations.As per my knowledge in normal DMA operation we have 32 Bytes FIFO is there so after acquisition of 32 bytes only i can read it.How it will known to me that 32 bytes acquisition is complete?Next,If i want to acquire each byte separately using DMA interrupts what should i do?Provide me the name of sourse from which i can get details about onboard memory & DMA process of 6534 specifically
(4).In 6534 pattern Input mode,if i want to but only 10 bits of data.and i don't want to waste any data line what should i do?Hi Vishal,
I'll try to answer your questions as best I can.
1) It is definitely possible to preload data to the 32MB memory (per group) and start the acquisition after you have preloaded the memory. There are example programs on ni.com/support under Example Code for pattern generation and the 6534 that demonstrate which functions to use for this. Also, if your PC memory buffer is less than 32MB, it will automatically be loaded to the card. If you are in continuous mode however, you can choose to loop using the on-board memory or you can constantly be reading the PC memory buffer as you update it with your application environment.
2) Yes, your data will automatically be loaded into the card's onboard memory. It will however be transferred as quickly as possible to the DMA FIFO on the card and then transferred to the PC memory buffer through DMA. It is not going to wait until the whole onboard memory is filled before it transfers. It will transfer throughout the acquisition process.
3) Vishal, searching the example programs will give you many of the details of programming this type of application. I don't know you application software so I can't give you the exact functions but it is easiest to look at the examples on the net (or the shipping examples with your software). Now if you are acquiring 512 bytes of data, you will start to fill your onboard memory and at the same time, data will be sent to the DMA FIFO. When the FIFO is ready to send data to the PC memory buffer, it will (the exact algorithm is dependent on many things regarding how large the DMA packet is etc.).
4) If I understand you correctly, you want to know if you waste the other 6 bits if you only need to acquire on 10 lines. The answer to this is Yes. Although you are only acquiring 10 bits, it is acquired as a complete word (16bits) and packed and sent using DMA. You application software (NI-DAQ driver) will filter out the last 6 bits of non-data.
Hope that answers your questions. Once again, the example code on the NI site is a great place to start this type of project. Have a good day.
Ron -
Need to add Excel as option on SAP report view (currently only ALV layout)
Some users currently have the option to view a report in either the standard ALV layout view or as Excel (example output - transaction VA05). They also have the Excel icon on their toolbar. Our issue is that not all users have this option in their GUI. What do we need to do to add the Excel icon/view option to either their account or their GUI?
Hello Ryan,
The export option is coded into the application.
Can you advise if all users are using the same application VA*?
Do all users have the same Gui patch and version? -
How to send pdf or excel attachment as saved alv layout in email
Hi Guru,
I am developing a report in which, i am sending report as excel attachment after clicking a button on top of alv grid, and pdf attachment after clicking another button on top of alv grid. I am sending mail by two ways they are:
1) I am populating my internal table value in separate internal table and converting that to string and sending email as excel attachment.
2) And am converting report as spooljob, and using abapspool 2 pdf function module i am converting spool to pdf, after that am send that pdf as mail attachment.
Now my requirement is i need to send email attachment as layout which is displayed in the alv screen, even i hide a column and change the layout it is going with all the columns. What should i do for this problem.
Regards,
RithikaHi,
Check if the below steps will solve the problem.
* Get the run time ALV layout (field catalog) using the below method.
data: r_grid TYPE REF TO cl_gui_alv_grid.
CALL METHOD r_grid->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = t_fcat.
* Adjust the download table according to t_fcat. -
Webdynpro ABAP -- ALV Layout setting
Dear all,
In my development with ALV in Webdynpro ABAP, I want to save the ALV layout via Setting. but it seems that the layout only can be saved as user-specific, is it any possible to use it as the gobal one?
Please kindly provide me some hints. Thanks in Advance.
Best Regards,Hi,
Yes you can make it global in administrative level.
1.In SE80 ,Double click on the name of your Web Dynpro Application .
2.Select Web Dynpro Application Menu .
3.Select Test->-> Execute in Administrative Mode from the menu.
Your application opens in administrative mode .
Go to the ALV settings make the changes and save it as some variant.
This layout will be default and global to all the users.
Regards
John Paul -
Allowing a User to choose the ALV layout format on selection-screen
Hi all,
I would like to know how i can add a parameter to my selection-screen which would allow the User to choose a saved ALV layout format before pressing F8 rather than after. As used in CO15 or MB51.
Thanks femi.yes , You can check the program BCALV_TEST_FULLSCREEN_LAYOUT to check how F4 help is to be used .
to check existene of variant is pretty simple.
Pass the variant name in the ALV display FM . -
ALV + layout varient on selection screen
hiii
with ALV list i want to know with how to allow to put the layout on the selection screen and when user press F4 he will be able to use the list of layout he has save on the ALV output
Note for the layout button to appear i had to activate shown below:
i_save = c_x
please give me sample code where user can choose layout on selection screen and this layout will be used to display on ALVHi,
Please refer the code below for layout variants :
DATA: gt_rsparams TYPE TABLE OF rsparams.
* Data for ALV variant
DATA gv_repname LIKE sy-repid.
DATA gv_x_variant LIKE disvariant.
DATA gv_exit(1) TYPE c.
DATA gv_save(1) TYPE c.
DATA gv_variant LIKE disvariant.
PARAMETERS: sp_vari LIKE disvariant-variant. "Dispaly Variant
INITIALIZATION.
gv_repname = sy-repid.
REFRESH : gt_glacct,
gr_rcomp,
gt_output,
gt_fieldcat,
gt_sort.
* Initialize ALV Layout variant
PERFORM f_initialize_variant.
FORM f_initialize_variant .
CLEAR gv_variant.
gv_save = 'X'.
gv_variant-report = gv_repname.
gv_x_variant = gv_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = gv_save
CHANGING
cs_variant = gv_x_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
sp_vari = gv_x_variant-variant.
ENDIF.
ENDFORM. " f_initialize_variant
AT SELECTION-SCREEN ON VALUE-REQUEST FOR sp_vari.
PERFORM f_f4_for_variant.
FORM f_f4_for_variant .
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = gv_variant
i_save = gv_save
IMPORTING
e_exit = gv_exit
es_variant = gv_x_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF gv_exit = space.
sp_vari = gv_x_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " f_f4_for_variant
AT SELECTION-SCREEN.
* Validating selection screen fields
PERFORM f_at_selection_screen.
FORM f_at_selection_screen .
* ALV Layout variant
IF NOT sp_vari IS INITIAL.
MOVE gv_variant TO gv_x_variant.
MOVE sp_vari TO gv_x_variant-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = gv_save
CHANGING
cs_variant = gv_x_variant.
gv_variant = gv_x_variant.
ELSE.
PERFORM f_initialize_variant.
ENDIF.
FORM f_initialize_variant .
CLEAR gv_variant.
gv_save = 'X'.
gv_variant-report = gv_repname.
gv_x_variant = gv_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = gv_save
CHANGING
cs_variant = gv_x_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
sp_vari = gv_x_variant-variant.
ENDIF.
ENDFORM. " f_initialize_variant
Thanks,
Sriram POnna. -
Alle experts:
In ALV layout report, how to dynamic change the layout int ABAP porgram?
e.g. I have save 5 layout, I need to change them base the my selection in ABAP program? How to do this?
Thanks in advance!Try to call fieldcatlog dymnamically. Refer tofollowing code. Reward if helpful.
REPORT zfir0001 MESSAGE-ID ztax.
Tables
TABLES : glt0, t001, skat.
Internal Tables
DATA: BEGIN OF itab OCCURS 0,
racct LIKE glt0-racct, "Account number
txt20 LIKE skat-txt20, "G/L account short text
co_1000 LIKE glt0-hslvt, "Balance carried forward for company code 1000
co_1100 LIKE glt0-hslvt, "Balance carried forward for company code 1100
co_1200 LIKE glt0-hslvt, "Balance carried forward for company code 1200
DATA : BEGIN OF itab1 OCCURS 0,
bukrs LIKE glt0-bukrs,
waers LIKE t001-waers,
END OF itab1.
DATA : BEGIN OF it_itab1 OCCURS 0.
INCLUDE STRUCTURE glt0.
DATA : END OF it_itab1.
Data Declarations
DATA : w_total LIKE glt0-hslvt,
w_count LIKE glt0-bukrs,
w_flg TYPE c,
lv_count TYPE i.
w_slash TYPE c VALUE ' '.
Selection screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE tit1.
SELECT-OPTIONS : s_bukrs FOR glt0-bukrs OBLIGATORY,
s_racct FOR glt0-racct OBLIGATORY,
s_ryear FOR glt0-ryear OBLIGATORY,
s_rldnr FOR glt0-rldnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
tit1 = 'Please select:'(004).
TYPE-POOLS: slis. "ALV Declarations
DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
********Geting the selected company code in table itab1****
START-OF-SELECTION.
IF NOT s_bukrs-high IS INITIAL.
itab1-bukrs = s_bukrs-low.
APPEND itab1.
w_count = s_bukrs-low.
DO.
IF s_bukrs-high = w_count.
EXIT.
ELSE.
w_count = w_count + 1.
ENDIF.
SELECT SINGLE * FROM t001
WHERE bukrs = w_count.
IF sy-subrc = 0.
itab1-bukrs = w_count.
APPEND itab1.
CLEAR itab1.
ENDIF.
ENDDO.
ELSE.
itab1-bukrs = s_bukrs-low.
APPEND itab1.
ENDIF.
SELECT * FROM glt0 INTO CORRESPONDING FIELDS OF TABLE it_itab1
WHERE rldnr IN s_rldnr
AND bukrs IN s_bukrs
AND ryear IN s_ryear
AND racct IN s_racct.
SORT it_itab1 BY bukrs.
LOOP AT it_itab1.
AT END OF racct.
w_flg = 'X'.
ENDAT.
SELECT SINGLE txt20 INTO (itab-txt20) FROM skat
WHERE spras = sy-langu
AND saknr = it_itab1-racct.
PACK it_itab1-racct TO it_itab1-racct.
itab-racct = it_itab1-racct.
w_total = it_itab1-hsl01 + it_itab1-hsl02 + it_itab1-hsl03 + it_itab1-hsl04 +
it_itab1-hsl05 + it_itab1-hsl06 + it_itab1-hsl07 + it_itab1-hsl08 +
it_itab1-hsl09 + it_itab1-hsl10 + it_itab1-hsl11 + it_itab1-hsl12 +
w_total + it_itab1-hslvt.
IF w_flg = 'X'.
READ TABLE itab1 WITH KEY bukrs = it_itab1-bukrs.
IF sy-subrc = 0.
SELECT SINGLE * FROM t001
WHERE bukrs = itab1-bukrs.
IF t001-waers = 'JPY' OR
t001-waers = 'HUF'.
w_total = w_total * 100.
ENDIF.
CASE it_itab1-bukrs.
WHEN '1000'.
itab-co_1000 = w_total.
WHEN '1100'.
itab-co_1100 = w_total.
WHEN '1200'.
itab-co_1200 = w_total.
ENDCASE.
COLLECT itab.
CLEAR: itab, w_flg, w_total.
ENDIF.
ENDIF.
ENDLOOP.
SORT itab BY racct.
IF NOT itab[] IS INITIAL.
PERFORM field_cat1.
lv_count = 1.
LOOP AT itab1.
PERFORM field_cat USING itab1-bukrs.
ENDLOOP.
PERFORM display_alv_report .
ELSE.
MESSAGE s000 WITH 'No records Found'(003).
ENDIF.
*& Form display_alv_report
text
FORM display_alv_report .
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
is_layout = gd_layout
it_fieldcat = i_fieldcat[]
i_save = 'X'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "display_alv_report
*& Form field_cat1
text
FORM field_cat1 .
i_fieldcat-col_pos = 0.
i_fieldcat-fieldname = 'RACCT'.
i_fieldcat-seltext_m = 'Account'(001).
i_fieldcat-fix_column = 'X'.
i_fieldcat-emphasize = 'X'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-col_pos = 1.
i_fieldcat-fieldname = 'TXT20'.
i_fieldcat-seltext_m = 'Description'(002).
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
ENDFORM. "field_cat1
*& Form field_cat
text
-->XV_BURKS text
FORM field_cat USING xv_burks TYPE char4.
lv_count = lv_count + 1.
i_fieldcat-col_pos = lv_count.
CONCATENATE 'CO_' xv_burks INTO i_fieldcat-fieldname.
i_fieldcat-seltext_m = xv_burks.
i_fieldcat-just = 'C'.
i_fieldcat-no_zero = 'X'.
i_fieldcat-do_sum = 'X'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
ENDFORM. "field_cat
Edited by: dhanashree wadkar on Apr 30, 2008 6:00 AM
Maybe you are looking for
-
Suspented Account, Customer Support won't help
I am always a very easy going and peaceful person but in this situation I am really frustrated. To cut things short: All of a sudden an informal Skype account of mine went off in the middle of a chat actually. I do not keep details of this account as
-
I am executing one sql query with order by clause. how to check sort is happing in memory or disk ? what are all the init parameter affect in order by clause
-
For selection parameter the default date should be of the previous month.
Hi all, In my selection-screen what i want is for the selection parameter "Selection period month" the default value to be the previous month. For example today is 24.09.2008 so the default value of this field has to be 200808 instead of 200809 toda
-
How to select color space for PDF export in Aperture 3
If you're exporting a book layout as a PDF for printing by a third-party album company, you may need to specify sRGB as the color space for images in the PDF. That's OK if your book is composed of JPEGs that are already in the sRGB color space. But,
-
How can I use the Outlook 2010 social connector to connect to a Sharepoint 2013 mysite?
Hello Forumfriends! We have recently (like, last Weekend) migrated our Sharepoint 2010 Farm to SharePoint 2013 and we have started using mysites. Now, there is a nice featur in Outlook 2010, the social connector. This connector connects nicely to Sha