Dynamic Parameters in the Selection screen
Hi,
I want to have a pair of Parameters (Source & Target Field) in the Selection Screen. Is it possible to create more pairs of Parameters by click of a Button or something else?
Sinan
hi,
Dynamic generation of selection-screen is bit confusing.
I have a sample program which takes an integer as an input. After giving input, click on the button on selection screen. You can make a similar logic in your case also.
Create a program with name 'Z_13317_DYN_CHKBOX' and paste the following code in it. Also make ensure that an include with name 'Z_13317_DYN_INCL' is not existing earlier because this program will be overwritten each and everytime.
Suppose, if you have given 3 as input and if you have clicked the button, then 3 checkboxes will be generated on your selection screen.
REPORT Z_13317_DYN_CHKBOX.
types :begin of t_itab1,
line(72),
end of t_itab1.
data: incl type table of t_itab1 with header line.
parameters: p_tab type i,
p_frst type c no-display.
selection-screen begin of line.
selection-screen: pushbutton 2(20) but1 user-command cli1.
selection-screen end of line.
include z_13317_dyn_incl if found.
initialization.
at selection-screen output.
if p_frst = ' '.
p_frst = 'X'.
perform crt_dyn_incl.
endif.
at selection-screen.
case sy-ucomm.
when 'CLI1'.
perform crt_dyn_incl.
endcase.
*& Form crt_dyn_incl
* text
form crt_dyn_incl .
perform populate_incl.
perform del_incl.
insert report 'Z_13317_DYN_INCL' from incl.
commit work.
submit z_13317_dyn_chkbox via selection-screen with p_frst = p_frst.
endform. " crt_dyn_incl
*& Form del_incl
* text
form del_incl .
call function 'RS_DELETE_PROGRAM'
exporting
program = 'Z_13317_DYN_INCL'
suppress_checks = 'X'
suppress_popup = 'X'
with_cua = ' '
with_documentation = ' '
with_dynpro = 'X'
with_includes = ' '
with_textpool = ' '
with_variants = ' '
if sy-subrc <> 0.
endif.
endform. " del_incl
*& Form populate_incl
* text
form populate_incl .
data: v_cnt type n.
do p_tab times.
v_cnt = v_cnt + 1.
incl-line = 'parameters: '.
concatenate incl-line 'p_chk' v_cnt into incl-line.
concatenate incl-line 'as checkbox.' into incl-line separated by space.
append incl.
clear incl.
enddo.
endform. " populate_incl
Regards
Sailaja.
Similar Messages
-
How to display the dynamic text in the selection screen
Hi All,
I want to display the dynamic text in the selection screen .... ( I searched in forums , didnt get the any answer fot this sort of qustion ).....
EX: If i have the date of today 31st it has to show message like " today date is 31 like some thing " when i execute the report .
Could any one face this sort of requirment, Please let me know.
Thanks in advance.
Reagrds,
BharaniWhere would you like this dynamic text being displayed? As an "message" or in some parameter field?
If first
parameters date type d.
data: text type string.
at selection-screen.
concatenate 'Today is' date into text.
message text type 'I'.
If second
parameters pa_text type c length 50.
at selection-screen on date.
if date is not initial.
concatenate 'Today is' date into pa_text.
enidf.
at selection-screen output.
"show it as read only
loop at screen.
if screen-name = 'PA_TEXT'.
screen-input = abap_false.
modify screen.
endif.
endloop.
Regards
Marcin -
Too many Parameters in the Selection Screen
Hi all,
I have a requirement to include too many parameters in the selection screen. Let me explain the scenario.
1. There is an option for Output File name previously. But now i need to provide fields for 5 to 8 file names in the same Selection Screen.
2. There will be 8 more check boxes coming to the selection screen. Could you please provide me the best & Optimal way to incorporate them in the same selection screen.
Already the screen is overcrowded with many fields & What need is that 'Is there any option to utilise the Screen at most without using Tab Strip?'
Pleas Help me in this crucial regard.
Thanks & Best Regards,
VishnuHi,
Use the below logic.
selection-screen: begin of block blk1 with frame.
selection-screen: begin of line.
parameters: p_chk1 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm1.
selection-screen position 10.
parameters: p_file1 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk2 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm2.
selection-screen position 10.
parameters: p_file2 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk3 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm3.
selection-screen position 10.
parameters: p_file3 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk4 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm4.
selection-screen position 10.
parameters: p_file4 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk5 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm5.
selection-screen position 10.
parameters: p_file5 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk6 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm6.
selection-screen position 10.
parameters: p_file6 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk7 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm7.
selection-screen position 10.
parameters: p_file7 like rlgrap-filename.
selection-screen: end of line.
selection-screen: begin of line.
parameters: p_chk8 as checkbox.
SELECTION-SCREEN COMMENT 4(5) comm8.
selection-screen position 10.
parameters: p_file8 like rlgrap-filename.
selection-screen: end of line.
selection-screen: end of block blk1.
initialization.
comm1 = 'File1'.
comm2 = 'File2'.
comm3 = 'File3'.
comm4 = 'File4'.
comm5 = 'File5'.
comm6 = 'File6'.
comm7 = 'File7'.
comm8 = 'File8'. -
How to remove the underline in the parameters in the selection screen?
how to remove the underline from the parameters in the selection screen?
i came through the comment statements in the forum is there any other ways like setting some fields in the declarattion of the parameter itself?
like
parameter:p1 type string .......?I dont think there is an alternative to removing the underlines other than to go for COMMENT. In the selection texts (of text elements) we can just give the parameter name or take the standard text from dictionary, but theres no option to remove the underlines.
SELECTION-SCREEN BEGIN OF BLOCK rbg WITH FRAME TITLE tit.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-001 MODIF ID sc1.
PARAMETERS:
p_param TYPE vbak-vbeln.
SELECTION-SCREEN END OF LINE.
PARAMETERS:
p_posnr TYPE vbap-posnr.
SELECTION-SCREEN END OF BLOCK rbg. -
Input help required for parameter on the selection screen
hi all,
i have created two parameters on the selection screen.
1. deptno
2.empname
so my requirement is if i input any deptno then i should get all
the empname corresponding to that deptno in the parameter empname
ie for deptno 10 there should be f4 help for empname.
here i am pasting my code plz check where i am doing wrong--
*& Report ZTEST10
*& Developer
*& Date: &DATE
REPORT ZTEST10.
tables: zemployee1.
parameters: p_deptno like zemployee1-deptno,
p_empnam like zemployee1-empname.
Data: begin of itab occurs 0,
deptno like zemployee1-deptno,
empname like zemployee1-empname,
empno like zemployee1-empno,
end of itab.
At selection-screen on value-request for p_empnam.
select empname
from zemployee1
into corresponding fields of table itab
where deptno = p_deptno.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'empname'
PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'p_empnam'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'C'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = itab
FIELD_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.
I will award ur efforts.
Thanks
sanjeevHi Sanjeev,
If you input any deptno and you should get all the empname corresponding then first you need to use CALL FUNCTION 'DYNP_VALUES_READ'.
EXPORTING
DYNAME = sy-repid
DYNUMB = sy-dynnr
TRANSLATE_TO_UPPER = ' '
REQUEST = 'A'
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
TABLES
DYNPFIELDS = gt_dynp
declare: DATA : gt_dynp LIKE dynpread OCCURS 0.
loop at gt_dynp into wt_dynp where fieldname = 'P_SUPRID-LOW'.
lv_low = wt_dynp-fieldvalue.
endloop.
Then while selecting use this p_superid-low instead of p_deptno.
Then :
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
After this funtion module:
write:
IF sy-subrc = 0.
READ TABLE itab
INDEX 1.
'p_empnam' = return_tab-fieldval.
Declare return_tab as:
DATA: return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
Thanks,
Shweta
ENDIF. -
Parameter inactive in the selection screen of a report with logical datab.
I`m using a logical database in a report (PNP).
I need put as inactive some parameters of the selection screen. How can i do it ??? From customizing ???
ThanksHi,
Check this code..
" In screen loop You need to inactive the field.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name CS 'PNPKOKRS' OR
screen-name CS 'PNPKOSTL' OR
screen-name CS 'PNPORGEH'.
screen-active = '0'.
screen-invisible = '1'.
MODIFY SCREEN.
CLEAR screen.
ENDIF.
ENDLOOP. -
Add input parameters to ik07 selection screen..enhancement spots
hello experts,
Help required..
Please tell me how to enhance the tcode ik07 for putting the input parameters on the selection screen I think there are no badi and exits we have to use enhancement spot.
How can i... Please reply...screenshot for referenceSince i am adding a select option of type ekko-ebeln, i have to add a statement TABLE ekko.
-
Dynamic Selection option in the selection screen
Hi ,
I have a requirement like this ....
The user wants some fields to be default available in the selection screen. But they also want to be able to select the data based on additional fields (all the remaining fields ) which they want to see in the dynamic selection .
The basic list for selections should be limited to the fields listed in the specifications provided to me and the remaining fields should be made available through the dynamic selection option.
In the transaction FBL3N , this facility is provided.
Kindly help me with this..
thanks,
Sumit .Hi Sumit,
To include dynamic selection check this sample code.
TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS
TYPE-POOLS : vrm,
icon.
*SELECTION SCREEN FIELDS
TABLES : sscrfields.*GLOBAL DECLARATIONS
DATA : flag TYPE c,
tablename(10),
mmtable LIKE dd02l-tabname,
sdtable LIKE dd02l-tabname,
hrtable LIKE dd02l-tabname.*DECLARATIONS FOR SELECTION SCREEN STATUS
DATA it_ucomm TYPE TABLE OF sy-ucomm.***********SELECTION-SCREENS**********************
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.*FOR DYNAMIC DISPLAY OF MODULES
PARAMETERS : pa RADIOBUTTON GROUP rad USER-COMMAND com MODIF ID mod,
pb RADIOBUTTON GROUP rad MODIF ID rad,
pc RADIOBUTTON GROUP rad MODIF ID cad.SELECTION-SCREEN SKIP.**TO INCLUDE DYNAMIC ICONS
SELECTION-SCREEN COMMENT 2(6) text_001.*DYNAMIC LIST BOX BASED ON USER SELECTIONS
PARAMETERS one AS LISTBOX VISIBLE LENGTH 20 MODIF ID mod.
PARAMETERS two AS LISTBOX VISIBLE LENGTH 20 MODIF ID rad.
PARAMETERS three AS LISTBOX VISIBLE LENGTH 20 MODIF ID cad.SELECTION-SCREEN END OF BLOCK blk1.*DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS
SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2,
FUNCTION KEY 3.**EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY
AT SELECTION-SCREEN OUTPUT.*CLICK OF FIRST RADIO BUTTON
IF pa = 'X'.
sscrfields-functxt_01 = 'Materials Management'.
WRITE icon_plant AS ICON TO text_001.
*CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO
LOOP AT SCREEN.
IF screen-group1 = 'MOD'.
screen-intensified = '1'.
screen-active = 1.
screen-display_3d = '1'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'RAD'.
screen-intensified = '0'.
screen-active = 0.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'CAD'.
screen-intensified = '0'.
screen-active = 0.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.*CLICK OF SECOND RADIO
IF pb = 'X'.
sscrfields-functxt_02 = 'Sales And Distribution'.
WRITE icon_ws_ship AS ICON TO text_001.
LOOP AT SCREEN.
IF screen-group1 = 'RAD'.
screen-intensified = '1'.
screen-active = 1.
screen-display_3d = '1'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'MOD'.
screen-intensified = '0'.
screen-active = 0.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'CAD'.
screen-intensified = '0'.
screen-active = 0.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.*CLICK OF THIRD RADIO
IF pc = 'X'.
sscrfields-functxt_03 = 'Human Resources'.
WRITE icon_new_employee AS ICON TO text_001.
LOOP AT SCREEN.
IF screen-group1 = 'RAD'.
screen-intensified = '0'.
screen-active = 0.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'MOD'.
screen-intensified = '0'.
screen-active = 0.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'CAD'.
screen-intensified = '1'.
screen-active = 1.
screen-display_3d = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.*CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN
*WITH F8 BUTTON DISABLED APPEND : 'PRIN' TO it_ucomm,
'SPOS' TO it_ucomm,
'ONLI' TO it_ucomm. CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = it_ucomm.
**EVENT ON THE SELECTION
AT SELECTION-SCREEN.* LIST BOX ONE VALUES
CASE one.
WHEN '1'.
mmtable = 'MARC'.
WHEN '2'.
mmtable = 'MARA'.
WHEN '3'.
mmtable = 'MARD'.
WHEN '4'.
mmtable = 'MARM'.
ENDCASE.* LIST BOX TWO VALUES
CASE two.
WHEN '1'.
sdtable = 'VBAK'.
WHEN '2'.
sdtable = 'VBAP'.
WHEN '3'.
sdtable = 'VBUK'.
WHEN '4'.
sdtable = 'VBUP'.
ENDCASE.* LIST BOX THREE VALUES
CASE three.
WHEN '1'.
hrtable = 'PA0001'.
WHEN '2'.
hrtable = 'PA0006'.
WHEN '3'.
hrtable = 'PA0022'.
WHEN '4'.
hrtable = 'PA0008'.
ENDCASE.*VALUES FOR CLICK OF THE PUSHBUTTON ON APP TOOLBAR
*AND ENABLING THE BUTTONS TO PERFORM F8
CASE sscrfields-ucomm.
WHEN 'FC01'.
tablename = mmtable.
sscrfields-ucomm = 'ONLI'.
WHEN 'FC02'.
tablename = sdtable.
sscrfields-ucomm = 'ONLI'.
WHEN 'FC03'.
tablename = hrtable.
sscrfields-ucomm = 'ONLI'.
ENDCASE.*INITIALIZATION EVENT
INITIALIZATION.*VALUES ASSIGNED TO DROPDOWNLISTS IN THE SUBROUTINES
PERFORM f4_value_request_pa.
PERFORM f4_value_request_pb.
PERFORM f4_value_request_pc.*START OF SELECTION EVENT
START-OF-SELECTION.*SUBROUTINE FOR OUTPUT
PERFORM output.*&----------------------------------------------------------------*
*& Form f4_value_request_PA
* text
*SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST1
FORM f4_value_request_pa. DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values,
l_value LIKE LINE OF li_list. l_value-key = '1'.
l_value-text = 'Plant Data for Material'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '2'.
l_value-text = 'General Material Data'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '3'.
l_value-text = 'Storage Location Data for Material'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '4'.
l_value-text = 'Units of Measure for Material'.
APPEND l_value TO li_list.
CLEAR l_value.
l_name = 'ONE'. CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = li_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.ENDFORM. " f4_value_request_tabname*&----------------------------------------------------------------*
*& Form f4_value_request_PB
* text
*SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST2FORM f4_value_request_pb. DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values,
l_value LIKE LINE OF li_list. l_value-key = '1'.
l_value-text = 'Sales Document: Header Data'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '2'.
l_value-text = 'Sales Document: Item Data'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '3'.
l_value-text = 'Sales Document:Header Status'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '4'.
l_value-text = 'Sales Document: Item Status'.
APPEND l_value TO li_list.
CLEAR l_value.
l_name = 'TWO'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = li_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_value_request_PB*&----------------------------------------------------------------*
*& Form f4_value_request_PC
* text
*SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST3FORM f4_value_request_pc. DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values,
l_value LIKE LINE OF li_list. l_value-key = '1'.
l_value-text = 'HR Master :Infotype 0001 (Org. Assignment)'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '2'.
l_value-text = 'Address Infotype 0006'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '3'.
l_value-text = 'Education Infotype 0022'.
APPEND l_value TO li_list.
CLEAR l_value. l_value-key = '4'.
l_value-text = 'Basic Pay Infotype 0008'.
APPEND l_value TO li_list.
CLEAR l_value.
l_name = 'THREE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = li_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_value_request_PC
*& Form OUTPUT
* text
* -->P_TABLENAME text
*fINAL OUTPUT
FORM output. DATA p_table(10). p_table = tablename.*popup to display teh selected table and
*Continue button is clicked
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
titel = 'User Selections '
textline1 = p_table
textline2 = 'is the Selected table'
start_column = 25
start_row = 6.*assigning the table value in p_table to the
* Table in SE16 transaction by explicitly calling
SET PARAMETER ID 'DTB' FIELD p_table.
CALL TRANSACTION 'SE16'.
ENDFORM. "OUTPUT
Regards,
Manoj Kumar P -
Dynamic ALV as per the periods on the selection screen
Hello Experts
I am new to dynamic ALV , Please help me to sought out my confusion.
I want to create a dynamic ALV , based on the period mentioned at selection screen.
for example I want to display the movement type ( sum of the quantity ) for materials for the full month.
I want the ALV output as below.
Material .........qty 01.04.2011..... qty 02.04.2011... qty 03.04.2011 ........ qty 30.04.2011
AB1........................... 30.................... 20............................. 50......................... 200
AB2.................................................... 50 ............................. 80 ..........................10
I create an internal table itab with there fields to selact the data
MATNR
date
qty
select MATNR
date
qty
into itab
from mseg
where based on the selection screen.
then collect the data to other table date wise , now i have summrise data of material quantity
now the results after collection data into table itab2 is as follows
Material ................... date ................................ qty
AB1 .................... 01.04.2011....................... 30
AB1 ................... 02.04.2011 ....................... 20
AB1 ................... 03.04.2011....................... 50
AB1 ................... .30.04.2011....................... 200
AB2 .................... 02.04.2011....................... 50
AB2 ....................... 03.04.2011....................... 80
AB2 ....................... 30.04.2011 ....................... 10
How can I display these fields horizontally instead of vertically ,
and to the exact column as per the field catalog column header belongs to date.
it would be so helpful if somebody explain with code by taking the above example.
Thanks in AdvanceHello Both Experts ,
I write the below code and it is working for the requirement.
Can you please check
REPORT z_test_dynamic .
TABLES : mkpf , mseg .
TYPES : BEGIN OF t_mseg ,
mblnr TYPE mblnr ,
bwart TYPE bwart ,
matnr TYPE matnr ,
werks TYPE werks_d ,
menge TYPE menge_d ,
budat TYPE budat ,
END OF t_mseg.
TYPES : BEGIN OF t_mseg_1 ,
matnr TYPE matnr ,
menge TYPE menge_d ,
budat TYPE budat ,
END OF t_mseg_1.
DATA : gt_mseg TYPE STANDARD TABLE OF t_mseg ,
gs_mseg TYPE t_mseg,
gt_mseg_1 TYPE STANDARD TABLE OF t_mseg_1 ,
gs_mseg_1 TYPE t_mseg_1,
gt_mseg_2 TYPE STANDARD TABLE OF t_mseg_1 ,
gs_mseg_2 TYPE t_mseg_1..
DATA : gt_date TYPE STANDARD TABLE OF sy-datum ,
gs_date TYPE sy-datum..
DATA: ok_code LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'CONTAINER_01',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
DATA: gt_fieldcat TYPE lvc_t_fcat.
DATA: gp_table TYPE REF TO data.
FIELD-SYMBOLS: <gt_table> TYPE table.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR mseg-matnr ,
s_bwart FOR mseg-bwart NO INTERVALS,
s_werks FOR mseg-werks ,
s_budat FOR mkpf-budat .
PARAMETERS : p_mjahr TYPE mjahr OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b1.
PERFORM field_catalog.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fieldcat
IMPORTING
ep_table = gp_table.
ASSIGN gp_table->* TO <gt_table>.
PERFORM select_main_data.
PERFORM move_data.
*& Form select_main_data
* text
* --> p1 text
* <-- p2 text
FORM select_main_data .
SELECT mseg~mblnr
mseg~bwart
mseg~matnr
mseg~werks
mseg~menge
mkpf~budat
INTO TABLE gt_mseg
FROM mseg AS mseg INNER JOIN mkpf AS mkpf
ON mseg~mblnr = mkpf~mblnr AND
mseg~mjahr = mkpf~mjahr
WHERE matnr IN s_matnr AND
budat IN s_budat AND
werks IN s_werks AND
bwart IN s_bwart AND
mseg~mjahr EQ p_mjahr .
IF gt_mseg IS NOT INITIAL.
LOOP AT gt_mseg INTO gs_mseg.
gs_mseg_1-matnr = gs_mseg-matnr.
gs_mseg_1-budat = gs_mseg-budat.
gs_mseg_1-menge = gs_mseg-menge.
COLLECT gs_mseg_1 INTO gt_mseg_1.
ENDLOOP.
ENDIF.
gt_mseg_2 = gt_mseg_1.
DELETE ADJACENT DUPLICATES FROM gt_mseg_2 COMPARING matnr.
ENDFORM. " select_main_data
*& Form field_catalog
* text
* --> p1 text
* <-- p2 text
FORM field_catalog .
DATA : lt_day_attributes TYPE STANDARD TABLE OF casdayattr ,
ls_day_attributes TYPE casdayattr .
DATA: ls_fieldcat TYPE lvc_s_fcat ,
lv_fieldname TYPE lvc_fname.
IF s_budat-high IS INITIAL.
s_budat-high = s_budat-low.
ENDIF.
CALL FUNCTION 'DAY_ATTRIBUTES_GET'
EXPORTING
* FACTORY_CALENDAR = ' '
* HOLIDAY_CALENDAR = ' '
date_from = s_budat-low
date_to = s_budat-high
language = sy-langu
* IMPORTING
* YEAR_OF_VALID_FROM =
* YEAR_OF_VALID_TO =
* RETURNCODE =
TABLES
day_attributes = lt_day_attributes
* EXCEPTIONS
* FACTORY_CALENDAR_NOT_FOUND = 1
* HOLIDAY_CALENDAR_NOT_FOUND = 2
* DATE_HAS_INVALID_FORMAT = 3
* DATE_INCONSISTENCY = 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.
LOOP AT lt_day_attributes INTO ls_day_attributes.
gs_date = ls_day_attributes-date.
APPEND gs_date TO gt_date.
ENDLOOP.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-inttype = 'CHAR18'.
ls_fieldcat-coltext = 'MATERIAL'.
* ls_fieldcat-decimals_o = '2'.
ls_fieldcat-outputlen = 18.
APPEND ls_fieldcat TO gt_fieldcat.
LOOP AT gt_date INTO gs_date.
CONCATENATE 'QTY_' gs_date INTO lv_fieldname.
ls_fieldcat-fieldname = lv_fieldname.
ls_fieldcat-inttype = 'QUAN'.
ls_fieldcat-coltext = gs_date.
ls_fieldcat-decimals_o = '2'.
* ls_fieldcat-outputlen = 18.
APPEND ls_fieldcat TO gt_fieldcat.
ENDLOOP.
ENDFORM. " field_catalog
*& Form move_data
* text
* --> p1 text
* <-- p2 text
FORM move_data .
DATA: l_row TYPE sy-index.
FIELD-SYMBOLS: <ls_table>.
FIELD-SYMBOLS: <l_field> ,
<l_mseg_1> TYPE t_mseg_1.
DATA: ls_fieldcat TYPE lvc_s_fcat .
ASSIGN LOCAL COPY OF INITIAL LINE OF <gt_table> TO <ls_table>.
SORT gt_mseg_1 BY matnr.
LOOP AT gt_mseg_1 ASSIGNING <l_mseg_1> .
IF <l_field> IS ASSIGNED.
UNASSIGN <l_field>.
ENDIF.
MOVE-CORRESPONDING <l_mseg_1> TO <ls_table>.
READ TABLE gt_fieldcat INTO ls_fieldcat WITH KEY coltext = <l_mseg_1>-budat.
IF sy-subrc EQ 0.
ASSIGN COMPONENT ls_fieldcat-fieldname OF STRUCTURE <ls_table> TO <l_field>.
<l_field> = <l_mseg_1>-menge.
ELSE.
<l_field> = 0.
ENDIF.
AT end of matnr.
APPEND <ls_table> TO <gt_table>.
clear <ls_table>.
ENDAT.
ENDLOOP.
ENDFORM. " move_data
your answers help me lot . I am awarding the points.
Very Very Thanks
Edited by: Dilraj Singh on Apr 13, 2011 3:58 PM
Edited by: Dilraj Singh on Apr 13, 2011 4:09 PM
Edited by: Dilraj Singh on Apr 13, 2011 4:23 PM -
How to create the selection screen dynamically
Hi,
I have a requirement to create the selection screen Dynamically. All the fields that should appear on the selection screen will be available in a custom table. So, based on the entries available in the Z tables, the selection screen should be built. Eg. If there are 10 records available in the Z table, the selection screen should consist of 10 fields. If there are 100 entries, the Selection screen should contain 100 fields. and the logic to build this selection screen should be carried out dynamically in the program.
Could anyone of you please share the valuable inputs on this. If anyone has the sample code to do this, please share.
Thanks in advance.
Regards,
Paddu.Hi,
Kindly go through this sample program below:
DEMO_LIST_FORMAT_INPUT *and
check this function module:
FREE_SELECTIONS_DIALOG *.
Hope it helps
Regards
Mansi -
Changing of default values on the selection screen dynamically
Hi,
I have 2 radiobuttons R_A & R_B and i have one text field like P_TEXT. Based on selection of radio button i have to change the default values in P_TEXT on the selection screen. like if i select R_A i have to display P_TEXT = 'A'. if i select R_B then it has to display P_TEXT = 'B'. I tried like as below
in AT SELECTION-SCREEN OUPUT EVENT.
IF R_A = 'X'
P_TEXT = 'A'.
ELSEIF R_B= 'B'.
P_TEXT = 'B'.
ENDIF.
But it's not working. it is working only for first radio button. when i select second radio button it is not giving the second value. can any one tell the sol.
Tks in advance.Hi Pammi,
Use this code, its working:-
PARAMETERS : r_a RADIOBUTTON GROUP gp1 DEFAULT 'X' USER-COMMAND rb,
r_b RADIOBUTTON GROUP gp1,
p_text(20).
"we use user command with the radiobutton so that some event is occured in order to call AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
IF r_a = 'X'.
p_text = 'Hello'.
ELSEIF r_b = 'X'.
p_text = 'Hi'.
ENDIF.
In the above case 'AT SELECTION-SCREEN OUTPUT' will act as PBO of the selection screen and will change value of selection text as per condition.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
Auto-populating the selection screen parameters for web report
hello
i am having a scenario where my web report is a link to another internet application (a BSP application) and it is called by clicking some link or button on the BSP page.
can i pass the selection values for BW Web report directly from BSP application through a query string or by setting some cookie values so that the user will directly view the report on click of that link?
Thanks in advance.
Regards
Rajeevwe can do this by adding a URL as the query-string with web template_id and with the selection screen parameters as key value pairs
-
Checking the Selection Screen Parameters
Dear All,
We are uploading data from various excel sheets into SAP tables. Now at selection screen I just want to check if the location specified exists or not ie. if I have created one variant on one system & then if I am running that report from other system using the variants, since the files does not exists it should throw the error and should return to the selection screen to enter the new parameters.
Please help me in the code, I am attaching my code herewith.
Waiting for ur responses,
Nishu
*********************CODE***************************
tables: bseg, zfi_tbl_qty, t001, tgsb.
data:
t_excel like alsmex_tabline occurs 0 with header line,
l_excelfile(128) type c,
l_excelfile1(128) type c,
l_excelfile2(128) type c,
l_excelfile3(128) type c.
data: begin of t_bukrs_tmp occurs 0,
bukrs like t001-bukrs,
end of t_bukrs_tmp.
data: begin of t_gsber_tmp occurs 0,
gsber like tgsb-gsber,
end of t_gsber_tmp.
ranges: r_bukrs_tmp for t001-bukrs,
r_gsber_tmp for tgsb-gsber.
data: begin of t_type,
bukrs like bseg-bukrs,
gsber like bseg-gsber,
count type i,
end of t_type.
data: l_charlen1 type i,
l_charlen2 type i.
data: t_type2 like t_type occurs 0 with header line,
t_type2_tmp like t_type occurs 0 with header line.
data: l_end_row type i,
l_endrow1 type i,
l_count type i,
v_bukrs like bseg-bukrs.
data : q_count type i value 1,
v_flag type i value 0,
v_gsber like t_type2-gsber.
data: l_var type c.
selection-screen begin of block b1 with frame title text-001.
parameter : p_file1 type rlgrap-filename obligatory,
p_file2 type rlgrap-filename obligatory,
p_file3 type rlgrap-filename obligatory,
p_file4 type rlgrap-filename obligatory.
selection-screen end of block b1.
*perform updation_tbl.
*clearing the contents of database table before uploading a new file everytime
delete from zfi_tbl_qty.
*selection-screen
at selection-screen on value-request for p_file1.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file1
changing
file_name = p_file1.
at selection-screen on value-request for p_file2.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file2
changing
file_name = p_file2.
at selection-screen on value-request for p_file3.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file3
changing
file_name = p_file3.
at selection-screen on value-request for p_file4.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file4
changing
file_name = p_file4.
at selection-screen.
l_excelfile = p_file1.
l_excelfile1 = p_file2.
l_excelfile2 = p_file3.
l_excelfile3 = p_file4.
if l_excelfile = l_excelfile1 or l_excelfile = l_excelfile2 or l_excelfile = l_excelfile3
or l_excelfile1 = l_excelfile2 or l_excelfile1 = l_excelfile3 or l_excelfile2 = l_excelfile3.
message e010(zn) with 'Files with the same name found Please enter again. '.
endif.
start-of-selection.
select bukrs
from t001
into corresponding fields of table t_bukrs_tmp.
loop at t_bukrs_tmp.
r_bukrs_tmp-sign = 'I'.
r_bukrs_tmp-option = 'EQ'.
r_bukrs_tmp-low = t_bukrs_tmp-bukrs.
append r_bukrs_tmp.
endloop.
select gsber
from tgsb
into corresponding fields of table t_gsber_tmp.
loop at t_gsber_tmp.
r_gsber_tmp-sign = 'I'.
r_gsber_tmp-option = 'EQ'.
r_gsber_tmp-low = t_gsber_tmp-gsber.
append r_gsber_tmp.
endloop.
perform upload_table using l_excelfile 5 2 6 4000.
perform upload_table using l_excelfile1 5 2 6 4000.
perform upload_table using l_excelfile2 5 2 6 4000.
perform upload_table using l_excelfile3 5 2 6 4000.
if sy-subrc = 0.
message i010(zn) with 'Files Uploaded Successfully.'.
if sy-subrc <> 0.
message e398(00) with 'Files Not Found'.
leave to screen 0.
endif.
************Calling the other program
SUBMIT ZFI_REP_IS_CHARGES_POST1.
*and return.
*******************Calling the subroutine.
form upload_table using filename
i_begin_col type i
i_begin_row type i
i_end_col type i
i_end_row type i.
clear : t_excel.
refresh : t_excel.
v_flag = v_flag + 1.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = filename
i_begin_col = 5
i_begin_row = 2
i_end_col = 6
i_end_row = 4000
tables
intern = t_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
case v_flag.
when '1'.
perform fill_int_tab.
when '2'.
perform fill_int_tab.
when '3'.
perform fill_int_tab.
when '4'.
perform fill_int_tab.
endcase.
endform. "upload_table
*uploading data from internal table into database table
*& Form fill_int_tab
text
--> p1 text
<-- p2 text
form fill_int_tab .
clear : t_type2, q_count.
refresh : t_type2.
describe table t_excel lines l_endrow1.
l_endrow1 = l_endrow1 / 2.
do.
loop at t_excel where row = q_count.
if t_excel-col = 1.
t_type2-gsber = t_excel-value.
elseif t_excel-col = 2.
t_type2-bukrs = t_excel-value.
endif.
endloop.
l_charlen1 = strlen( t_type2-bukrs ).
l_charlen2 = strlen( t_type2-gsber ).
if ( t_type2-bukrs <> ' ' and t_type2-gsber <> ' ' ).
if ( l_charlen1 = 4 and l_charlen2 = 4 ).
append t_type2. clear t_type2.
endif.
endif.
q_count = q_count + 1.
if q_count > l_endrow1.
exit.
endif.
enddo.
t_type2_tmp[] = t_type2[].
clear t_type2.
refresh t_type2.
loop at t_type2_tmp where bukrs in r_bukrs_tmp
and gsber in r_gsber_tmp.
move-corresponding t_type2_tmp to t_type2.
append t_type2.
endloop.
sort t_type2 by bukrs gsber.
loop at t_type2.
clear v_gsber.
l_count = l_count + 1 .
v_gsber = t_type2-gsber.
at end of gsber.
at end of bukrs.
zfi_tbl_qty-company_code = t_type2-bukrs.
zfi_tbl_qty-barea = v_gsber.
zfi_tbl_qty-comb = l_count.
if v_flag = 1.
zfi_tbl_qty-type = 'A'. " Item 1
endif.
if v_flag = 2.
zfi_tbl_qty-type = 'B'. " Item 2
endif.
if v_flag = 3.
zfi_tbl_qty-type = 'C'. " Item 3
endif.
if v_flag = 4.
zfi_tbl_qty-type = 'D'. " Item 4
endif.
insert zfi_tbl_qty from zfi_tbl_qty.
clear l_count.
endat.
endat.
endloop.
endform. " fill_int_tabHi,
After calling this FM:
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = filename
i_begin_col = 5
i_begin_row = 2
i_end_col = 6
i_end_row = 4000
tables
intern = t_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
*-> try following code:
if sy-subrc = '2'.
message 'File not Found' type 'I'.
leave list-processing.
endif.
Regards,
Kalyan -
Adding Standard Text to the Selection Screen obtained using PARAMETERS
Hi all,
I have a report program which has the selection screen declared by the key word PARAMETERS.
Now I need to make the changes to this program such that a Text Editor appears on the Selection Screen and has a Standard text that should be displayed.
How can I do it?
I saw the screen number of the Selection Screen and went to screen painter and tried to add the Text Editot..but it did not let me dou2026.Why?
How should I add a standard text to a selection screen? The standard text should not be on top , but some where on the screen.
Regards,
Jessica SamHi Sam,
I dont want to create a new screen for this. On the existing screen whihc was built using PARAMETERS key word..i should insert a blokc of text whihc is mpre than 5-6 lines..how should i do it.
I navigated to Text Elements---->Selection Texts
it is now asking for Name and Text and i see in Name column the name of the parametsr that they used for Check box, radio button etc and in Text i see the text that is appearing on the screen
Now i am not sure what is should do next
My req is..i should display a block of standard text that doesnt change and whihc is of 4-6 lines?
how should i do it?
please also help me with what data declartions that i should do in parametrs key word in program?
Regards,
Jessica Sam -
Modifying the selection screen dynamically
Hey folks,
I have posted this question previously but no one understood the real problem.
I have 4 fields
Company Code
material Number
plant
storage Location
Unit
when I select the company code AA01 from the F4 help I want to disable material number and Plant ..Like this i have 4 scenarios where based upon the input given in the selection screen other fields have to be enabled or disabled.
I have already used at selection screen on output but that doesn't help me as its a PBO event I tried to search for a proper event but cudn't find it. Is there any way i can achieve this. A sample code wud be easy for me to understand .
Thanks in advance
RockSet different groups in your fieds on the screen.
Set the screen group for the Material and Plant as the GR1
Set the screen gorup for the Storage location as the GR2.
You need to modify your screen fields on the PBO event.
Like:
IF P_BUKRS = 'AA01'.
loop at screen.
if screen-group1 = 'GP1'.
screen-input = 0.
modify screen.
elseif screen-group2 = 'GP2'.
screen-input = 1.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'GP2'.
screen-active = 0.
modify screen.
elseif screen-group2 = 'GP1'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
Regards,
Naimesh Patel
Maybe you are looking for
-
Have Photoshop Elements from 2001. Got new computer with Windows 7 Professional 64 bit. It won't run on my new computer. What version is MOST SIMILAR to the old version I have, that will run on W7P-64? Thanks for any help. Popjer
-
Album frames don't display properly: Since .MAC converted to MobileME help?
ORIGINAL MESSAGE POSTED TO APPLE SUPPORT Ever since .MAC was recently down - and converted to Mobile Me - I have been having problems with my iWEB site: 1. Frames around Photo Albums no longer display (on mac or win web browsers) - On Windows Compute
-
WCS annual support: what do I get for extra AP license packs?
I am not trying to be snide here, but I am having a difficult time understanding what new value I get for an extra SAU annual support package that my Cisco Partner says I now need, since I added additional AP licenses to the WCS software. This add-on
-
Authorization based on Material
Hi Friends, I want to give authorization to some users only for certain material groups. Normally in PFCG transaction, we can give authorization for purchasing group, plant, company code etc. But I could not find how to control the authorization for
-
Apple Movie Trailers Website not displaying Correctly
Hi, for a few days now when I go to Apples Movie Trailer Website, there's a gap where the trailers should be. Here's a screenshot: http://img198.imageshack.us/i/screenshot20100412at422.png/ Does anyone else notice this?