‎2006 Jan 02 3:10 PM
Hi all,
I want to use my selections along with logical database selection screen in my program.when i am trying to use it its giving some errors.if there is a get event its not allowing to select my own selection.can any advise my how to do it.
Regards,
Lisa
Message was edited by: Lisa Roy
‎2006 Jan 02 3:42 PM
Hi Lisa,
I used PNP logical database and declared seelction
screen in my program it is working for me.
Please see the below code
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
Parameters : p_date like sy-datum default sy-datum obligatory.
SELECTION-SCREEN : END OF BLOCK b2.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
select-options : s_plans for p0001-plans, " Position
s_orgeh for p0001-orgeh. " Org Unit
Parameters : p_actgr like agr_1250-agr_name " Act.Grp
default 'E:HR-*TIMEKEEPER*' obligatory.
SELECTION-SCREEN : END OF BLOCK b1.
Hope this will help you.
Thanks&Regards,
Siri.
‎2006 Jan 02 3:13 PM
Hi Lisa,
what is the error? did you declare your selections using the SELECTION-SCREEN option? It would help if you paste your code?
Regards,
Suresh Datti
‎2006 Jan 02 3:16 PM
Hi Suresh,
Yes i have declared by using some more fields by using the select-options.its giving error Local selections not allowed.so it mean i have to declare globally.So where i have to declare.
‎2006 Jan 02 3:42 PM
Hi Lisa,
I used PNP logical database and declared seelction
screen in my program it is working for me.
Please see the below code
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
Parameters : p_date like sy-datum default sy-datum obligatory.
SELECTION-SCREEN : END OF BLOCK b2.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
select-options : s_plans for p0001-plans, " Position
s_orgeh for p0001-orgeh. " Org Unit
Parameters : p_actgr like agr_1250-agr_name " Act.Grp
default 'E:HR-*TIMEKEEPER*' obligatory.
SELECTION-SCREEN : END OF BLOCK b1.
Hope this will help you.
Thanks&Regards,
Siri.
‎2006 Jan 02 3:45 PM
Hi Srilatha,
If u selection-options in our program it will work but if u use 'get' the it will give error.
‎2006 Jan 02 3:54 PM
Hi Lisa,
Eeven I am using GET (pernr) in my scenario also.
see my below sample code
*----------------------------------------------------------------------*
* S T A R T O F S E L E C T I O N
*----------------------------------------------------------------------*
START-OF-SELECTION.
* Get pernr
GET pernr.
* To Get Employee Details
PERFORM get_data.
*----------------------------------------------------------------------*
* E N D O F S E L E C T I O N
*----------------------------------------------------------------------*
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* Form to get data
*----------------------------------------------------------------------*
FORM GET_DATA.
* Get latest record from P0001 infotype
rp-provide-from-last p0001 space pn-begda pn-endda.
if pnp-sw-found = 1.
* Check positions
IF NOT s_plans IS INITIAL.
CHECK p0001-plans IN s_plans.
ENDIF.
* Check Org.Unit
IF NOT s_orgeh IS INITIAL.
CHECK p0001-orgeh IN s_orgeh.
ENDIF.
* Check Org.Structure
* CHECK p0001-orgeh IN pnpobjid.
rp-provide-from-last p0105 '0001' pn-begda pn-endda.
clear dg_flag.
* Form to get Activity Group
perform get_act_group using p0001-plans.
* Form to get profile info
perform get_info.
else.
exit.
endif.
ENDFORM. " GET_DATA
If you see my above code <b>s_palns</b> is the select-option and I am using in my program. It is working for me.
Can you post ur code or tell me which LDB u r using.
Thanks&Regards,
Siri.
‎2006 Jan 02 3:46 PM
Hi Lisa.
I'm not sure I understand your problem.
I usually declare variables in the beginning of the code, right after i write in the tables i will require.
However, if you're usring forms or function modules, those variables might not be available in them, if you want to use them you must declare them in the IMPORTING section of your form and pass them along in the form calls.
Hope this Helps.
André
‎2006 Jan 02 4:21 PM
Hi Lisa,
Use the select-options in the include program.
So that you can include it in your logical database and also in your report.
Refer this link...
1.<b>Help on selection-screen.</b>
http://www.geocities.com/siliconvalley/campus/6345/select_o.htm (Search for 'logical')
2.<b>Selection Screen and Logical Database (Help.sap.com)</b>
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba65c35c111d1829f0000e829fbfe/frameset.htm
Hope it helps.
Kindly reward points if it helps by clicking star on the left hand side of the screen.
Regards,
Maheswaran.B
Message was edited by: Maheswaran B