Dyanamic selection screen
Hi,
I have a Ztable created my program should create a dynamic selection screen depending on tht ztable
can you suggest me a solutin for this
Manohar.
Hi
Use this code
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab. *********Creates a dyanamic internal table*********
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform.
form create_dynamic_itab.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
Kiran
Similar Messages
-
FBL5N - Logical databases - Dyanamic selection screen fields
I am trying to insert "Profit center" from BSEG table of Logical database DDF into the dynamic selection screen of FBL5N.
Procedure I followed:
Program -> Attributes -> Logical database -> Extras -> Selection views.
Interestingly when I add "Profit center" from BSID table instead of BSEG, it appears on dynamic selection screen. But this is not working for BSEG. I have no clue why this is so? If someone can help me in this regard, that would be great.
P.S: I can not insert Profit center from BSID table as BSEG contains profit center values and BSID is not storing the same info.Rob,
Below is the BSEG contents:
Company code Document Number Customer Profit Center
1000 1800001111 0000100006
1000 1800001111 0000000401
BSID contents:
Company code Customer Document Number Profit Center
1000 0000100006 1800001111
As BSID stores customer info, I believe only line item that has customer info is stored here.
I guess, that is the reason.
I will try the option told by prev post. Will keep you guys posted.
Thanks,
Phani -
Dyanamic selection screen accordingly output
Hi Experts,
I want to making dyamic selection screen on there I take two fields only customer number and date.
It can be change the position of fields. In following ways.
First time selection screen : customer no
Date.
If I insert first value in customer field then output will come
In tree Report
Customer
Sales order
Items no. material no. order qty net price currency.
Second time selection screen : Date
Customer no.
If I selected date and inserted values in date field then output will get
Date
Sales order
items no material no. order qty net price currency.
This my requirement , I will try to making by using OOP ALV. Can any one give me any example or any standard such type of report for help.
Regards
PravinHello Pravin,
You can try this way:
1. Create basic selection screen with customer number and date field.
2. Now on START-OF-SELECTION you can call another screen which will display data in ALV.
3. Main part is of creating internal table dynamically depending on which field is selected on first selection screen,
4. So you can use static method cl_alv_table_create=>create_dynamic_table for creating dynamic table.
5. so load fieldcatalog table with required field as per the field selection and call method as follow:
DATA table TYPE REF TO DATA.
FIELD-SYMBOLS <ITAB> TYPE ANY TABLE.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = fieldcatalog_tab
importing
ep_table = table.
Now, here table is data object having reference to internal table created dynamically.
so you can assign that table to field symbol as follows:
ASSIGN table->* to <ITAB>.
Now you select data into table <ITAB> and pass it to ALV method SET_TABLE_FOR_FIRST_DISPLAY.
There are lot of threads on SDN for creating ALV using OOP method.
Hope this helps!
Thanks,
Augustin. -
Dyanamic Selection of Fields and prepare internal table dyanamically
Hi,
How can we select fields dyanamically and create a dyanamic internal table for the fields created dyanamically.
like from table KNC1 if user wants data from period 1 to 3 then for the following fields (UM01S,UM01H,UM01U,UM02S,UM02H,UM02U,UM03S,UM03H,UM03U) daynamic internal table should be created accordingly.
regards,
BGreport z_dynamic.
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab.
perform get_data.
perform write_out.
Get_Structure Form
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform.
Create_Dynamic_Itab Form
form create_dynamic_itab.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
Get_Data Form
form get_data.
Select Data from table.
select * into table <dyn_table>
from (p_table).
endform.
Write_Out Form
Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index
of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Dynamic Select Statement
check this code...
For dynamic table name....
REPORT demo_select_dynamic_database .
DATA wa TYPE scarr.
DATA name(10) TYPE c VALUE 'SCARR'.
SELECT *
INTO wa
FROM (name) CLIENT SPECIFIED
WHERE mandt = '000'.
WRITE: / wa-carrid, wa-carrname.
ENDSELECT.
For dynamic field list
REPORT demo_select_dynamic_columns .
DATA: itab TYPE STANDARD TABLE OF spfli,
wa LIKE LINE OF itab.
DATA: line(72) TYPE c,
list LIKE TABLE OF line(72).
line = ' CITYFROM CITYTO '.
APPEND line TO list.
SELECT DISTINCT (list)
INTO CORRESPONDING FIELDS OF TABLE itab
FROM spfli.
IF sy-subrc EQ 0.
LOOP AT itab INTO wa.
WRITE: / wa-cityfrom, wa-cityto.
ENDLOOP.
ENDIF.
regards
vinod -
Regarding Selection Screen field making display field in ALV report
Hi All,
In ALV Report, at runtime how can i make the field as Display Field in selection screen .
Thks & Regds
Shaileshhii,
Go to se38 and give the below progra name execute.... check the source code it is very easy to understand.
1.demo_dynpro_modify_simple
2.demo_dynpro_modify_screen
if tou are using grid,u can refer to foll link
sequencing / choosing fields in report screen at runtime,
Display the Columns in the grid at run time
rgrds,
Shweta -
Help Needed in At selection screen output
Hi Experts,
I need your help in AT SELECTION SCREEN OUTPUT event. My issue is i have 4 radio button and with each radio button couple of parameters that need to be filled in selection screen of report. My requirement is that sometimes user enters details in second radio button parameters but forgot to change the radio button to second one so kindly suggest a solution so that radio button gets selected as per user input in parameter like if user clicks on certain parameter to enter value then automatically corresponding radio button gets selected.
Thanks in advance for all your help.example from a checkbox in one of my progs..but you can do same approach with radio butts
parameters p_test as checkbox default abap_on user-command test.
at selection-screen.
if sy-ucomm = 'TEST'.
perform birth_mnth_chck.
endif. -
Help needed in selection screen - Urgent
Hi Experts,
I have a selection screen. I have three radi buttons in that selection screen. Based on the selection of the radio buttons I need to activate corresponding selection screen parameters.
e.g : if radiobutton1 is selected, njo activation needed,
if radiobutton2 is selected, activate selection screen parameter p_one,
if radiobutton3 is selected, activate selection screen parameter p_two.
All three radiobuttons are attached to the same radio button group.
I have assigned the parameters p_one, p_two, p_three to MODIF ID as follows.
p_one - NULL
p_two - t01
p_three - t02.
on the selection of a radio button I want the corresponding parameter to get activated.
please help me.
Regards,
Arul jothi A.hi
jothi
AT SELECTION-SCREEN OUTPUT.
CASE SY-TCODE.
WHEN 'ZEDI6'.
LOOP AT SCREEN.
CASE SCREEN-GROUP4.
WHEN '001'. "Sales order select
SCREEN-ACTIVE = '1'. "1=Active, 0=Don't display
MODIFY SCREEN.
WHEN '002'. "Delivery select
SCREEN-ACTIVE = '0'. "1=Active, 0=Don't display
MODIFY SCREEN.
WHEN '003'. "Invoice select
SCREEN-ACTIVE = '0'. "1=Active, 0=Don't display
MODIFY SCREEN.
WHEN '004'. "PO Select
SCREEN-ACTIVE = '0'. "1=Active, 0=Don't display
MODIFY SCREEN.
regards
praveen -
Compare the input filename in the selection screen
In the selection screen input field
there is an option of selecting the directory and file name and not the extension .
This is used to download the datas
Extension can be selected by using the option button
rtf
csv.
the user has to give only the filename and not the extension.
suppose if the user input is C:\temp\file1.rtf.
Either i should take only the filename
or i should display the message give only the filename and not the extension . its already been selected!!!!
I want to compare the input string contains .doc
how to do the comparison and to get the above results mentiond
Thanks in advanceBecause the requirment is there are two option buttion for selecting the download file format
But unknowingly if the user gives the filename along with the extension. I need to handle that error
giving some error message or information message
By comparing the last 4 letters of the filename.. either.doc or rtf or csv or watever
so how to do that
then after comparing that i should give the user a msg doc type is already selected give only the filename
I hope u understand my req -
Change selection screen in LDB (KDF logical database - NOT HR)
Hi All,
Iu2019d like to use KDF logical database to keep the dynamic selections since user wants to use it but I need to change the selection screen itself. The existing variants for KDF donu2019t meet the user requirements. Some fields I need to hide some add. Like I want to u201Cremoveu201D the field u2018Posting periodu2019 (MONAT) (which is available in dynamic selection screen) and put it on the u201Cmainu201D selection screen.
Do I need to create my own logical database or there is a way around?
Could someone give me a practical advice or sample of solution?
Thanks a lot.Thanks Himanshu,
I did as you suggested but problem is that it does not allow me to hide the whole block.
I have 3 filelds actually on block KD_0 I need to hide (its from selection screen of KDF logical database.)
SELECT-OPTIONS: KD_LIFNR FOR LFA1-LIFNR MATCHCODE OBJECT KRED.
SELECT-OPTIONS: KD_BUKRS FOR LFB1-BUKRS.
SELECTION-SCREEN END OF BLOCK KD_0.
PARAMETERS KD_INDEX AS SEARCH PATTERN FOR TABLE LFA1.
What I did is below. I used sp instead of u201C=u201D since it has many screen for field KD_LIFNR(for frame, text etc).
And when I did just for KD_LIFNR it was hidden but when I did the same for KD_BUKRS it was not hidden . The field has stars u201C*********u201D in it.
Same happen with KD_INDEX. The name of the field is hidden but field not and it filled with ********. Do you have any ideas what it can be?
I debugged it to catch all screen names but no luck
loop at screen.
if screen-name cp 'KD_LIFNR' or
screen-name cp 'KD_BUKRS' or
screen-name cp 'KD_INDEX' or
screen-name = '%B000003_BLOCK_1000' or
screen-name = 'SSCRTEXTS-FRAME_TEXT' or
screen-name = 'SSCRTEXTS-MCID_TEXT' or
screen-name = 'SSCRTEXTS-STRNG_TEXT' or
screen-name = 'SSCRFIELDS-SEARCH_BTN' or
screen-name = '%B025008_BLOCK_1000' or
screen-name = '%F021010_1000' or
screen-name = 'ALCUR' or
screen-name = '%F022012_1000' or
screen-name = 'EXCDT' or
screen-name = 'SSCRFIELDS-UCOMM'.
screen-invisible = '1'.
modify screen.
endif.
endloop. -
How to define our own selection screen for logical database in abap-hr?
Hi Friends,
Can u please help me
How to define your own selection screens for logical database.
we use to do like(goto->attributes-HRReportcatagerious ).but How to desin using customer table like t599c, t599f and how to add to my logical database?
Thanks in advance
charancheck out this online help
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba65c35c111d1829f0000e829fbfe/frameset.htm
Regards
Raja -
Need to restrict selection screen entries in logical database in HR report
After creating custom HR Report Category using Logical database, I need to restrict the options available in the in the selection Screen
for example- for company code i m getting 182 entries, but after running the program, selection-options for company code, i need only first 3 entries, don't want remailing entries
how can i do this?Hi
You can retrieve the required entries into an internal table and use FM F4IF_INT_TABLE_VALUE_REQUEST to provide them under F4 help.
Regards
Raj -
Selection Screen in Report Painter
Dear Experts,
I have an issue in the report painter. While executing the report from GRR2, selection screen is not displayed but report is coming as I expected.
I want to create the selection screen for this report. I have created this report without copying from the standard report.
Thanks in Advance.
Regards,
AswimnHi,
Please refer following links.
<Link farm removed by moderator>
Regards,
Renuka S.
Edited by: Vinod Kumar on May 25, 2011 10:12 AM -
HR ABAP - PNP selection screen
Hi Friends,
I am executing the standard report with PNP logical database .
But in the selection screen when I click on further selection and select the parameter company code.
Now I entered the company code "0060", but I am getting the out put for both company code 0060 and 0020,
here I need the out put only for the person which are belongs to company code 0060, but I think the selection screen company code was not controlling the out put.
Also I checked the Infotype internal table p0001, here I am able to see both the company codes, and for that person the process is continuing and I am getting the out put for the company code 0020, bcz the current/valid record for this person is 0020.
Request to let me know any issue there?
Magesh.SHi,
You need to set "person selection period" dates, in order to list values with selected parameters.
Daniel -
Logical database : user defined selection screen
Hi Experts,
I am working with HR-ABAP. The logical databases provide a selection screen......but i want to use a selection screen of my own and not that of the LDB.
Plz help...............hi do like this....
go to attributes-->hr report catagory-->master data...here use the value _____000(5underscores and 000 )..
you wii get that..
regards,
venkat -
Logical database sdf in custom program not triggering selection screen?
I added logical Database SDF (screen 905) to a custom program - but the selection screen is not getting triggered.
Do I have to associate these somewhere?
Thanks,
VenHI,
Declare this statement after the Report Statement in the program.
TABLES : SKA1, SKB1.
You will get the selection screen now.
Maybe you are looking for
-
Number of elements - Dimensional Hierarchy
Hi, In a *'Dimensional Hierarchy'*, while creating a new *'Parent level'*, a 'Logical Level' dialogue box prompts for entering *'Number of elements at this Level'*+. What is its significance ? What is achieved by+ *'Number of elements at this Level'*
-
Hi, We have an application that uses Struts 1.1 with an XSLT servlet to do the rendering. Basically, the app never forwards to a .jsp but to destinations intercepted by the XSLT servlet that uses the destination URI to fetch an XSL template and rende
-
HELP: WI in waiting status
I have a situation where a SC has been created and I have a work item ID but it's in 'waiting' stage. I can see in the SC approval preview that the right approver has been determined, but no emails are going out. I used txn SWUE to create a "SAVED" e
-
How to change video cameras easily
When using iChat AV or SKYPE, it is easy to have a MacBook built-in Video camera and a FireWire iSight both attached - and using preferences switch from one to the other (for example to use the iSight to show the entire room). BUT I would like to be
-
Sales return before invoice generation
Hi Experts, can we take material return before invoice generation sales order - >delivery---- >sales return - > actual invoice 10 nos 10 nos 2 nos 8 nos for example sales order 10