Selection screen obligatory
Hi all,
in selection screen
SELECT-OPTIONS: S_MATNR FOR MATNR OBLIGATORY.
in this obligatory will comes only for lower value.but i want for upper value also. i can i do it?
Hi Katta.
What mittal said will work.
Put a error message for validation
TABLES mara.
SELECT-OPTIONS : so_matnr FOR mara-matnr OBLIGATORY.
AT SELECTION-SCREEN.
IF so_matnr-high IS INITIAL.
MESSAGE 'Enter To value for material' TYPE 'E'.
ENDIF.
START-OF-SELECTION.
WRITE 'Hai'.
Regards
Similar Messages
-
At selection screen output problem when a field is obligatory
Hi All,
I have two radiobuttons on the selection screen and when I select first radiobutton one screen should display and the other should not be displayed and vice-versa. It is working fine if I do not have a mandatory field.I am pasting my code here.Can anyone please help me how to handle this situation when we have some mandatory fields on one of these screens.
TABLES : mara,marc.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,
p_meth2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK matnr WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1 obligatory.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .
SELECTION-SCREEN END OF BLOCK matnr.
SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-003.
SELECTION-SCREEN SKIP 1.
PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.
SELECTION-SCREEN END OF BLOCK file.
SELECTION-SCREEN BEGIN OF BLOCK date WITH FRAME TITLE text-004.
SELECTION-SCREEN SKIP 1.
PARAMETERS : p_date TYPE datuv.
SELECTION-SCREEN END OF BLOCK date.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'M1'.
IF p_meth1 = 'X'.
screen-active = 1.
ENDIF.
IF p_meth2 = 'X'.
screen-active = 0.
ENDIF.
WHEN 'M2'.
IF p_meth2 = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
IF p_meth1 = 'X'.
screen-active = 0.
ENDIF.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
Thanks in advance
SandeepObligatory fields with your requirement will not work, reason : The GUI checks obligatory fields before passing the control back to the program (i.e Before triggering the PAI )
If you check for empty fields and give appropriate error message in the PAI, the program will not allow you to switch to the other radio button until you fill something in the fields because the moment you select a radiobutton, it will validate the field and issue the error message.
So it is like a catch 22 situation.
All you can really do is to check see which radio button is clicked and then do your processing. Also make sure to assign a user command to the radiobutton and query it in the AT SELECTION SCREEN and based on the radiobutton selected, decide which fields should be validated.
" Additon...
INITIALIZATION " Default values
p_meth1 = 'X'.
AT SELECTION-SCREEN. " General PAI
if p_meth1 EQ 'X'.
"validate fields for meth1.
elseif p_meth2 EQ 'X'.
" validate fields for meth2.
endif.
regards,
Advait -
How to manage obligatory parameters on standard selection screen.
Hi all,
How could I ensure settings some fields-parameters as obligatory on standard selection screen-dynpro1000. I would like to manage this according choosen block. On standard dynpro 1000 I have two blocks for two different selections. Checkboxes ensure which block of selection parameters I want to use. When I check first checkbox I need to set parameters in first block as obligatory and reversely in second block.
Thanks. zd.Another example...
report zrich_0003.
selection-screen begin of block b1 with frame .
parameters: p_check1 as checkbox user-command chk.
parameters: p_fielda type c modif id gp1.
parameters: p_fieldb type c modif id gp1.
parameters: p_fieldc type c modif id gp1.
selection-screen end of block b1.
selection-screen begin of block b2 with frame .
parameters: p_check2 as checkbox user-command chk.
parameters: p_fieldd type c modif id gp2.
parameters: p_fielde type c modif id gp2.
parameters: p_fieldf type c modif id gp2.
selection-screen end of block b2.
at selection-screen output.
if p_check1 = 'X'.
loop at screen.
if screen-group1 = 'GP1'.
screen-required = '1'.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'GP1'.
screen-required = '0'.
modify screen.
endif.
endloop.
endif.
if p_check2 = 'X'.
loop at screen.
if screen-group1 = 'GP2'.
screen-required = '1'.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'GP2'.
screen-required = '0'.
modify screen.
endif.
endloop.
endif.
Regards,
Rich Heilman -
Make (LDB)PNP Fields obligatory on selection-screen
I am using LDB PNP.. I want to make some fields of PNP as obligatory. How Can I do that?
So far I am doing the following...
<b>Initialization.
PNPABKRS-LOW = '?'.
Append PNPABKRS.
At selection-screen.
if PNPABKRS-LOW is initial.
PNPABKRS-LOW = '?'.
Message e100(z01).
endif.</b>
What you suggest ?
Thanks
Message was edited by: Saquib KhanYou have to do this way,
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'PNPABKRS-LOW '.
SCREEN-REQUIRED = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP. -
SELECTION-SCREEN disable OBLIGATORY
Hi all,
at the moment I'm building a selection-screen which, has a radiobutton group with two options. When one radiobutton is been selected, a couple of fields are disabled for input, or could be hidden. What I want to accomplish is to make some of these fields OBLIGATORY when they're ready for input.
All ok, but when the other radio buttons is pressed, the OBLIGATORY check already set an error message before the AT SELECTION-SCREEN OUTPUT is been triggered, so I can not suppress the 'required' parameter.
Suggestions are welcome, if it's not possible, it's also ok to state that here, I'm afraid that will be the conclusion.
Some reference code:
PARAMETERS p_dele TYPE boolean RADIOBUTTON GROUP a USER-COMMAND SELECT.
SELECTION-SCREEN COMMENT /1(79) s01.
PARAMETERS p_geraet TYPE gernr OBLIGATORY MODIF ID del.
PARAMETERS p_equnr TYPE equnr OBLIGATORY MODIF ID del.
PARAMETERS p_logik TYPE logiknr OBLIGATORY MODIF ID del.
PARAMETERS p_ins1 TYPE anlage OBLIGATORY MODIF ID del.
PARAMETERS p_ins2 TYPE anlage MODIF ID del.
SELECTION-SCREEN ULINE.
PARAMETERS p_rest TYPE boolean RADIOBUTTON GROUP a.
PARAMETERS p_uname TYPE uname MODIF ID res.
PARAMETERS p_time TYPE TIMESTAMP MODIF ID res.
DATA go_report TYPE REF TO lcl_report.
INITIALIZATION.
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'RES'.
screen-INPUT = '0'.
screen-OUTPUT = '1'.
screen-invisible = '0'.
MODIFY SCREEN.
WHEN 'DEL'.
screen-INPUT = '1'.
screen-OUTPUT = '1'.
screen-invisible = '0'.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_dele EQ 'X'.
CASE screen-group1.
WHEN 'RES'.
screen-INPUT = '0'.
screen-OUTPUT = '1'.
screen-invisible = '0'.
screen-required = '0'.
MODIFY SCREEN.
WHEN 'DEL'.
screen-INPUT = '1'.
screen-OUTPUT = '1'.
screen-invisible = '0'.
MODIFY SCREEN.
ENDCASE.
ENDIF.
IF p_rest EQ 'X'.
CASE screen-group1.
WHEN 'DEL'.
screen-INPUT = '0'.
screen-OUTPUT = '1'.
screen-invisible = '0'.
MODIFY SCREEN.
WHEN 'RES'.
screen-INPUT = '1'.
screen-OUTPUT = '1'.
screen-invisible = '0'.
MODIFY SCREEN.
ENDCASE.
ENDIF.
ENDLOOP.
START-OF-SELECTION.Hi ,
please ref following code it may help you .
***********constants***********
CONSTANTS : C_YES TYPE C VALUE '1' ,
C_NO TYPE C VALUE '0' .
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS p_dele TYPE C RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND DEL.
PARAMETERS p_rest TYPE C RADIOBUTTON GROUP a.
SELECTION-SCREEN: END OF BLOCK B1.
SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-002.
PARAMETERS p_geraet TYPE gernr OBLIGATORY MODIF ID DEL.
PARAMETERS p_equnr TYPE equnr OBLIGATORY MODIF ID DEL.
PARAMETERS p_logik TYPE logiknr OBLIGATORY MODIF ID DEL.
PARAMETERS p_ins1 TYPE anlage OBLIGATORY MODIF ID DEL.
PARAMETERS p_ins2 TYPE anlage OBLIGATORY MODIF ID DEL.
PARAMETERS p_uname TYPE uname MODIF ID RES.
PARAMETERS p_time TYPE TIMESTAMP MODIF ID RES.
SELECTION-SCREEN: END OF BLOCK B3.
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN .
IF SCREEN-GROUP1 = 'DEL'.
IF p_dele = 'X' .
SCREEN-INVISIBLE = C_NO .
SCREEN-ACTIVE = C_YES .
screen-required = 2 .
MODIFY SCREEN.
ENDIF.
ENDIF.
IF SCREEN-GROUP1 = 'DEL'.
IF p_REST = 'X' .
SCREEN-INVISIBLE = C_YES .
SCREEN-ACTIVE = C_NO .
screen-required = 2 .
MODIFY SCREEN.
ENDIF.
ENDIF.
IF SCREEN-GROUP1 = 'RES'.
IF p_DELE = 'X' .
SCREEN-INVISIBLE = C_YES .
SCREEN-ACTIVE = C_NO .
MODIFY SCREEN.
CLEAR : p_geraet,
p_equnr ,
p_logik ,
p_ins1 ,
p_ins2 .
ENDIF.
ENDIF.
IF SCREEN-GROUP1 = 'RES'.
IF p_REST = 'X' .
SCREEN-INVISIBLE = C_NO .
SCREEN-ACTIVE = C_YES .
* screen-required = 2.
* SCREEN-INPUT = 0 .
MODIFY SCREEN.
CLEAR : p_geraet,
p_equnr ,
p_logik ,
p_ins1 ,
p_ins2 .
ENDIF.
ENDIF.
ENDLOOP. -
Selection screen output obligatory field
Hi all,
I have two radio buttons, if i selected one radio button one selection screen will come for entries another will be invisible.
in that selection screen i have all are mandatory fields. so it is not allowing to another radio button with out entering the values
Chek my code.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text001.
PARAMETERS : p_aut RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ac.
PARAMETERS : p_man RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text002.
PARAMETERS : p_zbukr TYPE reguh-zbukr MODIF ID aut.
SELECT-OPTIONS : s_laufi FOR reguh-laufi MODIF ID aut OBLIGATORY,
s_laufd FOR reguh-laufd MODIF ID aut OBLIGATORY,
s_hbkid FOR reguh-hbkid MODIF ID aut OBLIGATORY,
s_hktid FOR reguh-hktid MODIF ID aut OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text003.
PARAMETERS : p_bukrs TYPE bsak-bukrs MODIF ID man DEFAULT 'LTGI'.
SELECT-OPTIONS : s_augbl FOR bsak-augbl MODIF ID man OBLIGATORY,
s_augdt FOR bsak-augdt MODIF ID man OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b3.
Will it move from one radion button to another even those are obligatory.
Regards,
Sri
Edited by: Thomas Zloch on Sep 14, 2010 2:34 PM - please use code tags!Hi,
True. There are some variables to keep track of.
So, I have two radio buttons. P_UPL and P_DNL. If P_DNL is selected and gv_mode has already been set to "download status", then I do the check. AT SELECTION-SCREEN OUTPUT happens after AT SELECTION-SCREEN so my gv_mode variable won't be set on the first AT SELECTION-SCREEN when the radio button is selected.
* SELECTION SCREEN EVENTS
AT SELECTION-SCREEN OUTPUT.
DATA: lv_type(3).
IF p_upl = 'X'.
gv_mode = c_screen_upload.
ELSE.
gv_mode = c_screen_download.
ENDIF.
LOOP AT SCREEN.
IF NOT screen-group1 IS INITIAL.
IF screen-group1 = gv_mode.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN.
IF p_dnl = 'X' and gv_mode = c_screen_download.
IF p_aland is INITIAL.
MESSAGE text-m03 type 'E'.
ENDIF.
IF so_azone[] is INITIAL.
MESSAGE text-m04 TYPE 'E'.
ENDIF.
endif. -
How to set selection screen field obligatory dymically
hi expert,
i have to make selection screen field obligatory while selecting a check box,i am using the following code can any one help me regards, thanks in advance.....
PARAMETER:p_user TYPE adr6-smtp_addr ,
p_check AS CHECKBOX user-command ucomm.
at SELECTION-SCREEN.
case sy-ucomm.
when 'UCOMM'.
PERFORM set_obligatory.
ENDCASE.
FORM set_obligatory .
LOOP AT SCREEN.
IF SCREEN-name = 'P_USER'.
SCREEN-REQUIRED = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDFORM. " set_obligatoryHi,
The following is the sample code.
PARAMETERS : p_barea TYPE ps0171-barea DEFAULT 'Z1' MODIF ID pb,
" Benefit Area
p_imfil TYPE rlgrap-filename, " Import file name
p_lock TYPE ztx_int-int_name
DEFAULT 'ZHBNT06A_METLIFE_INBOUND' MODIF ID pb, " Lock
p_test TYPE c AS CHECKBOX, " Test run
p_update type c as checkbox. " default 'X'
SELECTION-SCREEN END OF BLOCK selb01.
AT SELECTION-SCREEN OUTPUT *
AT SELECTION-SCREEN OUTPUT.
Benefit Area field made display only field
LOOP AT SCREEN.
IF screen-group1 EQ 'PB'.
CLEAR screen-input.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards
Vick -
How to make a selection screen two fields obligatory
Dear friends...
I wish to know how i make two fields obligatory in the selection screen
like
select-options Po_Num for ekpo-ebeln obligatory.
select-options Po_Date for ekko-aedat.
select-options Material for mara-matnr.
in the above example i am looking for po_num and po_date both obligatory but if i dont enter data in the po_num, po_dat becomes obligatory and po_dat has no data entererd po_num is obligatory. i wish to know how i achieve single field act as a obligatory in absence of another field. please help in this regards..
thanking you,,,
regards.
NaimREPORT ZMM_COMP_POS no standard page heading line-size 225
tables: ekko, ekpo, mara.
data: begin of i_ekko occurs 0,
ebeln like ekko-ebeln,
ebelp like ekpo-ebelp,
matnr like mara-matnr,
aedat like ekko-aedat,
waers like ekko-waers,
ernam like ekko-ernam,
end of i_ekko.
data: begin of i_ekpo occurs 0,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
matnr like mara-matnr,
aedat like ekpo-aedat,
waers like ekko-waers,
menge like ekpo-menge,
meins like ekpo-meins,
ernam like ekko-ernam,
lgort like ekpo-lgort,
netwr like ekpo-netwr,
recd(16) type p decimals 3,
rec_val(16) type p decimals 3,
end of i_ekpo.
data: lines type i.
data :itab_output like i_ekpo occurs 0 with header line.
data: itab_output3 like standard table of itab_output .
data data.
data total like sy-dbcnt.
data recd(16) type p decimals 3.
data rec_val(16) type p decimals 3.
data : it like i_ekpo occurs 0 with header line.
selection-screen begin of block b1 with frame title text-010.
select-options Po_Num for ekpo-ebeln .
select-options Po_Date for ekko-aedat.
select-options Material for mara-matnr.
selection-screen end of block b1.
at selection-screen.
if po_num[] is initial
and po_date[] is initial.
message e001(00) with 'Make at least one entry'.
endif.
start-of-selection.
if PO_NUM is initial and
Po_Date is initial or
Material is initial.
select ebeln ebelp matnr
menge meins netwr
aedat
from ekpo
into corresponding fields of table i_ekpo
where ebeln in Po_Num.
endif.
loop at i_ekpo.
select ebeln aedat waers ernam
from ekko
into corresponding fields of table i_ekko
where ebeln in Po_Num.
if sy-subrc = 0 .
i_ekpo-aedat = i_ekko-aedat.
i_ekpo-waers = i_ekko-waers.
i_ekpo-ebeln = i_ekko-ebeln.
i_ekpo-ernam = i_ekko-ernam.
modify i_ekpo transporting ebeln aedat waers
ernam
where ebeln = i_ekko-ebeln.
clear i_ekko.
endif.
endloop.
describe table i_ekpo lines lines.
if lines le 0.
message e017(zk).
endif.
select ebeln ebelp matnr
menge meins netwr
werks
from ekpo
into corresponding fields of table i_ekpo
for all entries in i_ekko
where ebeln = i_ekko-ebeln .
sort i_ekpo by ebeln ebelp.
sort i_ekko by ebeln.
loop at i_ekko.
read table i_ekpo with key ebeln = i_ekko-ebeln.
if sy-subrc = 0.
i_ekpo-aedat = i_ekko-aedat.
i_ekpo-waers = i_ekko-waers.
i_ekpo-ebeln = i_ekko-ebeln.
i_ekpo-ernam = i_ekko-ernam.
modify i_ekpo transporting ebeln aedat waers
ernam
where ebeln = i_ekko-ebeln.
endif.
endloop.
describe table i_ekpo lines lines.
if lines le 0.
message e017(zk).
endif.
loop at i_ekpo.
write:/1 sy-vline,
(5) i_ekpo-ebeln left-justified ,sy-vline,
(10) i_ekpo-ebelp left-justified ,sy-vline,
(15) i_ekpo-aedat left-justified ,sy-vline,
(18) i_ekpo-ernam left-justified ,sy-vline,
(23) i_ekpo-matnr left-justified , sy-vline,
(27) i_ekpo-menge UNIT i_ekpo-meins left-justified , sy-vline,
(29) i_ekpo-meins left-justified , sy-vline,
(31) i_ekpo-netwr CURRENCY 'INR' left-justified ,sy-vline,
(33) i_ekpo-waers left-justified ,sy-vline.
endloop.
write:/(743) sy-uline.
top-of-page.
write:/30 'ESSAR CONSTRUCTIONS LTD.' color 6 inverse.
write:80 'DATE :' color 6 inverse, sy-datum color 6 inverse.
new-line no-scrolling.
write:/30 'PO Details.' color 7 inverse.
write: /(743) sy-uline.
format color col_heading on.
write:/1 sy-vline.
write: (5) 'PO no.',sy-vline,
(10) 'Item no.',sy-vline,
(15) 'PO Date' color 1,sy-vline,
(18) 'PO Created By.',sy-vline,
(23) 'Material No.', sy-vline,
(27) 'PO Quantity', sy-vline,
(29) 'PO Unit', sy-vline,
(31) 'PO Value',sy-vline,
(33) 'Currency' , sy-vline.
write:/(743) sy-uline.
format reset. -
Dynamically calling selection screens with obligatory
TABLES :
******selection-screen: begin of block bal with frame title txt3.
******parameters: RB1 radiobutton group rd1 user-command abc default 'X'.
******parameters: RB2 radiobutton group rd1.
******selection-screen: end of block bal.
******selection-screen: begin of block B1 with frame title txt1.
******SELECT-OPTIONS : s_cust FOR KNA1-kunnr OBLIGATORY MODIF ID r1.
******SELECT-OPTIONS : s_plant FOR plko-werks OBLIGATORY MODIF ID r1 .
******selection-screen: end of block val.
******selection-screen: begin of block upd with frame title txt2.
******SELECT-OPTIONS: s_vend FOR lfa1-lifnr OBLIGATORY modif id r2.
******SELECT-OPTIONS: s_plan FOR plko-werks OBLIGATORY modif id r2.
******selection-screen: end of block upd.
Here i need to call these two selection screens dynamically depends on radio buttion selection.
But
Problem is a arising when when both are obligatory in selection screen ( with out obligatory , it is working fine)
I need to call screens dynamically, ecen though we have obligatory
Let me know procedure , the possibility of same funcationality in tabstips & selection screen.
MadhuHi Madhu,
You have to write code in AT SELECTION-SCREEN OUTPUT event.
First of all remove obligatory from select-options declaration. Do it dynamically in AT SELECTION-SCREEN OUTPUT event.
You enable or disable the block depending upon the rediobutton selected. Then in the venet AT SELECTION-SCREEN ON field, you can check whethere user has entered data into that field or not depending upon the radiobutton selected.
TABLES : kna1,
plko,
lfa1.
SELECTION-SCREEN: BEGIN OF BLOCK bal WITH FRAME TITLE txt3.
PARAMETERS: rb1 RADIOBUTTON GROUP rd1 USER-COMMAND abc DEFAULT 'X'.
PARAMETERS: rb2 RADIOBUTTON GROUP rd1.
SELECTION-SCREEN: END OF BLOCK bal.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE txt1.
SELECT-OPTIONS : s_cust FOR kna1-kunnr MODIF ID r1.
SELECT-OPTIONS : s_plant FOR plko-werks MODIF ID r1 .
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK upd WITH FRAME TITLE txt2.
SELECT-OPTIONS: s_vend FOR lfa1-lifnr MODIF ID r2.
SELECT-OPTIONS: s_plan FOR plko-werks MODIF ID r2.
SELECTION-SCREEN: END OF BLOCK upd.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rb1 EQ 'X'.
IF ( screen-name EQ 'S_CUST-LOW'
OR screen-name EQ 'S_CUST-HIGH'
OR screen-name EQ 'S_PLANT-LOW'
OR screen-name EQ 'S_PLANT-HIGH') .
screen-active = '1' .
ENDIF.
IF ( screen-name EQ 'S_VEND-LOW'
OR screen-name EQ 'S_VEND-HIGH'
OR screen-name EQ 'S_PLAN-LOW'
OR screen-name EQ 'S_PLAN-HIGH') .
screen-active = '0' .
ENDIF.
ELSEIF rb2 EQ 'X'.
IF ( screen-name EQ 'S_VEND-LOW'
OR screen-name EQ 'S_VEND-HIGH'
OR screen-name EQ 'S_PLAN-LOW'
OR screen-name EQ 'S_PLAN-HIGH') .
screen-active = '1' .
ENDIF.
IF ( screen-name EQ 'S_CUST-LOW'
OR screen-name EQ 'S_CUST-HIGH'
OR screen-name EQ 'S_PLANT-LOW'
OR screen-name EQ 'S_PLANT-HIGH') .
screen-active = '0' .
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Regards,
Anil Salekar -
ABAP Query : Obligatory fields on selection screen!
Hi Experts,
I would like to know the differrent ways through which we can define mandatory fields on selection screen.Options availabel in Infosets (SQ02) as well as Query(SQ01).
Selection Screen:
Document Date in Document: (Mandatory Select-Option)
Plant : (Mandatory Select-Option)
Thanks,
YogeshHi, Everyone .
We can do that .
At selection-screen output (code section 13), set "1" to the field REQUIED by using MODIFY SCREEN code .
(You can get Dynpro number by F1 key or T-cd SE51 )
Masao .
Edited by: MASAO NONAKA on Oct 20, 2008 9:11 AM -
Getting parameter id in the selection screen parameter
Hi,
There are few fields in my selection screen. I need to set the parameter id of warehouse number such that the value in the user profile should get displayed by default when the user executes the report.. The parameter id is /scwm/lgn . How do I get it? Please advise.
I have my parameter as follows:
parameter: p_lgnum TYPE /sapapo/matio_wm-lgnum obligatory.
Moderator message: please read F1-help for "parameters", section "value options".
Edited by: Thomas Zloch on Jan 19, 2012not enough research..
Parameter: p_lgnum TYPE /sapapo/matio_wm-lgnum MEMORY ID /scwm/lgn .
press F1 and see how it works -
Hi All,
I have a requirment that:
I need to refresh my selection screen at every time i selected back button.
Following fields are maintained in selection screen.
PARAMETERS pc_chgno TYPE ZTB1 OBLIGATORY MEMORY ID zbc_change_number.
PARAMETERS PC_PHONE TYPE telf1 OBLIGATORY.
PARAMETERS PC_DIR TYPE LOCALFILE OBLIGATORY default 'C:\' .
SELECT-OPTIONS pc_uname FOR sy-uname OBLIGATORY NO INTERVALS .
SELECT-OPTIONS pt_korr FOR e070-trkorr NO INTERVALS .
The last field is diaplaying some data when i select "Select more single value" button of the field.
This have to be clear when come back the screen.
Thanks,
SubbuHi,
Clear all the selection screen fields in the AT SELECTION-SCREEN OUTPUT event. So that it will be triggered each time when your screen displayed again.
Reward if useful.
Thanks,
Muthu. -
SELECTION-SCREEN FIELD VALIDATION
Hi All!
I am trying to write this ABAP program in 4.7 Enterprise. I wish to selectively display (based on radio buttons) selection screen blocks and make them mandatory in runtime. I use code like this:
AT SELECTION-SCREEN ON SAL_ORG. (this is one of the fields that will be obligatory)
IF RD2 EQ 'X'.
IF SAL_ORG IS INITIAL.
MESSAGE 'THIS FIELD IS MANDATORY' TYPE 'I'.
ENDIF.
ENDIF.
Now, if I execute this as is, then I will get this message as soon as the block is displayed, not just after hitting the execution button. Can you please tell me how I should put a condition on this checking. I know it is triggered by SY-UCOMM = 'ONLI' but i am not sure where to put the condition.
Thanks in advance!hello J.C.!
this is what worked for me finally:
AT SELECTION-SCREEN.
CHECK sy-ucomm EQ 'ONLI'.
IF RD2 EQ 'X'.
IF SAL_ORG IS INITIAL.
MESSAGE 'THIS FIELD IS MANDATORY' TYPE 'I'.
ENDIF.
ENDIF.
SAP says sscrfields-ucomm is unrecognized. can you please tell me what it is actually? why did you prefer using it instead of SY-UCOMM? If possible, please direct me to some good reference on calling selection screen.
I have given your answer 10 points by the way. I am very new here, so i don't know what exactly it's role is, but i figured it is something significant. -
Regarding selection screen output
hi,
i have created ALV report by using selection screen.in this i have displayed kunnr field from kna1 table.
but it is showing someextra zero's and then code now i want to display only code not extra zero.here below i am giving example:----
sap code
00001562
but i want like this....
sap code
1562.
thanx/regards,
vaneet thakurTABLES : VBRK,KNA1.
TYPE-POOLS : SLIS.
DATA : T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_FIELDCAT TYPE SLIS_FIELDCAT_ALV, "DECLARATION OF FIELDCAT FOR OUTPUT DISPLAY
T_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBRK-VBELN, "PO NUMBER
VTEG LIKE VBRK-VTWEG, "DC
SPART LIKE VBRK-SPART, "DIVISION
FKDAT LIKE VBRK-FKDAT, "DATE
KUNRG LIKE VBRK-KUNRG, "CUSTOMER PLANT
WERKS LIKE VBRK-WAERK, "SITE
VKORG LIKE VBRK-VKORG, "SALE ORGANIZATION
NAME1 LIKE KNA1-NAME1,
ORT01 LIKE KNA1-ORT01,
END OF ITAB.
SELECTION-SCREEN : BEGIN OF BLOCK VANEET WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : SITE FOR VBRK-WAERK.
SELECT-OPTIONS : PCODE FOR VBRK-KUNRG.
*SELECT-OPTIONS : INVOICE FOR VBRK-VBELN.
SELECT-OPTIONS : S_ORG FOR VBRK-VKORG OBLIGATORY.
SELECT-OPTIONS : DC FOR VBRK-VTWEG OBLIGATORY.
SELECT-OPTIONS : DIVISION FOR VBRK-SPART obligatory.
*SELECT-OPTIONS : PO_DATE FOR VBRK-FKDAT.
SELECTION-SCREEN : END OF BLOCK VANEET.
SELECTION-SCREEN : BEGIN OF BLOCK VANEET1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS : INVOICE FOR VBRK-VBELN.
SELECT-OPTIONS : PO_DATE FOR VBRK-FKDAT.
SELECTION-SCREEN : END OF BLOCK VANEET1.
*PERFORM TOP-OF-PAGE.
PERFORM FETCH-DATA.
*PERFORM DISP_DATA.
PERFORM T_FIELDCAT.
PERFORM REUSE_ALV.
**& Form TOP-OF-PAGE
text
--> p1 text
<-- p2 text
*FORM TOP-OF-PAGE .
*FORMAT COLOR 3 INTENSIFIED OFF.
*FORMAT COLOR 5 INTENSIFIED OFF.
*write : /48(120) 'NAHAR RETAIL LTD'.
*FORMAT COLOR 3 INTENSIFIED OFF.
*write : /48(120) 'FOCAL POINT'.
*FORMAT COLOR 6 INTENSIFIED OFF.
*write : /48(120) 'LUDHIANA'.
*write : / sy-uline.
*format color 4.
**WRITE: /1(20) 'INVOICENO',
25(15) 'SAP CODE',
55(15) 'PARTYNAME',
100(50) 'LOCATION'.
format color 7 INTENSIFIED ON.
*ENDFORM. " TOP-OF-PAGE
*& Form FETCH-DATA
text
--> p1 text
<-- p2 text
FORM FETCH-DATA .
REFRESH ITAB.
SELECT AVBELN AKUNRG AFKDAT AWAERK BNAME1 BORT01 INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBRK AS A INNER JOIN KNA1 AS B
ON AKUNRG = BKUNNR
WHERE
A~VBELN IN INVOICE
and
A~FKDAT IN PO_DATE
and
B~KUNNR IN PCODE
GROUP BY AVBELN AKUNRG BNAME1 BORT01 AFKDAT AWAERK.
SORT ITAB ascending BY VBELN.
*ENDSELECT.
ENDFORM. " FETCH-DATA
**& Form DISP_DATA
text
--> p1 text
<-- p2 text
*FORM DISP_DATA .
*loop at itab.
*write :/1(18) itab-VBELN,
27(5) ITAB-KUNRG,
55(25) ITAB-NAME1,
100(50) ITAB-ORT01.
*endloop.
*ENDFORM. " DISP_DATA
*& Form T_FIELDCAT
text
--> p1 text
<-- p2 text
FORM T_FIELDCAT .
PERFORM fill_field USING 'VBELN' 'PO NO'.
PERFORM fill_field USING 'KUNRG' 'CUSTOMER PLANT'.
PERFORM fill_field USING 'NAME1' 'PARTY NAME'.
PERFORM fill_field USING 'ORT01' 'LOCATION'.
PERFORM fill_field USING 'BASME' 'UOM'.
PERFORM SELECTION_WIDTH.
ENDFORM. " T_FIELDCAT
*& Form fill_field
text
-->P_0267 text
-->P_0268 text
FORM fill_field USING p_fieldname
p_seltext.
L_FIELDCAT-FIELDNAME = p_fieldname.
L_FIELDCAT-TABNAME = 'ITAB'.
L_FIELDCAT-SELTEXT_M = p_seltext.
L_FIELDCAT-OUTPUTLEN = 10.
APPEND L_FIELDCAT TO T_FIELDCAT.
CLEAR L_FIELDCAT.
ENDFORM. " fill_field
*& Form REUSE_ALV
text
--> p1 text
<-- p2 text
FORM REUSE_ALV .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = T_LAYOUT
IT_FIELDCAT = T_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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. " REUSE_ALV
*& Form SELECTION_WIDTH
text
--> p1 text
<-- p2 text
FORM SELECTION_WIDTH .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = itab-kunrg
IMPORTING
OUTPUT = itab-kunrg -
How to capture the user change in an input field on a selection screen?
I am coding a selection screen in which there are two input fields. The first field takes a Unix directory from the user input. Based on the input value, the second field will be populated with a the name of a file under the corresponding directory.
My question is how I can make the program capture the user input without having to make the user press ENTER after they enter the value in the first field?
Any help will be greatly appreciated.Venkat,
Actually you led me to the real solution! It's the function module DYNP_VALUES_READ that does the trick for me. This function enables the program to capture dynamic user changes without recourse to PAI. Please refer to the code below:
REPORT zreiabsintf MESSAGE-ID zreiabsintfmc.
*<HGDC------------------------------------------------------------------
* Selection screen for the conversion program
*HGDC>------------------------------------------------------------------
SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-001.
PARAMETERS: p_indir LIKE epsf-epsdirnam OBLIGATORY, " Inbound file directory
p_infile LIKE epsf-epsfilnam DEFAULT gc_infile OBLIGATORY, " Inbound file name
SELECTION-SCREEN END OF BLOCK input.
*<HGDC------------------------------------------------------------------
* Displays a file-open dialog when the user clicks the search
* help button next to the inbound file text field. The user
* can select the inbound file visually.
*HGDC>------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
* Capture any user change to the directory.
PERFORM check_dir_change.
* Display the file open dialog
PERFORM file_open_dialog CHANGING p_infile.
*<HGDC------------------------------------------------------------------
* Global constants
*HGDC>------------------------------------------------------------------
CONSTANTS:
gc_indir LIKE epsf-epsdirnam
VALUE '/interfaces/<SID>/inbound/', " Default inbound directory template
gc_infile LIKE epsf-epsfilnam VALUE 'input'. " Default inbound file name
*<HGDC------------------------------------------------------------------
* Global data
*HGDC>------------------------------------------------------------------
DATA:
gs_dynpfields TYPE dynpread, " Fields of the current screen
gt_dynpfields LIKE STANDARD TABLE OF gs_dynpfields. " Table of the screen fields
*& Form file_open_dialog
* Opens a dialog window for the user to choose a file in
* the specified Unix directory.
* <--P_FILE is the file to be selected.
FORM file_open_dialog CHANGING p_file.
* Validate the directory.
OPEN DATASET p_indir FOR INPUT IN BINARY MODE.
IF sy-subrc NE 0.
MESSAGE i001(zreiabsintfmc) WITH p_indir. " Unable to open the given directory
EXIT.
ENDIF.
CLOSE DATASET p_indir.
* Call the dialog window to open a file in the directory.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = p_indir
IMPORTING
serverfile = p_file
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE i002(zreiabsintfmc). " Failed to open the file.
EXIT.
ENDIF.
ENDFORM. " file_open_dialog
*& Form check_dir_change
* text
* --> p1 text
* <-- p2 text
FORM check_dir_change .
CLEAR gs_dynpfields.
CLEAR gt_dynpfields.
gs_dynpfields-fieldname = 'P_INDIR'.
gs_dynpfields-fieldvalue = p_indir.
APPEND gs_dynpfields TO gt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = gt_dynpfields
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 NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE gt_dynpfields INTO gs_dynpfields INDEX 1.
p_indir = gs_dynpfields-fieldvalue.
ENDFORM. " check_dir_change
Thanks for all your answers! The problem is now solved.
Edited by: Ning Hu on Apr 9, 2008 11:32 AM
Edited by: Ning Hu on Apr 9, 2008 11:34 AM
Maybe you are looking for
-
Can i upload only select songs to itunes match
I currently carry 20 gigs of music around on my iphone and am looking to free up some space. If I use iTunes Match to upload my music to the cloud, will it take everything in my iTunes Library or just the songs/playlists/albums I select? This is crit
-
The video tab in ipod is locked- cannot load dvd (.mp4 files) files to ipod
I converted the dvd files to .mp4 files (Using cusoft). The files were loaded in the itune (by using add files to library). I can play the dvd in the itune on my pc but cannot transfer the dvd files to the ipod because: The dvd tab in the ipod is loc
-
R12.1.3 Vision Instance Product Status are Inactive.
I have R12.1.3 vision instance. I need to check whether the product are installed are not. so i run the script cd $AD_TOP/sql/ sqlplus apps/apps @adutconf.sql File adutconf.lst will be created in directory $AD_TOP/sql. Check product status by product
-
Icon in taskbar not transparent
Just a very minor nitpicking issue: The icon used for Raptor on the taskbar has a white background and is not transparent. This doesn't look very pretty. Probably one for the very last entry on your issue list.
-
Why AME takes twice the time for the same conversion?
Hi all! Yesterday I made a video conversion with Adobe Media Encoder CS6 and it took about half the time it is taking now...same file, same conversion, same machine, same tasks, double time...WHY??? Thank you in advance.