Modify select-option!!
Hi
i hav to modify select-option:
The select-option S_LGORT, S_VSTEL and S_LGORT will be restricted.
Only show tab Single vals and ranges, and option equal...how shall i modify..loop at that select-option or directly assign the option value n modify ...points for sure...
Regards
Gunjan
chk this report
REPORT TESTREP.
* Include type pool SSCR
TYPE-POOLS SSCR.
* Define the object to be passed to the RESTRICTION parameter
DATA RESTRICT TYPE SSCR_RESTRICT.
* Auxiliary objects for filling RESTRICT
DATA OPT_LIST TYPE SSCR_OPT_LIST.
DATA *** TYPE SSCR_***.
* Define the selection screen objects
* First block: 3 SELECT-OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK BLOCK_0 WITH FRAME TITLE TEXT-BL0.
SELECT-OPTIONS SEL_0_0 FOR SY-TVAR0.
SELECT-OPTIONS SEL_0_1 FOR SY-TVAR1.
SELECT-OPTIONS SEL_0_2 FOR SY-TVAR2.
SELECT-OPTIONS SEL_0_3 FOR SY-TVAR3.
SELECTION-SCREEN END OF BLOCK BLOCK_0.
* Second block: 2 SELECT-OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK BLOCK_1 WITH FRAME TITLE TEXT-BL1.
SELECT-OPTIONS SEL_1_0 FOR SY-SUBRC.
SELECT-OPTIONS SEL_1_1 FOR SY-REPID.
SELECTION-SCREEN END OF BLOCK BLOCK_1.
INITIALIZATION.
* Define the option list
* ALL: All options allowed
MOVE 'ALL' TO OPT_LIST-NAME.
MOVE 'X' TO: OPT_LIST-OPTIONS-BT,
OPT_LIST-OPTIONS-CP,
OPT_LIST-OPTIONS-EQ,
OPT_LIST-OPTIONS-GE,
OPT_LIST-OPTIONS-GT,
OPT_LIST-OPTIONS-LE,
OPT_LIST-OPTIONS-LT,
OPT_LIST-OPTIONS-NB,
OPT_LIST-OPTIONS-NE,
OPT_LIST-OPTIONS-NP.
APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
* NOPATTERN: CP and NP not allowed
CLEAR OPT_LIST.
MOVE 'NOPATTERN' TO OPT_LIST-NAME.
MOVE 'X' TO: OPT_LIST-OPTIONS-BT,
OPT_LIST-OPTIONS-EQ,
OPT_LIST-OPTIONS-GE,
OPT_LIST-OPTIONS-GT,
OPT_LIST-OPTIONS-LE,
OPT_LIST-OPTIONS-LT,
OPT_LIST-OPTIONS-NB,
OPT_LIST-OPTIONS-NE.
APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
* NOINTERVLS: BT and NB not allowed
CLEAR OPT_LIST.
MOVE 'NOINTERVLS' TO OPT_LIST-NAME.
MOVE 'X' TO: OPT_LIST-OPTIONS-CP,
OPT_LIST-OPTIONS-EQ,
OPT_LIST-OPTIONS-GE,
OPT_LIST-OPTIONS-GT,
OPT_LIST-OPTIONS-LE,
OPT_LIST-OPTIONS-LT,
OPT_LIST-OPTIONS-NE,
OPT_LIST-OPTIONS-NP.
APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
* EQ_AND_CP: only EQ and CP allowed
CLEAR OPT_LIST.
MOVE 'EQ_AND_CP' TO OPT_LIST-NAME.
MOVE 'X' TO: OPT_LIST-OPTIONS-CP,
OPT_LIST-OPTIONS-EQ.
APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
* JUST_EQ: Only EQ allowed
CLEAR OPT_LIST.
MOVE 'JUST_EQ' TO OPT_LIST-NAME.
MOVE 'X' TO OPT_LIST-OPTIONS-EQ.
APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
* Assign selection screen objects to option list and sign
* KIND = 'A': applies to all SELECT-OPTIONS
MOVE: 'A' TO ***-KIND,
'*' TO ***-SG_MAIN,
'NOPATTERN' TO ***-OP_MAIN,
'NOINTERVLS' TO ***-OP_ADDY.
APPEND *** TO RESTRICT-***_TAB.
* KIND = 'B': applies to all SELECT-OPTIONS in block BLOCK_0,
* that is, SEL_0_0, SEL_0_1, SEL_0_2
CLEAR ***.
MOVE: 'B' TO ***-KIND,
'BLOCK_0' TO ***-NAME,
'I' TO ***-SG_MAIN,
'*' TO ***-SG_ADDY,
'NOINTERVLS' TO ***-OP_MAIN.
APPEND *** TO RESTRICT-***_TAB.
* KIND = 'S': applies to SELECT-OPTION SEL-0-2
CLEAR ***.
MOVE: 'S' TO ***-KIND,
'SEL_0_2' TO ***-NAME,
'I' TO ***-SG_MAIN,
'*' TO ***-SG_ADDY,
'EQ_AND_CP' TO ***-OP_MAIN,
'ALL' TO ***-OP_ADDY.
APPEND *** TO RESTRICT-***_TAB.
* KIND = 'S': Applies to SELECT-OPTION SEL_0_3
CLEAR ***.
MOVE: 'S' TO ***-KIND,
'SEL_0_3' TO ***-NAME,
'I' TO ***-SG_MAIN,
'N' TO ***-SG_ADDY,
'JUST_EQ' TO ***-OP_MAIN.
APPEND *** TO RESTRICT-***_TAB.
* Call function module
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
RESTRICTION = RESTRICT
* DB = ' '
EXCEPTIONS
TOO_LATE = 1
REPEATED = 2
NOT_DURING_SUBMIT = 3
DB_CALL_AFTER_REPORT_CALL = 4
SELOPT_WITHOUT_OPTIONS = 5
SELOPT_WITHOUT_SIGNS = 6
INVALID_SIGN = 7
REPORT_CALL_AFTER_DB_ERROR = 8
EMPTY_OPTION_LIST = 9
INVALID_KIND = 10
REPEATED_KIND_A = 11
OTHERS = 12.
* Exception handling
IF SY-SUBRC NE 0.
ENDIF.
Similar Messages
-
How to modify a select option without range and mutiple selection??
hi all,
i need to modify a select option by removing the range and option for multiple entry. i other words i need to make select option as parameter.( because i cannot use parameter in my program due to some constraints.)
is it possible to change the select option as per my requirement if yes please let me know how is it possible.
Thanks in advance.
Sreekanth.hi,
Yes u can use code like following way..
select-options : s_matnr for mara-matnr no-extension no intervals.
Reward if helpful.
Regards
Gagan -
How to modify a select-option in a block
Hello, i have a block containing 2 select options. when i try to grey out the first, the second is also greyed out. Both depend on whether their checkboxes are checked.
LOOP AT SCREEN.
IF CB_SRM IS INITIAL .
IF screen-NAME = 'S_SC-LOW' OR screen-NAME = 'S_SC-HIGH' .
SCREEN-input = 0.
MODIFY SCREEN .
ENDIF.
ENDIF.
IF CB_SAP IS INITIAL.
IF screen-NAME = 'S_CMDE-LOW' OR screen-name = 'S_CMDE-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.Hi,
<li>Try this way.
<li>Clue is Set USER-COMMAND addition to checkbox.
REPORT ztest.
TABLES:mara.
SELECT-OPTIONS:s_matnr FOR mara-matnr.
PARAMETERS:p_check AS CHECKBOX USER-COMMAND uc1.
AT SELECTION-SCREEN OUTPUT.
IF p_check = 'X'.
LOOP AT SCREEN.
IF screen-name = 'S_MATNR-LOW' OR
screen-name = 'S_MATNR-HIGH'.
screen-input = 0.
MODIFY SCREEN.
CLEAR screen.
ENDIF.
ENDLOOP.
ENDIF.
Thanks
Venkat.O -
How to hide some select-option of Logical Database in report?
How to hide select-option of Logical Database in report?eg . In Logical Database 'PNP' , my code is 'GET PERNR' , excute the report , select-screen is displayed . I want to hide some select-options , such as PNPPERNR-LOW .
Edited by: rongrong wang on Mar 26, 2008 9:31 AMU need to write code in initialization as
initialization.
loop at screen.
if screen-name = 'PNPPERNR-LOW'.
screen-active = '0'.
modify screen.
endif.
if screen-name = 'PNPPERNR-HIGH'.
screen-active = '0'.
modify screen.
endif.
endloop. -
Re : select-options in abap-objects program
Dear friends,
I want to give select-options in abap-objects program. How to give that.
Thanking You
with regards,
ManiIn the transaction SE24, enter your class name, click modify.
in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
" P_SAKNR FOR SKAT-SAKNR".
you've got to declare two types in the class:
a- TYPES: begin of E_S_SAKNR,
sign(1),
option(2),
low(10),
high(10),
end of E_S_SAKNR.
b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
method TEST importing ET_SAKNR type E_T_SAKNR.
now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example.. -
Help on Dynamic values in select options
Hi All,
I need help for the following.
1. I have two select options for fields VBAK-VBELN and VBAK-ERDAT one after the other.
2. When I select VBELN through F4 in the first select option then the corresponding ERDAT should be displayed in second select option.
Please let me know how to do thisUse the below code
tables: pa0000, pa0001.
parameters: p_chk1 as checkbox user-command rusr,
p_chk2 as checkbox user-command rusr,
p_chk3 as checkbox user-command rusr,
p_chk4 as checkbox user-command rusr,
p_chk5 as checkbox user-command rusr.
selection-screen: begin of block blk1 with frame.
select-options: s_pernr for pa0000-pernr modif id ABC,
s_stat2 for pa0000-stat2 modif id DEF,
s_werks for pa0001-werks modif id GHI,
s_persg for pa0001-persg modif id JKL,
s_persk for pa0001-persk modif id MNO.
selection-screen: end of block blk1.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
IF p_chk1 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'DEF'.
IF p_chk2 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'GHI'.
IF p_chk3 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'JKL'.
IF p_chk4 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'MNO'.
IF p_chk5 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*Note
*Titles for check boxes and select options
*P_CHK1 Personal Number
*P_CHK2 Employment Status
*P_CHK3 Personnel Area
*P_CHK4 Employee Group
*P_CHK5 Employee Sub group
*S_PERNR Personal Number
*S_PERSG Employee Group
*S_PERSK Employee Sub group
*S_STAT2 Employment Status
*S_WERKS Personnel Area -
How to set the parameter selection *optional* for each subreport?
Hi,
I am using Crystal Reprots 11.
I create 10 subreports, and each subreport contains a Parameters Field.
The 10 subreports are put in 10 footer sections in increasing order, i.e. subreport1, subreport2, subreport3, ..., subreport10.
When I use "Print Preview" to take a look at the whole report, CR prompts a "Edit Values" window for selecting parameter values for all 10 subreports.
For example, if I only select parameter values for subreport1 and click "OK", 9 error messages on the "Edit Values" window come out above the selection list box of every other subreports (i.e. subreport2 ~ subreport10) showing that: 'The value is not valid'.
Sometimes, I just want to review some specific subreports but not all.
How should I do to set the parameter selection optional (not mandatory) for each subreport?
Thank you in adavance.
Edited by: Holdup on Feb 17, 2012 3:44 PMHi,
Here's how you can make the prompts optional (Assuming you're using CR 2008 or higher):
1) Go into each subreport
2) You should see the parameter in the Field Explorer. Right-click the name and select Edit > Look for an option called 'Optional Prompt'. Set it to true
3) If you have a record selection in the subreport, then you need to modify the selection formula to something like this:
if not(hasvalue({?Parameter_Name})) then True else = {?Parameter_Name}
Hope this helps!
-Abhilash -
How to use the select option to get the multiple bom explosion
hi friends,
i have completed the bom exp using parameters to get one material
input,but i need to adopt select option to give from and to materials
i ll gives from and to materials with description and bom deails
i here gave the coding also, pl give me a suggestion how to adpot the select
optoins instead of parameters ,very urgent
REPORT PP_BOM_EXPLOSION.
tables :mara,marc,stpo.
TYPE-POOLS : SLIS.
*parameters: p_werks like t001w-werks obligatory.
SELECT-OPTIONS : p_matnr FOR mara-matnr obligatory.
**select-options : p_matnr for mara-matnr obligatory.
PARAMETERS : P_WERKS LIKE T001W-WERKS OBLIGATORY,
P_MATNR LIKE MARA-MATNR OBLIGATORY.
*parameters: p_werks like marc-werks obligatory,
*p_matnr like marc-matnr obligatory.
constants c_x value 'X'.
data: begin of it_comp occurs 0,
matnr like mara-matnr,
maktl like makt-maktx,
idnrk like stpox-idnrk,
ojtxp like stpox-ojtxp,
menge like stpox-menge,
meins like stpox-meins,
matkl like stpox-matmk,
end of it_comp.
data : topmat like cstmat.
data: w_topmat like cstmat.
DATA : IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : WA_FIELDCAT_LN LIKE LINE OF IT_FIELDCAT.
DATA : IT_EVENTCAT TYPE SLIS_T_EVENT.
DATA : WA_EVENTCAT_LN LIKE LINE OF IT_EVENTCAT.
DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: S_COL_POS TYPE I.
start-of-selection.
perform explode_assembly.
PERFORM BUILD_FIELDCATALOG.
PERFORM DATA_DISPLAY.
*end-of-selection.
*perform write_report.
*top-of-page.
*perform print_header.
*form print_header.
*write: /(18) 'Component'(h00),
*(40) 'Description'(h01),
*'Mat.Group'(h02),
*(18) 'Quantity'(h03).
*uline.
*endform.
*form write_report.
*write: / w_topmat-matnr under text-h00 color col_heading,
*w_topmat-maktx under text-h01 color col_heading.
*loop at it_comp.
*write: /
*it_comp-idnrk under text-h00,
*it_comp-ojtxp under text-h01,
*it_comp-matkl under text-h02,
*it_comp-menge unit it_comp-meins under text-h03,
*it_comp-meins.
*endloop.
*uline.
*endform.
form explode_assembly.
data: it_stb like stpox occurs 0 with header line,
it_stb2 like stpox occurs 0 with header line,
it_stb3 like stpox occurs 0 with header line,
w_msg(255) type c.
SELECT MATNR FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_MARA
WHERE MATNR IN P_MATNR.
Explode highest level:
*LOOP AT IT_MARA.
call function 'CS_BOM_EXPL_MAT_V2'
exporting
auskz = c_x
capid = 'PP01'
cuols = c_x
datuv = sy-datum
knfba = c_x
ksbvo = c_x
mbwls = c_x
mdmps = c_x
BGIXO = c_x
MKMAT = c_x
MMAPS = c_x
FBSTP = c_x
FTREL = c_x
mtnrv = P_MATNR
werks = p_werks
importing
topmat = w_topmat
tables
stb = it_stb
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
into w_msg.
*write: / w_msg.
exit.
endif.
Don't process documents
delete it_stb where idnrk is initial.
Don't process valid from furure:
delete it_stb where datuv >= sy-datum.
Explode phantom assemblies up to last level
*do.
it_stb2[] = it_stb[].
*delete it_stb2 where dumps is initial.
*if it_stb2[] is initial.
*exit.
*endif.
*delete it_stb where not dumps is initial.
delete it_stb where VPRSV <> 'S' OR MMSTA = '61'.
loop at it_stb2.
call function 'CS_BOM_EXPL_MAT_V2'
exporting
capid = 'PP01'
auskz = c_x
cuols = c_x
datuv = sy-datum
knfba = c_x
ksbvo = c_x
mbwls = c_x
mdmps = c_x
FBSTP = c_x
FTREL = c_x
mtnrv = it_stb2-idnrk
werks = p_werks
tables
stb = it_stb3
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
into w_msg.
*write: / w_msg.
else.
delete it_stb3 where idnrk is initial.
delete it_Stb3 where sobsl = 50.
loop at it_stb3 .
multiply it_stb3-menge by it_stb2-menge.
modify it_stb3 transporting menge.
endloop.
append lines of it_stb3 to it_stb.
endif.
*ENDLOOP.
endloop.
*enddo.
Build table of components collecting the same components from
all levels
loop at it_stb.
it_comp-matkl = it_stb-matmk.
it_comp-idnrk = it_stb-idnrk.
it_comp-ojtxp = it_stb-ojtxp.
it_comp-menge = it_stb-menge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = IT_STB-MEINS
LANGUAGE = SY-LANGU
IMPORTING
LONG_TEXT =
OUTPUT = IT_STB-MEINS
SHORT_TEXT =
EXCEPTIONS
UNIT_NOT_FOUND = 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.
it_comp-meins = it_stb-meins.
collect it_comp.
clear it_comp.
endloop.
*READ TABLE IT_COMP INDEX 1.
*IF SY-SUBRC = 0.
IT_COMP-MATNR = w_topmat-matnr.
IT_COMP-MAKTL = w_topmat-maktx.
INSERT IT_COMP index 1.
*ENDIF.
ENDFORM.
FORM TO APPEND DATA INTO ALV FORM
FORM BUILD_FIELDCATALOG.
PERFORM BUILD_FIELDCAT USING 'MATKL' 'Component'.
PERFORM BUILD_FIELDCAT USING 'MATKL' 'Component'.
*loop at it_comp.
PERFORM BUILD_FIELDCAT USING 'MATNR' 'Material'.
PERFORM BUILD_FIELDCAT USING 'MAKTL' 'Material Description'.
PERFORM BUILD_FIELDCAT USING 'IDNRK' 'Component'.
PERFORM BUILD_FIELDCAT USING 'OJTXP' 'Description'.
PERFORM BUILD_FIELDCAT USING 'MATKL' 'Material Group'.
PERFORM BUILD_FIELDCAT USING 'MENGE' 'Quantity'.
PERFORM BUILD_FIELDCAT USING 'MEINS' 'Unit Of MEASUREMENT'.
*endloop.
ENDFORM.
FORM TO BUILD IN FIELD CATALOG FOR ALV FORM
FORM BUILD_FIELDCAT USING L_FIELDNAME LIKE DD03L-FIELDNAME S_TEXT LIKE DD03P-SCRTEXT_M.
CLEAR WA_FIELDCAT_LN.
ADD 1 TO S_COL_POS.
WA_FIELDCAT_LN-REF_TABNAME = 'IT_COMP'.
WA_FIELDCAT_LN-FIELDNAME = L_FIELDNAME.
WA_FIELDCAT_LN-SELTEXT_M = S_TEXT.
WA_FIELDCAT_LN-COL_POS = S_COL_POS.
WA_FIELDCAT_LN-QFIELDNAME = SPACE.
WA_FIELDCAT_LN-HOTSPOT = SPACE.
WA_FIELDCAT_LN-JUST = 'R'.
APPEND WA_FIELDCAT_LN TO IT_FIELDCAT.
ENDFORM.
FORM TO BUILD IN FIELD CATALOG FOR ALV FORM
FORM DATA_DISPLAY.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = TEXT-001
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_COMP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform.
Thanks in advance
Regards
senthilkumar Dtables :mara,marc,stpo.
parameters: p_werks like t001w-werks obligatory.
*p_matnr like mara-matnr obligatory.
*select-options : p_matnr for mara-matnr obligatory.
select-options : P_matnr for mara-matnr.
*parameters: p_werks like marc-werks obligatory,
*p_matnr like marc-matnr obligatory.
constants c_x value 'X'.
data: begin of it_comp occurs 0,
idnrk like stpox-idnrk,
ojtxp like stpox-ojtxp,
menge like stpox-menge,
meins like stpox-meins,
matkl like stpox-matmk,
end of it_comp.
data: w_topmat like cstmat.
data : begin of itab occurs 0,
matnr like mara-matnr,
end of itab.
*data : itab type table of mara with header line.
start-of-selection.
perform explode_assembly.
end-of-selection.
perform write_report.
top-of-page.
perform print_header.
form print_header.
write: /(18) 'Component'(h00),
(40) 'Description'(h01),
'Mat.Group'(h02),
(18) 'Quantity'(h03).
uline.
endform.
form write_report.
write: / w_topmat-matnr under text-h00 color col_heading,
w_topmat-maktx under text-h01 color col_heading.
loop at it_comp.
write: /
it_comp-idnrk under text-h00,
it_comp-ojtxp under text-h01,
it_comp-matkl under text-h02,
it_comp-menge unit it_comp-meins under text-h03,
it_comp-meins.
endloop.
uline.
endform.
form explode_assembly.
data: it_stb like stpox occurs 0 with header line,
it_stb2 like stpox occurs 0 with header line,
it_stb3 like stpox occurs 0 with header line,
w_msg(255) type c.
select matnr from mara into table itab where matnr between p_matnr-low and p_matnr-high.
loop at p_matnr.
itab-matnr = p_matnr-low.
append itab.
itab-matnr = p_matnr-high.
append itab.
clear itab.
endloop.
Explode highest level:
loop at itab.
call function 'CS_BOM_EXPL_MAT_V2'
exporting
auskz = c_x
capid = 'PP01'
cuols = c_x
datuv = sy-datum
knfba = c_x
ksbvo = c_x
mbwls = c_x
mdmps = c_x
BGIXO = c_x
MKMAT = c_x
MMAPS = c_x
FBSTP = c_x
FTREL = c_x
mtnrv = itab-matnr
werks = p_werks
importing
topmat = w_topmat
tables
stb = it_stb
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
into w_msg.
write: / w_msg.
exit.
*else.
endif.
loop at it_stb.
it_comp-matkl = it_stb-matmk.
it_comp-idnrk = it_stb-idnrk.
it_comp-ojtxp = it_stb-ojtxp.
it_comp-menge = it_stb-menge.
it_comp-meins = it_stb-meins.
collect it_comp.
clear it_comp.
endloop.
endloop.
endform.
i got the low and high from selectoption and then move it into itab.
then i pass itab-matnr into fm. using loop.
but i got only one output
but ineet to got from and to output.
give me a solution
Regards
ds -
Select options - dynp_values_update
Hi,
I need to update a select option ( multiple values ) in the selection screen. I tried with DYNP_VALUES_UPDATE but it was not working. I am checking on this for last two days but did not reach the solution.
Please donot tell me to use submit statement ( calls an internall session ) becuase that is what i got when i searched in SCN. I want this functionality to happen when the f4 help is selected. We are providing a popup of multiple checkboxes when f4 is pressed on a select option. When one or more check boxes are selected then those values must be appended to the select option. Please give me some ideas.
If i have to use DYNP_VALUES_UPDATE then how should i use it for select option ?
Regards
KesavHello Keshav,
Not sure why you've used REUSE_ALV_POPUP_TO_SELECT. You can achieve the same by turning on the MULTIPLE_CHOICE param in F4IF_INT_TABLE_VALUE_REQUEST. Check this code snippet:
DATA: v_field TYPE fieldname.
SELECT-OPTIONS: s_field FOR v_field NO INTERVALS.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'S_FIELD-LOW'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_field-low.
* Local type declarations
TYPES : BEGIN OF t_flds,
tabname TYPE dfies-tabname,
fieldname TYPE dfies-fieldname,
keyflag TYPE dfies-keyflag,
fieldtext TYPE dfies-fieldtext,
END OF t_flds.
CONSTANTS: lc_field TYPE fieldname VALUE 'FIELDNAME'.
* Local data declarations
DATA:
ls_flds TYPE t_flds,
lt_flds TYPE STANDARD TABLE OF t_flds,
ls_values TYPE ddshretval,
lt_values TYPE STANDARD TABLE OF ddshretval,
lt_dfies TYPE TABLE OF dfies,
ls_dfies TYPE dfies.
* Get field details of the Table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'MARC'
langu = sy-langu
TABLES
dfies_tab = lt_dfies
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc = 0.
LOOP AT lt_dfies INTO ls_dfies WHERE fieldname NE 'MANDT'.
MOVE-CORRESPONDING ls_dfies TO ls_flds.
APPEND ls_flds TO lt_flds.
ENDLOOP.
ELSE.
EXIT.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = lc_field
window_title = 'Select the Table Field'(001)
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_FIELD-LOW'
value_org = 'S'
multiple_choice = 'X'
display = 'F'
TABLES
value_tab = lt_flds
return_tab = lt_values.
s_field-sign = 'I'.
s_field-option = 'EQ'.
LOOP AT lt_values INTO ls_values .
s_field-low = ls_values-fieldval.
APPEND s_field.
ENDLOOP.
DATA: lt_dynpread TYPE STANDARD TABLE OF dynpread,
lwa_dynpread TYPE dynpread.
READ TABLE s_field INDEX 1.
IF sy-subrc = 0.
lwa_dynpread-fieldname = 'S_FIELD-LOW'.
lwa_dynpread-fieldvalue = s_field-low.
APPEND lwa_dynpread TO lt_dynpread.
* Update the screen field values
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpread
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 NE 0.
ENDIF.
ENDIF.
Hope this helps.
BR,
Suhas -
How can i create a dynamic structure based on my input from a select-option
Hello,
This is to develop a custom report in FI for G/L Balance based on company code.
I have an input select-option for Company code.
Based on the range of company code my output layout should be modified.
I am not very much sure to create a dynamic internal based on the input from a select-option.
Can any one please let me know how can i do this.
I would appreciate for anyone who turns up quickly.
Thank you,
With regs,
Anitha Joss.See the following program, it builds a dynamic internal table based on the company codes from the select option.
report zrich_0001 .
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>.
data: alv_fldcat type slis_t_fieldcat_alv,
it_fldcat type lvc_t_fcat.
data: it001 type table of t001 with header line.
selection-screen begin of block b1 with frame title text-001.
select-options: s_bukrs for it001-bukrs.
selection-screen end of block b1.
start-of-selection.
select * into table it001 from t001
where bukrs in s_bukrs.
perform build_dyn_itab.
* Build_dyn_itab
form build_dyn_itab.
data: index(3) type c.
data: new_table type ref to data,
new_line type ref to data,
wa_it_fldcat type lvc_s_fcat.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = 'PERIOD' .
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 6.
append wa_it_fldcat to it_fldcat .
loop at it001.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = it001-bukrs .
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 4.
append wa_it_fldcat to it_fldcat .
endloop.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
endform.
Regards,
Rich Heilman -
How to created Freely Programmed F4 help in Select Options
hi,all
I have a probelm about how to created a Freely Programmed F4 help in Select Options,and put help value into select options field
Thanks and Best RegardsHi Haung,
You need to use FREE_HELP not the component name.
Modify you code as below:
LT_RANGE_TABLE_V = wd_this->m_handler_V->create_range_table( 'ZCYPHDATE' ).
wd_this->M_HANDLER_V->add_selection_field(
i_id = 'ZCYPHDATE'
it_result = LT_RANGE_TABLE_V
i_value_help_type = if_wd_value_help_handler=>CO_PREFIX_APPLDEV
i_value_help_id = 'FREE_HELP'
i_no_intervals = abap_false ).
Hope this helps you.
Regards,
Rama -
Can we hide the select-option in a selection screen
Hi all,
I have two radio buttons in my selection screen with 1 select-option criteria, now on choosing the other radio button I want that a different select-option criteria should appears.
Thankshi kunal check the code below.
TABLES : SSCRFIELDS,MARA.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
PARAMETERS : R1 RADIOBUTTON GROUP RB1 DEFAULT 'X',
R2 RADIOBUTTON GROUP RB1,
R3 RADIOBUTTON GROUP RB1,
R4 RADIOBUTTON GROUP RB1.
SELECTION-SCREEN PUSHBUTTON /10(20) FRST USER-COMMAND FRST.
SELECTION-SCREEN PUSHBUTTON /10(20) SCND USER-COMMAND SCND.
SELECTION-SCREEN END OF BLOCK B1.
DATA : ACTIVE1 VALUE '1',
ACTIVE2 VALUE '1'.
initialization.
move 'frst' to frst.
move 'scnd' to scnd.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'R1' OR SCREEN-NAME = 'R2' .
SCREEN-INVISIBLE = ACTIVE1.
screen-output = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'R3' OR SCREEN-NAME = 'R4' .
SCREEN-INVISIBLE = ACTIVE2.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
WHEN 'FRST'.
ACTIVE1 = '0'.
ACTIVE2 = '1'.
WHEN 'SCND'.
ACTIVE2 = '0'.
ACTIVE1 = '1'.
ENDCASE. -
SELECT-OPTIONS in table maintenance generator screen
Hi
Is it possible to create SELECT-OPTIONS in table maintenance screen?
My requirement is to allow the user to enter single Company code and Range of G/L Accounts in the Table Maintenance input screen. Please let me know.
Thanks
Abdul HakimHello Tamas,
As a matter of fact we can add a custom selection-screen to the TMG screen & without manually modifying the TMG
You can do so by using the [Event AA: Instead of the Standard Data Read Routine|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f56a9d111d1a5690000e82deaaa/content.htm].
Please check the code snippet:
DATA: gv_fldate TYPE s_date.
* User-defined selection-screen
SELECTION-SCREEN: BEGIN OF SCREEN 9000.
PARAMETERS: p_carrid TYPE s_carr_id OBLIGATORY.
SELECT-OPTIONS: s_fldate FOR gv_fldate OBLIGATORY.
SELECTION-SCREEN: END OF SCREEN 9000.
*& Form sub_yvsflight_event_aa
* text
FORM sub_yvsflight_event_aa.
DATA: ls_temp_data TYPE yvsflight,
lt_temp_data TYPE STANDARD TABLE OF yvsflight.
* Call the user-defined selection-screen
CALL SELECTION-SCREEN 9000 STARTING AT 25 10.
* Populate the int. table TOTAL
PERFORM get_data_yvsflight.
* Delete the records which are not required
LOOP AT total.
ls_temp_data = <vim_total_struc>. "Copy to local struct.
IF ls_temp_data-carrid NE p_carrid OR
ls_temp_data-fldate NOT IN s_fldate.
DELETE total. "Remove the record from the TOTAL
ENDIF.
ENDLOOP.
ENDFORM. "sub_yvsflight_event_aa
BR,
Suhas -
Hi,
I am trying to create select - options in Screen , i.e. not the selection screen but a custom screen, say 9000. I can make the text boxes etc for having the select options. But How do I simulate the button wchich comes after select options. It would be used in dialogue programming with multiple screens having different reports.
Please reply to me urgently,
Thanks and Regards
Arnab PanigrahiA few dot points:
1. You can have a select-option embedded in a dynpro, if you want, by using a subscreen. There's an example bit of code at
Module - pool Question..?
This would be easy to adapt to being a popup rather than a full screen if required.
2. As noted above, you can code your own select-options as in
Making a referenced field a range?
which I think Sesh has quoted from.
3. For the requirement you expressed initially, the code below should do the trick... you get a different block of extra selections depending on which radionbutton you select.
Jonathan
report zlocal_jc_radiobutton_hiding.
tables:
sscrfields. "To allow trapping of Fcode on selection screen
selection-screen begin of block tot with frame.
parameters :
p_rb_01 radiobutton group rbg1 user-command zrb1 default 'X',
p_rb_02 radiobutton group rbg1.
selection-screen begin of block block1 with frame title text1.
parameters:
p_date like sy-datum modif id bl1.
selection-screen end of block block1.
selection-screen begin of block block2 with frame title text2.
parameters:
p_time like sy-uzeit modif id bl2.
selection-screen end of block block2.
selection-screen end of block tot.
*" Events:
initialization.
text1 = 'Enter a date'.
text2 = 'Enter a time'.
at selection-screen output.
perform at_selection_screen_output.
at selection-screen.
perform at_selection_screen.
*& Form at_selection_screen_output
form at_selection_screen_output.
*" Hide the appropriate fields
loop at screen.
if p_rb_01 = 'X'
and screen-group1 = 'BL2'.
screen-active = '0'.
endif.
if p_rb_02 = 'X'
and screen-group1 = 'BL1'.
screen-active = '0'.
endif.
modify screen.
endloop.
endform. "at_selection_screen_output
*& Form at_selection_screen
form at_selection_screen.
*" trap the radiobutton
if sscrfields-ucomm = 'ZRB1'. "clicked Subtotal checkbox
*" if you want to trap this radio button press here
endif.
endform. "at_selection_screen -
Select-options in display mode
Hi
How to set the SELECT-OPTIONS in display mode by default
regards
Srinivashiii
for every LOW and HIGH value of select option you can use a code like given below..
First initialize your select option with some values then use following code
AT SELECTION-SCREEN OUTPUT .
IF s_docno IS NOT INITIAL .
LOOP AT SCREEN.
IF screen-name CS 's_docno'.
screen-input = 0.
MODIFY SCREEN.
ENDIF. " IF screen-name CS 'p_docno'.
ENDLOOP. " LOOP AT SCREEN.
regards
twinkal
Maybe you are looking for
-
Acrobat 9.3.4 freezing when opening specific PDF
I have a specific PDF file that when opened from the local computer causes Acrobat to freeze (adobe launches, but then hour glass with blank screen). Other PDFs open just fine. I have tried multiple computers, and every computer with Acrobat versio
-
WHY CANT I USE FINAL CUT EXPRESS HD IN MY MACBOOK
WHY CANT I USE FINAL CUT EXPRESS HD IN MY MACBOOK?
-
i had to completely reset my computer and i still have music and apps and everything on my phone but how do i sync itunes with my phone without losing everything that is already on my phone?
-
Dear all I had one already define sap query , the sap query contains MSKU , MBEW table which give us the information regarding customer consignment stock as well as the material moving average price , now client want to see the sales order with res
-
How to rename custom tab?
I add container (JSPTableContainer) to JSPTabContainer and now cannot change the title of this tab; in the "Tabs" link inside the portal there are no actions "Rename" or "Delete" for my tab. Changing the property "Title" of my container also has no e