ALV Type Selection Screen
Hi,
I am having a selection screen with few parameters and also having a push button. When the user clicks on the push button, a new selection screen should open(like varaint screen) with check boxes. The user should have possibility of saving the screen.
The initial screen had been done. I want help when the user click on the push button.
Any idea of how this can be done. Any inputs will be appreciated.
Regards,
Ramesh.
Hi,
Declare the 2nd screen using ....
SELECTION-SCREEN: BEGIN OF SCREEN 2000.
declare the checkboxes ....
SELECTION-SCREEN: END OF SCREEN 2000.
At the time of variant saving both the screen values will be saved.
Regards,
Amitava
Similar Messages
-
How to set Screen type "Selection Screen" in Dialog program
Hi Experts,
I have copied a screen 400 from a program into my program. In that screen in source program, the screen type was defined as 'Selection Screen'. After i copied that screen into my program, the screen type Selection Screen option is disabled. How to set the screen type of a screen to Selection Screen.
I am currently getting the following error
"Error when generating the selection screen "0400" of "Ztest_screen ".
I tried running the generation program RSDBGENA. There the diagnosis was given as follows:
When generating the report Ztest_screen and its selection screen, an existing screen 1000 (not a selection screen) was overwritten.
The selection screen was defined as follows:
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
PARAMETERS: p_werks TYPE werks_d OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blck1.
SELECTION-SCREEN END OF SCREEN 400 .
I am calling the screen 400 with selection screen declarations in PBO of screen 0100.
CALL SUBSCREEN sub_scr INCLUDING 'Ztest_Screen' '400'.
Where am i going wrong? Your inputs are needed.
ThanksThanks Przemysław and Nabheet for your suggestions.
I had copied the generated screen 400 also from the source program into my program. This was the error. I deleted that and the report got activated now.
Both the source and destination programs are not module pool. They are executable programs.
Thanks -
Reg: Alv and selection-screen
Hi,
I created a ALV report,
I gave the user provision delete rows and dispalyed the new list without the deleted rows( one row at a time)
when i deleted few rows and when i press the back button i am getting all the rows deleted, but i want to jump directly to selection screen
please help me how to jump to selection screen after pressing the back button
i tried set screen 0 leave to screen 0 but of no use,
please help in this regard
thnxHi learner,
After deleting a row in ur internal tab u hav to refresh the display to remove dat row from display rite .....how r u doing it...??
Are u calling the ALV FM again... if ur doin so !! its a wrong way and der lies de problem....
check the sample code below in which if u double click on a row dat row gets deleted and the screen is refreshed.....also if u click back it goes to the selection-screen and not the previous alv display with deleted rows......
TYPE-POOLS: slis.
PARAMETERS rows TYPE i DEFAULT 20.
DATA: itab TYPE TABLE OF mara WITH HEADER LINE,
ls_layout TYPE slis_layout_alv.
START-OF-SELECTION.
SELECT * UP TO rows ROWS
FROM mara
INTO CORRESPONDING FIELDS OF TABLE itab.
ls_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_structure_name = 'MARA'
is_layout = ls_layout
i_callback_program = sy-repid
i_grid_title = 'Double click on a row'
i_callback_user_command = 'EVENT_HANDLER'
TABLES
t_outtab = itab[].
*& Form event_handler
FORM event_handler USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CLEAR itab.
DELETE itab INDEX rs_selfield-tabindex.
MOVE 'X' TO rs_selfield-refresh . " this automatically refreshes the display
ENDFORM. "event_handler
Cheers,
jose. -
Hi Abapers,
I have small query
<b>Can we add Two ALV on the selection Screen. I am not talking about OOALV or not Block ALV</b>
Please suggest if it can be possible to create two ALV on screen using Simple ABAP.HI,
REPORT YMS_TWOALV .
TYPE-POOLS: slis.
DATA: BEGIN OF i_clients OCCURS 0,
mandt LIKE t000-mandt,
mtext LIKE t000-mtext,
ort01 LIKE t000-ort01.
DATA: END OF i_clients.
DATA: BEGIN OF i_industry OCCURS 0,
mandt LIKE t016t-mandt,
spras LIKE t016t-spras,
brsch LIKE t016t-brsch,
brtxt LIKE t016t-brtxt.
DATA: END OF i_industry.
DATA: i_fcat_c TYPE slis_t_fieldcat_alv,
i_fcat_i TYPE slis_t_fieldcat_alv.
DATA: i_layout_c TYPE slis_layout_alv.
DATA: i_layout_i TYPE slis_layout_alv.
DATA: i_events_c TYPE slis_t_event.
DATA: i_events_i TYPE slis_t_event.
DATA: gt_print TYPE slis_print_alv.
START-OF-SELECTION.
*BREAK-POINT.
SELECT mandt mtext ort01
FROM t000 INTO CORRESPONDING FIELDS OF TABLE i_clients.
SELECT mandt spras brsch brtxt
FROM t016t INTO CORRESPONDING FIELDS OF TABLE i_industry.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZKB_BLOCK_LIST_REPORT'
i_internal_tabname = 'I_CLIENTS'
I_STRUCTURE_NAME = 'T000'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = 'ZKB_BLOCK_LIST_REPORT'
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fcat_c
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.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZKB_BLOCK_LIST_REPORT'
i_internal_tabname = 'I_INDUSTRY'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = 'ZKB_BLOCK_LIST_REPORT'
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fcat_i
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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = 'ZKB_BLOCK_LIST_REPORT'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = i_layout_c
it_fieldcat = i_fcat_c
i_tabname = 'I_CLIENTS'
it_events = i_events_c
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = i_clients
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = i_layout_i
it_fieldcat = i_fcat_i
i_tabname = 'I_INDUSTRY'
it_events = i_events_i
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = i_industry
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gt_print-reserve_lines = 2.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
is_print = gt_print
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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.
Thanks,
Sankar M -
Tooltip on pushbutton on alv report selection screen
Hi Experts,
I have a selection screen with two pushbuttons i want to provide tooltip on this button when user takes his cursor on it .. some part of my code
Selection screen:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-t02 FOR FIELD p_info.
PARAMETERS: p_info TYPE string.
SELECTION-SCREEN: PUSHBUTTON 68(10) but1 USER-COMMAND cli1.
SELECTION-SCREEN : END OF LINE.
PARAMETERS: r_exe_im RADIOBUTTON GROUP rb1.
PARAMETERS: r_st RADIOBUTTON GROUP rb1.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN: PUSHBUTTON /1(20) exec1 USER-COMMAND cli2.
SELECTION-SCREEN: FUNCTION KEY 1.
SELECTION-SCREEN END OF BLOCK b1.
please tell me on these selection fields how to display tool tip.
Thanks and regards,
Roshan.Hi,
After completing your executable program in SE38, activate it and goto SE51(Screen painter).
Here give the name of your program and screen number as 1000.
Click on Change.
Goto Element List Tab.
Here you will find all your elements from your program.
Select the required element and click on Properties.
Here you will find a Tooltip Text property. Click on the button 'Text' of this property.
You will be given 2 options 1) Text from Text element 2) Text from Variable
Enter as per requirement
Save and Activate.
Hope this will be useful
Regards
Bhupal -
ALV Report - Selection screen information should appear in Output screen
Hi experts,
I am working on ALV Reports.
I want selection screen information to appear in ouputscreen when report executed.
Those who know the sloution pls tell me as soon as possible.
regards,
ImranHi Imrangs ,
Ur requirement is not clear -
if u want ur selection screen and the output screen on the same screen, i.e if u fill ur selection options with input and press the button then ur ALV will display on the same screen. For this try to use Screen painter, it will get resolved.
http://www.kodyaz.com/articles/sap-abap-tutorial-alv-grid-cl_gui_alv_grid-screen-painter.aspx
chreers
Regards
Neha -
Customised Back button in ALV loses selection screen parameters
Hi,
In my ALV output, the user interacts with the output. I had to program my own back button in the pf-status so that when the user hit back they didnt return to the original alv output. (if that makes sense)
I use LEAVE TO TRANSACTION 'ZZZZ' (user_command form) but the problem is that i lose all the selection parameters that the user has entered.
I have tried everything.........set screen 0, leave screen etc..........and searched the forum but cant find the answer.
Anyone know what i need i do..........
Cheers..........try submit ...
submit the report of ZZZZ tcode... with the selection parameters of your existing report....
e.g.
SUBMIT zbbp_sc_arch_initial_upload
VIA SELECTION-SCREEN
WITH p_r01 EQ p_r01
WITH p_r02 EQ p_r02
WITH p_mode EQ p_mode. -
Stuck on tv type selection screen.
I just got the ATV and Im already having problems with it. After the lauguage selection screen it takes me to the screen where I can select the type of tv i have (720, 1080p, 1080i, ect.)I select the right one and all of the sudden the ATV turns off and starts right back up again with the same tv selection screen up again. Ive tried all the troubleshooting keys that are provided in the manual and still nothing. I have even left it disconnected over night and I am still having the same problems. HELP!!!
Welcome to the Discussion Forums
If you select a video output that your tv doesn't support, this is what will happen. -
Check box in ALV selection screen
Hi to all
I like to know how to create a checkbox in the input screen of an ALV.What do you mean by ALV check box selection screen?
ALV and selection screen check box( you are mixing two cases in your Question).
You need use the Function moduel in the user command to get the updated data.
in fieldcatalog you have to use INPUT = 'X' and EDIT = 'X' for the columns which ever you want edit.
GET_GLOBALS_FROM_SLVC_FULLSCR
follow the sample code.
REPORT ZTEST_ALV_CHECK MESSAGE-ID ZZ .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV,
X_EVENTS TYPE SLIS_ALV_EVENT,
IT_EVENTS TYPE SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
CHK(1),
color(4),
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-HOTSPOT = 'X'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-info_fieldname = 'COLOR'.
*L_LAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
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.
*& Form STATUS
text
-->P_EXTAB text
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
Pf status
SET PF-STATUS 'STATUS'.
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.
DATA: GD_REPID LIKE SY-REPID, "Exists
REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA .
ENDIF.
loop at itab where chk = 'X'.
itab-color = 'C300'.
modify itab index sy-tabix transporting color.
endloop.
RS_SELFIELD-refresh = 'X'.
break-point.
ENDFORM. "USER_COMMAND
Regards
Vijay Babu Dudla -
ALV using OOABAP fieldnames changing in the selection screen
Hi
I am new to OOABAP.Here is the requirement.
I need to create a ALV report, in the selection screen field label can change and it needs to display in ALV report. selection screen contains 4 checkboxes. based on selection hide the columns in ALV display.
Can anyone help me in this?
Thanks
sapienu build field cat "at selection-screen event.
LET S_A, S_B, S_C, S_D BE THE SELECTION SCREEN FIELD.
AT SELECTION-SCREEN.
PERFORM BUILD_FIELDCAT USING S_A S_B S_C S_D.
form build_fieldcat using s_a type ... s_b type .... so on
if s_a = 'X'.
FIELDCAT-FIELDNAME = '......'.
append fieldcat.
if s_b = 'X'.
FIELDCAT-FIELDNAME = '......'.
append fieldcat.
IF S_C = 'X'.
FIELDCAT-FIELDNAME = '......'.
append fieldcat.
IF S_D = 'X'.
FIELDCAT-FIELDNAME = '......'.
append fieldcat. -
ALV Layout on selection screen?
Is it possible to offer the ALV Layouts on the selection screen? And how can i pass such a variant to the reuse-FM?
Hi,
Yes u can do it.Check this sample code
Variant for ALV display
SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE text-000.
<b>PARAMETERS: p_varnt LIKE disvariant-variant.</b>
DATA: w_save(1) TYPE c,
w_default(1) TYPE c,
i_variant LIKE disvariant,
i_variant1 LIKE disvariant.
INITIALIZATION.
i_variant-report = w_repid.
i_variant1 = i_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = w_save
CHANGING
cs_variant = i_variant1
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_varnt = i_variant1-variant.
ENDIF.
Process on value request (list of possible variants)
<b>AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varnt.</b>
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = i_variant
i_save = w_save
it_default_fieldcat =
IMPORTING
e_exit = w_exit
es_variant = i_variant1
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 w_exit = space.
p_varnt = i_variant1-variant.
ENDIF.
ENDIF.
<b>AT SELECTION-SCREEN.</b>
IF NOT p_varnt IS INITIAL.
MOVE i_variant TO i_variant1.
MOVE p_varnt TO i_variant1-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = w_save
CHANGING
cs_variant = i_variant1.
i_variant = i_variant1.
ELSE.
PERFORM variant_init.
ENDIF.
START_OF_SELECTION.
Call ABAP/4 List Viewer
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
i_callback_program = w_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 = 'SFLIGHT'
i_background_id = 'ALV_BACKGROUND'
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = i_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
it_special_groups = i_sp_group[]
it_sort = i_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = w_save
<b> is_variant = i_variant</b>
it_events = i_events[]
IT_EVENT_EXIT =
is_print = i_print
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = i_sflight
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.
Hope u understood.
Thanks&Regards,
Ruthra. -
ALV grid list report when selected from selection screen
Hi folks,
I need to get ALV grid display in my list report when selected the interval values from the selection screen. If I change the values in list of ALV grid it needs to be updated when I press UPDATE pushbutton. The output of list should be in ALV grid display.I need sorting ,flitering,totaling functionality in the list output.
For example if I selected BUKRS = 100 and 200 in the selection screen ,I need to display the ALV grid list in below the selection screen as ALV grid display...
Its urgent as I am new to ALV grid functionality...
Thanks in advance..hi raja,
check with the folllowing code.
REPORT zca0m_zca0fcstftop NO STANDARD PAGE HEADING
MESSAGE-ID zcsv_usrtbl_maintain.
Type pools *
TYPE-POOLS : slis. " Used for ALV display
Tables
TABLES: zca0fcstftop,
dd04t, "R/3 DD: Data element texts
tactt. "Activities that can be protected
internal tables
DATA: BEGIN OF wa_zca0fcstftop .
INCLUDE STRUCTURE zca0fcstftop.
DATA: END OF wa_zca0fcstftop.
DATA: t_zca0fcstftop LIKE STANDARD TABLE OF wa_zca0fcstftop.
DATA: BEGIN OF i_fcode OCCURS 0,
fcode LIKE sy-ucomm,
END OF i_fcode.
*Record for variant selection
DATA : BEGIN OF ws_variant,
selected TYPE c,
variant LIKE ltdx-variant, "Variant name
text LIKE ltdxt-text, "Variant description
END OF ws_variant.
*Table for variant selection
data : itab_variant LIKE STANDARD TABLE OF ws_variant WITH HEADER LINE.
Variant selection pop-up global variables
DECLARATION OF TABLECONTROL 'VARIANT_CNTL' ITSELF
CONTROLS: variant_cntl TYPE TABLEVIEW USING SCREEN 0200.
LINES OF TABLECONTROL 'VARIANT_CNTL'
DATA: g_variant_cntl_lines LIKE sy-loopc.
DATA:grid1 TYPE REF TO cl_gui_alv_grid ,
g_custom_container TYPE REF TO cl_gui_custom_container.
Work fields
DATA: table_name LIKE dd02l-tabname, "To store table name
field_name LIKE dd03l-fieldname, "To Store Field Name
act_auth LIKE tactz-actvt, "To pass Activity ID
tab_maint LIKE dd02l-tabname, "To pass Table Name to be Maintd.
wg_confirm_ind, "To trap User responses
flag, "To trap changes made to an entry
f_copy, "To Identify 'COPY' Command Use
f_select, "To decide between Select-options
" and Internal Table
l_transaction_code LIKE tstc-tcode,
v_langu LIKE sy-langu,
v_repid LIKE sy-repid,
s_variant TYPE disvariant.
DATA: ok_code LIKE sy-ucomm.
DATA:selected_rows TYPE lvc_t_row ,
sel_rows TYPE lvc_t_row WITH HEADER LINE.
DATA:t_lines TYPE i.
Constants *
CONSTANTS :
c_x TYPE c VALUE 'X', " Constant 'X'.
c_f TYPE c VALUE 'F'. " Constant 'F'.
Parameters and Selection Options
*Selection Screen for table maintenance
*Selection option for Plant
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-b01.
PARAMETERS: p_werks LIKE zca0fcstftop-werks OBLIGATORY.
SELECT-OPTIONS: s_prdfml FOR zca0fcstftop-product_family,
s_bmach FOR zca0fcstftop-base_machine,
s_factop FOR zca0fcstftop-factory_top,
s_optval FOR zca0fcstftop-option_value,
s_week FOR zca0fcstftop-week.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-b02.
PARAMETERS : p_varant LIKE ltdx-variant. " ALV variant
SELECTION-SCREEN END OF BLOCK block2.
At selection screen *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varant.
PERFORM alv_variant_f4 CHANGING p_varant.
AT SELECTION-SCREEN ON p_werks .
Validating Plant on the selection screen
PERFORM validate_plant.
Initialization
INITIALIZATION.
Check Authorization for the Transaction
Authorization Check For T Code
SELECT tcode
INTO l_transaction_code
FROM tstc UP TO 1 ROWS
WHERE pgmna = sy-repid.
ENDSELECT.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD l_transaction_code.
IF sy-subrc NE 0.
MESSAGE e001 WITH l_transaction_code.
ENDIF.
v_langu = sy-langu. " language
v_repid = sy-repid . " abap Program name
Start Of Selection
START-OF-SELECTION.
CALL SCREEN 0050.
*& Form validate_plant *
Validating Plant on the selection screen *
FORM validate_plant .
DATA : l_werks LIKE t001w-werks. " Plant
IF p_werks IS NOT INITIAL.
SELECT SINGLE werks
FROM t001w
INTO l_werks
WHERE werks EQ p_werks.
IF sy-subrc NE 0.
MESSAGE e100(ra) WITH text-001 .
ENDIF.
ENDIF.
AUTHORITY-CHECK OBJECT 'Z_PP_PLANT'
ID 'ACTVT' FIELD '03'
ID 'WERKS' FIELD p_werks
ID 'TCD' FIELD l_transaction_code.
IF sy-subrc NE 0.
MESSAGE e000(oo) WITH 'No authorization for plant:'(e80) p_werks.
ENDIF.
ENDFORM. " validate_plant
*& Form get_data *
Get data *
FORM get_data .
SELECT * FROM zca0fcstftop
INTO TABLE t_zca0fcstftop
WHERE werks = p_werks
AND product_family IN s_prdfml
AND base_machine IN s_bmach
AND factory_top IN s_factop
AND option_value IN s_optval
AND week IN s_week.
ENDFORM. " get_data
*& Form fill_fcode
FORM fill_fcode USING value(p_0029).
i_fcode-fcode = p_0029.
APPEND i_fcode.
CLEAR i_fcode.
ENDFORM. " fill_fcode
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'UPDATE'.
CLEAR flag.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module MODIFY_0100 OUTPUT
MODULE modify_0100 OUTPUT.
IF sy-ucomm = 'CHNG' OR
sy-ucomm = 'PICK'.
LOOP AT SCREEN.
CHECK screen-group1 = 'CHG'.
screen-required = '0'.
screen-output = '1'.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Check if you are in create mode & if yes then set the screen elements
as mandatory
IF ok_code = 'CREA'.
LOOP AT SCREEN.
CHECK screen-group1 = 'CHG'.
screen-required = '1'.
screen-output = '1'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE. " MODIFY_0100 OUTPUT
*& Module Check_Exit INPUT
text
MODULE check_exit INPUT.
IF ( sy-ucomm = 'BACK' OR sy-ucomm = 'CANC' OR sy-ucomm = 'EXIT' ) AND
( flag = 'Y' ).
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y'
textline1 = text-008
textline2 = text-009
titel = text-004
cancel_display = ' '
IMPORTING
answer = wg_confirm_ind.
CASE wg_confirm_ind.
WHEN 'J'. "Yes
sy-ucomm = 'SAVE'.
CLEAR flag.
WHEN 'N'. "No
sy-ucomm = 'BACK'.
CLEAR flag.
ENDCASE.
ENDIF.
ENDMODULE. " Check_Exit INPUT
*& Module Exit_0100 INPUT
text
MODULE exit_0100 INPUT.
SET SCREEN 0. LEAVE SCREEN.
ENDMODULE. " Exit_0100 INPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'. "Save
Check to see if the user has the appropriate authorization
IF p_werks NE zca0fcstftop-werks.
could not update - not in selection
MESSAGE e000(oo) WITH 'Entry not within selection'.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ENDIF.
IF f_copy = 'X'.
INSERT zca0fcstftop.
IF sy-subrc = 0.
MESSAGE s004.
PERFORM initialize.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ELSE.
MESSAGE w005.
ENDIF.
ELSE.
MODIFY zca0fcstftop.
IF sy-subrc = 0.
MESSAGE s004.
PERFORM initialize.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ELSE.
MESSAGE w005.
ENDIF.
ENDIF.
PERFORM get_data.
WHEN 'BACK'. "Back
SET SCREEN 0. LEAVE SCREEN.
WHEN 'CANC'. "Cancel
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
COMMIT WORK.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form Initialize
FORM initialize.
CLEAR : table_name,
field_name,
wg_confirm_ind,
f_copy,
flag,
t_zca0fcstftop,
zca0fcstftop,
wa_zca0fcstftop,
i_fcode.
REFRESH: t_zca0fcstftop.
ENDFORM. " Initialize
*& Form alv_variant_f4
text
<--P_VARIANT text
FORM alv_variant_f4 CHANGING variant.
DATA: rs_variant LIKE disvariant.
DATA nof4 TYPE c.
CLEAR nof4.
LOOP AT SCREEN.
IF screen-name = 'VARIANT'.
IF screen-input = 0.
nof4 = 'X'.
ENDIF.
ENDIF.
ENDLOOP.
rs_variant-report = sy-repid.
rs_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = rs_variant
i_save = 'A'
IMPORTING
es_variant = rs_variant
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0 AND nof4 EQ space.
variant = rs_variant-variant.
ENDIF.
ENDFORM. " ALV_VARIANT_F4
*& Module STATUS_0050 OUTPUT
text
MODULE status_0050 OUTPUT.
In this module Initialize the container and put the grid in it
DATA:grid_layout TYPE lvc_s_layo,
fieldcat TYPE lvc_t_fcat,
wa_fieldcat LIKE LINE OF fieldcat.
PERFORM set_auth.
SET PF-STATUS 'UPD_0050' EXCLUDING i_fcode.
SET TITLEBAR 'UPD_0050'.
IF g_custom_container IS INITIAL .
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'FTDATA'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container.
ELSE.
CALL METHOD grid1->free.
CALL METHOD g_custom_container->free.
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'FTDATA'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container.
ENDIF.
Every time refresh The variables
PERFORM initialize.
PERFORM get_data.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZCA0FCSTFTOP'
CHANGING
ct_fieldcat = fieldcat.
grid_layout-grid_title = text-t01.
grid_layout-sel_mode = 'A'.
grid_layout-stylefname = 'CT'.
s_variant-report = sy-repid.
s_variant-username = sy-uname.
s_variant-variant = p_varant.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'ZCA0FCSTFTOP'
is_layout = grid_layout
is_variant = s_variant
i_save = 'A'
CHANGING
it_outtab = t_zca0fcstftop
it_fieldcatalog = fieldcat.
Create Object to receive events and link them to handler methods.
When the ALV Control raises the event for the specified instance
the corresponding method is automatically called.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_button_click FOR grid1.
ENDMODULE. " STATUS_0050 OUTPUT
*& Module USER_COMMAND_0050 INPUT
MODULE user_command_0050 INPUT.
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = selected_rows.
DESCRIBE TABLE selected_rows LINES t_lines.
IF t_lines > 1 .
MESSAGE e048(zcsv_sfdr).
ENDIF.
Clear Header
CLEAR wa_zca0fcstftop.
sel_rows[] = selected_rows .
READ TABLE sel_rows INDEX 1.
READ TABLE t_zca0fcstftop INTO wa_zca0fcstftop INDEX sel_rows-index.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'CREA'.
CLEAR zca0fcstftop.
ok_code = sy-ucomm.
zca0fcstftop-werks = p_werks.
CALL SCREEN 100.
WHEN 'COPY'.
MOVE wa_zca0fcstftop TO zca0fcstftop .
CLEAR wa_zca0fcstftop.
f_copy = 'X'.
CALL SCREEN 100.
WHEN 'CHNG'.
CHECK NOT wa_zca0fcstftop IS INITIAL.
MOVE wa_zca0fcstftop TO zca0fcstftop .
CLEAR wa_zca0fcstftop.
ok_code = sy-ucomm.
CALL SCREEN 100.
WHEN 'DELE'.
CHECK NOT wa_zca0fcstftop IS INITIAL.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'N'
textline1 = text-005
textline2 = text-006
titel = text-007
cancel_display = ' '
IMPORTING
answer = wg_confirm_ind.
IF wg_confirm_ind EQ 'J'.
DELETE zca0fcstftop FROM wa_zca0fcstftop .
IF sy-subrc EQ 0.
MESSAGE s004.
ELSE.
MESSAGE e005.
ENDIF.
ELSEIF wg_confirm_ind EQ 'N'.
ENDIF.
ENDCASE.
CLEAR ok_code.
ENDMODULE. " USER_COMMAND_0050 INPUT
*& Form exit_program
FORM exit_program .
CALL METHOD g_custom_container->free.
CALL METHOD cl_gui_cfw=>flush.
SET SCREEN 0.
LEAVE SCREEN.
ENDFORM. " exit_program
*& Form set_auth
FORM set_auth.
REFRESH: i_fcode.
Check authorization for change
MOVE '02' TO act_auth. "02 --> Change
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'CHNG'.
ENDIF.
Check for authorization for create
MOVE '01' TO act_auth. "01 --> Create
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'CREA'.
PERFORM fill_fcode USING 'COPY'.
ENDIF.
Check for authorization for delete
MOVE '06' TO act_auth. "06 --> Delete
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'DELE'.
ENDIF.
ENDFORM. " set_auth
*& Module check_change INPUT
MODULE check_change INPUT.
flag = 'Y'.
ENDMODULE. " check_change INPUT
regards,
vikas.
plz reward if helpful -
Display alv grids in selection screen based on the user event
Hi All,
I am workign on displaying ALV in same selection screen.I am able to display the ALV in selection screen.
But i have 2 buttons in my selection screen 'Create' and 'change'.
When i click on create i need with some type of data and when i click on 'change' my alv grid another type of data.Ex: if i click on crate mara data should be dispalyed when i click on change makt table data should be dispalyed and also i have user defined buttons are in my grids.
So i have used 2 containers to dispaly to different data.I am able to display the perfectly but the problem is first time when i click on create the grid is displaying when i click on change button the create alv grid is displaying down and change data is dispalying up.
I need only one alv grid at a time.Can anybody please let me know how can i do this.
Thanks,
TaraginiHello,
Also I would suggest if it is relevant data maintain in one interntal table and show/hide based on condition
through fieldcatalog (NO_OUT) parameter.
Thanks -
hello,
in this program there are 2 selection screens,called from MAIN screen.
DEMO_SEL_SCREEN_AS_SUBSCREEN
i want to create similar..
In main screen i will have 3 screens (which should have of screen type 'Selection screen ' ) and 1 BOX (in which I will have Table control)..
I created the main screen 0100 and 3 sub screens..(1001,1002,1003)
But when i want to create these I cannot choose Screen Type as 4 Selection screen (the other options are 1.normal 2.Subscreen 3 Modal dialog box)..
I have gone through other threads..they simply say its not possible..
then how was it done in DEMO_SEL_SCREEN_AS_SUBSCREEN..
Also i have seen Zprograms with 3 sub screens as Selection screen ...
Also interestingly the short description of this screen is
SEL_SCREEN 1100 INFO:140000140000000000000000000005490892784Hi,
This code form teh same program creates them as selection screen.
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.
PARAMETERS: p1(10) TYPE c,
p2(10) TYPE c,
p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 1100.
SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-020.
PARAMETERS: q1(10) TYPE c OBLIGATORY,
q2(10) TYPE c OBLIGATORY,
q3(10) TYPE c OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 1200.
check this out:
[http://wiki.sdn.sap.com/wiki/display/ABAP/Select-OptionsinModulePoolProgramming]
Edited by: sap_wiz on Jun 23, 2011 1:33 PM -
F4 help for timestamp on selection screen
Hi experts!
I have this code in custom ALV report:
selection-screen: begin of block b1 with frame title text-t01.
DATA: w_aux_sc_created_at like ztable-sc_created_at.
SELECT-OPTIONS s_sc_c02 for w_aux_sc_created_at.
Ztable-sc_created_at is COMT_CREATED_AT_USR (data element)
COMT_CREATED_AT_USR is standard data type (DEC, lenght 15) domain COM_TSTMP --> UTC Time Stamp Short Form (YYYYMMDDhhmmss) (Output sy-zonlo)
Ok, I would like to show a calendar for select date in my SELECT-OPTIONS custom ALV report like MATCHCODE OBJECT.
A lot of thanks in advance.
Best regards.
djlu
Moderator message: please use more descriptive subject lines from now on, changed for you this time
Edited by: Thomas Zloch on Nov 8, 2010 9:44 AMthanks you for your answer but I fixed it.
I created a select-options in date form (with F4 help) and I convert it to timestamp for my select sentence.
Regards
Maybe you are looking for
-
CS4, AS3.Windows XP SP3. I've created a pretty simple flash animation with some text that fades in and moves around a bit. Nothing fancy. It runs just fine both locally and on my client's site. I need to turn it into an animated gif so that non-flash
-
There were many updates for Acrobat Pro 9 on the website last week and I was downloading and updating my copy. (I have a version that came with a scanner so I'm not inclined to buy a new version.) Now they vanished. Are they now somewhere else?
-
[Microsoft][ODBC Driver Manager]
I am using IBM Websphere Application Server V3.5 & IBM DB2 V7 I am getting this error in creating reports. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. how can i solve this ? pls help me.
-
Logic can output video to Firewire, any chance we can convert to DVI?
Logic can output video to Firewire, any chance we can convert tbe video data in firewire to DVI and connect to a display? Thanks!
-
Spilt beer on macbook/white screen
Hello, I am in need of some help/advice. An unknown(although not too much) amount of beer got spilt onto my macbook this evening. The screen is now completley a gray/white color and that is all it does. I have as of now turned off the computer comple