‎2012 Oct 27 9:15 AM
Hi my requirement is to add a select option in screen but i got to know that the existing program is using a Logical Database.
So help me plss in editing the Database and creating my Select option.
The field is PRCTR which is already there but i have never worked on LDB's before so i have no clue how to proceed on this.
thanks
‎2012 Oct 28 7:36 PM
There is not need to copy a logical database. It is much simpler to just add PRCTR as another selection in your program and apply the selection criteria using CHECK after the respective GET statement.
Thomas
‎2012 Oct 27 3:33 PM
use SLDB tcode, copy to logical database to custom logical database, you can modify custom logical database as per your requirement.
‎2012 Oct 27 5:15 PM
I tried copying the standard ADA logical database but it gives me an error stating "nothing was copied since the lock could not be removed"..
Please help
‎2012 Oct 27 9:48 PM
Hi Rajat,
I have observed that PRCTR(Profit center) field is not available in ADA LDB. I believe it is coming from the program to which ADA LDB is attached. So copy that program to Z and modify as per requirement if no enhancements are available for that program.
One more thing, I have copied ADA to ZADA without any issues. Pls remove the lock entries in transaction SM12 on this object and then give a try.
Hope this will helps you!
Shravan
‎2012 Oct 28 7:36 PM
There is not need to copy a logical database. It is much simpler to just add PRCTR as another selection in your program and apply the selection criteria using CHECK after the respective GET statement.
Thomas
‎2013 Nov 13 1:45 AM
Hi Thomas,
Thanks for the idea, I've tried out you suggestion in a test program (code below) and I've found it works well.
I'm concerned that it may be slow if only the 'new' select-options are used i.e. no selections are made from the existing selection screen parameters. So I will add some default values, or a variant, that will limit the data returned in the 'get' for my production version.
Brian
report zbme_test.
* This report uses Logical database AFI
* If you forgot to add it when creating the program add it now via
* the menu Goto->Attributes-> add AFI in the Logical Database field
tables diaufk.
data: lt_diaufk type table of diaufk.
selection-screen begin of block b1 with frame title text-001.
select-options: s_aenam for diaufk-aenam,
s_mat for diaufk-ilart.
selection-screen end of block b1.
get diaufk.
* remove any items that are not wanted
check s_aenam.
check s_mat.
append diaufk to lt_diaufk.
end-of-selection.
* display results in ALV
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_structure_name = 'DIAUFK'
tables
t_outtab = lt_diaufk
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.