Selection screen 2 connected parameters
Hi folks,
I would like to have 2 fields. Both are "F4 enabled" ( they are of type of key fields in one DBtable, and those DBtable fields have domains, which have value check with their table). And I want these 2 parameters to be connected - when I choose value in 1, value in the 2nd should be placed, and vice versa.
(What I miss is some event like on value-request...)
Thanks in advance,
Piotr
Hi,
Check the sample code..
REPORT ZTEST_F4HELP .
*---Report with selection screen and to display the list of
* possible entries for field 'B' as per the value in field 'A'.
parameters: p_vbeln type vbak-vbeln,
p_posnr type vbap-posnr.
at selection-screen on value-request for p_posnr.
data: begin of help_item occurs 0,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_VBELN'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
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.
read table dynfields with key fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
importing
output = p_vbeln.
select posnr matnr arktx into table help_item
from vbap
where vbeln = p_vbeln.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.
Regards
vijay
Similar Messages
-
Validating a selection screen on input parameters
hi,
on my selection screen ,a parameter called no. of boxes and 3 select options are given.
i want to validate the 3 select options according to the entry done in no. of box .
ex. if 2 is entered in no. of boxes then only the 2 select options would be available to user for entering rest 1 would be isolated
Thanks in advance !!!
amitHi,
Check this,
PARAMETERS: p_1 type i.
SELECT-OPTIONS:num1 for mara-matnr.
SELECT-OPTIONS:num2 for mara-matnr.
SELECT-OPTIONS:num3 for mara-matnr.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if p_1 = '1'.
IF screen-name cs 'NUM2'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-name cs 'NUM3'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
elseif p_1 = '2'.
IF screen-name cs 'NUM3'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
endif.
endloop.
Regards,
Vik -
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 -
SQ01 - need to change selection screen text of parameters
I am using KNA1 table in my SQ01(Abap query) and am having Kunnr as the selection screen parameter .The default text of Kunnr coming from KNA1 is 'customer number 1'.I need to change this to show it as 'customer number'.
I changed the text in infoset in long text and header value,but it still does not work out. Any suggestions ??.Pls let me know.Hi,
When you define the selection screen fields in the info set..There will be text box for selection text..There you can give the text..
I tried this..And it worked for me..
Thanks,
Naren -
How can i set a Title to Parameters(Selection-Screen)?
Hi,
i have a Selection-Screen with two Parameters. Both Parameters should be have an Title.
But how can I set a Title two this Parameters? Is there existing any options????
For example, the Parameters "I_WRBTR" and "I_NBDOCS" needs two Title´s.
Every Parameter must have a title, but how can I realize this???
*I have know only a title for "IWRBTR" but i need also a title for "I_NBDOCS"*_.
DATA: FIELD_BUKRS(10).
SELECTION-SCREEN BEGIN OF SCREEN 0100.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS SEL_BUKR FOR FIELD_BUKRS OBLIGATORY.
SELECTION-SCREEN BEGIN OF LINE, COMMENT (25) text-005 FOR FIELD IWRBTR_, POSITION 33.
PARAMETERS: I_WRBTR(10),
I_NBDOCS(3).
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN END OF SCREEN 0100.
Thanks for Helps.
ETNHi,
try this short example:
DATA: FIELD_BUKRS(10).
SELECTION-SCREEN BEGIN OF BLOCK BLOCK WITH FRAME TITLE T_BLOCK.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE T_BLOCK1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (29) T_SEL_BU.
SELECT-OPTIONS SEL_BUKR FOR FIELD_BUKRS OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BLOCK1.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK2 WITH FRAME TITLE T_BLOCK2.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (32) T_WRBTR.
PARAMETERS: I_WRBTR(10).
SELECTION-SCREEN COMMENT 50(15) T_NBDOCS.
PARAMETERS: I_NBDOCS(3).
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BLOCK2.
SELECTION-SCREEN END OF BLOCK BLOCK.
INITIALIZATION.
T_BLOCK = 'parameter'.
T_BLOCK1 = '1. parameter'.
T_BLOCK2 = '2. parameter'.
T_SEL_BU = 'Buchungskreis'.
T_WRBTR = 'Parameter wrbtr'.
T_NBDOCS = 'Parameter nbdocs'.
Regards, Dieter -
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'. -
Hello Experts,
I have a requirement. My user want when she run the report online all variable on selection screen should be parameters means not range or extension and some selection screen checks. But when she run the report in batch mode, all variable on the selection screen should be select-options means ranges with extension. Is it possible to create 2 selection screen in same report, I have no idea, is it possible or not. If possible please tell me how.
Thanks,
AmitHi,
Try this code,
<b>Important thing is, don't use default selection-screen(1000).</b>
DATA: w_matnr TYPE matnr.
SELECTION-SCREEN BEGIN OF SCREEN 1001.
PARAMETER: pr_param TYPE matnr.
SELECTION-SCREEN END OF SCREEN 1001.
SELECTION-SCREEN BEGIN OF SCREEN 1002.
SELECT-OPTIONS: so_sele FOR w_matnr.
SELECTION-SCREEN END OF SCREEN 1002.
INITIALIZATION.
IF sy-binpt = 'X'.
CALL SELECTION-SCREEN 1001.
ELSE.
CALL SELECTION-SCREEN 1002.
ENDIF.
<b>You should be the same logic in the remaining program(like in START-OF-SELECTION, END-OF-SELECTION etc) where ever the implication of selection screen fileds are there.</b>
Thanks and Regards,
Bharat Kumar Reddy.V -
How to configure selection screen in report
Hi all,
could anyone help me in configuring the selection screen in the report.
Advance Thanks
Regards
GuhapriyanHere is some basic code to generate a selection screen.
tables: afko.
selection-screen begin of block b1 with frame title text-001 .
select-options: s_gltrp for afko-gltrp.
parameters: p_gltrp type afko-gltrp.
selection-screen begin of line.
selection-screen comment (25) text-005.
selection-screen position 33.
parameters: p_pln as checkbox default ' '.
selection-screen end of line.
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-004 .
selection-screen begin of line.
selection-screen comment (20) text-002.
selection-screen position 33.
parameters: p_det as checkbox default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment (20) text-003.
selection-screen position 33.
parameters: p_sum as checkbox.
selection-screen end of line.
selection-screen end of block b2.
Regards,
Rich Heilman -
Hi Experts, a question about messages in selection screen? thank you!
Hi Experts,
I have a selection screen and two parameters on it, I need to check if the entries exist if the fields is filled in, if it doesn't exist I need to issue a warning message, but if the two parameters are both filled in and the related entries both don't exist, how can I handle this situation? what I mean is that I want to display the two warnings at the same time(like below), now I only can display one warning, can anyone help me on this? thank you much!
You are not authorised for this purchasing organisation
Plant: invalid entry
Purchasing organisation: invalid entry
No valid record selected
Kind regards
DawsonHi Dawson
As far as i get from your disciption of the problem, i get that: -
(a) You want to check that both the fields are filled or not
(b) If they are filled, then you want to check if in database there exists any record pertaining to them.
Correct me if i am wrong.
If this is correct, then you will have to make use of nested if condtions to diaplay the warnings.
Like as follows: -
If pa1 IS INITIAL and pa2 IS INITIAL.
<your warning message>.
ELSEIF pa1 IS INITIAL and pa2 IS NOT INITIAL.
<your warning message>.
ELSEIF pa1 IS NOT INITIAL and pa2 IS INITIAL.
<your warning message>.
ELSEIF pa1 IS NOT INITIAL and pa2 IS NOT INITIAL.
<try matching it with the database records>.
<your warning message>.
ENDIF.
As far as i know, the 2 warning messages cannot be issued as they appear in the status bar of the current screen. SO you will have to put them in if condition only and display the approriate warning .
Hope this solves your problem.
Regards
Gaurav. -
Report should executed based on the radio buttons on the selection screen
Hi everyone,
Greets....................
My scenario is I have 2 selection screen blocks on same screen..
One selection screen block contains input parameters as follows
Company Code - S_BUKRS
Business Area - S_GSBER
Customer Code - S_KUNNR
Fiscal Area - S_GJAHR
GL Account - S_HKONT
Posting Date -S_ZFBDT
Ledger Type -P_RLDNR
Open Item Key Date - P_ZFBDT
Another selection screen block contains 2 radio buttons with the option as follows
Collection Plan
*Credit days summary.
If i click Collection plan the report output should come based on the input parameters in first selection-screen block.
If i click Credit days summary the report output should come based on the input parameters in first selection-screen block.
Pls send me the sample code for this.
Thanks in Advance
Regards
Raj kumarSee the below folling example : it will have radio buttons and depends on radio button it will show output.
REPORT ZPPR_BOM_INFOL_REPORT no standard page heading
line-size 160
line-count 60.
======================================================================
Program Name : ZPPR_BOM_INFOL_REPORT
Description : This Program would be used for BOM List for a material*
and the component's where used list *
Author : Seshu *
Date : 07/24/2006 *
MODIFICATION HISTORY *
DATE | AUTHOR | CHANGE # | DESCRIPTION OF MODIFICATION *
|----
|----
|----
*12/04/06 | Seshu | DEVK921821 | Removed new page for each material *
======================================================================
Table definition *
TABLES: mast,
stko,
stpo,
T418,
makt.
TYPE - POOLS
TYPE-POOLS: slis.
Constants
constants : c_tcode(4) type c value 'CS03',
gc_formname_top_of_page TYPE slis_formname
VALUE 'TOP_OF_PAGE'.
Variables
data : v_maktx like makt-maktx,
wa_stko like stko.
DATA:
Objekttyp 'Material'
otyp_mat(1) TYPE c VALUE '1',
ootyp_mat(1) TYPE c VALUE 'M',
Objekttyp 'kein Objekt'
otyp_noo(1) TYPE c VALUE '2',
Objekttyp 'Dokument'
otyp_doc(1) TYPE c VALUE '3',
Objekttyp 'Klasse'
otyp_kla(1) TYPE c VALUE '4',
Objekttyp 'Intramaterial'
otyp_ntm(1) TYPE c VALUE '5'.
maximal anzeigbare Menge
data: max_num(7) TYPE p DECIMALS 3 VALUE '9999999999.999',
ueberl_kz(1) TYPE c VALUE '*',
min_num(7) TYPE p DECIMALS 3 VALUE '9999999999.999-',
b_flag(1) TYPE c VALUE 'X',
ecfld(250) TYPE c,
v_flag type c.
ALV Variables
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv,
gs_keyinfo TYPE slis_keyinfo_alv,
gt_sp_group TYPE slis_t_sp_group_alv,
gt_events TYPE slis_t_event.
DATA: g_repid LIKE sy-repid.
DATA: gt_list_top_of_page TYPE slis_t_listheader,
g_tabname_header TYPE slis_tabname,
g_tabname_item TYPE slis_tabname,
g_save(1) TYPE c,
gx_variant LIKE disvariant,
g_variant LIKE disvariant,
g_default(1) TYPE c,
g_exit(1) TYPE c.
Includes *
INCLUDE .
Internal Table Declaration *
DATA: t_mast LIKE STANDARD TABLE OF mast WITH HEADER LINE.
*DATA: t_makt LIKE STANDARD TABLE OF makt WITH HEADER LINE.
BOM Function module Related
DATA: t_matcat LIKE cscmat OCCURS 0 WITH HEADER LINE.
Internal Table for Level by Level Function module
DATA: t_stb LIKE stpox OCCURS 0 WITH HEADER LINE.
Get the Relevant data from FM
DATA: BEGIN OF hd_tab OCCURS 0,
stufe LIKE stpox-stufe,
vwegx LIKE stpox-vwegx,
END OF hd_tab.
Final Output
DATA: BEGIN OF alv_stb OCCURS 0.
INCLUDE STRUCTURE stpox_alv.
DATA: info(3) TYPE c,
END OF alv_stb.
DATA: BEGIN OF stb_orig.
INCLUDE STRUCTURE stpox.
DATA: END OF stb_orig.
DATA: BEGIN OF stb_add.
INCLUDE STRUCTURE stpol_add.
DATA: END OF stb_add.
Internal Table for STPO
*-- BOM Line item
TYPES: BEGIN OF ty_stpo,
stlty TYPE stpo-stlty,
stlnr TYPE stpo-stlnr,
stlkn TYPE stpo-stlkn,
stpoz TYPE stpo-stpoz,
idnrk TYPE stpo-idnrk,
meins TYPE stpo-meins,
menge TYPE stpo-menge, "Component Qty
END OF ty_stpo.
DATA: t_stpo TYPE STANDARD TABLE OF ty_stpo WITH HEADER LINE.
*-- BOM Header
TYPES: BEGIN OF ty_stko,
stlty TYPE stko-stlty,
stlnr TYPE stko-stlnr,
stlal TYPE stko-stlal,
stkoz TYPE stko-stkoz,
bmein TYPE stko-bmein,
bmeng TYPE stko-bmeng,
END OF ty_stko.
DATA: t_stko TYPE STANDARD TABLE OF ty_stko WITH HEADER LINE .
data : t_makt like makt occurs 0 with header line.
DATA: BEGIN OF cl_clstab OCCURS 0, "YHG079407
class LIKE klah-class, "YHG079407
klart LIKE klah-klart, "YHG079407
chked LIKE csdata-xfeld, "YHG079407
noobj LIKE csdata-xfeld, "YHG079407
dsply LIKE csdata-xfeld, "YHG079407
END OF cl_clstab.
*-- Header table
TYPES: BEGIN OF ty_main_material,
matnr TYPE mast-matnr, "Material
werks TYPE mast-werks, "Plant
maktx TYPE makt-maktx, "Description
stlal TYPE mast-stlal, "Alternative BOM
stlnr TYPE stko-stlnr, "BOM Number
bmein TYPE stko-bmein, "UOM
bmeng TYPE stko-bmeng, "Base Qty
expand(1) TYPE c, "Expanding Field
END OF ty_main_material.
DATA: t_main_material TYPE STANDARD TABLE OF ty_main_material WITH
HEADER LINE.
*-- Item (Component) Table
TYPES: BEGIN OF ty_item_material,
matnr TYPE mast-matnr, "Material
werks TYPE mast-werks, "Plant
idnrk TYPE stpo-idnrk, "Component (Material)
maktx TYPE makt-maktx, "Description
stlal TYPE mast-stlal, "Alternative BOM
stlnr TYPE stpo-stlnr, "BOM Number
meins TYPE stpo-meins, "UOM
menge TYPE stpo-menge, "Base Qty
END OF ty_item_material.
DATA: t_item_material TYPE STANDARD TABLE OF ty_item_material WITH
HEADER LINE.
Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_werks LIKE marc-werks DEFAULT '1000' OBLIGATORY.
SELECT-OPTIONS s_stlal FOR mast-stlal .
SELECT-OPTIONS s_stlan FOR mast-stlan DEFAULT '1'.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP.
PARAMETERS: p_bomlst RADIOBUTTON GROUP g1 DEFAULT 'X'.
SELECT-OPTIONS s_matnr FOR mast-matnr.
SELECTION-SCREEN SKIP.
PARAMETERS: p_compon RADIOBUTTON GROUP g1.
SELECT-OPTIONS: s_idnrk FOR stpo-idnrk.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF BLOCK b1.
selection-screen begin of block b03 with frame title text-b03.
selection-screen begin of line.
selection-screen comment 1(40) text-005.
parameters: p_all radiobutton group r1 default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(40) text-006.
parameters: p_one radiobutton group r1 .
selection-screen end of line.
selection-screen end of block b03.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_vari LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK b3.
At slection screen events *
*-- Process on value request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
Intitialisation
INITIALIZATION.
g_repid = sy-repid.
g_tabname_header = 'T_MAIN_MATERIAL'.
g_tabname_item = 'T_ITEM_MATERIAL'.
*-- define keyinformation
CLEAR gs_keyinfo.
gs_keyinfo-header01 = 'MATNR'.
gs_keyinfo-item01 = 'MATNR'.
PERFORM e03_eventtab_build USING gt_events[].
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM e07_sp_group_build USING gt_sp_group[].
PERFORM e08_layout_build USING gs_layout.
Set Options: save variants userspecific or general
g_save = 'A'.
PERFORM variant_init.
Get default variant
gx_variant = g_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_save
CHANGING
cs_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = gx_variant-variant.
ENDIF.
S T A R T - O F - S E L E C T I O N *******************
start-of-selection.
if p_all = 'X'.
Get the data from MAST and MAKT Table
if p_bomlst = 'X'.
Get the data Based On Material #
perform get_data.
else.
Get the data Based On Component
perform get_data_component.
endif.
else.
Get the Single Level Report
*-- Moved the fiedl catalog here inorder to change the layout based on
*-- Selection
PERFORM e01_fieldcat_init USING gt_fieldcat[].
PERFORM select_data.
endif.
E N D - O F - S E L E C T I O N *******************
end-of-selection.
if p_one = 'X'.
perform alv.
endif.
User Command
at line-selection.
Interactive to CS03 Transaction
case sy-ucomm.
when 'PICK' or 'F2'.
if not alv_stb-idnrk is initial .
if not alv_stb-werks is initial.
if not alv_stb-objty is initial.
SET PARAMETER ID 'MAT' FIELD alv_stb-idnrk.
SET PARAMETER ID 'WRK' FIELD alv_stb-werks.
SET PARAMETER ID 'CSV' FIELD alv_stb-OBJTY.
call transaction c_tcode and skip first screen.
endif.
endif.
endif.
clear alv_stb.
endcase.
*& Form get_data
Get data from MAST and MAKT Table
FORM get_data.
data : wa_lines type sy-index.
REFRESH : T_MAST,
t_STB,
t_MATCAT,
alv_STB.
CLEAR : T_MAST,
t_STB,
t_MATCAT,
alv_STB.
Get the data from MAST Table
Get all the information from MAST - BOM Table
SELECT * FROM mast INTO TABLE t_mast WHERE matnr IN s_matnr AND
werks = p_werks AND
stlan IN s_stlan AND
stlal IN s_stlal.
describe table t_mast lines wa_lines.
if wa_lines is initial.
Write:/2 'List contains no data'.
stop.
endif.
loop at t_mast.
clear : v_maktx.
Start of change Seshu
Reason - Remove the new page option
if sy-tabix ne 1.
skip 1.
endif.
End of Change Seshu
Get the material Description
select single maktx from makt into v_maktx
where matnr = t_mast-matnr
and spras = 'E'.
Get the material details from STKO Table
select single * from stko into wa_stko
where STLTY = 'M'
and STLNR = t_mast-stlnr
and STLAL = t_mast-stlal.
Main Header for Each Material
format color 5 on.
write:/2 'Material',20 'Material Description',65 'Alternative BOM',
90 'Base Qty', 115 'Base Unit'.
format color 5 off.
format color 1 on.
write:/2 t_mast-matnr,20 v_maktx,65 wa_stko-STLAL, 85 wa_stko-BMENG,
115 wa_stko-BMEIN.
format color 1 off.
Use the Function Module and get the format level by level
perform get_level_level.
endloop.
ENDFORM. " get_data
Top of page *
top-of-page.
perform report_header .
*& Form report_header
text
--> p1 text
<-- p2 text
FORM report_header.
new-page line-size 160 .
format color col_heading intensified on.
write:/ sy-uline(160) .
*--- Write Company Name.
perform calc_col_and_write using text-h00
sy-linsz.
*--- Write Report Title.
perform calc_col_and_write using sy-title
sy-linsz.
*--- Write User Id, Date / Time, Program Id, Page etc.
perform write_other_hdr_details.
write:/ sy-uline(160) .
ENDFORM. " report_header
*& Form calc_col_and_write
text
-->P_TEXT_H00 text
-->P_SY_LINSZ text
FORM calc_col_and_write USING P_TEXT
P_LINSZ.
data: col1 type i,
col2 type i,
len type i,
str type i.
str = strlen( p_text ).
col1 = ( p_linsz / 2 ) - ( str / 2 ) .
len = p_linsz - col1 - 2.
write: at /1 '|'.
write: at col1 p_text,
at sy-colno(len) space.
write at 160 '|'.
ENDFORM. " calc_col_and_write
*& Form write_other_hdr_details
text
--> p1 text
<-- p2 text
FORM write_other_hdr_details.
data: col1 type i,
col2 type i,
len type i.
col1 = 3.
write:/1 '|'.
write: at col1 'UserId : ',
sy-uname.
len = sy-linsz - 1.
write at sy-colno(len) space.
col2 = sy-linsz - 18.
write: at col2 'Date: ',
sy-datum mm/dd/yyyy.
write: at sy-linsz '|'.
write:/1 '|'.
write: at col1 'ReportId: ',
sy-repid.
write at sy-colno(len) space.
col2 = sy-linsz - 18.
write: at col2 'Page: ',
sy-pagno.
write: at sy-linsz '|'.
ENDFORM. " write_other_hdr_details
*& Form get_data_component
Get the data based on Component level
FORM get_data_component.
data wa_lines type i.
*-- Get the BOM item details
SELECT stlty stlnr stlkn stpoz idnrk meins menge
FROM stpo
INTO TABLE t_stpo
WHERE idnrk IN s_idnrk.
IF sy-subrc = 0.
CLEAR wa_lines.
DESCRIBE TABLE t_stpo LINES wa_lines.
IF wa_lines > 0.
SELECT stlty stlnr stlal stkoz bmein bmeng
FROM stko
INTO TABLE t_stko
FOR ALL ENTRIES IN t_stpo
WHERE stlnr = t_stpo-stlnr.
CLEAR wa_lines.
DELETE ADJACENT DUPLICATES FROM t_stko COMPARING ALL FIELDS.
DESCRIBE TABLE t_stko LINES wa_lines.
IF wa_lines > 0.
*-- Get the BOM item details
SELECT * FROM mast INTO TABLE t_mast FOR ALL ENTRIES IN t_stko
WHERE werks = p_werks AND
stlnr = t_stko-stlnr
and stlal in s_stlal.
ENDIF.
ENDIF.
else.
Write:/2 'List contains no data'.
stop.
endif.
loop at t_mast.
clear : v_maktx.
Start of change Seshu
Reason - Remove the new page option
if sy-tabix ne 1.
skip 1.
endif.
End of change Seshu
Get the material Description
select single maktx from makt into v_maktx
where matnr = t_mast-matnr
and spras = 'E'.
Get the material details from STKO Table
select single * from stko into wa_stko
where STLTY = 'M'
and STLNR = t_mast-stlnr
and STLAL = t_mast-stlal.
Main Header for Each Material
format color 5 on.
write:/2 'Material',20 'Material Description',65 'Alternative BOM',
90 'Base Qty', 115 'Base Unit'.
format color 5 off.
format color 1 on.
write:/2 t_mast-matnr,20 v_maktx,65 wa_stko-STLAL, 85 wa_stko-BMENG,
115 wa_stko-BMEIN.
format color 1 off.
Use the Function Module and get the format level by level
perform get_level_level.
clear : t_mast.
endloop.
ENDFORM. " get_data_component
*& Form obj_ident
text
FORM obj_ident.
weder Mat noch Doc
CHECK: T_stb-objty NE otyp_mat,
T_stb-objty NE ootyp_mat,
T_stb-objty NE otyp_doc,
T_stb-objty NE otyp_ntm.
?T418-WA schon ok
nein
IF T_stb-postp NE t418-postp.
T418 einlesen
PERFORM t418_lesen USING T_stb-postp.
ENDIF.
PERFORM cl_clstab_maint.
?MatNr-Eingabe bei diesem PosTyp moeglich
und keine Textposition
trifft zu
IF t418-matin NE '-'
AND t418-txpos IS INITIAL.
aktuelles Objekt ist Material NLAG
T_stb-objty = '1'.
PosKurztext in ObjKurztext uebernehmen.
T_stb-ojtxp = T_stb-potx1.
MODIFY T_stb.
ELSE.
IF T_stb-objty IS INITIAL.
T_stb-objty = '2'.
MODIFY T_stb.
ENDIF.
ENDIF.
ENDFORM. " obj_ident
*& Form t418_lesen
text
-->P_T_STB_POSTP text
FORM t418_lesen USING lkl_postp LIKE stpo-postp.
T418-WA initialisieren
CLEAR:
t418.
Key angeben
t418-postp = lkl_postp.
PosTypDefinition lesen
READ TABLE t418.
ENDFORM. " t418_lesen
*& Form cl_clstab_maint
text
FORM cl_clstab_maint.
nur fuer Klassenpositionen
CHECK t_STB-OBJTY EQ OTYP_KLA.
Teilkey der Klassenpositionentabelle
CL_CLSTAB-CLASS = t_STB-CLASS.
CL_CLSTAB-KLART = t_STB-KLART.
Klassenpositionentabelle lesen
READ TABLE CL_CLSTAB
WITH KEY CL_CLSTAB(21)
BINARY SEARCH.
aktuelle Klassenposition bereits in Klassenpositionentabelle
nein
IF SY-SUBRC <> 0.
Klassenposition in Klassenpositionentabelle hinzufuegen
INSERT CL_CLSTAB INDEX SY-TABIX.
ENDIF.
ENDFORM. " cl_clstab_maint
*& Form alv_stb_prep
Printing the data as LEVEL BY LEVEL
FORM alv_stb_prep.
CLEAR:
alv_stb,
stb_orig,
stb_add.
IF t_stb-hdnfo IS INITIAL.
stb_orig = t_stb.
IF t_stb-mngko >= max_num.
stb_add-ovfls = ueberl_kz.
ELSE.
IF t_stb-mngko <= min_num.
stb_add-ovfls = ueberl_kz.
ELSE.
CLEAR: stb_add-ovfls.
ENDIF.
ENDIF.
IF NOT t_stb-xtlnr IS INITIAL.
stb_add-bomfl = b_flag.
ENDIF.
IF NOT t_stb-knobj IS INITIAL
OR NOT t_stb-class IS INITIAL
OR NOT t_stb-kzclb IS INITIAL.
stb_add-knofl = 'X'.
ENDIF.
ELSE.
CHECK t_stb-stufe > 1.
alv_stb-info = 'C30'.
IF t_stb-ttidx <> t_matcat-index.
READ TABLE t_matcat INDEX t_stb-ttidx.
ENDIF.
stb_orig-hdnfo = t_stb-hdnfo.
stb_orig-stufe = t_stb-stufe - 1 .
stb_orig-ojtxp = t_stb-ojtxb.
IF NOT t_stb-altst IS INITIAL.
stb_orig-stlal = t_stb-stlal.
IF stb_orig-stlal(1) EQ '0'.
stb_orig-stlal(1) = ' '.
ENDIF.
ENDIF.
stb_orig-idnrk = t_matcat-matnr.
ENDIF.
CLEAR:
stb_add-dobjt,
stb_add-objic.
CASE t_stb-objty.
WHEN otyp_mat.
WRITE: stb_orig-idnrk TO ecfld.
stb_add-objic = '@A6@'.
WHEN 'M'.
WRITE: stb_orig-idnrk TO ecfld.
stb_add-objic = '@A6@'.
WHEN otyp_noo.
WRITE: stb_orig-potx1 TO ecfld.
stb_add-objic = '@0Q@'.
WHEN otyp_doc.
write stb_orig-doknr to ecfld. "note 489354
IF ecfld CP '*# '. ENDIF. "note 489354
sy-fdpos = sy-fdpos + 1. "note 489354
CONCATENATE
*d stb_orig-doknr "note 489354
stb_orig-dokar
stb_orig-doktl
stb_orig-dokvr
*d INTO ecfld "note 489354
INTO ecfld+sy-fdpos "note 489354
SEPARATED BY space.
stb_add-objic = '@AR@'.
WHEN otyp_kla.
CONCATENATE
stb_orig-class
stb_orig-klart
INTO ecfld
SEPARATED BY space.
stb_add-objic = '@7C@'.
WHEN otyp_ntm.
WRITE: stb_orig-intrm TO ecfld.
WHEN OTHERS.
ENDCASE.
*d CONDENSE ecfld. "note 515408
stb_add-dobjt = ecfld(40).
CLEAR: ecfld.
WRITE stb_orig-stufe TO stb_add-dstuf NO-SIGN.
*d MOVE-CORRESPONDING stb_orig TO alv_stb. "note 331962
MOVE-CORRESPONDING stb_add TO alv_stb.
MOVE-CORRESPONDING stb_orig TO alv_stb. "note 331962
APPEND alv_stb.
ENDFORM. " alv_stb_prep
*& Form get_level_level
text
FORM get_level_level.
REFRESH : T_STB,
T_MATCAT,
ALV_STB.
CLEAR : T_STB,
T_MATCAT,
ALV_STB.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
mktls = 'X'
mehrs = 'X'
mtnrv = t_mast-matnr
stlal = '01'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = p_werks
vrsvo = 'X'
TABLES
stb = t_stb
matcat = t_matcat
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR: hd_tab.
Entry der KlassenstatusTab. initialisieren
cl_clstab,
Entry 'Objekte von Klassen' initialisieren
cl_objmemo.
REFRESH: hd_tab.
SORT t_matcat BY index ASCENDING.
Get the All levels
loop at t_stb.
IF NOT t_stb-hdnfo IS INITIAL.
EXIT.
ENDIF.
Object Identification
PERFORM obj_ident.
READ TABLE hd_tab
WITH KEY stufe = t_stb-stufe
vwegx = t_stb-vwegx
BINARY SEARCH
TRANSPORTING NO FIELDS.
?gibt es diesen Satz schon
nein
IF sy-subrc <> 0.
dann in SFP-Infosatzverweistab. aufnehmen
*d APPEND HD_TAB. "HGH054648
hd_tab-stufe = t_stb-stufe.
"HGH054648
hd_tab-vwegx = t_stb-vwegx.
"HGH054648
INSERT hd_tab "HGH054648
INTO hd_tab "HGH054648
INDEX sy-tabix. "HGH054648
PosNr initialisieren
CLEAR: t_stb-posnr.
SFP-InfosatzKz setzen
t_stb-hdnfo = 'X'.
stb-objty = otyp_mat.
"HGE246532
als SFP-Infosatz in die STB aufnehmen
append t_stb.
ENDIF.
*del ENDIF.
clear t_stb.
endloop.
SORT t_stb ASCENDING BY stufe
index ASCENDING
*del POSNR ASCENDING. "HGC062735
posnr ASCENDING "HGC062735
hdnfo DESCENDING.
LOOP AT t_stb.
T_stb-index = sy-tabix.
MODIFY T_stb.
PERFORM alv_stb_prep.
ENDLOOP.
Displays the Value as Level by Level
loop at ALV_stb.
if sy-tabix = 1.
format color 3 on.
write:/2 'Level',12 'Item',22 'Component',
42 'Material Description',82 'Base Qty',
107 'Base Unit',120 'Assembly Indicator'.
format color 3 on.
endif.
if alv_stb-MEINs is initial.
v_flag = 'X'.
endif.
if v_flag = 'X'.
format color 5 on.
write:/2 ALV_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP.
format color 1 off.
else.
if alv_stb-STUFE = '1'.
format color 1 on.
write:/2 ALV_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs, 120 alv_stb-bomfl .
format color 1 off.
elseif alv_stb-STUFE = '2'.
format color 2 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl.
format color 2 off.
elseif alv_stb-STUFE = '3'.
format color 3 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 3 off.
elseif alv_stb-STUFE = '4'.
format color 4 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 4 off.
elseif alv_stb-STUFE = '5'.
format color 5 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 5 off.
elseif alv_stb-STUFE = '6'.
format color 7 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl.
format color 6 off.
elseif alv_stb-STUFE = '7'.
format color 7 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 7 off.
else.
format color 1 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 1 off.
endif.
endif.
hide: alv_stb.
clear : alv_stb.
clear v_flag.
endloop.
ENDFORM. " get_level_level
*& Form f4_for_variant
text
FORM f4_for_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
i_save = g_save
i_tabname_header = g_tabname_header
i_tabname_item = g_tabname_item
it_default_fieldcat =
IMPORTING
e_exit = g_exit
es_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF g_exit = space.
p_vari = gx_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " f4_for_variant
FORM E03_EVENTTAB_BUILD *
--> E03_LT_EVENTS *
FORM e03_eventtab_build USING e03_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = e03_lt_events.
READ TABLE e03_lt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO e03_lt_events.
ENDIF.
ENDFORM.
FORM E04_COMMENT_BUILD *
--> E04_LT_TOP_OF_PAGE -
Enforcing event AT-SELECTION-SCREEN OUTPUT
Hi Gurus
Does anybody know how to force event AT-SELECTION-SCREEN OUTPUT ?
What I'm aiming for is changing screen somewere outside of this event. For example.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_param.
IF p_param = 'change'.
changes_in_screen = 'X'.
*???* "forcing AT-SELECTION-SCREEN OUTPUT event
ENDIF.
AT-SELECTION-SCREEN OUTPUT.
IF changes_in_screen = 'X'.
LOOP AT SCREEN.
"do something
ENDLOOP.
ENDIF.
I would be grateful for any hints.One alternative to define two selection screens. First selection screen (default selection screen of report #1000) having Client_type. After user hits execute (F8) then show the second selection screen with corresponding parameters.
PARAMETERS: p_client(1).
SELECTION-SCREEN BEGIN OF SCREEN 9000 AS WINDOW.
PARAMETERS: p_name(20),
p_lname(20),
p_cname(20),
p_oname(20).
SELECTION-SCREEN END OF SCREEN 9000.
AT SELECTION-SCREEN OUTPUT.
CHECK sy-dynnr = '9000'.
* Hide corresponding fields on second selection screen
* based on values of P_CLIENT.
* Also should make key parameters obligatory!
START-OF-SELECTION.
CALL SELECTION-SCREEN 9000 STARTING AT 5 5.
Another alternative is to use a dialog/module pool program to handle this. Such screen field controlling can easily be done in dialog programs because you have full PAI/PBO control, unlike report program selection screen 1000. Unfortunately in a dialog program it is not easy to reproduce the functionality of a select-option. -
hi folks,
I need help in updating the selection screen, I have declared the 'parameters' object in the selection screen like this.
parameters:
Paygroup type ZPGKIS obligatory.
it has three values '5A', '5B' and '5V'. when I select '5V' from the parameters, I need to display another parameters selection object for 'date' otherwise NO
I tried something like this.....
if Paygroup = '5V'.
parameters: p_date type d.
endif.
It is not working...
How can I correct this??
Thanks in advance
Vinuhii
you can make that using radio button
<b>
REPORT z_selectionscreen .
SELECTION-SCREEN BEGIN OF BLOCK blk.
PARAMETERS : p_rb1 TYPE PAYGROUP RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND FC,
p_rb2 TYPE PAYGROUP RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK blk.
SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME.
PARAMETERS : p_werks1 TYPE werks_d MODIF ID bk1.
SELECTION-SCREEN END OF BLOCK blk_1.
SELECTION-SCREEN BEGIN OF BLOCK blk_2 WITH FRAME.
PARAMETERS : p_werks2 TYPE werks_d MODIF ID bk2,
p_matnr2 TYPE matnr MODIF ID bk2.
SELECTION-SCREEN END OF BLOCK blk_2.
AT SELECTION-SCREEN OUTPUT.
IF p_rb1 = '5V'.
LOOP AT SCREEN.
IF screen-group1 = 'BK1'.
screen-active = 0.
MODIFY SCREEN.
ELSE.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = 'BK2'.
screen-active = 0.
MODIFY SCREEN.
ELSE.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.</b>
you can as well check this code
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_FILE(25) TYPE C,
O_FILE(25) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
*Selection Screen 2
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
*Selection Screen 3
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
UPDATE DEFAULT 'X' MODIF ID BL1.
SELECTION-SCREEN END OF BLOCK B3.
*Selection Screen 4
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
LOC_DATE TYPE SY-DATUM MODIF ID BL2,
USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK B4.
At Selection-Screen Output *
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Message was edited by: Naresh Kumar
Message was edited by: Naresh Kumar -
Radio button field issue in the selection screen
Hi Folks,
I am using an LDB(Logical Data Base) of 'PNP' in my custom report and the LDB has a selection screen with different parameters .
My concern is, the selection screen has 6 Radio buttons from which if I select one from the first 5 Radio buttons the Dates highlighted should clear off, and when I click on Radio Button 'Other Period' the dates should display as shown .
Note: I am using the ECC 4.6C
Please suggest any solution to achieve this functionality .
Thanks,
Sujay.VHi,
Consider your radio buttons looks like below:
PARAMETERS: RADIO1 RADIOBUTTON GROUP R1 MODIF ID RA1, "Today
RADIO2 RADIOBUTTON GROUP R1 MODIF ID RA2, "Current Month
RADIO3 RADIOBUTTON GROUP R1 MODIF ID RA3, "Current Year
RADIO4 RADIOBUTTON GROUP R1 MODIF ID RA4, " Up to today
RADIO5 RADIOBUTTON GROUP R1 MODIF ID RA5, "From today
RADIO6 RADIOBUTTON GROUP R1 MODIF ID RA6. "Other period
AT SELECTION-SCREEN.
IF RADIO1 EQ 'X' OR RADIO2 EQ 'X' OR RADIO3 EQ 'X'
OR RADIO4 EQ 'X' OR RADIO5 EQ 'X'.
CLEAR: "Add your date variables here
ELSEIF RADIO6 EQ 'X'
ADD Logic for your date variable here
ENDIF.
Hope this will help you .
regards,
Rajesh Sadula. -
Dynamic fields creation on selection screen
Good evening everybody!
I've got the following problem for solving:
Imagine the following situation:
on the selection-screen there are some input fields in one line and a button after them. By pressing that button (e.g. it's name is "Add line") the same fields should be duplicated so many times as many times that button pressed. By pressing another button (e.g. it's name is "Delete line") one last line should be deleted. The mechanism is similar to adding lines in a screen table. What is the solution of this problem?
So: by pressing an "Add line" button on a screen identical fields should be created on the same selection-screen and deleted by pressing "Delete line".
Thanks in advance!Here's a way to do it.
DEFINE aline.
selection-screen: begin of line.
parameters: inp&1(5) type c modif id l&1.
selection-screen position 15.
parameters: inp10&1(5) type c modif id l&1.
selection-screen pushbutton 25(5) pb_&1 user-command add
modif id a&1.
selection-screen pushbutton 31(5) pb_10&1 user-command del
modif id d&1.
selection-screen end of line.
END-OF-DEFINITION.
TABLES: sscrfields.
DATA:
max_lines TYPE i VALUE 20,
fldname(60) TYPE c,
lines(2) TYPE n VALUE 1,
cnt(2) TYPE n VALUE 1.
FIELD-SYMBOLS:
<fld> TYPE ANY.
aline 01.
aline 02.
aline 03.
aline 04.
aline 05.
aline 06.
aline 07.
aline 08.
aline 09.
aline 10.
aline 11.
aline 12.
aline 13.
aline 14.
aline 15.
aline 16.
aline 17.
aline 18.
aline 19.
aline 20.
*---------------------------------------------------- Push Button
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'ADD'.
CHECK lines LT max_lines.
lines = lines + 1.
WHEN 'DEL'.
CHECK lines GT 1.
lines = lines - 1.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 CP 'A*'.
IF screen-group1+1(2) NE lines.
screen-active = 0.
ELSE.
IF lines LT max_lines.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
ENDIF.
ENDIF.
IF screen-group1 CP 'D*'.
IF screen-group1+1(2) NE lines.
screen-active = 0.
ELSE.
IF lines = 1.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ENDIF.
ENDIF.
IF screen-group1 CP 'L*'.
IF screen-group1+1(2) GT lines.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
INITIALIZATION.
cnt = 1.
WHILE cnt LE max_lines.
CONCATENATE 'PB_' cnt INTO fldname.
ASSIGN (fldname) TO <fld>.
<fld> = 'Add'.
CONCATENATE 'PB_10' cnt INTO fldname.
ASSIGN (fldname) TO <fld>.
<fld> = 'Del'.
cnt = cnt + 1.
ENDWHILE.
Edited by: Paul Chapman on Jul 1, 2008 1:06 PM -
Want to display space in selection screen
hi,
I want to display some space between one select-option and ane checkbox.
my coding is like
SELECT-OPTIONS:
s_vstel FOR vekp-vstel.
PARAMETERS:
p_dimen AS CHECKBOX DEFAULT ' '.
any pointer.Hi,
Use the
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-s01.
Selection-Screen : Begin of Line.
SELECT-OPTIONS:
s_vstel FOR vekp-vstel.
SELECTION-SCREEN: Skip.
PARAMETERS:
p_dimen AS CHECKBOX DEFAULT ' '.
Selection-Screen : End of Line.
SELECTION-SCREEN END OF BLOCK b1.
Edited by: avinash kodarapu on Nov 20, 2008 3:17 PM
Maybe you are looking for
-
PDF Specific printing issues relating to ink usage and duplexing
I have a preset printing setting so that I don't waste my color ink cartridges on my HP officejet 6500 when I'm only printing in black and white. When I print from adobe reader or preview (which I print from PDFs 95% of the time) the printer ignores
-
I somehow changed the pointer / cursor in bridge from an arrow to a small magnifying glass... when i position the cursor / pointer on a picture in the PREVIEW panel in bridge and press on the left mouse key, the cursor is a small magnifying glass tha
-
Hello everyone, A customer uses the Pick and Pack functionality of SAP Business One to process the deliveris for up to 100 sales orders at a time (an average of about 400 lines in the picking list). In version 2007A SP 01 PL08 this function consumes
-
Link Title To Video Clip - PE8
How do I link a "title" to a video clip so that it is locked and cannot shift when editing or deleting clips?
-
Fiori Launch Pad and Object Based Navigation (OBN)
I was wondering if anyone knows how the Fiori Launch Pad works with Object Based Navigation (OBN)... The scenario I am imagining is that I have a tile defined on the Fiori Launch Pad that opens a Web Dynpro ABAP Application - within that application