Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Ad-hoc query

Former Member
0 Likes
1,010

Hi Team,

We have a client requirement to include an additional field in our ad-hoc query to fetch the descritpion for position from hrt1002 table for this we are using fm RH_READ_HRP1002 to first fetch details from hrp1002 table under node for org assignment.

in parameter   act_begda     and   act_endda need to pass the value choosen in reporting period in the ad-hoc query.

   CALL FUNCTION 'RH_READ_HRP1002'
  EXPORTING
    act_plvar     = '01'
    act_otype     = 'S'
    act_objid     = p0001-plans
    act_subty     = '0002'
    act_langu     = 'E'
    act_begda     = syhr_evaluation_begda
    act_endda     = syhr_evaluation_endda
  TABLES
    act_p1002     = itab_plans
  EXCEPTIONS
    no_data_found = 1
    OTHERS        = 2.

But when coding the above getting syntax error

Field "SYHR_EVALUATION_BEGDA" is unknown. It is neither in one of the

specified tables nor defined by a "DATA" statement.

But when putting break point above this call fm step, we are getting value for both syhr_evaluation_begda  and syhr_evaluation_endda.

Kindly advice.

Thanks,

Anju

Hi Team,

We have a client requirement to include an additional field in our ad-hoc query to fetch the descritpion for position from hrt1002 table for this we are using fm RH_READ_HRP1002 to first fetch details from hrp1002 table under node for org assignment.

in parameter   act_begda     and   act_endda need to pass the value choosen in reporting period in the ad-hoc query.

   CALL FUNCTION 'RH_READ_HRP1002'
  EXPORTING
    act_plvar     = '01'
    act_otype     = 'S'
    act_objid     = p0001-plans
    act_subty     = '0002'
    act_langu     = 'E'
    act_begda     = syhr_evaluation_begda
    act_endda     = syhr_evaluation_endda
  TABLES
    act_p1002     = itab_plans
  EXCEPTIONS
    no_data_found = 1
    OTHERS        = 2.

But when coding the above getting syntax error

Field "SYHR_EVALUATION_BEGDA" is unknown. It is neither in one of the

specified tables nor defined by a "DATA" statement.

But when putting break point above this call fm step, we are getting value for both syhr_evaluation_begda  and syhr_evaluation_endda.

Kindly advice.

Thanks,

Anju

4 REPLIES 4
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
878

where are you coding this..You need to declare them as variables in data declaration..While compiling the compiler is not able to find the variable declartion. Declare them of same type function module needs

Read only

Former Member
0 Likes
878

Hi Anju,

Please check the Blogs

http://scn.sap.com/community/erp/hcm/blog/2008/06/16/sap-adhoc-query-sq01-sq02-sq03

http://scn.sap.com/docs/DOC-35463

They cover the concept of adding new fields to existing Ad-hocs and usage of local variables in queries

Regards

Read only

leelamohan_kavali
Active Contributor
0 Likes
878

Hi Anju,

I think for your scenario you can use SQVI, By this tcode you can get it all information from any table if it is possible try to use.

Best Regards

Mohan

Read only

0 Likes
878

Hi,

Kindly follow below link to write query

Sequence like SQ03 - 1,2,3...., SQ02 - 1,2,3,........,SQ01 - 1,2,3,4.........

Postimage.org / gallery - SQ 01 1, SQ 01 2, SQ 01 3, SQ 01 4, SQ 01 5, SQ 01 6, SQ 01 7

If still you have doubts kindly let me know

Yours

Mohan