Clear Selection-Screen Fields
Hello all,
How to clear the fields content from a selection-screen when the user returns from report to sel.screen?
I try in PBO for selection screen to clear all the fields, works fine but with one exception, when it is pressed Enter,
all the fields contents are empty.
Thank you
Bogdan
Hi Bogdan,
i think you can achieve this with a flag and export/import to SAP-memory:
AT SELECTION-SCREEN OUTPUT.
IMPORT back FROM MEMORY ID 'back'.
IF back = 'X'.
*clear/refresh your sel-opt/param.
refresh gjahr.
CLEAR : gjahr , amount.
CLEAR back.
FREE MEMORY ID 'back'.
ENDIF.
START-OF-SELECTION.
*end of your program
back = 'X'.
EXPORT back TO MEMORY ID 'back'.
Andreas
Similar Messages
-
Clear selection screen fields on using value help on another field
Hi Experts,
I have 3 fields - reason1, reason2, reason3.
Now i want to clear fields reason2 and reason 3 when i use value help for reason1.
How do i go about it.
Thanks & Regards
Gaurav Kumar RaghavHi,
You use the function module 'DYNP_VALUES_UPDATE', here is a code extract showing its use..
*& Form f4_laufd
form f4_laufd .
data: ls_laufk type ilaufk,
lt_laufk type table of ilaufk.
ls_laufk-laufk = space.
ls_laufk-sign = 'I'.
append ls_laufk to lt_laufk.
call function 'F4_ZAHLLAUF'
exporting
f1typ = 'D'
f2nme = 'F110V-LAUFI'
importing
laufd = p_laufd
laufi = p_laufi
tables
laufk = lt_laufk.
perform set_selection using 'P_LAUFI' p_laufi.
endform. " f4_laufd
*& Form set_selection
form set_selection using value(i_field)
i_value.
data: ls_dynpfld type dynpread,
lt_dynpfld type table of dynpread.
ls_dynpfld-fieldname = i_field.
ls_dynpfld-fieldvalue = i_value.
append ls_dynpfld to lt_dynpfld.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = lt_dynpfld.
endform. " set_selection
Darren -
Selection screen field problem
Hello experts..
i have a selection screen , in that i have a field s_bwart for mseg-bwart.
some times the user will input the data in the field and sometimes he wont. we have fixed movement types combination like
11-21 , 13-24 , 13-56 , 101-543 , 101-544 etc.
if the user did not input any thing in the selection screen , i am populating s_bwart in at-selection screen event with all the mvt types. after executing the report when user presses the back button to come to the selection screen, there the s_bwart field is containing all the mvt types in single values ie in the select options screen. So the user dont want that, if he comes back nothing should be there in the selection screen field s_bwart if he has not inputted anything. if he inputs only 11 mvt type then when he comes back after executing the report he should see only 11 in the select screen field ie s_bwart. Please send the replies on how to solve the problem.hi,
in ur program try to display values for users in START-OF-SELECTION event as it triggers after the selection screen displayed for users. if user doesn't give any input then display default values in this event. and also create a variable
for ex:
data: ws_flag type c,
p_value type i.
after u display default values for users in selection screen assign the flag as ' X '
ws_flag = 'X'.
before leaving ur program based on flag try to do like this.
if ws_flag = ' X '.
clear s_data. // s_data is the select options for u.
else.
s_data = p_value. // the value which user gave in selection screen as i/p.
endif.
if helpful reward some points.
with regards,
Suresh Aluri. -
Hi,
I want to group the selection screen fields. where should i group.
I want to group using the modif Id
T Y P E S
TYPES:
BEGIN OF TYVBAK,
VBELN TYPE VBAK-VBELN,
AUART TYPE VBAK-AUART,
AUDAT TYPE VBAK-AUDAT,
KUNNR TYPE VBAK-KUNNR,
NETWR TYPE VBAK-NETWR,
END OF TYVBAK.
D A T A D E C L A R A T I O N S
DATA:
STVBAK TYPE TYVBAK,
ITVBAK TYPE TABLE OF TYVBAK.
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
SKUNNR FOR STVBAK-KUNNR.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS:
SVBELN FOR STVBAK-VBELN,
SAUDAT FOR STVBAK-AUDAT.
SELECTION-SCREEN END OF BLOCK B2.
I N I T I A L I Z A T I O N
*INITIALIZATION.
FILLING SELECT OPTIONS WITH DEFAULTS
SKUNNR-SIGN = 'I'.
SKUNNR-OPTION = 'BT'.
SKUNNR-LOW = '1'.
SKUNNR-HIGH = '4000000'.
APPEND SKUNNR.
T O P O F P A G E
TOP-OF-PAGE.
WRITE:/1'SALES DOC',12 'DOC TYPE',20 'SALES DATE',32 'NETWORTH',60 'CUSTOMER'.
*A T S E L E C T I O N S C R E E N O U T P U T .
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'SVBELN-LOW'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'SVBELN-HIGH'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
where should i group SBVELN and SAUDATHi
Instead of SCREEN-NAME use SCREEN-GROUP1 and for your select options give MODIF ID.
As follows
SELECTION-OPTIONS: selcrt for dobj MODIF ID MOD1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'MOD1.
SCREEN-REQUIRED = 1.
MODIFY SCREEN.
ENDLOOP.
This is COZ when you use select-options you get TWO fileds on the INPUT screen LOW and HIGH so you have to check for selcrit-low and selctri-high you can avoid all this my assigning a MODIF ID.
See this sample programs for this
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
pa_vkorg TYPE vbak-vkorg MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
s_date FOR gs_lfa1-erdat MODIF ID def,
s_augru FOR gs_vbak-augru MODIF ID def,
s_vbeln FOR gs_vbak-vbeln MODIF ID def.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b3.
IF pa_rep EQ gc_x.
LOOP AT SCREEN.
IF screen-group1 = gc_abc.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_def.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF pa_upd EQ gc_x.
*For Reprocessing
LOOP AT SCREEN.
IF screen-group1 = gc_def.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_abc.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
CLEAR pa_upd.
ENDLOOP.
ENDIF.
REPORT zrich_001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
user-command chk,
p_rad2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
s_datum2 FOR sy-datum MODIF ID d2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rad1 = 'X'
AND screen-group1 = 'D2'.
screen-active = '0'.
ENDIF.
IF p_rad2 = 'X'
AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP -
Validating a selection-screen field
Hi all,
I am Anil.can any body explains me how to validate a selection-screen field for the following scenario?
I have customer nos ranging from 100-1000.among them i dont have any sales orders for the customers who are in between 150-250.I have sales order(VBELN) as select-options and Plant(WERKS) as Parameter on the selection-screen.I want to validate these fields without hardcaode.How can i do that?Please send me the complete code.
I am not getting how to validate a field which is declared as parameter?
regards and thanks in advance.
Anil.Make sure that u are validating against the header table.
say eg if u wnat t validate matnr in marc, then do as below.
SELECT-OPTIONS: s_matnr FOR marc-matnr. "Material No
AT SELECTION-SCREEN.
*Validate material no details
PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
SELECT SINGLE matnr INTO v_matnr
FROM <b>mara</b>
WHERE matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE i128.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM.
Dont select from marc.
Hope this is clear. -
Selection-screen fields validation for dialog
Hello ABAP Gurus
Requirements: this is a report wherein , depending upon the correct select-options , user will pick some field values from table and some will be entered by the user in the next se51 custom screen for creation of a record in a ztable .
the problem is :without validating select-options values , it calls the se51 screen 100.
How to keep the cursor at the selection-screen field until & unless user enters the correct i/p s .if i/p are correct then only it should call screen 100 otherwise remain in the selection screen only .
*& Report ZSD_REP_QUOT_BANK_CREATE *
REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK_CODE LIKE SY-UCOMM,
WA_ITAB LIKE ZSD_TABL_QOTBANK,
ANSWER TYPE C,
COPIED ,
STS TYPE N,
EMGRP LIKE MARA-EXTWG,
QTY LIKE ZSD_TABL_QOTBANK-QTY,
UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,
TOT LIKE ZSD_TABL_QOTBANK-TOT,
INO LIKE VBAP-POSNR.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_ITNO FOR ZSD_TABL_QOTBANK-ITNO
NO INTERVALS NO-EXTENSION OBLIGATORY.
S_MATNO FOR ZSD_TABL_QOTBANK-MATNO
NO INTERVALS NO-EXTENSION. "
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT SINGLE VBTYP
INTO VBAK-VBTYP
FROM VBAK
WHERE VBELN IN S_QTNO.
IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.
MESSAGE I005(ZQOTBANK).
SET CURSOR FIELD S_QTNO-LOW.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
CLEAR WA_ITAB.
SELECT SINGLE QTNO ITNO
INTO WA_ITAB
FROM ZSD_TABL_QOTBANK
WHERE QTNO IN S_QTNO
AND ITNO IN S_ITNO.
IF SY-SUBRC EQ 0.
MESSAGE I001(ZQOTBANK).
SET CURSOR FIELD S_QTNO-LOW.
SET CURSOR FIELD S_ITNO-LOW.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
*START-OF-SELECTION.
END-OF-SELECTION.
CALL SCREEN 0100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.
SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT
KNUMV
INTO (ZSD_TABL_QOTBANK-CCODE,
ZSD_TABL_QOTBANK-SORG,
ZSD_TABL_QOTBANK-DISTCHAN,
ZSD_TABL_QOTBANK-DIV,
ZSD_TABL_QOTBANK-CUSTNO,
ZSD_TABL_QOTBANK-QTDAT,
ZSD_TABL_QOTBANK-QTVALDAT,
VBAK-KNUMV)
FROM VBAK
WHERE VBELN IN S_QTNO
AND VBTYP = 'B'.
IF SY-SUBRC EQ 0.
SELECT SINGLE KWMENG POSNR MATNR
INTO (QTY , INO , ZSD_TABL_QOTBANK-MATNO)
FROM VBAP
WHERE VBELN IN S_QTNO.
SELECT SINGLE EXTWG
INTO EMGRP
FROM MARA
WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.
ZSD_TABL_QOTBANK-ITNO = INO.
ZSD_TABL_QOTBANK-EMATGRP = EMGRP.
ZSD_TABL_QOTBANK-QTY = QTY.
SELECT SINGLE KBETR
INTO UPRICE
FROM KONV
WHERE KNUMV = VBAK-KNUMV
AND KPOSN = INO
AND KSCHL = 'PR00'.
ENDIF.
ZSD_TABL_QOTBANK-UPRICE = UPRICE.
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-CGL_QTY.
UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-CGL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.
UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.
UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-TELK_QTY.
UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-TELK_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-OTH_QTY.
UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-OTH_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'SAVE'.
INSERT ZSD_TABL_QOTBANK.
IF SY-SUBRC EQ 0.
MESSAGE I000(ZQOTBANK).
COMMIT WORK.
CALL SELECTION-SCREEN 1000.
ELSE.
MESSAGE E001(ZQOTBANK).
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module EXIT_COMMAND INPUT
text
MODULE EXIT_COMAND INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'CANCEL'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Quotation Bank Entry'
TEXT_QUESTION = 'Do you want to Cancel ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE PROGRAM.
ELSE.
CALL SELECTION-SCREEN 1000.
ENDIF.
WHEN 'EXIT'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Quotation Bank Entry'
TEXT_QUESTION = 'Do you want to Exit ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE PROGRAM.
ELSE.
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDCASE.
ENDMODULE. " EXIT_COMMAND INPUT
Thnx in AdvancePut the statement
CALL SCREEN 100
in the event <b>AT SELECTION-SCREEN</b> and NOT in <b>END-OF-SELECTION</b>.
Regards,
Subramanian V. -
Need help on search help on selection screen field
Hi guyz,
Please tell me how to pass the parameter or restrict the below search help.
*s_bsart FOR ekko-bsart . " Doc. Type*
For the above selection screen field i need to display the data only for cat = F if i click search help.
Thanks,
Mohamed KaleelHi,
Use At selection-screen for value-request for s_bsart.
SELECT_OTPIONS: s_bsart FOR ekko-bsart.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bsart.
CALL SCREEN 100 STARTING AT 10 5
ENDING AT 50 10.
MODULE value_list OUTPUT.
SUPPRESS DIALOG.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS space.
NEW-PAGE NO-TITLE.
s_bsart-low = 'F' / 'CAT=F'.
write :/ s_bsart-low.
Hide: s_bsart-low
clear s_bsart-low.
ENDMODULE.
AT LINE-SELECTION.
LEAVE TO SCREEN 0.
This will resolve the issue.
Regards,
Gurpreet -
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 -
Default value for selection screen field
Hi all,
I am using LDB PNPCE. I want to give default value for field Personnel area on selection screen.
How can I do it?
Thanks
RahulHi Rahul,
In the INITIALIZATION event we can set the default values for selection screen fields.
INITIALIZATION.
loop at screen.
if screen-name = 'S_MATNR-LOW'.
CLEAR S_MATNR.
s_matnr-low = '1234'.
s_matnr-option = 'EQ'.
s_matnr-sign = 'I'.
append s_matnr.
CLEAR S_MATNR.
s_matnr-high = '5678'.
s_matnr-option = 'EQ'.
s_matnr-sign = 'I'.
append s_matnr
clear s_matnr.
endif.
endloop.
Hope it helps.
Mark if useful
Regards,
Saumya -
Creating a list box to the selection screen field
Hi folks,
Could any one suggest me how to add a list box (drop down list) to a selection screen field.
Thanks,
Santosh.
Edited by: shyam prasad on Apr 3, 2009 6:07 AMHi,
just follow the code like below,
TYPE-POOLS: vrm.
TABLES sscrfields.
PARAMETERS: p_values AS LISTBOX VISIBLE LENGTH 10.
PARAMETERS: p_key TYPE char40 DEFAULT '5',
p_text TYPE char80 DEFAULT 'Motorcycle'.
SELECTION-SCREEN PUSHBUTTON /10(10) but USER-COMMAND abc.
DATA: i_val TYPE vrm_values,
wa_val TYPE vrm_value.
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_VALUES'
values = i_val
EXCEPTIONS
id_illegal_name = 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.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ABC'.
IF p_key IS INITIAL AND p_text IS INITIAL.
MESSAGE e001(00) WITH 'Enter both Key and Text to add value'.
ELSE.
CLEAR: wa_val.
wa_val-key = p_key.
wa_val-text = p_text.
APPEND wa_val TO i_val.
ENDIF.
ENDIF.
INITIALIZATION.
CLEAR: wa_val.
wa_val-key = 1.
wa_val-text = 'Bus'.
APPEND wa_val TO i_val.
CLEAR: wa_val.
wa_val-key = 2.
wa_val-text = 'Car'.
APPEND wa_val TO i_val.
CLEAR: wa_val.
wa_val-key = 3.
wa_val-text = 'Van'.
APPEND wa_val TO i_val.
CLEAR: wa_val.
wa_val-key = 4.
wa_val-text = 'Bicycle'.
APPEND wa_val TO i_val.
Hope it helps!!
Regards,
Pavan -
Truncation of selection screen field in reports
Hi,
Is there any way to avoid truncation of selection screen fields in ABAP reports? For eg, I declare:
SELECT-OPTIONS: s_test FOR ztest-test_field NO INTERVALS
The length of this field in the table is 30 chars. However, on displaying the field via selection screen, this gets truncated to around 18 or so. How do I avoid this as I need to display the full length of the field?Hi,
Try this
Tables : makt.
select-options maknr for makt-maktx.
now go to the screen painter of your program in change mode and move the Help buttons first to the Right each. now increasethe length of the Matnr Field length so that they are equal to 40 Char. in your program you have handle the length now if you want to restrict to 18 otherwise it will be ok
if they don't fit you need incease the Size of the Screen Visible area both in the Screen Painter as well as in the
Screen Attributes
You also get an Information Message just ignore that.
Just open your program in SE80 if you can't go to the screen painter in SE38. the other way just keep this program in Display mode and execute then take F1 help , take Technical Information and double click on the Screen number now go to the Screen Layout and go to Change mode here.
Regards,
Shirisha -
Regarding Search help on selection-screen field
Hi there,
I am working on custom tables.
I have a requirement to maintain search pattern on a selection-screen field.
selection-screen parameter: p_name which is company name filed from Z table.
By giving a string like Holl* and by pressing F4 on the field p_name it has to popup a dialogbox having list of company names starting with Holl.
Thanks in advance.
-TulasiHi
Go through the link given below :
How to create a search help for my own fields in selection screen
F4 search help on report selection screen
also try :
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'VKORG'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_VKORG'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'C'
TABLES
VALUE_TAB = T_TABLE1
FIELD_TAB = field_tab
RETURN_TAB = RET_TAB
DYNPFLD_MAPPING = DYN_TAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
With Regards
Nikunj shah -
Regarding Selection-Screen Field Display
Hi All,
I have issues with Selection-Screen field display.
The Actual issue is i had declared a selection screen field as: <b>s_exgen FOR embk-exgen</b>.
<b>EMBK-EXGEN</b> is actually <b>20</b> Char length field.
But in output display it is being shown as <b>18</b> Char field though i can type in all <b>20</b> characters.
But <b>display</b> restricted to <b>18</b> Characters only.
Can anybody give me the solution for the same!
Thanks in advance.
Thanks & Regards,
Prasad.Hi,
You can decrease the visible length of the field but you can not increase more than database field length. check SAP help on this :
select-options: s_exgen FOR embk-exgen VISIBLE LENGTH 5.
... VISIBLE LENGTH vlen
Effect
This addition allows you to shorten the visible length of the corresponding screen field on the selection screen to vlen.
Variant 2
SELECT-OPTIONS sel FOR (f).
Additions as in variant 1.
Effect
In this variant, (f) must be a field containing the name of the actual reference field at runtime. The system creates the LOW and HIGH fields as character fields with length 45. However, their appearance on the selection <b>screen is inherited from the reference field whose name is contained in field f at runtime.</b>
Regards
Appana -
How to schedule the background job using current selection screen field val
Hello Friends,
How to schedule the background job using current selection screen field values.
after completion of the job the spool should be sent as a mail to SAP Inbox.
Is there any way to create the variant dynamically by reading the current selection screen values.
Thanks,
RaviHi,
To get the variant details you can use teh following FM.
'RS_VARIANT_CONTENTS'.
Regards,
Ankur Parab -
F4 Help for the selection screen field
Hi Gurus,
I have to display F4 help for a selection screen field. i am using following code:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CODE'
dynpprog = lw_repid
dynpnr = sy-dynnr
VALUE_ORG = 'S'
TABLES
value_tab = gi_text
field_tab = li_fields_tab
return_tab = pi_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
My internal table gi_emp has two fields CODE & TEXT. When i select 1 particular value, it returns the CODE value in the pi_return_tab table.
But my requirement is i have to capture the corresponding TEXT value for the Returned CODE. Ex: following is the F4 help being displayed: -
001 test
001 test1
but is i select code 001(First Value), i also need to capture it's corresponding Text value. In return table pi_return_tab i have only Code value.
Please help me out.
Note: Based on return code i can't search into the internal table gi_code, because as shown in the example, code has multiple text.Sachin,
I think this is what you need. The following code will return the key and the text (OR any other columns), if both columns are in the selection screen the selected values (both columns) will also be passed to the corresponding parameters. If you only need the text to be in the return table and not passed to the selection screen then set the parameter for text with NO-DISPLAY option.
REPORT zktest01 .
DATA :
BEGIN OF value_tab OCCURS 0,
field LIKE e070-trkorr,
text LIKE e07t-as4text,
END OF value_tab.
DATA: t_fldtab LIKE dfies OCCURS 0 WITH HEADER LINE,
t_rettab LIKE ddshretval OCCURS 0 WITH HEADER LINE,
t_dynmap LIKE dselc OCCURS 0 WITH HEADER LINE.
PARAMETERS : p_field LIKE value_tab-field,
p_text LIKE value_tab-text. "NO-DISPLAY.
INITIALIZATION.
t_fldtab-tabname = 'VALUE_TAB'.
t_fldtab-fieldname = 'FIELD'.
t_fldtab-langu = 'E'.
t_fldtab-position = 1.
t_fldtab-offset = 0.
t_fldtab-fieldtext = 'Key'.
t_fldtab-reptext = 'Key'.
t_fldtab-leng = 20.
t_fldtab-intlen = 20.
t_fldtab-outputlen = 20.
t_fldtab-datatype = 'CHAR'.
t_fldtab-inttype = 'C'.
t_fldtab-headlen = 20.
t_fldtab-keyflag = 'X'.
t_fldtab-lowercase = ' '.
APPEND t_fldtab.
t_fldtab-tabname = 'VALUE_TAB'.
t_fldtab-fieldname = 'TEXT'.
t_fldtab-position = 2.
t_fldtab-offset = 20.
t_fldtab-fieldtext = 'Text'.
t_fldtab-reptext = 'Text'.
t_fldtab-leng = 60.
t_fldtab-intlen = 60.
t_fldtab-outputlen = 60.
t_fldtab-headlen = 60.
t_fldtab-keyflag = ' '.
t_fldtab-lowercase = ' '.
APPEND t_fldtab.
value_tab-field = '101'.
value_tab-text = 'dddd'.
APPEND value_tab.
value_tab-field = '202'.
value_tab-text = 'aaaa'.
APPEND value_tab.
t_dynmap-fldname = 'FIELD'.
t_dynmap-dyfldname = 'P_FIELD'.
APPEND t_dynmap.
t_dynmap-fldname = 'TEXT'.
t_dynmap-dyfldname = 'P_TEXT'.
APPEND t_dynmap.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_field.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FIELD'
dynpprog = 'ZKTEST01'
dynpnr = '1000'
dynprofield = 'P_FIELD'
value_org = 'S'
TABLES
field_tab = t_fldtab
value_tab = value_tab
return_tab = t_rettab
dynpfld_mapping = t_dynmap
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ENDIF.
START-OF-SELECTION.
Jeffrey Satriadi
Maybe you are looking for
-
This new XI Adobe Reader doesn't work!!!!
After I updated it to 11.0.02 it stopped working!! It doesn't open any .pdf online in ANY browser and it doesn't open any .pdf file on my PC. I have Windows 7. Before that everything worked perfectly. But after that update it just doesn't. First it o
-
Conditionally executing a function based on the existance of an item value
I want to populate a field based on a function. Easy enough with a function I have created to do this. GET_A_VALUE(:P14_ID); This works nicely when I put that in the default value and then go and edit an existing record. The problem is when we try an
-
HT1222 Problem installing iTunes on Windows 7
The error I receive is that I there are files missing from the system for the install. I found instructions to delete the temp file in the appdata area for my username. This could not be done so I deleted all the files within. I deinstalled all the a
-
MIRO Reference PO with many goods receipt
Dear guru , I enter an incoming invoice for a purchase order. I have many goods receipt for this po , the system show all the goods receipt with their amount and quantity. If I must do a change to the value is hard to distribute the new value for a
-
Failed Cluster Validation Wizard - Active Directory
Hi All, I have a problem creating a cluster that has just got me stumped. I've created two other clusters at two other sites with exact same hardware and configuration. All worked fine at those location. For this third location, the cluster build is