Function to append a 0 to the front of values in a Select-Options range?
Hi,
Is anyone aware of any function or class that will append a 0 (or any character) to the front of a range (or set of ranges) in an internal table of a Select-Options from a selection screen?
Hope that made sense.
Thanks,
Andy
Hi
Why not?
My code it's only a sample, but it can create a routine for a generic range table based on the fields of the internal table for the range have always the same names:
SIGN, OPTION, LOW and HIGH:
TABLES: BKPF.
SELECT-OPTIONS: SO_BELNR FOR BKPF-BELNR,
SO_GJAHR FOR BKPF-GJAHR,
SO_BUKRS FOR BKPF-BUKRS.
AT SELECTION-SCREEN.
PERFORM CONV_RANGE USING: SO_BELNR[],
SO_GJAHR[],
SO_BUKRS[].
*& Form CONV_RANGE
* text
* -->T_RANGE text
FORM CONV_RANGE USING T_RANGE TYPE TABLE.
FIELD-SYMBOLS: <W_RANGE> TYPE ANY,
<W_LOW> TYPE ANY,
<W_HIGH> TYPE ANY.
LOOP AT T_RANGE ASSIGNING <W_RANGE>.
ASSIGN COMPONENT 'LOW' OF STRUCTURE <W_RANGE> TO <W_LOW>.
ASSIGN COMPONENT 'HIGH' OF STRUCTURE <W_RANGE> TO <W_HIGH>.
PERFORM CONVERSION_EXIT_ALPHA_INPUT USING: <W_LOW>,
<W_HIGH>.
ENDLOOP.
ENDFORM. "CONV_RANGE
*& Form CONVERSION_EXIT_ALPHA_INPUT
* text
* -->INPUT text
FORM CONVERSION_EXIT_ALPHA_INPUT USING P_INPUT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = P_INPUT
IMPORTING
OUTPUT = P_INPUT.
ENDFORM. "CONVERSION_EXIT_ALPHA_INPUT
Max
Similar Messages
-
Clearing the displayed value for a SELECT-OPTION
How do I clear the displayed value of a SELECT-OPTION?
I have 2 SELECT-OPTIONs on my screen (standard basic report program screen). I use code like this to populate the drop-down boxes for each one.
=====
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
PERFORM fill_prgrp_values.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
PERFORM fill_prctr_values.
=====
The value the user picks for the first SELECT-OPTION will affect what values I put in the drop-down list for the second SELECT-OPTION.
If a user enters a value for the second SELECT-OPTION, and then goes back and changes the value of the first SELECT-OPTION, then I want to do two things:
1. Create a new set of values for the drop-down list for the second SELECT-OPTION (no problem; working fine);
2. Clear the displayed value from the second SELECT-OPTION that the user entered previously. That value became invalid when the user picked a new value for the first SELECT-OPTION.
How do I clear that second displayed value?
I have tried CLEAR and REFRESH for the second variable using the formats s_prctr, s_prctr[], and s_prctr-low. They will erase the values of the internal table or part(s) of it, but the displayed value stays on the screen.
I need to clear out the displayed value so the user will either leave it blank or enter or select a new value.
I am using F4IF_INT_TABLE_VALUE_REQUEST to build the drop-down lists, and it works fine, but I do not see any function module to clear the displayed value off the screen.
Thanks for your help.Sorry, but calling DYNP_VALUES_UPDATE did not work. This is how I coded it.
fld_reset_rcd-fieldname = 'S_PRCTR'.
fld_reset_rcd-stepl = sy-stepl.
CLEAR fld_reset_rcd-fieldvalue. " re-initialize s_prctr
CLEAR fld_reset_rcd-fieldinp. " what goes in here?
APPEND fld_reset_rcd TO fld_reset_tbl.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'ZFI_GL_BALANCE_NGL'
dynumb = '1000'
TABLES
dynpfields = fld_reset_tbl
<Added code tags>
I have discovered that CLEAR and REFRESH of s_prctr will clear it somewhat. If I enter multiple values, ranges, etc., they will all be cleared, EXCEPT for the one single value that is displayed on the main screen. It is not cleared and it remains if you push the button to display the pop-up to enter ranges, etc.
To devrath.sampat -- Thanks for your example for building the drop-down list, but that is not the problem I am having. I am already able to build it just fine.
To repeat my problem, if I:
1. first enter / select a value for the first SELECT-OPTION s_prgrp
2. then enter / select a value for the second SELECT-OPTION s_prctr
3. And finally go back and select a new value of the first SELECT-OPTION s_prgrp from its drop-down list,
when I do, the program needs to clear the value displayed on the main screen for the second SELECT-OPTION s_prctr (any additional values, ranges, etc., are cleared by CLEAR and REFRESH, if I go look; but not the value shown on the main screen).
Edited by: Scott Crosby on Feb 14, 2012 4:20 PM
Edited by: Suhas Saha on Feb 15, 2012 12:03 PM -
How to get the max. and min. of a selection-option?
hi experters
I wonder if there is any way can fetch the max value and minimum value from a select-option?
please hint, many thanks
wanlei.suna®s wrote:
> Try this way
>
>
> SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
>
> START-OF-SELECTION.
> SELECT * FROM T001W INTO IT_T001W
> WHERE WERKS IN S_WERKS.
>
> SORT IT_T001W BY WERKS ASCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MIN. " MIN Value
>
> SORT IT_T001W BY WERKS DESCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MAX. " MAx Value
>
>
> a®s
Please try this.
TABLES : t001w.
SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
data: lv_min type T001W-WERKS,
lv_max type T001W-WERKS,
lv_count type i.
START-OF-SELECTION.
sort s_werks by low.
describe TABLE s_werks LINES lv_count.
if lv_count = 1.
lv_min = s_werks-low.
lv_max = s_werks-high.
elseif lv_count > 1.
read TABLE s_werks index 1.
lv_min = s_werks-low.
if not s_werks-high is INITIAL.
lv_max = s_werks-high.
endif.
READ TABLE s_werks INDEX lv_count.
if lv_max is INITIAL.
lv_max = s_werks-low.
else.
if lv_max < s_werks-low.
lv_max = s_werks-low.
endif.
endif.
endif.
write :/ lv_min,
lv_max. -
How to prevent the use of wild cards in select-option
Hello experts,
Is it possible to prevent the use of wild cards in a select-option? If yes, how is it done please?
I have a
SELECT-OPTIONS: o_comp FOR dbtab-field OBLIGATORY DEFAULT 'FI'.
and, I want to prevent the users for giving in some thing like FI* with the wildcard bc it would lead to dump.
I want an error message to display and prevent the users for making such entry.
Please I need your help and I would be very grateful.
Thanks
NadinYou have to use SELECT_OPTIONS_RESTRICT to restrict input allowed. Call this FM in INITIALIZATION or SELECTION-SCREEN OUPUT sections.
Sample :
TYPE-POOLS: sscr.
INITIALIZATION.
* Restrict SELECT-OPTIONS
PERFORM restrict_select.
FORM restrict_select.
DATA: restrict TYPE sscr_restrict,
opt_list TYPE sscr_opt_list,
*** TYPE sscr_***.
* Défine select-options modes (aka option list)
* - ALL standard - all options allowed
CLEAR opt_list.
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.
* - EQU only equality allowed (list of values)
CLEAR opt_list.
MOVE 'EQU' TO opt_list-name.
MOVE 'X' TO opt_list-options-eq.
APPEND opt_list TO restrict-opt_list_tab.
* Affect modes to parameters or block of parameters
* ALL by default
CLEAR ***.
MOVE: 'A' TO ***-kind,
'*' TO ***-sg_main,
'ALL' TO ***-op_main.
APPEND *** TO restrict-***_tab.
* EQU to internal material number
CLEAR ***.
MOVE: 'S' TO ***-kind,
'S-MATNR' TO ***-name,
'I' TO ***-sg_main, " no exclusion
'EQU' TO ***-op_main. " only value list
APPEND *** TO restrict-***_tab.
* Call FM
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restrict
EXCEPTIONS
OTHERS = 1.
ENDFORM. " restrict_select
In the sample, only select-options for matnr is restricted to single value list.
For your request build a mode with all options except "pattern" ones : CP and NP.
Regards -
Restrict the no. of rows entered in select-options
Dear ABAPers,
I have used CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' to only allow user key in single value. The field is BUKRS(Company Code). Can I restrict the number of company code entered by user in this select-option? Please advise.
Thanks in advance.
Best Regards,
HikarunoSure, just do a check in the AT SELECTION-SCREEN event.
at selection-screen.
data: lines type i.
describe table s_bukrs lines lines.
if lines > 10.
message e001(00) with 'More than 10 entries'.
endif.
Regards,
RIch Heilman -
Result of the query is not filtered as value given in Select Option variabl
Hello ,
A Select option Variable is created on Navigational Attribute( ZINV_PROG) of 0WBS_ELEMT.
The Compound Key for object ZINV_PROG(Investment program) is APPR_YEAR( Approval Year)
This ZINV_PROG object does not bear Master data.
The values in the field get populated as you load Master data of 0WBS_ELEMT.
The values for this objects is as shown below:
APPR_YEAR ZINVPROG
2005 ESCCCAPS
2007 ESCCCAPS
2008 FIRE
2006 CAPITAL
A select option variable is craeted on this Navigational attribute.
When you execute the query , On the selection screen of the query..
If you provide i/p for Investment programm field as 2007 ESCCCAPS, the data should ideally be filtered for this values only.
But the result of the query shows data for both values 2005 ESCCCAPS and as well as for 2007ESCCCAPS.
Let me know how to sort this issue.
Points will be assigned for the correct and helpfull answere.
Thanks,Thanks Srini for your prompt explanation.
My Question is if Approval year is a compounded key of ZINV_PROG object why data would not get filter out directly.
I mean on the screen for this particualr variable i take help - F4 to see values there you are able to see all the values of Investment programm along with the apprroval year.
If i select value as 2005 ESCCCAPS from the help F4 screen then ideally data should be fileterd out for this particular value. But it is not happening so.
Is that so in Query desgining that if you creating a variable on Nav Attribute, and that particular Nav attribute has a compound key then if you want to filter out the data for this Nav attribute correctly you would also require to create a variable for Compound key also.
Please let me know
Thanks -
Creating select option with the search help based on other select option
Hi,
I have displayed a selection screen with two select options S1 and S2.
My requirement is that the values in the search help of S2 should get filled based on the values selected in S1.
Note: User has option to select multiple values in S1.
Does anybody know how to implement this?
Thanks,
Feroz>
Sanjeeva wrote:
> Hi,
>
> With standard f4 you cannot acheive this. You need to write customise with OVS or Simple value selector by reading S1 selected values.
>
> Thanks,
> Sanjeev
I'm getting fairly tired of seeing this completely incorrect information on this forum. As stated before and already found out by this poster, you can map input and output values between multiple data dictionary search helps. You do NOT have to resort to using OVS for this option. -
Value help for select options (pass the selected values to the select opt)
Hi everyone,
I created a custom value help for my select options.
It works fine, when the user clicks on the value help, my own view is displayed, and the user can select the required values:
lt_range_table =
wd_this->m_handler->create_range_table(
i_typename = 'ORGEH' ).
* add a new field to the selection
wd_this->m_handler->add_selection_field(
i_id = 'ORGEH'
i_value_help_id = 'MYSO'
i_value_help_type = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_APPLDEV
it_result = lt_range_table
i_read_only = read_only ).
The problem is, how can I pass the values to the select option? When the user selects the values in my view, I have them in an internal table. But how can i pass these values to the select option? I suppose there is declared method for this... but which one?
Thanks
N.Sorry for the stupid question, but it seems I can't acces my attribute:
I create it in the component controller
NODE: 'APP_DATA'
Attribute: M_HANDLER TYPE IF_WD_SELECT_OPTIONS
Cardinality 1..1
Selection 1..1
Singleton = 'X'
I pass the values int he EDOINIT method of MAIN view:
* Get compnent controller API
lo_component = wd_comp_controller->wd_get_api( ).
lo_controller ?= lo_component.
* Get the controler context node
CALL METHOD LO_CONTROLLER->GET_CONTEXT
RECEIVING
CONTEXT = lo_context.
*Get the root node
lo_node = lo_context->root_node.
*Get the child node
lo_child = lo_node->get_child_node( 'APP_DATA' ).
ls_app_data-m_handler = wd_this->m_handler.
lo_child->bind_structure( ls_app_data ).
After this code I test it if the binding is correct:
DATA: ls_test TYPE wd_comp_controller->element_app_data.
CALL METHOD LO_CHILD->GET_STATIC_ATTRIBUTES
IMPORTING
STATIC_ATTRIBUTES = ls_test.
The lstest is correct_. It has the reference for the SelectOption
Now, in the SEL_TREE View:
* Get compnent controller API
lo_component = wd_comp_controller->wd_get_api( ).
lo_controller ?= lo_component.
* Get the controler context node
CALL METHOD LO_CONTROLLER->GET_CONTEXT
RECEIVING
CONTEXT = lo_context.
*Get the root node
lo_node = lo_context->root_node.
*Get the child node
lo_child = lo_node->get_child_node( 'APP_DATA' ).
*Get the data from the node
CALL METHOD LO_CHILD->GET_STATIC_ATTRIBUTES
IMPORTING
STATIC_ATTRIBUTES = ls_app_data.
wd_this->m_handler = ls_app_data-m_handler.
The ls_app_data-m_handler is INITIAL. There is no value in it.
What did I do wrongly?
Please help
Thanks
N. -
Reading the record and displaying when u select it using checkbox
hi,
how to read the particilar record and display it in a popup screen when u select it using checkbox and then press 'DISP' button in alv(normal alv not with oops concepts).
like i select a row which is checked (checkbox) it and i have to read that particular record and display (value of keyfield say vbeln) details in a popup screen.hi,
go through the faloowing code.
this for normal popup.
*& Report ZGS_ALV_POPUP_2_SELECT
REPORT ZGS_ALV_POPUP_2_SELECT.
TYPE-POOLS: slis.
PARAMETERS: p_title TYPE sy-title default 'Sales Document:item data'.
DATA: itab TYPE vbap OCCURS 0 WITH HEADER LINE,
selfield TYPE slis_selfield.
START-OF-SELECTION.
SELECT *
FROM vbap
INTO TABLE itab
UP TO 20 ROWS.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = p_title
* I_SELECTION = 'X'
I_ZEBRA = 'X '
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_CHECKBOX_FIELDNAME =
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'ITAB'
i_structure_name = 'VBAP'
* IT_FIELDCAT =
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* is_private =
IMPORTING
es_selfield = selfield
* e_exit =
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i000(8I) WITH sy-subrc.
ENDIF.
WRITE:
/ 'Table Index : ', 20 selfield-tabindex,
/ 'Table Name : ', 15 selfield-tabname,
/ 'Field Name : ', 15 selfield-fieldname,
/ 'Table-Field : ', 15 selfield-sel_tab_field,
/ 'Field Value : ', 15 selfield-value.
the falowing code is for how to put checkbox and how to display the selected recods.you combine both codes.
*& Report ZRP_SALES
REPORT ZRP_SALES NO STANDARD PAGE HEADING.
DATA: TEMP_DATE_STR TYPE STRING.
*DATA: TEMP_NETP LIKE VBAK-NETWR.
DATA: TEMP_NETWR(10).
*DATA: TEMP_VBELN LIKE VBAK-VBELN.
DATA: CHECK TYPE C VALUE ' '.
*DATA: WA_VBELN LIKE VBAK-VBELN.
DATA: TEMP_DATE LIKE VBAK-ERDAT.
*DATA: TEMP_NETP_STR TYPE STRING.
DATA:FNAM(20), FVAL(20).
TYPES: BEGIN OF MY_VBAK,
VTWEG TYPE VTWEG,
VKORG TYPE VKORG,
SPART TYPE SPART,
NETWR TYPE NETWR_AK,
VBELN TYPE VBELN_VA,
ERDAT TYPE ERDAT,
END OF MY_VBAK.
DATA: IT_VBAK TYPE MY_VBAK OCCURS 0 WITH HEADER LINE.
DATA: WA_VBAK TYPE MY_VBAK.
DATA: V_VBELN TYPE VBELN,
V_ERDAT TYPE ERDAT.
SELECT-OPTIONS:S_VBELN FOR V_VBELN,
S_ERDAT FOR V_ERDAT.
AT SELECTION-SCREEN.
*Check for Sales Order number to be non-initial.
IF S_VBELN IS INITIAL.
*Checking for Date to be non-nitial.
IF S_ERDAT IS INITIAL.
MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
ELSE.
*Validating the right low values for Date select option
SELECT SINGLE ERDAT
FROM VBAK INTO TEMP_DATE
WHERE VBELN EQ S_VBELN-LOW OR ERDAT EQ S_ERDAT-LOW.
IF SY-SUBRC NE 0.
MESSAGE E004(ZRP_MSG).
ENDIF.
*Validating the right high values for Date select option
SELECT SINGLE ERDAT
FROM VBAK INTO TEMP_DATE
WHERE ERDAT EQ S_ERDAT-HIGH OR VBELN EQ S_VBELN-HIGH.
IF SY-SUBRC NE 0.
MESSAGE E005(ZRP_MSG).
ENDIF.
ENDIF.
ELSE.
*Checking for Date to be non-nitial.
IF S_ERDAT IS NOT INITIAL.
MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
ENDIF.
*Validating the right low values
SELECT SINGLE VBELN
FROM VBAK INTO S_VBELN
WHERE VBELN EQ S_VBELN-LOW.
IF SY-SUBRC NE 0.
MESSAGE E001(ZRP_MSG).
ENDIF.
*Validating the right high values
IF S_VBELN-HIGH IS NOT INITIAL.
SELECT SINGLE VBELN
FROM VBAK INTO S_VBELN
WHERE VBELN EQ S_VBELN-HIGH.
IF SY-SUBRC NE 0.
MESSAGE E002(ZRP_MSG).
ENDIF.
ENDIF.
ENDIF.
START-OF-SELECTION.
*First Screen.
SET PF-STATUS 'DISP'.
IF S_VBELN IS NOT INITIAL.
SELECT VTWEG VKORG SPART NETWR VBELN ERDAT
FROM VBAK
INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN.
ENDIF.
IF S_ERDAT IS NOT INITIAL.
SELECT VTWEG VKORG SPART NETWR VBELN ERDAT
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT IN S_ERDAT.
ENDIF.
SORT IT_VBAK BY VKORG VTWEG SPART.
END-OF-SELECTION.
LOOP AT IT_VBAK.
MOVE IT_VBAK-NETWR TO TEMP_NETWR.
MOVE IT_VBAK-ERDAT TO TEMP_DATE.
WRITE:/6 CHECK AS CHECKBOX.
FORMAT COLOR 1.
WRITE: IT_VBAK-VBELN UNDER 'SALES ORDER NO.' .
WRITE: IT_VBAK-ERDAT UNDER 'DATE'.
FORMAT COLOR OFF.
FORMAT COLOR 2.
WRITE: TEMP_NETWR UNDER 'NET PRICE'.
FORMAT COLOR OFF."TEMP_NETWR,
FORMAT COLOR 3.
WRITE:IT_VBAK-VKORG UNDER 'SALES ORG',
IT_VBAK-VTWEG UNDER 'DIST CHANNEL',
IT_VBAK-SPART UNDER 'DIVISION'.
FORMAT COLOR OFF.
SKIP 1.
*FOR SUBTOTALS
AT END OF SPART.
SUM.
FORMAT COLOR 5.
WRITE:/6 'SUB TOTOAL OF NET PRICE IS : '.
WRITE: 32 IT_VBAK-NETWR CURRENCY 'INR'.
FORMAT COLOR OFF.
SKIP 2.
ENDAT.
*FOR GRAND TOTALS
AT LAST.
SUM.
FORMAT COLOR 6.
WRITE:/6 'GRAND TOTOAL OF NET PRICE IS : ',
32 IT_VBAK-NETWR CURRENCY 'INR'.
FORMAT COLOR 6.
ENDAT.
ENDLOOP.
TOP-OF-PAGE.
FORMAT COLOR 6.
WRITE:/8 'SALES ORDER NO.',
27 'DATE',
42 'NET PRICE',
57 'SALES ORG',
70 'DIST CHANNEL',
87 'DIVISION'.
FORMAT COLOR OFF.
SKIP 1.
*WHEN SALES ORDER IS SELECTED
AT LINE-SELECTION.
CASE :SY-LSIND.
WHEN '2'.
GET CURSOR FIELD FNAM VALUE FVAL.
IF FNAM <> 'WA_VBAK-VBELN'.
MESSAGE E006(ZRP_MSG).
ELSE.
SET PARAMETER ID 'MAT' FIELD FVAL.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
*WHEN CLICKED ON PUSH BUTTON IN THE APPLICATION BAR
AT USER-COMMAND.
CASE:SY-UCOMM.
WHEN 'DISP'.
DO.
CLEAR CHECK.
CLEAR: WA_VBAK,TEMP_DATE_STR.
READ LINE SY-INDEX FIELD VALUE CHECK
IT_VBAK-VTWEG INTO WA_VBAK-VTWEG
* IT_VBAK-NETWR INTO TEMP_NETP_STR
IT_VBAK-VBELN INTO WA_VBAK-VBELN
IT_VBAK-ERDAT INTO TEMP_DATE_STR
IT_VBAK-VKORG INTO WA_VBAK-VKORG
IT_VBAK-SPART INTO WA_VBAK-SPART.
IF SY-SUBRC <> 0.
EXIT.
ELSEIF CHECK = 'X'.
FORMAT COLOR 1.
WRITE: 8 WA_VBAK-VBELN HOTSPOT. "UNDER 'SALES ORDER NO'
WRITE: 25 TEMP_DATE_STR." UNDER 'DATE'.
FORMAT COLOR OFF.
* FORMAT COLOR 2.
* WRITE: 44 TEMP_NETP_STR." UNDER 'NET PRICE'.
* FORMAT COLOR OFF.
FORMAT COLOR 3.
WRITE:44 WA_VBAK-VKORG," UNDER 'SALES ORG',
59 WA_VBAK-VTWEG," UNDER 'DIST CHANNEL',
72 WA_VBAK-SPART." UNDER 'DIVISION'.
FORMAT COLOR OFF.
SKIP 1.
ENDIF.
ENDDO.
ENDCASE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE:SY-LSIND.
WHEN 1.
FORMAT COLOR 6.
WRITE:/8 'SALES ORDER NO.',
25 'DATE',
* 44 'NET PRICE',
44 'SALES ORG',
58 'DIST CHANNEL',
72 'DIVISION'.
SKIP 1.
FORMAT COLOR OFF.
<b>if helpful reward some points.</b>
Message was edited by:
suredarreddy pulimamidi -
Need name of a function module or BAPI to update the Tax Classification val
Hi Guru's
Need name of a function module or BAPI to update the Tax Classification value for Material master.
Thanks in advance.Hi
U can try to use BAPI_MATERIAL_SAVEREPLICA
Max -
How to use select-options in the function module of import parameter ?
Hi ...
I have created a BAPI and tested in SWO1 tcode , by giving the single value for an company code ( BUKRS ) , it executed properly .
Same thing is working after implementing in a program .
so now it is working for fetching a single company code details .
My requirement is : I want to use select-options in program as well as in function module IN IMPORT PARAMETER.
Program :
REPORT ZTEST.
TABLES : T001 , ZBAPI_STR .
TYPES : BEGIN OF TY_ITEM .
INCLUDE STRUCTURE ZBAPI_STR .
TYPES : END OF TY_ITEM .
DATA :WA_ITEM TYPE TY_ITEM ,
ITEM LIKE STANDARD TABLE OF WA_ITEM INITIAL SIZE 0 .
PARAMETER : BUKRS TYPE ZBAPI_STR-BUKRS.
call function 'ZBAPI_FMT001'
exporting
bukrs = BUKRS
IMPORTING
RETURN =
tables
itemtab = ITEM
IF ITEM IS NOT INITIAL .
LOOP AT ITEM INTO WA_ITEM .
WRITE : / WA_ITEM-BUKRS , WA_ITEM-BUTXT , WA_ITEM-ORT01 , WA_ITEM-LAND1 .
ENDLOOP.
ENDIF.
FUNCTION MODULE :
FUNCTION ZBAPI_FMT001.
""Local Interface:
*" IMPORTING
*" VALUE(BUKRS) TYPE EFG_TAB_RANGES
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" TABLES
*" ITEMTAB STRUCTURE ZBAPI_STR
SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE ITEMTAB WHERE BUKRS = BUKRS .
ENDFUNCTION.
Regards
Deepa.I have given a similiar example which i did
Declare a
Table type:Z_TT_PONUM
Short text : Select options PO Number
in SE11 tcode with row type eg: Z_ST_PONUM
create a structure (this will be the row type)
Structure Z_ST_PONUM
Short text Select Options Field PO number
Compenent Compent type
SIGN BAPISIGN Inclusion/exclusion criterion SIGN for range tables
OPTION BAPIOPTION Selection operator OPTION for range tables
LOW EBELN Purchasing Document Number
HIGH EBELN Purchasing Document Number
In the function module import
give as
I_PO_NUM TYPE Z_TT_PONUM opt pass value Select options PO Number
Hope this is exactly what you want to know.
So you create a structure simliar to mine but the low an high whould be your component
then a table type and then include that in the BAPI.
Then pass your select-option value to this BAPI when you call this BAPI in the program -
Retrieve front end values of editable alv in same format
I have a problem to retrieve the front end values in editable alv filled by user.
I am able to get it from MODIFIED CELL method but it gives the values after
alv automatically conversion. For example if user filled 1 in cell of type numc
then i want to keep it as 1 not as 00..001 format of numc.
Same for when user fill alphbets in small letter the alv convert it in CAPS.
I want to retain it as it as filled by user.
Example: User filled aAbBcFG in a cell
then it should update in database in same format not like AABBCFG as alv did
<offer removed by moderator>
Edited by: Rocky_S on Jan 20, 2011 7:50 AM
Edited by: Rocky_S on Jan 20, 2011 7:51 AM
Edited by: Thomas Zloch on Jan 20, 2011 11:24 PMHi Srinivas I have used CONVERSION_EXIT_ALPHA_OUTPUT for number input. My problem is that
when user fill 0 in the alv cell then alv automatically convert it into 00000000. My field is of type numc
that why it converts in 00000000. I want to retrieve it as the user fill in alv cell. Through this function
module the import parameter parameter is of numc format not as filled by user. In my case if it is 0
then then i should retrieve it as it is.
My actual scenario is i have a numc type field in alv and i want to keep it as mandatory. For which i am
writing a logic. Because in my table there is a valid entry of 0. If user do not fill 0 then it takes automatically
0 as input because of initial value of numc field. I want to restict it. I can not convert this field as char.
Give me some logic to make numeric field mandatory. -
Clipboard functionality in Select-options in a WD4A application
Hi,
Currently in the select - options in a normal ABAP program we can paste multiple values from clipboard
Does anyone have an idea on whether this functionality will be extended to WD4A too.
Is there any workaround such that multiple values in a Select-option can be populated with values in the clipboard/spreadsheet
regards
SchunderHi Thomas,
Thanks for the update,
what I was thinking of is to open an OSS on this to find out if this functionality will be extended in future,
since existing SAP users are really missing this on the web front end
Thanks
Schunder -
Disabling the Ranges option in Select options
Hi,
I have a requirement where I have to remove the possibility of entering the ranges for select-options on the selection screen (eg: FROM xyz TO xyz ).. For this I used SELECT OPTIONS NO INTERVALS.
Now the range option doesnt appear on the main selection screen. However, when I click on the Multiple Selection screen button next to this field.. here again I find an option to enter the ranges. Is there a way to disable this option on the Multiple Selection screen.
Could anyone please help me in this.
Regards,
Harshachk this program
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.
Message was edited by: Sekhar -
How to avoid ranges option in the select option.
Hi All,
In the selection screen, when the user press the extension button usaually we are getting four columns. those columns are 2 sinlge vals, 2 ranges. but as per my requirement, user wants to display only one single val column in that dialog window.
please help me in this regard.
-Pesi.use SELECT_OPTINS_RESTRICT FM
chk the sample code
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.
Maybe you are looking for
-
Is it possible to create a link that I can place on a website to an internet radio stream on iTunes?
-
How do I transfer an IMOVIE show from one Mac to a diff Mac?
I was wondering if there was a way that I could transfer an IMOVIE show I made on a school eMAC to my Mini Mac at home? Or do I can I do it through an ethernet cable? Or is that impossible? Thanks!!
-
How to view ms access data base on click of button
hi every1 i m a newbie in java. i m designing a simple website where i hv to show data on click of a button. i am able to access data from the database. but the problem is-> i want to show 1st record when the page opens up and the next record only wh
-
Mixing surround 5.1 in FCP with Revolution 5.1?
After some research today, I am starting to wonder if I could get a M-Audio Revolution 5.1 PCI card and use it to do live monitoring out of FCP. This is what I'm thinking... Set the Revolution up in the Audio MIDI Setup for 5.1 output (my first quest
-
Overdelivery tolerance define?
Hi Experts, How can I define the over delivery tolerance in PO/GR. what are the steps to be followed. Pls let me know. I have defined, 10% assigned in the Material master and what to do? Fincance side what would be impact? Thanks Sreenivas