Comparing field with select-option
HI
i have one slect option
s_bukrs for coas-bukrs.
and
loop..
if w_bukrs eq s_bukrs"here is the problem,w_bukrs is
"holding single value and s_bukrs a range,so in such
"case how i can do comaprison
endif.
endloop
Hi Sanju,
Just use IN as said..
if w_bukrs <b>IN</b> s_bukrs
in case you want to compare a single value use..
if w_bukrs <b>EQ</b> s_bukrs-low or
if w_bukrs <b>EQ</b> s_bukrs-high
regards
satesh
Similar Messages
-
Innput field with Select option on custom screen
Hi,
I need to create an Input field with Select Option(No interval) button on Custom dialog screen .
Is there any idea how can I create it on screen ?
Thanks
Sachincreate a normal inputfield and place an icon next to it. then in the pai on click of that button use the following code.
data: wf_tab_field like rstabfield occurs 0 with header line ,
wf_exl_opt like rsoptions .
refresh: wf_tab_field .
move: 'KOSTL' to wf_tab_field-fieldname ,
'CSKS' to wf_tab_field-tablename .
append wf_tab_field .
clear wf_tab_field .
move: 'X' to wf_exl_opt-bt ,
'X' to wf_exl_opt-cp ,
'X' to wf_exl_opt-ge ,
'X' to wf_exl_opt-gt ,
'X' to wf_exl_opt-le ,
'X' to wf_exl_opt-lt ,
'X' to wf_exl_opt-nb ,
'X' to wf_exl_opt-np .
call function 'COMPLEX_SELECTIONS_DIALOG'
exporting
title = 'Select Cost Centers'
text = 'Cost Center'
* SIGNED = 'X'
* LOWER_CASE = ' '
* NO_INTERVAL_CHECK = ' '
* JUST_DISPLAY = ' '
* JUST_INCL = ' '
excluded_options = wf_exl_opt
* DESCRIPTION =
help_field = 'CSKS-KOSTL'
* SEARCH_HELP = 'KOST'
tab_and_field = wf_tab_field
tables
range = r_kostl
exceptions
no_range_tab = 1
cancelled = 2
internal_error = 3
invalid_fieldname = 4
others = 5
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
if not r_kostl[] is initial .
read table r_kostl index 1 .
if sy-subrc eq 0 .
move: r_kostl-low to wf_t_kostl .
endif .
endif .
wf_t_kostl is the screen field name.
Raja -
F4 help for PO number field with SELECT OPTIONS
Hi all,
I have a field (PO no) using SELECT OPTIONS on my selection screen.I need F4 help for this field.How shud i declare it?
I have declared it as follows:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
select-options sel_po for ZPO_LOI-zobject_id obligatory .
SELECTION-SCREEN END OF BLOCK b1.
ZPO_LOI is a table view with a z data element ZOBJECT_ID to which i have attached a search help which displays the required values for the PO field in the selection screen.But now the problem is i cant see the F4 icon for the field on the sel screen.
Please help.Hi I have a sapmle code for this.
*& AT SELECTION SCREEN ON VALUE REQUEST
*-- F4 help for IDOC numbers
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_docnum-low.
PERFORM value_request_status USING 'S_DOCNUM-LOW'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_docnum-high.
PERFORM value_request_status USING 'S_DOCNUM-HIGH'.
*& Form value_request_status
text
-->fp_field dynpro field that gets the return value
FORM value_request_status USING fp_field TYPE dynfnam.
STATICS tl_values TYPE STANDARD TABLE OF tp_value.
IF tl_values IS INITIAL.
SELECT docnum FROM edidc UP TO 500 ROWS INTO TABLE tl_values
WHERE credat IN s_credat
AND cretim IN s_cretim.
IF sy-subrc eq 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'DOCNUM'
dynpprog = syst-repid
dynpnr = syst-dynnr
dynprofield = fp_field
value_org = 'S'
TABLES
value_tab = tl_values
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc IS NOT INITIAL.
MESSAGE i999(zz) WITH 'No values found'(004).
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " value_request_status
Regards,
Amit. -
Mulitple selection with select option on subscreen
Hi colleagues,
I've the following issue:
I'm programming a dynpro this dynpro contains two subscreens. The lower subscreen will contain another dynpro defined as subscreen with an ALV to display results.
The top subscreen (0150) area will be filled with a generated subscreen with the command
SELECTION-SCREEN BEGIN OF SCREEN 0150 AS SUBSCREEN.
with select options I define my selection area like:
SELECT-OPTIONS: sa_6 FOR gs_rp_attrib_sel-sonr.
If I call my transaction starting up the dynpro containing the two subscreens the result looks quit how I expect it. BUT then I try to start up the multiply selection Pop-UP for the selection field by pressing the button just right behind the HIGH input field, nothing happens. The multiply selection pop-up basicly does not show up.
Any clues what I need to add that it will show up?
Does the mulitply selection not work with
SELECTION-SCREEN BEGIN OF SCREEN 0150 <b>AS SUBSCREEN</b>???
(If I do a simple test program with a selection screen not being a subscreen, the multiply select popup comes up.)Hi,
A subscreen cannot call another screen.
I guess this is the reason why u are facing this problem.
Thanks,
Rashmi. -
Dear Experts,
I used component wdr_select_options to achieve select options functionality, But it displaying only one field as per my requirement user expecting both low & high fields.
Can you guide for 5 select options whether i have use t times the component at my component level.
And also could please guide me how to use select options at code level.
Thanks & Regards,
Siva Mandapudi.
Edited by: SIVAMANDAPUDI on Jul 18, 2011 6:39 PMHi Saravan,
Please find below details.
The exception is:
The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
caught in
procedure "ONACTIONSEARCH_SUPPLIER" "(METHOD)", nor was it propagated by a
RAISING clause.
code:
DATA FOR WORKING WITH SELECT OPTIONS
data: rt_SUPPLIERNO type ref to data.
data: rt_SUPPLIERNAME type ref to data.
field-symbols: <fs_SUPPLIERNO> type table,
<fs_SUPPLIERNAME> type table.
TYPES: BEGIN OF T_SUPPLIERNO,
SIGN(1),
OPTION(2),
LOW TYPE /SAPAPO/LOC,
HIGH TYPE /SAPAPO/LOC,
END OF T_SUPPLIERNO.
TYPES: BEGIN OF T_SUPPLIERNAME,
SIGN(1),
OPTION(2),
LOW TYPE /SAPAPO/LOC_DESCR40,
HIGH TYPE /SAPAPO/LOC_DESCR40,
END OF T_SUPPLIERNAME.
DATA: WA_SUPPLIERNO TYPE T_SUPPLIERNO, IT_SUPPLIERNO TYPE TABLE OF T_SUPPLIERNO,
WA_SUPPLIERNAME TYPE T_SUPPLIERNAME, IT_SUPPLIERNAME TYPE TABLE OF T_SUPPLIERNAME.
Retrieve the data from the select option
rt_SUPPLIERNO = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'ID_SNO' ).
dump raising when get_range_table_of_sel_field is called.
Thanks a lot.
Regards
Siva Mandapudi. -
Issue with Select options in select statement - ABAP Question
Hi
I am facing an issue with select options. Select statement is returning sy-subrc as 4.
I wrote the program as below:
SELECT-OPTIONS:
s_kunnr FOR bsad-kunnr,
s_lifnr FOR bsak-lifnr,
s_gjahr FOR bsad-gjahr,
s_bukrs FOR bsad-bukrs,
s_saknr FOR bsad-saknr,
s_budat FOR bsak-budat.
In start of selection I have written the select statement as
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs AND lifnr = s_lifnr AND gjahr IN s_gjahr AND budat IN s_budat AND saknr IN s_saknr.
In selection screen I have not entered any values and executed the program. I am not getting any result. When I debug that, sy-subrc is 4 at above select statement. But table has records.
If am removing the "lifnr = s_lifnr " condition in select then select is returning values.
I am not getting where I made the mistake. Please suggest.
Thank you
HanuHi,
The problem here with where condition select option lifnr = s_lifnr.
Use below select query.
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr
AND gjahr IN s_gjahr
AND budat IN s_budat
AND saknr IN s_saknr.
s_lifnr is a select option and you are passing it as parameter lifnr = s_lifnr.
if you want to pass this s_lifnr as single vale then pass in below mentioned way.
lifnr = s_lifnr-low
BR,
Vijay -
How to declare and work with select-option in screen painter?
hello there,
can anybody plz suggest me ,how to declare and work with select-option in screen painter?
neonHi Blue,
Please check these threads which will help you a lot..
module pool programming " to add selection-option on screen"
Re: Select option in Dialog program screen
Re: SELECT-OPTIONS in Screen
Good luck
Narin -
Multiple records with select option
i have to use select option in selection screen, which wl take the multiple values but that select option wont act as a range, the select option is a session name from sm35, the table from where data is retrieved is APQI, i have used a parameter before using select option ,like:
selection-screen begin of line.
parameters: P_grpid like apqi-groupid.
select-options: s_grpid like apqi-groupid.
selection-screen end of line.
AT-SELECTION SCREEN ON VALUE REQUEST FOR p-GRPID. " previous situation
{the code starts
FM F4 selection is called}
AT-SELECTION SCREEN ON VALUE REQUEST FOR S_GRPID-low. " CURRENT situation
FM F4 selection is called}
now when i give data in slection screen for s_grpid-low then it works as a parametr, but it doesnt take multiple values at s_grpid when i have alos mentioned the same for s_grpid-high.
Please tell me how to achive multiple records with select option, or u can also send a sample code if you have..
Thanks
SwarnaliHello Swarnali,
You need to fill internal table of select-option once you got into the event AT SELECTION-SCREEN ON VALUE REQUEST FOR so_carr-LOW.
so sudo code will be:
AT SELECTION-SCREEN ON VALUE REQUEST FOR so_carr-LOW.
Select data from table.
so_carr-LOW = value
append so_carr.
You can also use NO INTERVAL to suppress the so_carr-HIGH value on selection screen.
Thanks,
Augustin. -
Working with select option in WD4A
can any one provide me some document or video file to work with select options in webdynro for abap?
Hi,
Find the following URLs
PDF - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/21706b4b-0901-0010-7d93-c93b6394bc1d
Video Clip - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/1a3c52e7-0b01-0010-ed81-f31d4868c5d6
Login to SDN to play the video clip.
Reward accordingly.
Regards
ChandraK -
Search help for A field in select option which doesnt have search help in c
u have table in QM which is QMFE in whihc field FECOD which doesnt have search help , but my requirement is that in select option in report to have users to see its search help, anyone there to help me
Hi sridhar loganathan,
For this goto SE11 and create a ZFECOD Search help for that field. In Defination Tab enter table name
QMFE and Enter Z_F4_FECOD_EXIT in Search help Exit.
Then create a FM in SE37 as Z_F4_FECOD_EXIT under a FG. And then write code as follows for example:
FUNCTION Z_F4_REG_EXIT.
""Local Interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR_T
*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
TYPES: begin of ty_code,
dam_code type QMFE-FECOD ,
end of ty_code.
DATA : tw_code type ty_code,
ta_code type table of ty_code.
IF "callcontrol-step <> 'SELONE' AND
callcontrol-step <> 'SELECT' AND
callcontrol-step <> 'DISP'.
EXIT.
ENDIF.
IF callcontrol-step = 'SELECT'.
CALL FUNCTION 'F4UT_PARAMETER_ALLOCATE'
EXPORTING
PARAMETER = 'FECOD'
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol
EXCEPTIONS
OTHERS = 3.
ENDIF.
IF callcontrol-step = 'DISP'.
Get the Region
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
PARAMETER = 'FECOD'
FIELDNAME = 'FECOD'
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
RESULTS_TAB = ta_code
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol
EXCEPTIONS
PARAMETER_UNKNOWN = 1
OTHERS = 2.
IF SY-SUBRC = 0.
SORT TA_CODE BY DAM_CODE.
Deleting duplicate damage codes in Internal Table ta_code
DELETE ADJACENT DUPLICATES FROM TA_CODE COMPARING DAM_CODE.
Passing changed Internal table to FM
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
PARAMETER = 'REGION'
FIELDNAME = 'REGION'
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
SOURCE_TAB = ta_code
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol
EXCEPTIONS
PARAMETER_UNKNOWN = 1
OTHERS = 2.
ENDIF.
ENDIF.
ENDFUNCTION.
Revert me for any clarifications.
Regards,
Suneel G. -
How to make htis code work with select options???
REPORT YTEST.
TABLES: MARA,MARC,MARD,MBEW,MVKE,MAKT.
DATA: BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-beskz,
END OF I_MARC.
DATA: BEGIN OF I_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
WERKS LIKE MARD-WERKS,
END OF I_MARD.
DATA: BEGIN OF I_MBEW OCCURS 0,
MATNR LIKE MBEW-MATNR,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
END OF I_MBEW.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
BSTME LIKE MARA-BSTME,
END OF I_MARA.
DATA: BEGIN OF I_MVKE OCCURS 0,
MATNR LIKE MVKE-MATNR,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
END OF I_MVKE.
DATA: BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_MAKT.
DATA: BEGIN OF I_OUT OCCURS 0,
MATNR LIKE MARC-MATNR,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
BSTME LIKE MARA-BSTME,
WERKS LIKE MARD-WERKS,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-BESKZ,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_OUT.
select-options: s_matnr for marc-matnr.
SELECT MATNR EKGRP PSTAT DISPO BESKZ FROM MARC INTO
CORRESPONDING FIELDS OF TABLE I_MARC where matnr in s_matnr.
SELECT MATNR MTART MATKL MEINS MBRSH BSTME FROM MARA INTO
CORRESPONDING FIELDS OF
TABLE I_MARA FOR ALL ENTRIES IN I_MARC
WHERE MATNR EQ I_MARC-MATNR.
SELECT MATNR SPRAS MAKTX FROM MAKT INTO
CORRESPONDING FIELDS OF TABLE I_MAKT
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
SELECT MATNR LGORT ERSDA WERKS FROM MARD INTO
CORRESPONDING FIELDS OF TABLE
I_MARD FOR ALL ENTRIES IN I_MAKT
WHERE MATNR = I_MAKT-MATNR.
SELECT MATNR BWKEY PEINH FROM MBEW INTO
TABLE I_MBEW
FOR ALL ENTRIES IN I_MARD
WHERE MATNR = I_MARD-MATNR.
SELECT MATNR VKORG VTWEG VRKME KONDM FROM MVKE INTO
TABLE I_MVKE
FOR ALL ENTRIES IN I_MBEW
WHERE MATNR = I_MBEW-MATNR.
LOOP AT I_MARC.
MOVE I_MARC-MATNR TO I_OUT-MATNR.
MOVE I_MARC-EKGRP TO I_OUT-EKGRP.
MOVE I_MARC-PSTAT TO I_OUT-PSTAT.
MOVE I_MARC-DISPO TO I_OUT-DISPO.
MOVE I_MARC-BESKZ TO I_OUT-BESKZ.
READ TABLE I_MARA WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARA-MTART TO I_OUT-MTART.
MOVE I_MARA-MBRSH TO I_OUT-MBRSH.
MOVE I_MARA-MEINS TO I_OUT-MEINS.
MOVE I_MARA-MATKL TO I_OUT-MATKL.
MOVE I_MARA-BSTME TO I_OUT-BSTME.
READ TABLE I_MAKT WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MAKT-SPRAS TO I_OUT-SPRAS.
MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.
READ TABLE I_MARD WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARD-LGORT TO I_OUT-LGORT.
MOVE I_MARD-ERSDA TO I_OUT-ERSDA.
MOVE I_MARD-WERKS TO I_OUT-WERKS.
READ TABLE I_MBEW WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MBEW-BWKEY TO I_OUT-BWKEY.
MOVE I_MBEW-PEINH TO I_OUT-PEINH.
READ TABLE I_MVKE WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MVKE-VKORG TO I_OUT-VKORG.
MOVE I_MVKE-VTWEG TO I_OUT-VTWEG.
MOVE I_MVKE-VRKME TO I_OUT-VRKME.
MOVE I_MVKE-KONDM TO I_OUT-KONDM.
APPEND I_OUT.
CLEAR I_OUT.
ENDLOOP.
Loop at i_out.
write:/ i_out-MATNR,
i_out-EKGRP,
i_out-PSTAT,
i_out-DISPO,
i_out-BESKZ,
i_out-LGORT,
i_out-ERSDA ,
i_out-WERKS,
i_out-BWKEY,
i_out-PEINH,
i_out-MTART,
i_out-MATKL,
i_out-MEINS,
i_out-MBRSH,
i_out-BSTME,
i_out-VKORG,
i_out-VTWEG,
i_out-VRKME,
i_out-KONDM,
i_out-SPRAS,
i_out-MAKTX.
endloop.
regards,
sriramREPORT YTEST.
TABLES: MARA,MARC,MARD,MBEW,MVKE,MAKT.
DATA: BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-beskz,
END OF I_MARC.
DATA: BEGIN OF I_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
WERKS LIKE MARD-WERKS,
END OF I_MARD.
DATA: BEGIN OF I_MBEW OCCURS 0,
MATNR LIKE MBEW-MATNR,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
END OF I_MBEW.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
BSTME LIKE MARA-BSTME,
END OF I_MARA.
DATA: BEGIN OF I_MVKE OCCURS 0,
MATNR LIKE MVKE-MATNR,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
END OF I_MVKE.
DATA: BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_MAKT.
DATA: BEGIN OF I_OUT OCCURS 0,
MATNR LIKE MARC-MATNR,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
BSTME LIKE MARA-BSTME,
WERKS LIKE MARD-WERKS,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-BESKZ,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_OUT.
select-options: s_matnr for marc-matnr.
SELECT MATNR EKGRP PSTAT DISPO BESKZ FROM MARC INTO
CORRESPONDING FIELDS OF TABLE I_MARC where matnr in s_matnr.
if i_marc[] is not initial.
SELECT MATNR MTART MATKL MEINS MBRSH BSTME FROM MARA INTO
CORRESPONDING FIELDS OF
TABLE I_MARA FOR ALL ENTRIES IN I_MARC
WHERE MATNR EQ I_MARC-MATNR.
SELECT MATNR SPRAS MAKTX FROM MAKT INTO
CORRESPONDING FIELDS OF TABLE I_MAKT
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
endif.
if i_makt[] is not initial.
SELECT MATNR LGORT ERSDA WERKS FROM MARD INTO
CORRESPONDING FIELDS OF TABLE
I_MARD FOR ALL ENTRIES IN I_MAKT
WHERE MATNR = I_MAKT-MATNR.
endif.
if i_mard[] is not initial.
SELECT MATNR BWKEY PEINH FROM MBEW INTO
TABLE I_MBEW
FOR ALL ENTRIES IN I_MARD
WHERE MATNR = I_MARD-MATNR.
endif.
if i_mbew[] is not initial.
SELECT MATNR VKORG VTWEG VRKME KONDM FROM MVKE INTO
TABLE I_MVKE
FOR ALL ENTRIES IN I_MBEW
WHERE MATNR = I_MBEW-MATNR.
endif.
LOOP AT I_MARC.
MOVE I_MARC-MATNR TO I_OUT-MATNR.
MOVE I_MARC-EKGRP TO I_OUT-EKGRP.
MOVE I_MARC-PSTAT TO I_OUT-PSTAT.
MOVE I_MARC-DISPO TO I_OUT-DISPO.
MOVE I_MARC-BESKZ TO I_OUT-BESKZ.
READ TABLE I_MARA WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARA-MTART TO I_OUT-MTART.
MOVE I_MARA-MBRSH TO I_OUT-MBRSH.
MOVE I_MARA-MEINS TO I_OUT-MEINS.
MOVE I_MARA-MATKL TO I_OUT-MATKL.
MOVE I_MARA-BSTME TO I_OUT-BSTME.
READ TABLE I_MAKT WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MAKT-SPRAS TO I_OUT-SPRAS.
MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.
READ TABLE I_MARD WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARD-LGORT TO I_OUT-LGORT.
MOVE I_MARD-ERSDA TO I_OUT-ERSDA.
MOVE I_MARD-WERKS TO I_OUT-WERKS.
READ TABLE I_MBEW WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MBEW-BWKEY TO I_OUT-BWKEY.
MOVE I_MBEW-PEINH TO I_OUT-PEINH.
READ TABLE I_MVKE WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MVKE-VKORG TO I_OUT-VKORG.
MOVE I_MVKE-VTWEG TO I_OUT-VTWEG.
MOVE I_MVKE-VRKME TO I_OUT-VRKME.
MOVE I_MVKE-KONDM TO I_OUT-KONDM.
APPEND I_OUT.
CLEAR I_OUT.
ENDLOOP.
Loop at i_out.
write:/ i_out-MATNR,
i_out-EKGRP,
i_out-PSTAT,
i_out-DISPO,
i_out-BESKZ,
i_out-LGORT,
i_out-ERSDA ,
i_out-WERKS,
i_out-BWKEY,
i_out-PEINH,
i_out-MTART,
i_out-MATKL,
i_out-MEINS,
i_out-MBRSH,
i_out-BSTME,
i_out-VKORG,
i_out-VTWEG,
i_out-VRKME,
i_out-KONDM,
i_out-SPRAS,
i_out-MAKTX.
endloop.
reward points to all helpful answers
kiran.M -
"WHERE field IN select-options" alternative
I currently have a report that uses
SELECT-OPTIONS so_num FOR qmih-qmnum.
SELECT * FROM qmih INTO TABLE t_qmih
WHERE qmnum IN so_num.
Now, this works fine unless the user selects a large number of individual items in the select options, e.g. 7,000 individual qmnums, in which case I get an ABAP error.
The dump contains the following helpful information:
How to correct the error
The SAP Open SQL statement must be divided into several smaller units.
If the problem occurred due to the use of an excessively large table
in an IN itab construct, you can use the addition FOR ALL ENTRIES
instead.
When you use this addition, the statement is split into smaller units
according to the restrictions of the database system used.
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
Could anyone give me an idea of how I could fix this?Hi Chandrasekhar,
very interesting statement but not necessarily correct.
Select-options declares a range-type internal table with header line. The number of table rows is limited by the system memory storage available.
Oracle database has a fixed limit of 32KB for the length of the select statement. The open SQL database interface will resolve the range table resulting in the right number of comparison expressions.
If the user puts too many values into select-options, he will probably copy single values which are represented by SIGN = 'I' and OPTION = 'EQ'.
Try this (example):
select-options:
s_matnr for mara-matnr.
data:
lt_value like hashed table of s_matnr-low with unique key table_line. "avoid duplicates
fiels-symbols:
<any> type any,
<value> type any.
loop at s_matnr assigning <any>
where sign = 'I' and option = 'EQ'.
assign component 'LOW' of structure <any> to <field>.
insert <field> into table t_value.
delete s_matnr.
endloop.
select ...
into table ...
from ...
for all entries in lt_value
where matnr = lt_value-table_line.
if lines( s_matnr ) > 0.
select ...
appending table ...
from ...
where matnr in s_matnr.
endif.
Now you've got them all.
Regards,
Clemens -
Finding a field in select options
I am using select options WD component in my WD component. I have added some fields in the select options component using add_selection_field method.
Is there any method using which I can check if i give an id of a particular field, the method should return if the field with that id already exists or not.
Thanks,
ReenaHi Reena,
just go thru this thread, you may goet some useful infm regarding your query. I m noty sure but just go thru it once
WD ABAP - Search help using Selection-options
thnks -
Strange problem with select options, problem in my code or standard bug?
I have a selection screen with no intervals.
In my select option When i give a range for example
BT(Between) 1 to 3 and then if i remove 3 (s-high) value and press enter the BT changes to EQ automatically which is correct.
Suppose i select BT as my operator and just give 1 in S-low and keep S-high as blank.
It behaves wiered and the data selected is not correct. BT now should have changed to EQ but it doesnt happen.
Same case occurs with NB ie not in between.
Can experts please give there advice on this behaviour of selection screenwht u can do is.....
u can keep these two input fields as two diff attributes....
consider it as A , B
then on various possibilities....fire select queries...
for eg:
if A & B not initial.
then select data between A and B
if A is not initial B is initial
then select data = A
and all possiblities to can think -
Hi everyone,
Is it possible to use checkbox and select option on the same variable?
My requirement is for a variable which is a select option with no intervals, and along with that, I need to put a checkbox in the left hand side of the same field.
Please suggest.Correct. I am not sure if you can achieve it without declaring a PARAMETER.
selection-screen : begin of block blk1 with frame title text-001.
selection-screen : begin of line.
parameters : p_chkbox as checkbox default 'X'.
selection-screen : comment 5(15) text-002.
selection-screen : position 21.
select-options : s_date for sy-datum no intervals.
selection-screen : end of line.
selection-screen : end of block blk1.
Thanks,
Pavan
Maybe you are looking for
-
How do i set up my messages on my new MacBook Pro?
how do i set up "messages" on my new macbookpro?
-
Can I delete a huge file in my Log folder of User Library?
Yosemite: Mac Book Pro retina mid 2012 User folder->Library (71 GB!) -> Logs folder (29 GB) -> made of mostly of this file "PDApp 02-15-2015 13-43-33.log" at 28 GB. Is this something I can delete? Looking to find some more space on hard drive which
-
Does LC 2.5 support MySQL 5.1.54?
Hi I want to install LC 2.5, but I can't find the right version MySQL 5.1.30, which is written in the installation guide, in the MySQL official site. And it seems the a win32 version can download from other sites but I need a 64 bit version. So I nee
-
Export HD to NTSC Widescreen -- not truly 16:9
If you export HD footage, 1080x1920 for example, to NTSC Widescreen, you end up with 720x480 with rectangular pixels that have a 1.2121 pixel aspect ratio. That means, the display is effectively 873x480 pixels, which is a a screen aspect ratio of abo
-
HT2204 how can i recover or change answers to my security questions
How can I change the answers to my security questions.