Subscreen with Select-Options called from At Selection Screen event
Dear friends,
I'm trying to call a subscreen that contains a select-options, from an 'at selection screen' event, in a report program, but without sucess.
Here's go what I'm doing:
I declared a selection-screen as subscreen in my main program, and I'm calling it from a module-pool subscreen area, to make the module-pool select-options magic.
In my main report program, I have a customized status GUI with a new toolbar button and I'm handling it at the 'at selection screen' event.
What I need to do is to call the subscreen that contains the select-options when this new customized button get pressed, but when It happens, the select-option selections pop-up doesn't appear.
If I call the subscreen from the 'start-of-selection' event, it goes fine, just don't work from the 'at selection screen'.
Any ideas on how can I do it?
Thank you,
Heber
i think you should try something like this:
at selection screen.
if condition handled ....
show_popup = 'X'.
endif.
at selection screen output.
if show_popup EQ 'X.
call subscreen
endif.
Similar Messages
-
Problem in creating a Select-option im a module pool screen
I've been searching how to do a select option in a module pool screen, I've found this neat tutorial http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html
but I'm having trouble to replicate it...
I've created this conde in my TOP include
SELECTION-SCREEN BEGIN OF SCREEN 201 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 201.
and this is my screen flow code
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE pbo_200.
PROCESS AFTER INPUT.
MODULE pai.
MODULE user_command_0200.
in the screen 200 I have a subscreen area named subs
but when I do this:
MODULE pbo_200 OUTPUT.
CALL subscreen subs including sy-repid '0201'.
ENDMODULE. " pbo_200 OUTPUT
it doesn't "compile"
it gives me this error:
""." or "ID ... FIELD ..." expected after "SUBSCREEN"."
what am I missing? it seems its not recognising the "CALL SUBSCREEN" command...you can't use CALL SUBSCREEN... in any ABAP section. It is reserved to dynpro flow logic. Just add it after PROCESS BEFORE OUTPUT (and also after PROCESS AFTER INPUT).
-
Dialog programming - How to place a select-option field in a dialog screen
Hi all,
In Dialog Programming, How to place a select-option field in a dialog screen.
Kindly give me some example code...
Thanks,
Jaffer Ali.Shi Ali,
U can add select-options in ur module pool by using SELECTION-SCREEN BEGIN OF SCREEN <scrn> AS SUBSCREEN command.
check this link for reference.....
http://help.sap.com/saphelp_47x200/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm
Example Code :
DATA : ok_code TYPE sy-ucomm.
SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X',
p_rad2 RADIOBUTTON GROUP grp1,
p_rad3 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_matnr FOR mara-matnr,
s_matkl FOR mara-matkl,
s_mtart FOR mara-mtart.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 1010.
START-OF-SELECTION.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
CALL SCREEN 1010 .
ENDMODULE. "status_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
SCREEN 100 ****************
PROCESS BEFORE OUTPUT.
MODULE status_0100.
CALL SUBSCREEN sub_1010 INCLUDING sy-repid '1010'.
<b>***** where sub_1010 is name of sub-screen area</b>
PROCESS AFTER INPUT.
CALL SUBSCREEN sub_1010.
MODULE user_command_0100.
<<< REMOVED BY MODERATOR >>>
Harimanjesh AN
Edited by: Marcelo Ramos on Dec 17, 2008 7:54 PM -
Select-option + ALV on the same screen
hi,
how can we can get Select-option + ALV on the same screen.
Thanks,
Gauravhi gaurav,
Use the following code...It works...
TABLES: vbrk.
*CONSTANTS
CONSTANTS :
c_x(1) TYPE c VALUE 'X',
c_zxto TYPE vbak-auart VALUE 'ZXTO',
c_e TYPE spras VALUE 'E',
c_000000 TYPE posnr VALUE '000000',
c_ship_to TYPE parvw VALUE 'WE'. "Ship To Party
Table Types
TYPES: BEGIN OF ty_vbrk_vbrp,
vbeln TYPE vbrk-vbeln, "Billing doc
posnr TYPE vbrp-posnr, "Billing item
aubel TYPE vbrp-aubel, "Sales order
waerk TYPE vbrk-waerk, "Doc currency
mvgr1 TYPE vbrp-mvgr1, "Material group 1
mvgr3 TYPE vbrp-mvgr3, "Material group 3
mvgr4 TYPE vbrp-mvgr4, "Material group 4
matnr TYPE vbrp-matnr, "Material no
ntgew TYPE vbrp-ntgew, "Net wt
gewei TYPE vbrp-gewei, "Wt unit
kzwi1 TYPE vbrp-kzwi1, "Subtotal 1
kursk TYPE vbrp-kursk, "Exchange rate
END OF ty_vbrk_vbrp.
TYPES: BEGIN OF ty_data,
land1 TYPE vbpa-land1,
landx TYPE t005t-landx,
mvgr3 TYPE vbrp-mvgr3,
mvgr4 TYPE vbrp-mvgr4,
bezei3 TYPE tvm3t-bezei,
bezei4 TYPE tvm4t-bezei,
ntgew_tea_bag TYPE vbrp-ntgew,
ntgew_pkt_tea TYPE vbrp-ntgew,
ntgew_bulk_tea TYPE vbrp-ntgew,
kzwi1_tea_bag TYPE vbrp-kzwi1, "Subtotal 1 Tea Bag
kzwi1_pkt_tea TYPE vbrp-kzwi1, "Subtotal 1 Pkt Tea
kzwi1_bulk_tea TYPE vbrp-kzwi1, "Subtotal 1 Bulk Tea
ntgew_tot TYPE vbrp-ntgew,
kzwi1_tot TYPE vbrp-kzwi1,
line_color(4) TYPE c, "For line color
END OF ty_data.
TYPES: BEGIN OF ty_vbpa,
vbeln TYPE vbpa-vbeln,
land1 TYPE vbpa-land1,
END OF ty_vbpa.
TYPES: BEGIN OF ty_t005t,
land1 TYPE t005t-land1,
landx TYPE t005t-landx,
END OF ty_t005t.
TYPES: BEGIN OF ty_tvm3t,
mvgr3 TYPE tvm3-mvgr3,
bezei TYPE tvm3t-bezei,
END OF ty_tvm3t.
TYPES: BEGIN OF ty_tvm4t,
mvgr4 TYPE tvm4-mvgr4,
bezei TYPE tvm4t-bezei,
END OF ty_tvm4t.
DATA: it_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp,
wa_vbrk_vbrp TYPE ty_vbrk_vbrp,
it_vbpa TYPE STANDARD TABLE OF ty_vbpa,
wa_vbpa TYPE ty_vbpa,
it_data TYPE STANDARD TABLE OF ty_data,
wa_data TYPE ty_data,
it_t005t TYPE STANDARD TABLE OF ty_t005t,
wa_t005t TYPE ty_t005t,
it_tvm3t TYPE STANDARD TABLE OF ty_tvm3t,
wa_tvm3t TYPE ty_tvm3t,
it_tvm4t TYPE STANDARD TABLE OF ty_tvm4t,
wa_tvm4t TYPE ty_tvm4t.
Global data for grand total
DATA:
w_tot_ntgew_tea_bag TYPE vbrp-ntgew,
w_tot_ntgew_pkt_tea TYPE vbrp-ntgew,
w_tot_ntgew_bulk_tea TYPE vbrp-ntgew,
w_tot_ntgew_tot TYPE vbrp-ntgew,
w_tot_kzwi1_tea_bag TYPE vbrp-kzwi1,
w_tot_kzwi1_pkt_tea TYPE vbrp-kzwi1,
w_tot_kzwi1_bulk_tea TYPE vbrp-kzwi1,
w_tot_kzwi1_tot TYPE vbrp-kzwi1.
Global data definitions for ALV
DATA :
ALV Grid container
w_alv_container TYPE REF TO cl_gui_custom_container,
ALV Grid
w_alv_grid TYPE REF TO cl_gui_alv_grid,
w_layo TYPE lvc_s_layo, "For layout
wt_fieldcat TYPE lvc_t_fcat, "For field catalog
okcode TYPE okcode, "OK Code
w_to(2) TYPE c,
w_title TYPE string.
---- START OF SELECTION SCREEN -
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
Billing Date
SELECT-OPTIONS: s_fkdat FOR vbrk-fkdat MEMORY ID vf OBLIGATORY no intervals.
SELECTION-SCREEN:SKIP 1.
SELECTION-SCREEN: END OF BLOCK b1.
---- END OF SELECTION SCREEN -
---- EVENT START-OF-SELECTION -
START-OF-SELECTION.
Get billing data from Delivery header(VBRK) and item (VBRP)
PERFORM get_billing_data.
Get ship-to country
PERFORM get_ship_to_data.
Get material group description 3
PERFORM get_material_group_3.
Get material group description 4
PERFORM get_material_group_4.
Form the ALV Grid title
PERFORM form_title.
Process data
PERFORM process_data.
Populate text descriptions
PERFORM populate_description.
---- EVENT END-OF-SELECTION -
END-OF-SELECTION.
Set the text to when date high is there
IF NOT s_fkdat-high IS INITIAL.
w_to = 'to'(c16).
ENDIF.
Call the scren 9000 for ALV Display
CALL SCREEN 9000.
*& Form get_billing_data
Get billing data from Delivery header(VBRK) and item (VBRP)
& store in internal table it_vbrk_vbrp
FORM get_billing_data .
REFRESH: it_vbrk_vbrp.
Select Billing data by joining VBRK & VBRP and store in it_vbrk_vbrp
SELECT a~vbeln
b~posnr
b~aubel
a~waerk
b~mvgr1
b~mvgr3
b~mvgr4
b~matnr
b~ntgew
b~gewei
b~kzwi1
b~kursk
FROM vbrk AS a INNER JOIN vbrp AS b
ON avbeln = bvbeln
INTO TABLE it_vbrk_vbrp
WHERE a~fkdat IN s_fkdat
Consider only non-deleted document
AND fksto = space
Billing doc type should be ZXTB
AND fkart = 'ZXTB'
AND pstyv = c_zxto.
*IF sy-subrc <> 0.
*MESSAGE i999(zttl) WITH 'No data is there'(m06).
*LEAVE LIST-PROCESSING.
*ENDIF.
ENDFORM. " get_billing_data
*& Form get_ship_to_data
Get Ship-To party data
FORM get_ship_to_data .
DATA: l_it_vbpa TYPE STANDARD TABLE OF ty_vbpa.
REFRESH: it_vbpa, it_t005t.
IF NOT it_vbrk_vbrp[] IS INITIAL.
SELECT vbeln
land1
FROM vbpa
INTO TABLE it_vbpa
FOR ALL ENTRIES IN it_vbrk_vbrp
WHERE vbeln = it_vbrk_vbrp-aubel
AND posnr = c_000000
AND parvw = c_ship_to.
IF sy-subrc <> 0.
MESSAGE i999(zttl) WITH 'Exporter country not maintained'(m02).
LEAVE LIST-PROCESSING.
ELSE.
SORT it_vbpa BY vbeln.
Create an unique and sorted driver table
l_it_vbpa[] = it_vbpa[].
SORT l_it_vbpa BY land1.
DELETE ADJACENT DUPLICATES FROM l_it_vbpa COMPARING land1.
IF NOT l_it_vbpa[] IS INITIAL.
Get the country description from T005t table
SELECT land1
landx
FROM t005t
INTO TABLE it_t005t
FOR ALL ENTRIES IN l_it_vbpa
WHERE spras = c_e
AND land1 = l_it_vbpa-land1.
IF sy-subrc = 0.
SORT it_t005t BY land1.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " get_ship_to_data
*& Form get_material_group_3
Get material group 3
FORM get_material_group_3 .
DATA: l_it_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp.
REFRESH: it_tvm3t.
Create an unique and sorted driver table
l_it_vbrk_vbrp[] = it_vbrk_vbrp[].
SORT l_it_vbrk_vbrp BY mvgr3.
DELETE ADJACENT DUPLICATES FROM l_it_vbrk_vbrp COMPARING mvgr3.
IF NOT l_it_vbrk_vbrp[] IS INITIAL.
SELECT mvgr3
bezei
FROM tvm3t
INTO TABLE it_tvm3t
FOR ALL ENTRIES IN l_it_vbrk_vbrp
WHERE mvgr3 = l_it_vbrk_vbrp-mvgr3.
IF sy-subrc = 0.
SORT it_tvm3t BY mvgr3.
ENDIF.
ENDIF.
ENDFORM. " get_material_group_3
*& Form get_material_group_4
Get material group 4
FORM get_material_group_4 .
DATA: l_it_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp.
REFRESH: it_tvm4t.
Create an unique and sorted driver table
l_it_vbrk_vbrp[] = it_vbrk_vbrp[].
SORT l_it_vbrk_vbrp BY mvgr4.
DELETE ADJACENT DUPLICATES FROM l_it_vbrk_vbrp COMPARING mvgr4.
IF NOT l_it_vbrk_vbrp[] IS INITIAL.
SELECT mvgr4
bezei
FROM tvm4t
INTO TABLE it_tvm4t
FOR ALL ENTRIES IN l_it_vbrk_vbrp
WHERE mvgr4 = l_it_vbrk_vbrp-mvgr4.
IF sy-subrc = 0.
SORT it_tvm4t BY mvgr4.
ENDIF.
ENDIF.
ENDFORM. " get_material_group_4
*& Form process_data
Process the data and do summation and populate final display table
FORM process_data .
LOOP AT it_vbrk_vbrp INTO wa_vbrk_vbrp.
CLEAR: wa_data, wa_vbpa.
READ TABLE it_vbpa INTO wa_vbpa WITH KEY
vbeln = wa_vbrk_vbrp-aubel
BINARY SEARCH.
IF sy-subrc = 0.
wa_data-land1 = wa_vbpa-land1.
ENDIF.
wa_data-mvgr3 = wa_vbrk_vbrp-mvgr3.
wa_data-mvgr4 = wa_vbrk_vbrp-mvgr4.
Do an unit conversion of the quamtity
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = wa_vbrk_vbrp-ntgew
NO_TYPE_CHECK = 'X'
ROUND_SIGN = ' '
unit_in = wa_vbrk_vbrp-gewei
unit_out = 'TO' "Metric tonn
IMPORTING
output = wa_vbrk_vbrp-ntgew
EXCEPTIONS
conversion_not_found = 1
division_by_zero = 2
input_invalid = 3
output_invalid = 4
overflow = 5
type_invalid = 6
units_missing = 7
unit_in_not_found = 8
unit_out_not_found = 9
OTHERS = 10.
IF sy-subrc <> 0.
wa_vbrk_vbrp-ntgew = wa_vbrk_vbrp-ntgew.
ENDIF.
Convert the currency from Customer currency to local
currency by multiplying with kursk
wa_vbrk_vbrp-kzwi1 = wa_vbrk_vbrp-kzwi1 * wa_vbrk_vbrp-kursk.
Convert the amount to Lacks by dividing with 100000
wa_vbrk_vbrp-kzwi1 = wa_vbrk_vbrp-kzwi1 / 100000. "DV1K905028
When MVGR1 is between A to F use the amount as TEA_BAG
IF wa_vbrk_vbrp-mvgr1 BETWEEN 'A' AND 'F'.
wa_data-ntgew_tea_bag = wa_vbrk_vbrp-ntgew.
wa_data-kzwi1_tea_bag = wa_vbrk_vbrp-kzwi1.
ENDIF.
When MVGR1 is between G to L use the amount as TEA_BAG
IF wa_vbrk_vbrp-mvgr1 BETWEEN 'G' AND 'L'.
wa_data-ntgew_pkt_tea = wa_vbrk_vbrp-ntgew.
wa_data-kzwi1_pkt_tea = wa_vbrk_vbrp-kzwi1.
ENDIF.
When MVGR1 is between G to L use the amount as TEA_BAG
IF wa_vbrk_vbrp-mvgr1 = 'M'.
wa_data-ntgew_bulk_tea = wa_vbrk_vbrp-ntgew.
wa_data-kzwi1_bulk_tea = wa_vbrk_vbrp-kzwi1.
ENDIF.
COLLECT wa_data INTO it_data.
ENDLOOP.
ENDFORM. " process_data
*& Form populate_description
Populate the description fields
FORM populate_description .
LOOP AT it_data INTO wa_data.
CLEAR: wa_t005t.
READ TABLE it_t005t INTO wa_t005t WITH KEY land1 = wa_data-land1
BINARY SEARCH.
IF sy-subrc = 0.
wa_data-landx = wa_t005t-landx.
ENDIF.
Read description of Material group 3
CLEAR wa_tvm3t.
READ TABLE it_tvm3t INTO wa_tvm3t WITH KEY
mvgr3 = wa_data-mvgr3
BINARY SEARCH.
IF sy-subrc = 0.
wa_data-bezei3 = wa_tvm3t-bezei.
ENDIF.
Read description of Material group 4
CLEAR wa_tvm4t.
READ TABLE it_tvm4t INTO wa_tvm4t WITH KEY
mvgr4 = wa_data-mvgr4
BINARY SEARCH.
IF sy-subrc = 0.
wa_data-bezei4 = wa_tvm4t-bezei.
ENDIF.
Get the grand totals
wa_data-ntgew_tot = wa_data-ntgew_tea_bag
+ wa_data-ntgew_pkt_tea
+ wa_data-ntgew_bulk_tea.
wa_data-kzwi1_tot = wa_data-kzwi1_tea_bag
+ wa_data-kzwi1_pkt_tea
+ wa_data-kzwi1_bulk_tea.
MODIFY it_data FROM wa_data TRANSPORTING landx
bezei3
bezei4
ntgew_tot
kzwi1_tot.
Summattion of grand totals
w_tot_ntgew_tea_bag = w_tot_ntgew_tea_bag + wa_data-ntgew_tea_bag.
w_tot_ntgew_pkt_tea = w_tot_ntgew_pkt_tea + wa_data-ntgew_pkt_tea.
w_tot_ntgew_bulk_tea = w_tot_ntgew_bulk_tea + wa_data-ntgew_bulk_tea.
w_tot_ntgew_tot = w_tot_ntgew_tot + wa_data-ntgew_tot.
w_tot_kzwi1_tea_bag = w_tot_kzwi1_tea_bag + wa_data-kzwi1_tea_bag.
w_tot_kzwi1_pkt_tea = w_tot_kzwi1_pkt_tea + wa_data-kzwi1_pkt_tea.
w_tot_kzwi1_bulk_tea = w_tot_kzwi1_bulk_tea + wa_data-kzwi1_bulk_tea.
w_tot_kzwi1_tot = w_tot_kzwi1_tot + wa_data-kzwi1_tot.
ENDLOOP.
Append a grand Total row at the end
CLEAR wa_data.
wa_data-landx = 'Grand Total:'.
wa_data-ntgew_tea_bag = w_tot_ntgew_tea_bag.
wa_data-ntgew_pkt_tea = w_tot_ntgew_pkt_tea.
wa_data-ntgew_bulk_tea = w_tot_ntgew_bulk_tea.
wa_data-ntgew_tot = w_tot_ntgew_tot.
wa_data-kzwi1_tea_bag = w_tot_kzwi1_tea_bag.
wa_data-kzwi1_pkt_tea = w_tot_kzwi1_pkt_tea.
wa_data-kzwi1_bulk_tea = w_tot_kzwi1_bulk_tea.
wa_data-kzwi1_tot = w_tot_kzwi1_tot.
wa_data-line_color = 'C310'.
APPEND wa_data TO it_data.
ENDFORM. " populate_description
*& Module STATUS_9000 OUTPUT
Initialise PF-STATUS and title
MODULE status_9000 OUTPUT.
SET PF-STATUS 'MAIN9000'.
SET TITLEBAR 'TITLE_9000'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module initialize_9000 OUTPUT
text
MODULE initialize_9000 OUTPUT.
Call the ALV grid to display data
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE text-001.
Billing Date
SELECT-OPTIONS: s_fkdat1 FOR vbrk-fkdat MEMORY ID vf OBLIGATORY NO-EXTENSION.
SELECTION-SCREEN:SKIP 1.
SELECTION-SCREEN: END OF BLOCK B2.
PERFORM display_alv_grid.
ENDMODULE. " initialize_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
Module to handle User Command
MODULE user_command_9000 INPUT.
CASE okcode.
WHEN 'BACK'.
SET SCREEN 0.
CLEAR okcode.
LEAVE SCREEN.
WHEN 'CANCEL'.
SET SCREEN 0.
CLEAR okcode.
LEAVE SCREEN.
WHEN 'EXIT'.
CLEAR okcode.
LEAVE PROGRAM.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Form display_alv_grid
Display the data in ALV Grid
FORM display_alv_grid .
IF w_alv_container IS INITIAL.
Create the alv container object
CREATE OBJECT w_alv_container
EXPORTING
container_name = 'ALV_GRID'
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 e999(zttl) WITH 'Problem in ALV display'(t04).
ENDIF.
Create the ALV grid object. The parent is the ALV container
CREATE OBJECT w_alv_grid
EXPORTING
i_parent = w_alv_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e999(zttl) WITH 'Problem in ALV display'(t04).
ENDIF.
This subrotine creates the field catalog and
store in internal table lt_fieldcat
PERFORM prepare_fieldcat CHANGING wt_fieldcat.
Layout design
w_layo-no_toolbar = ''.
Not to allow totaling feature
w_layo-no_totline = c_x.
Report title
w_layo-grid_title = text-004.
w_layo-grid_title = w_title.
w_layo-zebra = c_x. "Alternating line color (striped)
w_layo-cwidth_opt = c_x. "Optimize column width
w_layo-sel_mode = 'A'. "Selection Mode
Name of the color field
w_layo-info_fname = 'LINE_COLOR'."For row color
Call the method to display the data in ALV grid
CALL METHOD w_alv_grid->set_table_for_first_display
EXPORTING
i_save = 'A'
is_layout = w_layo
CHANGING
it_outtab = it_data[]
it_fieldcatalog = wt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e999(zttl) WITH text-t04.
ENDIF.
ELSE.
If the container & grid object is alreadt there reuse them
CALL METHOD w_alv_grid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e999(zttl) WITH text-t04.
ENDIF.
ENDIF.
IF okcode = 'CANCEL'.
EXIT.
ENDIF.
ENDFORM. " display_alv_grid
*& Form prepare_fieldcat
Prepare the list of fields to be displayed *
<--P_WT_FIELDCAT text
FORM prepare_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA : lx_fcat TYPE lvc_s_fcat.
REFRESH: pt_fieldcat.
**List of fields to be displayed should be added in pt_fieldcat
Customer PO no
CLEAR lx_fcat.
lx_fcat-fieldname = 'LANDX'.
lx_fcat-ref_field = 'T005T'.
lx_fcat-ref_table = 'T005T'.
lx_fcat-coltext = 'Market Name'(c01).
lx_fcat-seltext = text-c01.
APPEND lx_fcat TO pt_fieldcat.
Flavour type
CLEAR lx_fcat.
lx_fcat-fieldname = 'BEZEI3'.
lx_fcat-ref_field = 'BEZEI'.
lx_fcat-ref_table = 'TVM3'.
lx_fcat-coltext = 'Flavour Type'(c02).
lx_fcat-seltext = text-c02.
APPEND lx_fcat TO pt_fieldcat.
Tea type
CLEAR lx_fcat.
lx_fcat-fieldname = 'BEZEI4'.
lx_fcat-ref_field = 'BEZEI4'.
lx_fcat-ref_table = 'TVM4'.
lx_fcat-coltext = 'Tea Type.'(c03).
lx_fcat-seltext = text-c03.
APPEND lx_fcat TO pt_fieldcat.
Tea Bag Quantity in KG
CLEAR lx_fcat.
lx_fcat-fieldname = 'NTGEW_TEA_BAG'.
lx_fcat-ref_field = 'NTGEW'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'Tea Bag(MT)'(c04).
lx_fcat-seltext = text-c04.
APPEND lx_fcat TO pt_fieldcat.
PKT Tea Quantity in KG
CLEAR lx_fcat.
lx_fcat-fieldname = 'NTGEW_PKT_TEA'.
lx_fcat-ref_field = 'NTGEW'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'PKT Tea(MT)'(c05).
lx_fcat-seltext = text-c05.
APPEND lx_fcat TO pt_fieldcat.
Bulk Tea Quantity in MT
CLEAR lx_fcat.
lx_fcat-fieldname = 'NTGEW_BULK_TEA'.
lx_fcat-ref_field = 'NTGEW'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'Bulk Tea(MT)'(c06).
lx_fcat-seltext = text-c06.
APPEND lx_fcat TO pt_fieldcat.
Total Quantity in MT
CLEAR lx_fcat.
lx_fcat-fieldname = 'NTGEW_TOT'.
lx_fcat-ref_field = 'NTGEW'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'Total(MT)'(c07).
lx_fcat-seltext = text-c07.
APPEND lx_fcat TO pt_fieldcat.
Tea Bag Quantity in KG
CLEAR lx_fcat.
lx_fcat-fieldname = 'KZWI1_TEA_BAG'.
lx_fcat-ref_field = 'KZWI1'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'Tea Bag(FOB-Lacs)'(c08).
lx_fcat-seltext = text-c08.
APPEND lx_fcat TO pt_fieldcat.
PKT Tea Price in Lakh
CLEAR lx_fcat.
lx_fcat-fieldname = 'KZWI1_PKT_TEA'.
lx_fcat-ref_field = 'KZWI1'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'PKT Tea(FOB-Lacs)'(c09).
lx_fcat-seltext = text-c09.
APPEND lx_fcat TO pt_fieldcat.
PKT Tea Quantity in KG
CLEAR lx_fcat.
lx_fcat-fieldname = 'KZWI1_BULK_TEA'.
lx_fcat-ref_field = 'KZWI1'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'Bulk Tea(FOB-Lacs)'(c10).
lx_fcat-seltext = text-c10.
APPEND lx_fcat TO pt_fieldcat.
Total amount
CLEAR lx_fcat.
lx_fcat-fieldname = 'KZWI1_TOT'.
lx_fcat-ref_field = 'KZWI1'.
lx_fcat-ref_table = 'VBRP'.
lx_fcat-coltext = 'Total(FOB-Lacs)'(c11).
lx_fcat-seltext = text-c11.
APPEND lx_fcat TO pt_fieldcat.
ENDFORM. " prepare_fieldcat
*& Form form_title
Form the ALV Title
FORM form_title .
DATA: l_date(10) TYPE c.
CONCATENATE s_fkdat-low6(2) s_fkdat-low4(2) s_fkdat-low(4)
INTO l_date SEPARATED BY '/'.
CONCATENATE 'TTD - Statement of Export' '-From' l_date INTO
w_title SEPARATED BY space.
CLEAR l_date.
IF NOT s_fkdat-high IS INITIAL.
CONCATENATE s_fkdat-high6(2) s_fkdat-high4(2) s_fkdat-high(4)
INTO l_date SEPARATED BY '/'.
CONCATENATE w_title 'to' l_date INTO w_title SEPARATED BY space.
ENDIF.
ENDFORM. " form_title -
Select-Option F4 Help Multiple Selection
Hi
I have wriiten the code to provide custom F4 help for a field using F4IF_INT_TABLE_VALUE_REQUEST' and then updating the values back to screen using Function Module DYNP_VALUES_UPDATE.
It is working fine when the F4 is used on the main screen, But when i click on the multiple selection button and press F4, i do get the F4 values list, but selected value is not getting passed back to the field.
I guess the issue is the field name changes in the multiple section option, Please suggest how can i fix it.
*& Form update_date_bATCH
Updating the sel_screen with the retrieved values
FORM update_date_batch USING pt_filename pt_fieldvalue.
Rundate
st_dyn_fields-fieldname = pt_filename.
st_dyn_fields-fieldvalue = pt_fieldvalue.
APPEND st_dyn_fields TO it_dyn_fields.
Function Module to update the screen with the values retrieved
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = it_dyn_fields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE i006(zffi).
ENDIF.
ENDFORM. " update_new_date_timeYou have added the F4 to a select-option for areport and would like to get the F4 values back into the select-option, when the user selects multiple values?
If this is the case you have to fill the internal table behind the select-option and this will have to based on waht the user selected.
The first value will go on to the screen the way you have done it.
If this is what you want to do?
Rene -
Selection-options on a module pool screen
Hi all,
How to define a field as selection-options on a module pool screen.
Thanks,
ChuongHi Chuong,
You will need to define the screen as a selection screen..
Else, you can define a subscreen area in your screen, define a subscreen as selection screen and call that screen here..
Thanks and Best Regards,
Vikas Bittera. -
Error while using selection option variable in the selection screen
Hi All,
I am facing an issue while using selection option variable in the selection screen for one of my reports.
Scenario: For the field "Region From" we need to have wild card logic () in tes selection screen, for example if we put "BE" in the selection screen for the field Region From then the query should be executed only for those "Region From" values which begin from "BE".
Approach: For the above requirement I have made a selection option variable for "Region From". This allows use wild card
But when the report is executed we get the following error:
"System error in program CL_RSR_REQUEST. Invalid filter on ETVRGNFR".
(ETVRGNFR is technical name of the info object Region From)
Though the report is executed it displays all the values for the field "Region From" irrespective of the selection given in the selection screen.
Please give suggestions / alternate solutions to crack this issue.
Thanks in advance
Regards
Priyanka.Hi,
Try to use a variable of type Customer Exit and do the validation inside the exit to display according to your request.
This is just my view, i am not sure if u are already using this or Char. Variable.
Cheers.
Ranga. -
everytime i link my iphone up to my laptop the message 'welcome to your new iphone' with the option restore from back up or new iphone. i once did restore from back up and it deleted all my recent pictures, music etc. how can i get pass this stage?
Hi Khuram1981 - thank you thank you thank you! All sorted! dont suppose you know how to fix another problem I have??? for weeks now, since updating to ios5 I think, for some reason every time I have tried to log onto app store it says CANNOT CONNECT TO ITUNES STORE. It's nothing to do with my computer, and I've been to the Geniius bar but they couldnt help and nothing I seem to do lets me update my Apps and even worse, I cant even buy any more. Any suggestions?
Again thank you SO much for helping with other problem = a real relief.
Chatterwind xx -
How to validate a select-option field on the selection- screen
Hi,
I need to validate a selection-option field in the selection-screen.
Requirement is : i need to read each of customer number one by one and validateCan you please me in achieving this.
Best Regards
Mamatha.Bhi,
chk this sample code.
SELECT-OPTIONS : s_kunnr for kna1-kunnr.
AT SELECTION-SCREEN.
if 'S_KUNNR-HIGH' = "condition
"put your required validation here
endif.
rgds
Anver
Message was edited by:
Anversha s -
In iOS 7 you can still make calls from the locked screen. Just swipe the missed call numbers to the right. Is this a bug?
How is it a security breach? You're free to turn off lock screen notifications for the phone app so that no one can do that.... even if they can, they can only call the number that called you... nothing else. (well, except for 900 or whatever the emergency services number is where you are, but that's required by law).
-
I am calling a function from a SELECT statement. I want to call this function 3 times in the same select statement, to get 3 different levels in a hierarchy for a particular licence number. This function has a hierarchy query using a START WITH.. CONNECT BY clause and a SYS_CONNECT_BY_PATH function to get the full hierarchy path in the SELECT clause. Then the SUBSTR/INSTR functions are used to get the 1st, 2nd or 3rd element in the hierarchy.
The query is now running very slowly. Is there a better way of doing this -- should I just use in-line views in the SQL statement. Am I trying to do something stupid!!?a) you are calling the PL/SQL engine from the SQL engine 3 times for every row of data you are processing. This WILL have a performance impact.
b) If you can do something purely in SQL then do it that way as this will be the most peformant.
If you post an example of your data (provide us with CREATE TABLE/INSERTs or WITH statement) and an example of what you are trying to get as output then we may be able to help. -
How to catch the select-options value in AT SELECTION-SCREEN event?
Hi,all
This is my code:
SELECT-OPTIONS: P_BUKRS FOR T012-BUKRS.
PARAMETERS: P_BNKA TYPE BANKA.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BNKA.
select single bankl from bnka where bukrs = p_bukrs.
Last statement failed because p_bukrs was null.
So, How can I got the value of p_bukrs in AT SELECTION-SCREEN event?Hi Jie,
try following code.
REPORT zanu_test.
TABLES : t012.
PARAMETERS: p_bukrs LIKE t012-bukrs.
PARAMETERS: p_bnka TYPE banka.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bnka.
DATA: BEGIN OF dynpfields OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
*--- IT for changing fields on the screen
DATA : t_dynp_flds LIKE dynpread OCCURS 0 WITH HEADER LINE,
t_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
DATA: l_bukrs LIKE t012-bukrs.
DATA: BEGIN OF it_bank OCCURS 0,
banka LIKE bnka-banka,
END OF it_bank.
DATA: l_tabix LIKE sy-tabix.
dynpfields-fieldname = 'P_BUKRS'. APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = 'ZANU_TEST'
dynumb = sy-dynnr
TABLES
dynpfields = dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
IF sy-subrc EQ 0.
MOVE dynpfields-fieldvalue TO l_bukrs.
ENDIF.
ELSE.
EXIT.
ENDIF.
SELECT b~banka INTO CORRESPONDING FIELDS OF TABLE it_bank
FROM t012 AS a
INNER JOIN bnka AS b
ON abanks = bbanks AND abankl = bbankl
WHERE a~bukrs = l_bukrs.
CLEAR l_tabix.
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 85
endpos_row = 20
startpos_col = 50
startpos_row = 10
titletext = text-035
IMPORTING
choise = l_tabix
TABLES
valuetab = it_bank
EXCEPTIONS
break_off = 1
OTHERS = 2.
IF sy-subrc EQ 0.
READ TABLE it_bank INDEX l_tabix.
IF sy-subrc EQ 0.
*--- Clear IT t_dynp_flds
CLEAR : t_dynp_flds,
t_dynp_flds[].
*--- Append screen values
t_dynp_flds-fieldname = 'P_BNKA'.
t_dynp_flds-fieldvalue = it_bank-banka.
APPEND t_dynp_flds.
CLEAR t_dynp_flds.
ENDIF.
ENDIF.
*--- Change screen field contents w/o PBO
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'ZANU_TEST'
dynumb = sy-dynnr
TABLES
dynpfields = t_dynp_flds
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
START-OF-SELECTION.
-Anu -
SELECT-OPTIONS in Module Pool Sub-Screen
Hi,
I have been working on a Module-Pool Development, in the header portion of the Screen, I have provided a Selection-Screen as a Sub-Screen because the requirement specifies to display a SELECT-OPTION in the Header Area.
Now the problem is that, when working with the Screen, as soon as I press <ENTER> the Main Screen re-calls the Selection-Screen in the Sub-Screen area and all the entries made in the Selection-Screen are reset/erased.
Kindly provide a solution either to stop the <ENTER> action to re-call the sub-screen. Or on any alternate method(s) to provide a SELECT-OPTION on a Module Pool based Screen UI.
MAIN SCREEN Code:
* PROCESS BEFORE OUTPUT
PROCESS BEFORE OUTPUT.
*~ Set PF-STATUS and TiTLE for Screen 100
MODULE status_0100.
*~ Call the Subscreen Dynamically
CALL SUBSCREEN subscr1 INCLUDING sy-cprog gv_dynnr1.
CALL SUBSCREEN subscr2 INCLUDING sy-cprog gv_dynnr2.
* PROCESS AFTER INPUT
PROCESS AFTER INPUT.
*~ Handle the Exit Commands of Screen 100
MODULE user_command_0100 AT EXIT-COMMAND.
*~ Handle the User Command(s) for screen 100
MODULE user_action_0100.
CALL SUBSCREEN subscr1.
CALL SUBSCREEN subscr2.
So whenever <ENTER> is pressed, the PBO re-calls:
CALL SUBSCREEN subscr1 INCLUDING sy-cprog gv_dynnr1.
and the Selection-Screen is reset.
Regards,
Nishant Nayyar.Haii Nishant,
This problem was earlier solved by one of the members and after going through it i have now created a select-option in the Subscreen. Just create two input fields, name them as if they were low and high (for convinience as in case of select-option).
U now need to create a table of type rstabfield.
Ex: gt_rstab_bukrs type rstabfield.
Now create a button and assign a Fcode for it. When you click on this button then u need to implement the ranges functionality as in select-option. For that use the following function module:
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
TITLE = ' '
TEXT = ''
SIGNED = 'X'
SEARCH_HELP = 'H_T001'
TAB_AND_FIELD = gt_rstab_bukrs
TABLES
RANGE = rg_bukrs1.
Hope it helps.
Best Regards,
rama -
Collective search on the Select-options field on the selection screen
Hello experts,
I have a Y program and a selection screen for it. I have to get the BKPF-BELNR in the search help list. Since the table is too bulky to get all the documents form it. I thought I might need a condition of company code for fetching the documents. I have company code on the selection screen, but if I press F4, on the BELNR, my select-options internal table for <b>company code</b> is remains initial. I think for F4 events the values doesn't get populated in the internal tables, not sure.
Can you tell me, how to get the company code entered on the selection screen, on the F4 event. Or If this doesn't work, will collective search help solve my problem? If yes, Please let me know, which function module I can use to add a collective search to my select-options on the selection screen.
Thanks,
Ganesh Khumse.
Points will be rewarded!Hi
do like this
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
***********SELECTION SCREEN DESIGN***********************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
**********END OF SELECTION SCREEN DESIGN*****************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'OBJID'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 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.
ENDIF. -
How to create the select option for the Plant in screen (Module pool)
HI,
I am developing one module pool program and I have below requirement,
currently plant is acting like PARAMETER and the now it should be changed to select option.
how to create the select option in the screen
Thanks and regarding,
Malla
Moderator message - Cross post locked
Edited by: Rob Burbank on Dec 16, 2009 1:41 PMSteps to get SELECT-OPTIONS in module pool programs.
1.Start one dialog program with SAPMZ_001.
Place the below code in the TOP include of the dialog program.
TABLES marc.
SELECTION-SCREEN BEGIN OF SCREEN 3200 AS SUBSCREEN.
SELECT-OPTIONS: werks FOR marc-werks.
SELECTION-SCREEN END OF SCREEN 3200.
2 .Create one screen 3000.
Go to Layout of the screen and Define subscreen area on the screen and Name it as l_subscreen.
Place the below code in the Flow logic of the screen.
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN l_subscreen INCLUDING 'SAPMZ_001' '3200'.
PROCESS AFTER INPUT.
CALL SUBSCREEN l_subscreen.
Activate all.
Create Transaction code for the dialog program .
Execute the transaction code. You will see the select-option for werks how we see on Selection-screen.
Maybe you are looking for
-
Need to Generate sequence of dates
Hi, Given a Date as sysdate and any number like 10 and we need to generate a sequence of days with an interval on one month. we can consider sysdate '25-may-2012' and 10 as inputs to the function and the output need to be something like this. else a
-
SearchIndex Engine to be set for Secure Enterprise Search
Hi All, I have installed SES on my server. Now i want to integrate the same with my UCM. I have also enabled the inbuilt SESCrawler component. I want to know that which SearchEngine will work for the SES to integrate. As with DATABASE FULLTEXT search
-
HELP!!! Font Book crashed my OS, I only get my desktop image on startup
I was importing a large folder of fonts into Font Book, which apparently couldn't handle it and froze, I force-powered it down and now anytime I start up, I get my desktop image and my cursor moves but I get no menu options or anything but a search i
-
Asignacin de almacen a articulos vía Data transfer
Hola tengo el siguiente problema, cargue vía Data Transfer los articulos, en parametrizaciones generales- inventarios no marqué la opcion "Añadir automaticamente todos los almacenes al articulo", pues los almacenes son locales fisicos independiente
-
We have been making PDF and using the security so they can be viewed online ans notr printed or downloaded. This function works great for Adobe Reader Users. We have now found if someone uses Adobe Acrobat Pro 9 or CS 5.5 (Adobe 10) they have a save