How to restrict values displayed using a select-options
Can someone please tell me how to restrict values displayed using a select-options.
Example- in my table I have 100 entries. However when the user will click on the required field- I want to be display only 25 options based on a given value of another field in the table.
Thanks,
Mahesh.
get the screen value for the selectd field using the fm
DYNP_VALUES_READ.
for that value filter the internal table values and pass the table to f4 help of the field.
below code will help u
write the f4 help for the field.
At Selection Screen on value request *
F4 help for Corporate
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CORP.
Get Corporates for selected division
PERFORM GET_CORP.
PERFORM F4HELP_CORP.
*& Form GET_CORP
Get the corporates for the selected division
There are no interface parameters to be passed to this routine
FORM GET_CORP .
Table for conglomerate
DATA:
LT_CONG LIKE STANDARD TABLE OF FS_CORP,
Fields of current screen
LFS_DYNPREAD TYPE DYNPREAD,
Table for current Screen fields
LT_DYNPREAD LIKE STANDARD TABLE OF LFS_DYNPREAD.
LFS_DYNPREAD-FIELDNAME = 'P_DIV'.
APPEND LFS_DYNPREAD TO LT_DYNPREAD.
Get selection screen value for division
CALL FUNCTION 'DYNP_VALUES_READ'
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
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF SY-SUBRC EQ 0.
READ TABLE LT_DYNPREAD INTO LFS_DYNPREAD INDEX 1.
IF SY-SUBRC EQ 0.
P_DIV = LFS_DYNPREAD-FIELDVALUE.
ENDIF. " IF SY-SUBRC EQ 0
ENDIF. " IF SY-SUBRC EQ 0
REFRESH T_CORP.
Get the conglomerate for the selected division
SELECT KUNNR " Conglomerate
FROM KNVH
INTO TABLE LT_CONG
WHERE HITYP EQ C_HITYP
AND VKORG EQ C_VKORG
AND VTWEG EQ C_VTWEG
AND SPART EQ P_DIV
AND DATAB LE SY-DATUM
AND DATBI GE SY-DATUM
AND HKUNNR EQ SPACE.
IF SY-SUBRC EQ 0.
SORT LT_CONG BY KUNNR.
DELETE ADJACENT DUPLICATES FROM LT_CONG
COMPARING KUNNR.
Get the corporates for the selected conglomerates
SELECT KUNNR " Customer Number
FROM KNVH
INTO TABLE T_CORP
FOR ALL ENTRIES IN LT_CONG
WHERE HITYP EQ C_HITYP
AND VKORG EQ C_VKORG
AND VTWEG EQ C_VTWEG
AND SPART EQ P_DIV
AND DATAB LE SY-DATUM
AND DATBI GE SY-DATUM
AND HKUNNR EQ LT_CONG-KUNNR.
IF SY-SUBRC NE 0.
CLEAR: SSCRFIELDS.
MESSAGE I531(0U) WITH TEXT-005.
STOP.
ENDIF. " IF SY-SUBRC NE 0
ELSE.
CLEAR: SSCRFIELDS.
MESSAGE I531(0U) WITH TEXT-004.
STOP.
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " GET_CORP
*& Form F4HELP_CORP
F4 help for corporate
There are no interface parameters to be passed to this routine
FORM F4HELP_CORP .
F4 help for corporate
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'KUNNR'
DYNPPROG = 'Z_EXCESS_USAGE'
DYNPNR = '1000'
DYNPROFIELD = 'P_CORP'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_CORP
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
Do nothing
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " F4HELP_CORP
Similar Messages
-
Using a selection option Var on a restricted list of values for a char
hi all,
i am trying to use a selection option variable in a restricted list of values in a characteristic. for example. company code has the following values:
1) GB01
2) GB02
3) GB03
4) MY01
5) SG01
and so on.....
Now, i would like to restrict the list of values into GB01, GB02 and MY01.
and based on this restricted list, i will again need a variable to do a selection option in the report.
Do you think this is possible? what will be the solution to this?
i have tried to restricted it with 2 variables but it doesnt allow that.
cheers,
willieADF Faces has a very small learning curve, at least
on top of learning JSF itself, - it's a JSF component
library with some extra JSF framework features, but
you can use only the bits you want. It is
proprietary to the extent that you're using some code
that isn't a standard, but we run right on top of the
JSF standard (and you can use either MyFaces or the
Sun RI), so there's not a whole lot of lock-in.Ok sounds good and I am aware of a lot of the work that Oracle has been doing. I would like though ask you some additional questions.
Could you contact me at [email protected] if it is not too much trouble.
Thanks much. -
How to restrict values of Dimensions in Webi report prompt
Hi
I need to create a WebI report for a set of Business users. We have several thousands of Agencies. Business Users want to see only the agencies they work with (about 100) in the prompt. This way they need not go through thousands of agencies they dont work with. I tried to use List Of Values option but that didnt give me desired result. Please let me know how to restrict values in prompt to few values from the n number of values available in database.
Thanks in advance.Hi,
there is no such step-by-step!
I would encourage you to consult documentation and search for terms 'row level restriction' in the help guides.
Practice makes perfect
Good luck
H -
How to restrict the display of report variants
Hello All,
I want t know how to restrict the display of report variants.
I mean, when a user saves a variant for his/her purpuse on some report program, only he/she can refer the variant while other users cannot.
I know that by setting the attribute of the variant ("Protect Variant ", "Only Display in Catalog"), this would be possible, but I want to know another way, without this setting.
Thank you for your help in advance.
Regards,Hi,
Can you just try this
DATA:it_varid TYPE TABLE OF varid.
DATA:wa_varid TYPE varid.
INITIALIZATION.
SELECT * FROM varid INTO TABLE it_varid
WHERE report = sy-repid
and ename = sy-uname.
IF sy-subrc = 0.
LOOP AT it_varid INTO wa_varid .
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
report = sy-repid
variant = wa_varid-variant
EXCEPTIONS
variant_not_existent = 1
variant_obsolete = 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.
ENDLOOP.
ENDIF. -
hello,
how to refresh table display using slis and 'reuse_alv_grid_display method'.
when i'm refreshing table display it performs once again reuse_alv_grid_display.and when i back the previous value appear.how to solve it?
neonare you chaning any value in the gird if so use this..
Pass the user_command form name to the Import parameter
I_CALL_BACK_USERCOMMAND .
and have the Dynamic form implementation..
FORM user_command USING ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
"The below is important for Editable Grid.
DATA: gd_repid LIKE sy-repid, "Exists
ref_grid TYPE REF TO cl_gui_alv_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data .
ENDIF.
CASE ucomm.
WHEN 'REFRSH'.
ENDCASE.
selfield-refresh = 'X'.
ENDFORM. "user_command -
Restrict number of entries in Select-Options
Hi,
I would like to restrict the number entries in select options. Lets say I have select options field defined for GL and I want only 10 GLs to be entered on Select-Options. If more than 10 Gls then it should give message that GL count is exceeding its Limit.
Please may I know how I can do this ?
Thanks for you help.Try this if you want to restrict rows in s_matnr for example.
At selection screen.
data: line type i.
describe table s_matnr lines line.
if line > 10.
Message 'Error' Type 'E'.
endif.
or else if you want only 10 Materials to be selected then try this.
At selection-screen.
if s_matnr-high - s_matnr-low > 10.
Message 'Error' type 'E'.
endif.
Regards,
Vamsi -
How to pack & unpack in case of selection options
I have a Ztable having field
ztable-belnr.
Now i hav a report which fetch data according to belnr.
This is a section option:
select-options: belnr1 for Ztable-belnr.
Now if i enter 51 it shows no document
& if i enter '0000000051' it shows the data.
How to use pack unpack.Plz guide.
Regards.Hi Abhut,
Check the data element of Ztable-belnr and then to domain to see if it has conversion routine ALPHA or other. If it doesn't have the conversion routine attached to this you need to do this manually in this program.
You need to use this code before you use this select options variable.
loop at belnr1.
if not belnr1-low is initial.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = belnr1-low
IMPORTING
OUTPUT = belnr1-low
endif.
if not belnr1-high is initial.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = belnr1-high
IMPORTING
OUTPUT = belnr1-high
endif,
modify belnr1.
endloop.
This fills the zeros automatically.
Regards,
Yellappa. -
Can you pass a hidden value along with your select option in the form selec
Can you pass a hidden value along with your select option in the html form select
Off topic. Locking.
-
Select options: Restricting Value Display in Search Help Parameters
Hello friends,
I have following requirement.
I have declared one select option. On that select options I'am having different search help paremeters on which I can restrict the search help values display.
Can I specify the restriction in search help at the time of programming so that it would display only the values that follows the given restriction?
I can ofcourse do this by AT SELECTION-SCREEN ON VALUE REQUEST, however I am trying to avoid this.
How can I proceed?
Points will be rewarded generously.
Best Regards,
NavinhI
SEE THIS CODE
**************DATA TYPES DECLARATION **********************
TABLES: HRP1001, HRP1026, HRP1000,PCHDY.
TYPE-POOLS SLIS.
TYPES :BEGIN OF ST_OUTPUT,
COUNT TYPE STRING,
OBJID TYPE HRP1001-OBJID,
STEXT TYPE HRP1000-STEXT,
BEGDA TYPE HRP1000-BEGDA,
ENDDA TYPE HRP1000-ENDDA,
CANCRT TYPE T77CRT-CANCRT,
AEDTM TYPE HRP1026-AEDTM,
UNAME TYPE HRP1026-UNAME,
LSTEXT TYPE HRP1000-STEXT,
RINVT TYPE T777V-RINVT,
END OF ST_OUTPUT.
TYPES: BEGIN OF ST_HRP1000,
OBJID TYPE HRP1001-OBJID,
STEXT TYPE HRP1000-STEXT,
END OF ST_HRP1000.
TYPES : BEGIN OF ST_HRP1001,
OTYPE TYPE HRP1001-OTYPE,
OBJID TYPE HRP1001-OBJID,
RELAT type hrp1001-RELAT,
BEGDA TYPE HRP1001-BEGDA,
ENDDA TYPE HRP1001-ENDDA,
SCLAS TYPE HRP1001-SCLAS,
SOBID TYPE HRP1001-SOBID,
END OF ST_HRP1001.
TYPES : BEGIN OF ST_HRP1026,
OTYPE TYPE HRP1026-OTYPE,
OBJID TYPE HRP1001-OBJID,
AEDTM TYPE HRP1026-AEDTM,
UNAME TYPE HRP1026-UNAME,
DELET TYPE HRP1026-DELET,
CANCR TYPE HRP1026-CANCR,
END OF ST_HRP1026.
TYPES : BEGIN OF ST_REASON,
CANCR TYPE HRP1026-CANCR,
CANCRT TYPE T77CRT-CANCRT,
END OF ST_REASON.
TYPES : BEGIN OF ST_SOBID,
OTYPE TYPE HRP1001-OTYPE,
OBJID TYPE HRP1001-OBJID,
RELAT type hrp1001-OBJID,
BEGDA TYPE HRP1001-BEGDA,
ENDDA TYPE HRP1001-ENDDA,
SCLAS TYPE HRP1001-SCLAS,
SOBID TYPE HRP1001-OBJID,
END OF ST_SOBID.
TYPES : BEGIN OF ST_OBJID,
OBJID TYPE HRP1001-OBJID,
END OF ST_OBJID.
TYPES : BEGIN OF ST_LOCATION,
OTYPE TYPE HRP1001-OTYPE,
OBJID TYPE HRP1001-OBJID,
RSIGN TYPE HRP1001-RSIGN,
RELAT TYPE HRP1001-RELAT,
SCLAS TYPE HRP1001-SCLAS,
SOBID TYPE HRP1001-SOBID,
END OF ST_LOCATION.
TYPES : BEGIN OF ST_LOCATION1,
OTYPE TYPE HRP1001-OTYPE,
OBJID TYPE HRP1001-OBJID,
RSIGN TYPE HRP1001-RSIGN,
RELAT TYPE HRP1001-RELAT,
SCLAS TYPE HRP1001-SCLAS,
SOBID TYPE HRP1001-OBJID,
END OF ST_LOCATION1.
TYPES : BEGIN OF ST_LSTEXT,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
LSTEXT TYPE HRP1000-STEXT,
END OF ST_LSTEXT.
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
DATA : IT_LSTEXT TYPE STANDARD TABLE OF ST_LSTEXT. "TOS STORE THE TEXT OF COURCE LOCATION
DATA : WA_LSTEXT TYPE ST_LSTEXT.
DATA : IT_LOCATION TYPE STANDARD TABLE OF ST_LOCATION. " TO STORE THE LOCATION OF COURCE
DATA : WA_LOCATION TYPE ST_LOCATION.
DATA : IT_LOCATION1 TYPE STANDARD TABLE OF ST_LOCATION1. " TO CONVERT SOBID INTO OBJID FOR COURCE LOCATION
DATA : WA_LOCATION1 TYPE ST_LOCATION1.
DATA : IT_SOBID TYPE STANDARD TABLE OF ST_SOBID. " TO CHANGE THE SOBID OF HRP1001 TO OBJID OF HRP1026
DATA : WA_SOBID TYPE ST_SOBID. " BY USING FOR ALL ENTRIES
DATA : IT_REASON TYPE STANDARD TABLE OF ST_REASON. "TO STORE T HE REASON FOR CANCELL TEXT
DATA : WA_REASON TYPE ST_REASON.
DATA : IT_OUTPUT TYPE STANDARD TABLE OF ST_OUTPUT. "OUTPUT FEILDS OF REPORT.
DATA : WA_OUTPUT TYPE ST_OUTPUT.
DATA : IT_OUTPUT_1 TYPE STANDARD TABLE OF ST_OUTPUT. " TEMP OUTPUT FEILDS OF REPORT.
DATA : WA_OUTPUT_1 TYPE ST_OUTPUT.
DATA : IT_HRP1000 TYPE STANDARD TABLE OF ST_HRP1000. "DATA FROM HRP1000 TABLE
DATA : WA_HRP1000 TYPE ST_HRP1000.
DATA : IT_HRP1001 TYPE STANDARD TABLE OF ST_HRP1001. "DATA FROM HRP1001 TABLE
DATA : WA_HRP1001 TYPE ST_HRP1001.
DATA : IT_HRP1026 TYPE STANDARD TABLE OF ST_HRP1026. "DATA FROM HRP1026 TABLE
DATA : WA_HRP1026 TYPE ST_HRP1026.
DATA : IT_OBJID TYPE STANDARD TABLE OF ST_OBJID. " TO STORE THE OBJID OF HRP1001
DATA : WA_OBJID TYPE ST_OBJID.
DATA: WS_FCAT TYPE SLIS_FIELDCAT_ALV . " FEILDCATALOG FOR ALV REPORT
DATA: IN_FCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: W_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : LV_COUNT TYPE I. "FEILD FOR SERIAL NUMBER
***************************END OF DATA DECLARATION******************************************
************SELECTION SCREEN DESIGN************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
***********END OF SELECTION SCREEN DESIGN******************
*****INITIALIZATION VENT TO ASIGN DEFAULT VALUES TO OTYPE
*INITIALIZATION.
S_OTYPE-LOW = 'D'.*
S_OTYPE-SIGN = 'I'.*
S_OTYPE-OPTION = 'EQ'.*
APPEND S_OTYPE.*
CLEAR S_OTYPE.*
**************END OF EVENT INITIALIZATION******************
**********VALIDATION FOR SCREEN FIELDS*********************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.*
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.*
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '*
RETFIELD = 'OBJID'
PVALKEY = ' '*
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0*
WINDOW_TITLE =*
VALUE = ' '*
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '*
DISPLAY = ' '*
CALLBACK_PROGRAM = ' '*
CALLBACK_FORM = ' '*
MARK_TAB =*
IMPORTING*
USER_RESET =*
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =*
RETURN_TAB = RETURN_TAB*
DYNPFLD_MAPPING =*
EXCEPTIONS*
PARAMETER_ERROR = 1*
NO_VALUES_FOUND = 2*
OTHERS = 3*
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.*
ENDIF.
ENDIF. -
How to restrict metadata to use only view values
I have a metadata which takes values from view, i want to restrict it's value to use only view values( as it is editable , user can type any value , and right now it is allowing any value but i want to restict it to use only view values.
Thanks.Hi Chely,
Try doing below steps and let us know if this solves the problem
Log in to WCC
Click on Administartion --> Admin applets --> configruation manager
Choose the metadata value for which you have problem
Click on Edit
Click on Configure button next to Enable Option List
What value do you see in Option List Type?
Change it to Select List validated and see if problem persists.
regards,
Deepak -
Restrict the no of values to 10 for select-options
hi gurus,
i have the require that the user can put only 10 distinct values for a select-option for selection screen....now to disable range selection and other signs than eq to i have used function module select_options_restrict..
The only thing which i could'nt do is restricting the values to 10. That is I want to disable (grey out ) the rows after 10 so that the user if wants also cannot put more than 10 values....i dont want to go by the convention method of displaying an error message that only 10 values are permitted...instead i will keep the provision of disabling after 10 values...
i guess that when we press the extension button the screen that comes for multiple selection is a module pool screen....so do we need to modify that screen or may be there is some other method...
please help.....im not aware of restricting the user form entry itself instead.
let the user enter the values..
select-options:so_dat for sy-datum.
at selection-screen on so_dat.
describe table so_dat lines wk_lines.
if wk_lines > 10.
throw message
endif. -
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 -
How to Restrict Users Rights to Change Select List
Good morning everyone,
I've got a select list that is populated using a basic query on a table. Lets say the items in the list are A,B,C and D.
At the moment the users are able to choose any of those options and they are written to the database as expected.
I want to prevent users from selecting option D unless they are a member of an authorization scheme, say SchemeX.
I've tried a validation process but can only access the current database value not the value that the user is attempting to set.
I've successfully used
APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('SchemeX')
to test whether a user is a member of SchemeX but can't quite get my hands on the value the user is trying to set.
Any ideas would be gratefully received :-)Thanks for the replies.
I tried the disable options method but unfortunately that doesn't work on IE 6 .. all my users are forced to use IE 6 at the moment. Works fine in Opera which I can use for testing purposes.
Drawing on inspiration from this thread I managed to sort it out. I set "Display Extra Values" to YES in my Select List and inserted this query as the "List of values definition" :
IF APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('OR_AUTHORISE_MANAGE') THEN
RETURN
'SELECT STATUS d, STATUS r ' ||
'FROM LSTSTATUS ORDER BY STATUS ASC';
ELSE
RETURN
'SELECT STATUS d, STATUS r ' ||
'FROM LSTSTATUS ' ||
'WHERE STATUS<>''Closed''' ||
'ORDER BY STATUS ASC';
END IF;
If the user is a member of OR_AUTHORISE_MANAGE they get the full list. If they are not they get the list minus "Closed" ... unless the record has already been set to "Closed" in which case it is added as an "Extra Value".
Thanks for the nudges :-) -
How to restrict values of characteristics in Bex
Hi All,
I want to restrict values for a particular characteristics starting from ZABC* in Bex without writing CMOD ABAP code
For Ex
ZABC123
12656
ZABC234
So in the report o/p shd be
ZABC123
ZABC234Hi Roshan,
I don't understand well your issue, but I will try to answer to you with two possible solutions anyway.
You can use the variable not in the characteristic filter but in each index. For example, if you have two indexes to be displayed in your column structure, try to filter them with the characteristic value variable. In this case you can probably see all of the characteristic values but for only ones that start from ZABC* you can see KFs values.
According to an another my supposition, you can use an exception (there is a dedicated tab when you restrict your characteristic). You can find more informations reading the following link:
http://help.sap.com/SAPhelp_nw70/helpdata/en/43/21b4cd14cd06f4e10000000a422035/content.htm
Hope it helps.
Best regards.
Simone. -
How to restrict value of materila in a PR created from PS to 1 Rupee
Hello Gurus,
While creation of material PR from P, system is picking value either info record or material master. How can we restrict value of materila in a PR created from PS to 1 Rupee?
NagarajHi,
On costing variants(OPL1)->valuation varient u can define which would be picked for planing, there give top priority for "Plan price 1"
To get plan price 1, you have to update on material master(mm02) on costing 2 tab as 1 rupee for all required materials.
hope this would help
regards,
SL
Maybe you are looking for
-
I want to share some experience about battery drain after IOS 7.1 update
Major issue was battery problem in ios 7. I . tried all methods that are told online but no luck. but then I found this guide howbees.com/2014/05/15/ultimate-method-to-resolve-battery-drain-issue-of-any-iph one-in-ios7-or-later/ it finally worked fo
-
Printing problem with EPSON DOT MATRICS 1600
Dear All, I am doing the reporting package, and need to print smartform on printer: EPSON DOC MATRICS 1600. But the problem is: 1. if print from SAP using device type: CNEPSON, all the contents on the form which should be display on one line becomes
-
Hello All, Can anyone please help me with Tab key navigation in a JTable.I read all the messages in this group but couldn't implement one.It would be a great help if anyone can provide me a working example of how to control the tab key in the JTable.
-
Error when changing the length of IO
Hi Experts, I have changed the length of one of my Info-Object from NUMC-2 to NUMC-3. While trying to activate it it is giving the error "Structure Change at field Level(change Table)". But When i changed the length of one more IO before from Char-1
-
I set up a site with a spry vertical menu with flyout submenus. It works fine in IE7, safari, and firefox. However, one of the clients for whom I did the site cannot display the menu correctly. The submenus "flyout", but half or more of the choices a