Question on selection-screen
Hi,
1) How we can provide two fields on selection-screen side by side
2) How we can provide Text on selection-screen (ie some comments regarding selection-screen fields)
Moderator message - Welcome to SCN
However, this is not a training forum for ABAP. Please read the appropriate documentation.
Thread locked..
Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
Similar Messages
-
One question about Selection screen
Hi experts,
I am writing a report, on the selection screen, I need to input the file path and then do the file upload.
My question is about how to check the file path I put is correct or not? If it is incorrect, I want to get a message and the cursor still in the field and don't jump to the next page.
How can I do like that?
Any one has any suggestion, please help me.
Thanks in advance.
Regards,
Chris GuHi Chris,
do it this way: check my code after calling gui_upload what condition i am using.
parameters:
p_file type rlgrap-filename. " File name
* AT SELECTION-SCREEN ON VALUE-REQUEST EVENT
at selection-screen on value-request for p_file.
perform get_file_name.
* AT SELECTION-SCREEN EVENT
at selection-screen on p_file.
perform validate_upload_file.
* Form GET_FILE_NAME
form get_file_name.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
importing
file_name = p_file.
endform. " GET_FILE_NAME
* Form VALIDATE_UPLOAD_FILE
form validate_upload_file.
data:
lw_file type string. " File Path
lw_file = p_file.
call function 'GUI_UPLOAD'
exporting
filename = lw_file
filetype = 'ASC'
has_field_separator = 'X'
dat_mode = 'X'
tables
data_tab = t_final_data.
IF sy-subrc ne 0 and t_final_data is initial. " here message if file path is wrong
Message 'File not found' type 'E'.
ELSEIF sy-subrc eq 0 and t_final_data is initial.
Message 'File empty' type 'E'.
ENDIF.
endform. " VALIDATE_UPLOAD_FILE
With luck,
Pritam.
Edited by: Pritam Ghosh on May 8, 2009 8:57 AM -
Question on selection screen in a subscreen in dialog prorgamming
hi,
i have a module pool in which the main program has the definition of the selection screen as follows:
SELECTION-SCREEN BEGIN OF SCREEN 0101 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS: S_VSTEL FOR TVST-VSTEL,
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 0101.
In the PBo of screen 100 this is called
CALL SUBSCREEN SUBSCREEN1 INCLUDING SY-REPID L_DYNNR.
The subscreen is displayed as
Shipping point _______ To _________ =>
When I click that arrow (( extension )) nothing happens !! I am supposed to get the standard extension screen in whcih i can select single values, ranges, exclude values, ranges !!
why is this not displayed..any idea ?
i have the same code in a normal report program and it works fine ..
thksin module pool you need to add code for the => this is not been handled by SAP in module pool whereas it is been handled in report program.
There is one FM which needs to be used so that when => is clicked it works... -
Question reg. selection screen
I am writing a report. On selection screen, I have a field for Sales order (vbeln) from a custom table zsales. Now when the user selects this field on selection screen and press F4, he/she should be able to select the salesorders from the table zsales.
I wrote:
SELECT-OPTIONS: s_vbeln FOR zsales-vbeln.
But on the output, when I press F4, I am still not getting any input help. What change can you suggest?
Appreciate your input.
Thanks,
KrishenTry something like this.
report zrich_0001 .
tables: zsales
data: begin of izsales occurs 0,
vbeln type vbak-vbeln,
end of izsales.
select-options s_vbeln for zsales-vbeln.
initialization.
select vbeln into table izsales from zsales.
sort izsales ascending by vbeln.
delete adjacent duplicates from izsales comparing vbeln.
at selection-screen on value-request for s_vbeln-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'VBELN'
dynprofield = 'S_VBELN'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = izsales.
start-of-selection.
Regards,
Rich Heilman -
how many push buttons put in selection screen
plzzz answer my questionHi,
U can place as many push buttons as u need...
Please reward if helpful. -
HI Question On Selection Screen
Hi Abapers,
i declared four parameters , one is assigned with one parameter is , and the other three are assigned with another parameter id , initially only one parameter has to display , if the entered parameter is valid one , then other three parameters has to be displayed, i wrote the folling code kindly make any corrections to the below code.
parameters:p_kunnr type kna1-kunnr modif id ABC.
parameters:p_vbeln type vbak-vbeln modif id DEF,
p_bukrs type bukrs modif id DEF,
p_werks type werks modif id DEF.
data: w_kunnr type kunnr,
val type i value 1.
at selection-screen .
select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.
if sy-subrc eq 0.
val = 100.
else.
message e000(0) with 'invalid '.
endif.
start-of-selection.
write:/ 'success'.
at selection-screen output .
IF VAL = 1.
loop at screen.
if screen-group1 = 'DEF'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
endif.
endloop.
ENDIF.
IF VAL NE 1.
loop at screen.
if screen-group1 = 'DEF'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
endif.
endloop.
ENDIF.
Thanks & Regards
Bhaskar Rao.Mhai,
Bhaskar try this code...
parameters:
p_kunnr type kna1-kunnr modif id ABC .
parameters:p_vbeln type vbak-vbeln modif id DEF,
p_bukrs type bukrs modif id DEF,
p_werks type werks modif id DEF.
data:
w_kunnr type kunnr,
val type i value 1.
at selection-screen output .
IF p_kunnr is initial.
loop at screen.
if screen-group1 = 'DEF'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
endif.
endloop.
ENDIF.
at selection-screen .
select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.
if sy-subrc ne 0.
message e000(0) with 'invalid '.
endif.
start-of-selection.
if p_vbeln is initial.
message 'error' type 'I'.
else.
write:/ 'success'.
endif.
regards,
ananth -
Reg: LDB& Selection screen
Hello All,
I have a question reg. selection screen associated with LDB. Iam developing a LDB for Hedge where there are nodes which have the same selection opt but
they are disjunct. But in LDB static slection screen , we associate Sel Opt with
a node and it would appear only for that node. In my case , i have two nodes for the same Sel Opt. How can i resolve this issue ? Kindly help.Hai Srivijaya
Go through the following Document
1. A logical database is in fact
a program only.
2. This LDB provides two main things :
a) a pre-defined selection screen
which handles all user inputs and validations
b) pre defined set of data
based upon the user selection.
3. So we dont have to worry about from
which tables to fetch data.
4. Moreover, this LDB Program,
handles all user-authorisations
and is efficient in all respects.
5. tcode is SLDB
good info about Logical Database. you can check the link.
http://www.geekinterview.com/question_details/1506
http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
Re: How to Create and Use ldb in reports?
Re: Logical databases
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
Functions for displaying and changing logical databases:
Call Transaction SE36 or
Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
Interaction between database program and report:
During program processing, subroutines are performed in the database program and events are executed in the report.
To read data from a database tables we use logical database.
A logical database provides read-only access to a group of related tables to an ABAP/4 program.
advantages:-
The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
i)An easy-to-use standard user interface.
ii)check functions which check that user input is complete,correct,and plausible.
iii)meaningful data selection.
iv)central authorization checks for database accesses.
v)good read access performance while retaining the hierarchical data view determined by the application logic.
disadvantages:-
i)If you donot specify a logical database in the program attributes,the GET events never occur.
ii)There is no ENDGET command,so the code block associated with an event ends with the next event
statement (such as another GET or an END-OF-SELECTION).
1. transaction code SLDB.
2.enter name z<ldb-name>
3.create
4.short text
5.create
6. name of root node (here Ekko)
7. enter short text (f6)
8.node type -> data base table.
9.create
10 change logical DB
riht click on ekko and insert node
here node name ekpo
11.create
12. click on selections
13. press no Should the changed structure of Z<ldb name> be saved first.
14.select tables which you want to join.
15.transfer
16 now you have to o to coding part.
17. save
activate.
19.click to src code
double click on first include and activate
Regards
Sreeni -
Dynamic interaction on selection screen
Hi experts,
I just have a easy question regarding selection screen in a ordinary ABAP report.
The code is below:
*-- Blcok 2
selection-screen begin of block block_2 with frame title text-s03.
select-options:
s_wc_id for /cockpit/cwc_id-wc_id matchcode object zmm25sh000008.
selection-screen begin of line.
parameters p_duewc type c as checkbox.
selection-screen comment 5(50) status_1 for field p_duewc.
selection-screen end of line.
parameters p_ndays(2) type n.
selection-screen end of block block_2.
When the user marks the checkbox p_duewc the parameter p_ndays should be ready for data entering.
If the checkbox is not marked (default) p_ndays shall be not ready for data entering.
I guess I can control it via the statement at-selection screen but can you give more details.
How can I code such a request?
Thanks in advance.
Regards
CorneliusHello,
U can use this code.
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-001.
PARAMETER: P_LAND LIKE KNA1-LAND1 ,
P_REGIO LIKE KNA1-REGIO ,
P_PSTLZ LIKE KNA1-PSTLZ ,
P_ORT01 LIKE KNA1-ORT01 .
SELECTION-SCREEN END OF BLOCK BL1.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_KDGR AS CHECKBOX MODIF ID SC1 USER-COMMAND SELTYPE,
P_BCS AS CHECKBOX MODIF ID SC2,
P_BDS AS CHECKBOX MODIF ID SC2,
P_BDC AS CHECKBOX MODIF ID SC2,
P_ALL AS CHECKBOX MODIF ID SC3 USER-COMMAND SELTYPE.
SELECTION-SCREEN END OF BLOCK BL2.
AT SELECTION-SCREEN OUTPUT.
IF P_KDGR = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
SCREEN-INPUT = '1'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'SC2'.
SCREEN-INPUT = '0'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'SC3'.
SCREEN-INPUT = '0'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF P_ALL = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
SCREEN-INPUT = '0'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'SC2'.
SCREEN-INPUT = '0'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Reward points if is useful.
Regards,
Vasanth -
Selection-screen functionality
Hi,
I have 2 questions regarding selection-screens:
1. I have 2 select-options like this in my selection-screen:
Matnr: s_matnr
Vendor: s_lifnr
How can I make a check that if Matnr is filled then Vendor has to be filled as well and vice versa ?
2. I want to take the interval of data from a select-option and create the records in an internal table:
example
Contract no: From 45000000 To 45000025
All the records that are contracts (document cat. = K) from that interval have to be appended to an internal table.Hi Peter ,
SELECTION-SCREEN :
BEGIN OF BLOCK b1 WITH FRAME TITLE tit.
parameters:
p_matnr TYPE marc-matnr,
P_WERKS TYPE MARC-WERKS,
p_lifnr TYPE lfa1-lifnr.
SELECTION-SCREEN END OF BLOCK b1.
WRITE: 10 p_lifnr.
INITIALIZATION.
MOVE 'Material-Plant' TO tit.
AT SELECTION-SCREEN ON p_matnr.
PERFORM validate_material.
AT SELECTION-SCREEN ON p_werks.
PERFORM validate_plant.
AT SELECTION-SCREEN." ON block b1.
PERFORM validate_material_plant_comb.
FORM validate_material .
DATA
lw_matnr TYPE matnr.
IF p_matnr IS NOT INITIAL.
SELECT SINGLE matnr
INTO lw_matnr
FROM mara
WHERE matnr EQ p_matnr.
IF sy-subrc NE 0.
MESSAGE e000(PP) WITH p_matnr.
ENDIF.
ENDIF.
ENDFORM. " validate_material
FORM validate_plant .
DATA
lw_werks TYPE werks.
IF p_werks IS NOT INITIAL.
SELECT SINGLE werks
INTO lw_werks
FROM t001w
WHERE werks EQ p_werks.
IF sy-subrc NE 0.
MESSAGE e272(61) WITH p_werks.
ENDIF.
ENDIF.
ENDFORM. " validate_plant
FORM validate_material_plant_comb .
DATA:
lw_matnr TYPE matnr,
lw_werks TYPE werks.
IF p_matnr IS NOT INITIAL
AND p_werks IS NOT INITIAL.
SELECT SINGLE matnr
INTO lw_matnr
FROM marc
WHERE werks EQ p_werks
AND matnr EQ p_matnr.
IF sy-subrc NE 0.
MESSAGE e707(12) WITH p_matnr p_werks.
ENDIF.
ENDIF.
ENDFORM. " validate_material_plant_comb
I have done it with parameters You just convert into select options.
This Validates the user before giving output
Regards
Swapna,
Edited by: NagaSwapna Thota on Jun 28, 2008 12:10 PM
Edited by: NagaSwapna Thota on Jun 28, 2008 12:11 PM -
Display list on selection-screen
Hello everyone,
I've got a question concerning selection screen. I want to know, if there is a way to display list/table on selection screen after user input. Specifically, when user enters for example 30 invoice numbers into select-options, I need those 30 numbers displayed on the same selection screen.
Thanks in advanceinstead u can print selection screen....along with output.....
for this....
You can use given function module to print your
selection screen
RS_REFRESH_FROM_SELECTOPTIONS
>This will get Current contents of selection screen
RS_LIST_SELECTION_TABLE
>This will Generates list according to values in selection table(RSPARAMS)
Sample
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = p_repid
TABLES
selection_table = it_int_tab
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
IF sy-subrc EQ 0.
WRITE:1 'Selection Criteria'(i19),
/1 sy-uline(18),
/1 'Variant Name'(i21),
23 sy-slset.
*-- This function module lists the Selection Screen contents
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = p_repid
seltext = 'X'
newpage = space
TABLES
sel_tab = it_int_tab
EXCEPTIONS
sel_tab_empty = 1
OTHERS = 2. -
Question on Logic of seperation in OOAbap-Selection screen
Hello guys
I like to ask you one question i found and get your ideas.
If you look at the codes for creating an ALV
it always recommends you to seperate logic and business layer etc..
this is the new way of creating an ALV
So you have a model view and a controller
I implemented that following useful resources.
So that there s class called view
and the selection screen gets called from there inside the method
like
call SELECTION-SCREEN 100.
IF sy-subrc EQ 0.
ENDIF.
But one issue when you execute the report and press GO BACK standard button it doesnot come back to your selection screen but way to your code.
Is there a get around to that?
here is the code below:
Header 1
*& Report ZZ_SOLEN_FIRST
REPORT ZZ_SOLEN_FIRST.
DATA: gv_vbeln type vbap-Vbeln.
***Screen
SELECTION-SCREEN: BEGIN OF SCREEN 100 TITLE t-004.
SELECTION-SCREEN: BEGIN OF block aa WITH FRAME TITLE t-001.
SELECT-OPTIONS: s_vbeln FOR gv_vbeln.
SELECTion-SCREEN: END OF block aa.
SELECTion-SCREEN: END OF SCREEN 100.
*****DATA Layer
class lcl_data DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF ty_out,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
vkorg type vbak-vkorg,
END OF ty_out
TYPES: tt_out TYPE STANDARD TABLE OF ty_out.
TYPES: gr_vbeln TYPE RANGE OF vbap-vbeln.
DATA: gt_output TYPE tt_out.
methods: constructor,
select_data IMPORTING VALUE(rs_vbeln) TYPE gr_vbeln.
ENDclass.
class lcl_data IMPLEMENTATION.
method constructor.
clear GT_OUTPUT.
ENDMETHOD.
method select_data.
DATA: lt_vbak type SORTED TABLE OF vbak WITH UNIQUE KEY vbeln.
FIELD-SYMBOLS: <lfs_output> like LINE OF gt_output,
<lfs_vbak> like LINE OF lt_vbak
select vbeln posnr matnr from vbap
INto TABLE
GT_OUTPUT
where vbeln in S_VBELN
IF sy-SUBRC EQ 0.
select * from vbak
INTO TABLE lt_vbak
FOR ALL ENTRIES IN GT_OUTPUT
where vbeln = GT_OUTPUT-vbeln
LOOP AT gt_output ASSIGNING <lfs_output>.
READ TABLE lt_vbak ASSIGNING <lfs_vbak>
with TABLE KEY vbeln = <lfs_output>-vbeln.
IF sy-Subrc eq 0.
<lfs_output>-vkorg = <lfs_vbak>-VKORG.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
ENDCLASS.
****Display
class lcl_view DEFINITION.
PUBLIC SECTION.
methods: start RETURNING VALUE(rv_true) type abap_bool.
METHODS: display CHANGING it_data TYPE STANDARD TABLE.
ENDCLASS.
class lcl_view IMPLEMENTATION.
METHOD start.
call SELECTION-SCREEN 100.
IF sy-subrc EQ 0.
rv_true = abap_true.
ENDIF.
endmethod.
method display.
DATA: lo_salv_table type REF TO CL_SALV_TABLE,
lt_columns TYPE SALV_T_COLUMN_REF.
FIELD-SYMBOLS: <lfs_columns> like LINE OF lt_columns.
CL_SALV_TABLE=>FACTORY(
* exporting
* LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE " ALV Displayed in List Mode
* R_CONTAINER = " Abstract Container for GUI Controls
* CONTAINER_NAME =
importing
R_SALV_TABLE = lo_salv_table " Basis Class Simple ALV Tables
changing
T_TABLE = it_data
* catch CX_SALV_MSG. " ALV: General Error Class with Message
lt_columns = lo_salv_table->GET_COLUMNS( )->GET( ).
* LOOP AT lt_columns ASSIGNING <lfs_columns>.
* break developer.
* ENDLOOP.
lo_salv_table->DISPLAY( ).
ENDMETHOD.
ENDCLASS.
class lcl_controller DEFINITION.
PUBLIC SECTION.
methods: main.
ENDCLASS.
class lcl_controller IMPLEMENTATION.
method main.
DATA: lo_view type REF TO lcl_view,
lo_data TYPE REF TO LCL_DATA .
CREATE OBJECT: lo_data, lo_view.
break developer.
IF lo_view->START( ) Eq abap_true.
**get the data
lo_data->SELECT_DATA( s_vbeln[] ).
lo_view->DISPLAY(
changing
IT_DATA = lo_data->GT_OUTPUT
ENDIF.
ENDMETHOD.
ENDCLASS.
INITIALIZATION.
START-OF-SELECTION.
break developer.
DATA: lo_controller type REF TO lcl_controller.
CREATE OBJECT lo_controller.
lo_controller->MAIN( ).Here is the complete code that works fine!!!
Thanks to your ideas:
OO ALV
*& Report ZZ_SOLEN_FIRST
REPORT ZZ_SOLEN_FIRST.
DATA: gv_vbeln type vbap-Vbeln.
***Screen
SELECTION-SCREEN: BEGIN OF SCREEN 100 TITLE t-004.
SELECTION-SCREEN: BEGIN OF block aa WITH FRAME TITLE t-001.
SELECT-OPTIONS: s_vbeln FOR gv_vbeln.
SELECTion-SCREEN: END OF block aa.
SELECTion-SCREEN: END OF SCREEN 100.
*****DATA Layer
class lcl_data DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF ty_out,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
vkorg type vbak-vkorg,
END OF ty_out
TYPES: tt_out TYPE STANDARD TABLE OF ty_out.
TYPES: gr_vbeln TYPE RANGE OF vbap-vbeln.
DATA: gt_output TYPE tt_out.
methods: constructor,
select_data IMPORTING VALUE(rs_vbeln) TYPE gr_vbeln.
ENDclass.
class lcl_data IMPLEMENTATION.
method constructor.
clear GT_OUTPUT.
ENDMETHOD.
method select_data.
DATA: lt_vbak type SORTED TABLE OF vbak WITH UNIQUE KEY vbeln.
FIELD-SYMBOLS: <lfs_output> like LINE OF gt_output,
<lfs_vbak> like LINE OF lt_vbak
select vbeln posnr matnr from vbap
INto TABLE
GT_OUTPUT
where vbeln in S_VBELN
IF sy-SUBRC EQ 0.
select * from vbak
INTO TABLE lt_vbak
FOR ALL ENTRIES IN GT_OUTPUT
where vbeln = GT_OUTPUT-vbeln
LOOP AT gt_output ASSIGNING <lfs_output>.
READ TABLE lt_vbak ASSIGNING <lfs_vbak>
with TABLE KEY vbeln = <lfs_output>-vbeln.
IF sy-Subrc eq 0.
<lfs_output>-vkorg = <lfs_vbak>-VKORG.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
ENDCLASS.
****Display
class lcl_view DEFINITION.
PUBLIC SECTION.
methods: start RETURNING VALUE(rv_return_flag) type abap_bool.
METHODS: display CHANGING it_data TYPE STANDARD TABLE.
ENDCLASS.
class lcl_view IMPLEMENTATION.
METHOD start.
call SELECTION-SCREEN 100.
IF sy-subrc EQ 0.
rv_return_flag = abap_true.
ENDIF.
endmethod.
method display.
DATA: lo_salv_table type REF TO CL_SALV_TABLE,
lt_columns TYPE SALV_T_COLUMN_REF.
FIELD-SYMBOLS: <lfs_columns> like LINE OF lt_columns.
CL_SALV_TABLE=>FACTORY(
* exporting
* LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE " ALV Displayed in List Mode
* R_CONTAINER = " Abstract Container for GUI Controls
* CONTAINER_NAME =
importing
R_SALV_TABLE = lo_salv_table " Basis Class Simple ALV Tables
changing
T_TABLE = it_data
* catch CX_SALV_MSG. " ALV: General Error Class with Message
lt_columns = lo_salv_table->GET_COLUMNS( )->GET( ).
* LOOP AT lt_columns ASSIGNING <lfs_columns>.
* break developer.
* ENDLOOP.
lo_salv_table->DISPLAY( ).
ENDMETHOD.
ENDCLASS.
class lcl_controller DEFINITION.
PUBLIC SECTION.
methods: main.
ENDCLASS.
class lcl_controller IMPLEMENTATION.
method main.
DATA: lo_view type REF TO lcl_view,
lo_data TYPE REF TO LCL_DATA .
CREATE OBJECT: lo_data, lo_view.
break developer.
* while lo_view->START( ) eq abap_true.
***get the data
* lo_data->SELECT_DATA( s_vbeln[] ).
* lo_view->DISPLAY(
* changing
* IT_DATA = lo_data->GT_OUTPUT
* ENDWHILE.
do.
if lo_view->START( ) eq abap_true.
***get the data
lo_data->SELECT_DATA( s_vbeln[] ).
lo_view->DISPLAY(
changing
IT_DATA = lo_data->GT_OUTPUT
else.
return.
ENDIF.
ENDDO.
ENDMETHOD.
ENDCLASS.
class lcl_test_submit DEFINITION.
PUBLIC SECTION.
TYPES: tr_vbeln TYPE RANGE OF vbap-vbeln.
data: lt_list type table_abaplist.
methods: test_submit IMPORTING VALUE(ir_vbeln) type tr_vbeln
EXCEPTIONS submit_failed
no_data_found
ENDCLASS.
class lcl_test_submit IMPLEMENTATION.
method test_submit.
submit ZZ_SOLEN_FIRST
with s_vbeln in ir_vbeln
exporting list to memory and return
***Get the list from the memory
call function 'LIST_FROM_MEMORY'
tables
listobject = lt_list
exceptions
not_found = 1
others = 2.
if sy-subrc <> 0.
raise submit_failed.
endif.
if lt_list is initial.
raise no_data_found.
endif.
ENDMETHOD.
ENDCLASS.
INITIALIZATION.
START-OF-SELECTION.
break developer.
DATA: lo_controller type REF TO lcl_controller.
****Testing the Main
CREATE OBJECT lo_controller.
lo_controller->MAIN( ). -
A question about keeping screen field unchangable in selection screen
Hello Expert,
I have a program as below.
REPORT Z_TEST.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-i01.
SELECT-OPTIONS: s_kappl FOR a017-kappl DEFAULT 'M' NO INTERVALS.
SELECTION-SCREEN: END OF BLOCK b1.
INITIALIZATION.
LOOP AT SCREEN.
IF screen-name CS 'KAPPL'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
When I executed the report, the field for S_KAPPL is unchangable. This is as expected. But if I select one variant, the filed will change back to changable.
My question is how can I keep the field unchangable after I select variant?
Thanks in advance,
Regards, JohnnyHello Johnny,
When you're creating the variant you've to mark the check-box "Protect field" as true.
This will make the field as output only.
BR,
Suhas -
Selection screen : matchcode on RYEAR and also question on FILE_SAVE_DIALOG
Hiii
Question 1 -->
i have on the selection screen a parameter of type RYEAR i check in database and theere is no matchcode attach to it.
can you please advise whether there is a standard matchcode i can used or am i missing something?
Question 2 -->
And also on my selection screen i have 2 parameter
P_path type string
P_name type string
on the P_path we need to put the directory name and also implement a F4 where user can browse the directory. On the p_name we will put the file name
have done somwthing like that. sorry i don't remember the exact name?
at selection screen on value request p_path
call method cl_xxxxx-file_save_dialogue
the problem is that the FILE_SAVE_DIALOGUE i must enter the a file name on the pop-up before clicking on save,
I don't want an F4 of P_PATH i want to only the browse directory path not save. can you please advise if there are another method for that?Check this code;
PARAMETER: p_path TYPE char50,
p_name TYPE char50.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
DATA: lv_path TYPE string.
lv_path = p_path.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
* window_title = 'Jay'
initial_folder = lv_path
CHANGING
selected_folder = lv_path
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
p_path = lv_path. -
Simple Selection-screen question
Right now my selection screen shows the variable names that I have assigned. The variable name is limited to 8 chars. I would like to be able to set the text. I know this is a very easy question and Im sorry to waste a forum post on it!
Here's what I got:
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-100.
SELECT-OPTIONS: network FOR AFPO-AUFNR.
SELECT-OPTIONS: s_dauat FOR AFPO-DAUAT.
SELECT-OPTIONS: fnsh_dat FOR AFKO-GSTRS.
SELECT-OPTIONS: strt_dat FOR AFKO-GLTRS.
SELECT-OPTIONS: status FOR TJ02T-TXT30.
SELECTION-SCREEN END OF BLOCK BL1.2 ways,
1) Go to TextElements and selection text and give the description there.
2) Using SELECTION-SCREEN COMMENT
For example
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-100.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) TEXT-001 FOR FIELD network.
selection-screen position 45.
SELECT-OPTIONS: network FOR AFPO-AUFNR.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BL1.
Here you may need to double click on TEXT-001 and give the description.
rgds,
TM. -
Hi Experts, a question about messages in selection screen? thank you!
Hi Experts,
I have a selection screen and two parameters on it, I need to check if the entries exist if the fields is filled in, if it doesn't exist I need to issue a warning message, but if the two parameters are both filled in and the related entries both don't exist, how can I handle this situation? what I mean is that I want to display the two warnings at the same time(like below), now I only can display one warning, can anyone help me on this? thank you much!
You are not authorised for this purchasing organisation
Plant: invalid entry
Purchasing organisation: invalid entry
No valid record selected
Kind regards
DawsonHi Dawson
As far as i get from your disciption of the problem, i get that: -
(a) You want to check that both the fields are filled or not
(b) If they are filled, then you want to check if in database there exists any record pertaining to them.
Correct me if i am wrong.
If this is correct, then you will have to make use of nested if condtions to diaplay the warnings.
Like as follows: -
If pa1 IS INITIAL and pa2 IS INITIAL.
<your warning message>.
ELSEIF pa1 IS INITIAL and pa2 IS NOT INITIAL.
<your warning message>.
ELSEIF pa1 IS NOT INITIAL and pa2 IS INITIAL.
<your warning message>.
ELSEIF pa1 IS NOT INITIAL and pa2 IS NOT INITIAL.
<try matching it with the database records>.
<your warning message>.
ENDIF.
As far as i know, the 2 warning messages cannot be issued as they appear in the status bar of the current screen. SO you will have to put them in if condition only and display the approriate warning .
Hope this solves your problem.
Regards
Gaurav.
Maybe you are looking for
-
The second tab opens in yahoo and i want it to open in google like the first tab does
my first search tab is set to go to google. when i open any more tabs, they go directly to yahoo, which i do not like as a search engine
-
Activate the FIELD Cost Center while issuing the Material to Order by 261
Dear All, How to activate the FIELD Cost Center while issuing the material againest Order IN MB1A? Thanks and regards, Satyajit
-
I upgraded my application server to 10.1.2.0.2. My DB is 9.2.0.6. My application is developed using web tool kit and deployed in mod_plsql. On a page i see the error "Too many arguments passed in. Got 5103. Upper limit is 2000" Can anyone help me res
-
Problems with sending requests
I cannot send requests from my N900 such as *102# or *111*1# after typing in dialing mode and tryin to call I see only WRONG NUMBER and its not operator answer but from phone. Is there any different way to make such requests?
-
I don't know what to do - I don't have any sound coming from my internal speakers, and with headphones there is still no sound coming out. When I go into system preferences under sound, there is nothing there - it says 'no output devices'. What shoul