Condition on selection screen parameters
Hi friends,
I have an ABAP query. Here , I have a date field (ISEG_ZLDAT - Cycle count date ) in the selection screen which is a parameter (not a select option). I have to write a condition for the report to pull all the materials which have a cycle count date less than the value entered on the selection screen.
How do I give this condition in the code ? Is there a way to do it without using select options ?
Please help.
Thanks,
Dikshitha
Hi Dikshitha,
as also said by others try it this way:
Parameters:
p_ZLDAT type ISEG-ZLDAT.
Data:
t_ISEG like standard table of ISEG.
select * from ISEG into table t_ISEG where ZLDAT lt p_ZLDAT.
if sy-subrc ne 0.
endif.
With luck,
Pritam.
Similar Messages
-
Selection Screen Parameters in SQL statements
Very new ABAP programmer here, so sorry if this is a really dumb question.
I'm trying to use my selection screen parameters to limit what is pulled in by my SQL statement (which seems to me to be a very logical thing to do). But I'm having a problem, that when no values are entered in the parameters, no data is returned in the table instead of all the data being returned.
Here is the code I have now:
SELECT cname1 akostl aorgeh asname apernr bbegda bendda bstatu
bconfl bmedcf breasn breman b~rqday
INTO CORRESPONDING FIELDS OF TABLE it_record
FROM ( ( pa0001 AS a
INNER JOIN pa0672 AS b ON bpernr = apernr )
INNER JOIN t500p AS c ON cpersa = awerks )
WHERE b~reman in so_reman
AND a~kostl in so_kostl
AND a~orgeh = p_orgeh
AND b~begda = p_begda
AND b~statu = p_statu
AND b~confl = p_confl
AND b~medcf = p_medcf
AND b~reasn = p_reasn
AND b~rqday = p_rqday
AND c~name1 = p_name1.
Can anyone tell me what I'd need to do to make it return properly?When you use parameters and no value is entered, it is treated as initial value. and the select statement looks for the initial values for those fields in the tabl;e...
you can make the parameters mandatory..then the user would be forced to enter something....
also you could do the following..
instead of parameters, use select-options with the addition no intervals and no extension, then practically it looks like a parameter but internally it is a select-option...
and in the select statement, give conditions like....field1 in <s_option name>....in this case if the user is not entering a value ...it is treated as *...
Thnaks & Regards,
Renjith -
ABAP Query Selection screen parameters
I need to add an additional selection screen parameter in existing ABAP Query. How to modify the selection screen fields in existing ABAP query ? Kindly help me.
Hi,
GO to info set transaction SQ02
Give the infoset
Press change
Press the selections button..Shift F7
In the right hand side you will get a table control to enter the selection screen parameters..
Press create button on top of the table control to create new parameters
Thanks,
Naren -
How to clear all selection screen parameters before calling transaction?
Hi Experts
I have a ABAP report that displays data using ALV.
When I double click a cell it calls transaction MB51. Before calling the transaction I need to set some parameters of the selection screen of the transaction.
My code is like below:
<UL>
<LI>FREE MEMORY ID 'MAT'. <I>"material</I>
<LI> FREE MEMORY ID 'WRK'. <I>"plant</I>
<LI> FREE MEMORY ID 'CHA'. <I>"batch</I>
<LI><I>* Get the selected ALV row data</I>
<LI>READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
<LI><I>* If link MB51 is clicked then open tcode MB51</I>
<LI> IF p_selfield-sel_tab_field+8(4) = 'MB51'.
<LI><I>* Pass material, plant to the corresponding tcode</I>
<LI> SET PARAMETER ID 'MAT' FIELD x_recon-matnr.
<LI> SET PARAMETER ID 'WRK' FIELD p_plant.
<LI> CALL TRANSACTION 'MB51' AND SKIP FIRST SCREEN.
</UL>
The problem is:
<UL> <LI> 1. First, I run the given transaction before running the report in a separate session with some set of values in the selection screen. For example: plant = AB01, Material = 990001 and Batch = 10001.</LI>
</UL>
<UL>
<LI> 2. Then in another session I run my report. In the report ALV I have selected a record where plant = AB01, Material = 990001 but Batch is blank. But it opens the transaction with plant = AB01, Material = 990001 and Batch = 10001.
Even though in my ALV record the batch is blank yet it uses the batch value from the memory. That is, the batch value that was given in the transaction earlier. Why it is not getting cleared? I have also used FREE MEMORY ID code in the beginning. But still it is not clearing the values in the memory.
</UL>
<UL>
<LI>What shall I do to clear all the selection screen parameters before calling the transaction?</LI>
</UL>
<UL>
<LI>
Thanks
Gopal
</LI>
</UL>
Edited by: gopalkrishna baliga on Aug 11, 2010 10:29 AMIts because sap memory is globally shared.
Do it like this.
READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
IF p_selfield-sel_tab_field+8(4) = 'MB51'.
perform bdc_dynpro using 'RM07DOCS' '1000'.
perform bdc_field using 'BDC_OKCODE' '=ONLI'.
perform bdc_field using 'MATNR-LOW' x_recon-matnr.
perform bdc_field using 'WERKS-LOW' p_plant.
perform bdc_field using 'CHARG-LOW' p_batch.
perform bdc_field using 'DATABASE' 'X'.
call transaction 'MB51' with i_bdcdata mode 'E'.
endif.
form bdc_dynpro using program dynpro.
clear la_bdcdata.
la_bdcdata-program = program.
la_bdcdata-dynpro = dynpro.
la_bdcdata-dynbegin = 'X'.
append la_bdcdata to i_bdcdata.
endform.
form bdc_field using fnam fval.
clear la_bdcdata.
la_bdcdata-fnam = fnam.
la_bdcdata-fval = fval.
append la_bdcdata to i_bdcdata.
endform. -
Hi Developer,
i have issues that i need stop or restrict the same entries provided in the selection screen parameters it should no display that data but it should give an alert message by saying the data all ready viewed or displayed.
example: organisation :getha pvt.td.
name :ramesh.
start date:10.2.2013.
these are parameter which has been displayed by clicking execute ,if provide the same value to display again it should give waring message.
Please guide me in solve the problem.
thanks.
ravi.Hi Somendra,
Thanks for your response sir , i have provided the according to your provided information sir but it was not displaying the data first time also its giving message which i have provided ,my issues is if i provide data from time should display if i provide same data next time then only it should restrict the data and give a message.
example:
types:BEGIN OF str1,
ROOMNO type zROOMNO,
NAME TYPE zname3,
BRANCH type zBRANCH,
PHONENUMBER type zPHONENUMBER,
END OF str1.
data:it_str1 type TABLE OF str1,
wa_str1 type str1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME .
skip.
PARAMETERS:s_roomno type ZTABLE_2-roomno.
skip.
parameters:s_name type ztable_2-name.
skip.
PARAMETERS:s_branch type ztable_2-branch.
skip.
PARAMETERS:s_pho type ztable_2-phonenumber.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT roomno
name
branch
phonenumber from ztable_2 into TABLE it_str1
WHERE roomno eq s_roomno and name eq s_name and branch eq s_branch and phonenumber eq s_pho.
READ TABLE it_str1 INTO wa_str1 with KEY roomno = s_roomno name = s_name branch = s_branch phonenumber = s_pho.
if sy-subrc eq 0.
MESSAGE 'THE DATA IS ALL READY VIEWED' TYPE 'E'.
RETURN.
ENDIF.
START-OF-SELECTION.
SELECT roomno
name
branch
phonenumber from ztable_2 into TABLE it_str1
WHERE roomno eq s_roomno and name eq s_name and branch eq s_branch and phonenumber eq s_pho.
loop at it_str1 into wa_str1.
WRITE:/1 wa_str1-roomno,
10 wa_str1-name,
30 wa_str1-branch,
60 wa_str1-phonenumber.
ENDLOOP.
please guide me in solving the issue sir.
thanks,
Ravi -
Hi its urgent...help on selection screen parameters
Hi all,
I need help on selection screen parameters.
requirement is that,
i am having input fields for material, plant ,start date and end date and a check box and an input field for getting the txt file.
when i select the checkbox, it should ignore the mandatory fileds in the selection screen.
and when i get the file input, it should take the input data material, plant, start date and end date from the flat file and populate the corresponding input fields in selection screen.
How to do this..
thanks in advance.Hi ..
While declare the Matnr, Plant etc dont use the OBLIGATORY addition.
instead of the based on the value of check box validate them .
AT SELECTION-SCREEN.
IF c_box = ' '.
<< validate for mandatory fields>>
endif.
<b>REWARD IF HELPFUL.</b> -
Auto-populating the selection screen parameters for web report
hello
i am having a scenario where my web report is a link to another internet application (a BSP application) and it is called by clicking some link or button on the BSP page.
can i pass the selection values for BW Web report directly from BSP application through a query string or by setting some cookie values so that the user will directly view the report on click of that link?
Thanks in advance.
Regards
Rajeevwe can do this by adding a URL as the query-string with web template_id and with the selection screen parameters as key value pairs
-
Submit program with selection screen parameters - getting blank values
Hi, I'm submitting a program with selection screen parameters. when I pass '000' (I_TPLSCN )value for Planning Scenario and when this goes to selection screen then I don't see value for Planning scenario as '000'(I_TPLSCN ) but the value is blank in selection screen. I'm using the below code for this.
SUBMIT RMCPAMRP WITH MATNR_GL EQ I_MATNR SIGN 'I'
WITH WERKS_GL EQ I_WERKS SIGN 'I'
WITH PLSCN EQ I_TPLSCN SIGN 'I'
via selection-screen AND RETURN.
Could anyone please help me how to display value '000' rather than blanks.
thanks in advance.If I_MATNR, I_TPLSCN and I_WERKS are variable then try with
SUBMIT rmcpamrp
WITH matnr_gl = i_matnr
WITH plscn = i_tplscn
WITH werks_gl = i_werks
via selection-screen
AND RETURN .
If I_MATNR, I_TPLSCN and I_WERKS are of type range then try with
SUBMIT rmcpamrp
WITH matnr_gl IN i_matnr
WITH plscn IN i_tplscn
WITH werks_gl IN i_werks
via selection-screen
AND RETURN
Edited by: Pawan Kesari on Dec 24, 2009 3:33 PM -
Reset selection screen parameters.
Hi,
I enter values in parameters on screen and generte output(add values to table/view report). After I return to originial screen, the fields should be reset to initial empty status.
How do I do that.
Thanks
PraveenHi,
U Clear the Selection Screen Parameters in At Selection Screen event, before clearing the value pass the Parameter value to some global variable for further use.
eg:
PARAMETERS : p_matnr TYPE matnr.
DATA : gv_matnr TYPE matnr.
AT SELECTION-SCREEN.
gv_matnr = p_matnr. "Passing the P_matnr value to global variable gv_matnr
CLEAR : p_matnr.
START-OF-SELECTION.
WRITE : gv_matnr.
Hope it helps!!
Rgds,
Pavan -
Get selection screen parameters from sap query
Hello. I use SAP Query Reporting, so I added a report assignment for detailing (sq01 -> Change button -> Goto -> Report Assignment -> Insert row -> Other type row -> Abap Report Program)
and put there ABAP program.
When I run query and press CtrlShiftF1 (or double click) It calls my abap program.
So the question is: how to get selection screen parameters in my program ?
to be more precise I want to get date parameter (begda, endda)
Thanks a lot.There is a Z query which I can see in sq01. I set reporting period and run the query; when I run it, it gives me the employee list.
So I wrote the abap report to get an employee details, customized query as I mentioned above.
The query calls my report and I need to get parameters.
SELECTION-SCREEN BEGIN OF BLOCK frm1 WITH FRAME TITLE text-001.
PARAMETER : p_pernr LIKE p0001-pernr OBLIGATORY MATCHCODE OBJECT prem.
PARAMETER : p_date LIKE sy-datum.
SELECTION-SCREEN END OF BLOCK frm1.
Parameter
p_pernr
passes normal. ALV Query contains it, but I'd like to get one more parameter from selection screen of the query and don't know how to get it. -
How to pass selection screen parameters in text elements?
how to pass selection screen parameters in text elements?
don't you mean he other way around. Assign text-elements (selection texts) to select options?
This you do in the menu where you can find text-elements, selection texts.
menu Goto->text elements->selection texts.
Edited by: Micky Oestreich on May 10, 2008 2:45 PM -
Abt selection screen parameters
hi all
i have made a report with selection screen which has two parameters
but to run that report i have to fill that two fileds
is there any way that i can run my report without filling the two fields of my selection screen. Both the fields are used in the where condition in my inner join query.
thanx n regardsit is not mendatory to fill these two fields unless n until u'r not making them OBLIGATROY. n offcorse u'r query will run execute perfectly but just check the query whether there'r a huge recordset selected while u'r keeping these fileds blank. otherwise u should take them as OBLIGATORY parameters.
reward if useful
S@meer -
Print Selection Screen Parameters in ALV report only once
Does anyone know how to print the selection screen within a ALV report.
I've tried everything. I have the code to capture the selection parameters into a internal table. I can use top_of_page but I only want it printed once.Hi,
If you have captured the selection screen entries in an internal table, then you could display it once by using the BLOCK LIST ALV.
Check the function module.
REUSE_ALV_BLOCK_LIST_DISPLAY
Using this function module more than 1 alv could be display in the report.
In our case ..there will be two alvs ...one for the selection screen n other for the main report output.
Check the following example on the block List ALV....
<b>BALVBT01</b>.
Regards,
Vara -
Dynamic selection-screen parameters
Hi All,
Is it possible to create a dynamic selection-screen checkbox parameters at runtime. My requirement is :
I have Object parameter on the selection-screen, based on this it has to fetch the info structures and display it with checkboxes on the same selection-screen, so that the user can select which info structures to be processed and can save it as a variant.
Thanks,
Satya Priyaas per ur requirment....execute it and see
tables :DD02L,t002t,t002.
data : begin of itab occurs 0,
tabname like DD02L-TABNAME,
end of itab.
data : tabname1 like DFIES-TABNAME,
RSSELTEXTS1 type table of RSSELTEXTS with header line.
data : begin of RSSELTEXTS2 occurs 0,
RSSEL type RSSELTEXTS,
initial type c,
end of RSSELTEXTS2.
data : begin of imakt occurs 0 .
include structure t002.
data : end of imakt.
data : begin of ipara occurs 0,
name(132) type c,
text(132) type c,
end of ipara.
data :srch_str(10) TYPE c,
tot type i,
ind type sy-tabix.
select-options : s_lang for t002-spras.
*PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
PARAMETERS showall1 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall2 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall3 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall4 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall5 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall6 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall7 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall8 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall9 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal10 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal11 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal12 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal13 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal14 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal15 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal16 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal17 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal18 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal19 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal20 AS CHECKBOX USER-COMMAND flag modif id sd.
initialization.
at selection-screen output.
if s_lang ne ' '.
select * from t002 into table imakt where spras in s_lang.
describe table imakt lines tot.
loop at screen .
if screen-group1 = 'SD'
and screen-group3 = 'PAR'.
ipara-name = screen-name.
ind = screen-group4.
read table imakt index ind.
ipara-text = imakt-laiso.
append ipara.
clear ipara.
endif.
endloop.
endif.
loop at ipara.
RSSELTEXTS1-name = ipara-name.
RSSELTEXTS1-kind = 'P'.
RSSELTEXTS1-text = ipara-text.
append RSSELTEXTS1.
clear RSSELTEXTS1.
endloop.
CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
EXPORTING
PROGRAM = sy-repid
TABLES
SELTEXTS = RSSELTEXTS1
EXCEPTIONS
PROGRAM_NOT_FOUND = 1
PROGRAM_CANNOT_BE_GENERATED = 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.
if s_lang ne ' '.
loop at screen .
if screen-group1 = 'SD'
and screen-group3 = 'PAR'
and screen-group4 > tot.
screen-input = '0'.
screen-active = '0'.
modify screen.
endif.
endloop.
endif.
if s_lang = ' '.
loop at screen .
if screen-group1 = 'SD'.
screen-input = '0'.
screen-active = '0'.
modify screen.
endif.
endloop.
endif. -
Transfer of selection screen parameters
Hi,
I have a program in classic ABAP which is actually 2 programs:
Program 1:
This program is the program that contains the selection-screen and it calls the related program by SUBMIT, see below:
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN COMMENT 1(40) text-s01 MODIF ID hdr.
SELECT-OPTIONS: s_werks FOR plko-werks,
s_plnnr FOR plko-plnnr.
PARAMETERS: p_write AS CHECKBOX,
p_update AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK bl1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'HDR'.
screen-intensified = '1'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
EXPORT p_write to memory id cst_mem_id.
EXPORT p_update to memory id cst_mem_id.
SUBMIT zzpp_inspchar_update
VIA SELECTION-SCREEN
AND RETURN.
Program 2 contains the selection of data like this:
SELECT fwerks fplnty fplnnr fzaehl fverwe fstatu psteus pvornr
INTO CORRESPONDING FIELDS OF TABLE gt_tasks
FROM plko AS f INNER JOIN plpo AS p
ON fplnnr = pplnnr
AND fplnty = pplnty
WHERE f~werks IN s_werks "
AND f~statu = '4'
AND f~plnty = 'N'
AND p~plnnr IN s_plnnr
AND p~steus = 'ZP04'
The 2 select-option, s_werks and s_plnnr has to come from program 1 and I have tried to use SET/GET parameter for this, but without luck.
How can I get these values filled ? EXPORT / IMPORT or ....?Hello,
If s_werks and s_plnnr are part of the selection screen of the second program, you can change the SUBMIT :
SUBMIT zzpp_inspchar_update WITH s_werks IN s_werks
AND s_plnnr IN s_plnnr
VIA SELECTION-SCREEN
AND RETURN.
For your problem using EXPORT/IMPORT, you do not show us the code you use so it is difficult to help you.
Cordialement,
Chaouki.
Maybe you are looking for
-
Script/Automator Get Filenames in Folder and Move Each File into Folder based on Filename?
I have searched for an answer to this and I have searched through multiple file renaming apps on the app store too but alas I cannot find anything that does what I want so I ended up looking into Automator as my saviour but I am a total NOOB. What I
-
Possible iTunes and CD import freeze workaround
I have been dealing with this problem of iTunes locking up while trying to import a CD. I think I have found a workaround for this issue. I insert the CD into my drive,(do not have iTunes automatically open on CD insert.) and I copy the songs that I
-
PE 9 - RenderFrameRequest Error
Hey all, Been using PE since 4 and upgraded to 7, 8, and now 9. After running 9 for the first time everything was going nicely untill I tried to "share" video. When using share function to export to FLV file I changed a few of the default settings on
-
Trusted CA Certificate Ignored When Connecting To Node Manager
I have a question about Node Manager. I have the following configuration: OS: Linux (CentOS 5.4) 32bit Oracle WebLogic Server 11gR1 (10.3.2) Portal, Forms, Reports and Discoverer (11.1.1.2.0) - only Forms and Reports are installed and configured All
-
Replace symbols in e-mail subject
Hi How can I create the subject of an e-mail that is send when I crete a delivery that depends of the delivery data? I want that the subject is ' Delivery (LIKP - VBELN) reference to (VBAK -BSTKD). Thanks Dora