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

SAP Query SQ02

Former Member
0 Likes
1,276

Hi,

there ia an existing infoset query retriving the data from logical database VFV.

There is an SAP Query accessing this infoset.

Now hte user wants to add addtional field from a Z table in the report.( SAP query report)

Is it possible to do that using the above infoset query???

Regards,

Chandan

Hi,

there ia an existing infoset query retriving the data from logical database VFV.

There is an SAP Query accessing this infoset.

Now hte user wants to add addtional field from a Z table in the report.( SAP query report)

Is it possible to do that using the above infoset query???

Regards,

Chandan

7 REPLIES 7
Read only

Former Member
0 Likes
1,060

I dont think you can have data source as logical database combined with Z table. But you can think about extending your logical database or write a separate query using table joins.

regards,

PB

Read only

Former Member
0 Likes
1,060

Hi Raja,

this is not possible, as logical database are just select statements and there is no defination in data dictionary.

hope you get it.

Read only

0 Likes
1,060

Hi Raja,

if you just want to get some field value from a custom table based on the existing data, i think you can do in the info set.

Read only

Former Member
0 Likes
1,060

hi all,

thnaks for your replies, if this is possible can please let me know the steps that i need to follow.

When i go to global properties in the infoset query , there we select the data source as logical datbas e or table join but not both. THen how can i retrieve the data from logical database and Z table based on some conditions.

Regards,

Chandan.

Read only

0 Likes
1,060

hi Raja,

you can write your query code in the infoset SQ02 and create the query in SQ01.

when you go to SQ02 then go to Application specific program (white color circle in the tool bar is there) then go to data read program.here you can write your logic and retreive the values you want.

to get the output you have to loop like this.


LOOP AT gt_out_list INTO wa_out_list.   " To display the output of the Query

  wa_data-equnr   = wa_out_list-equnr.
  wa_data-charge  = wa_out_list-scrp.
  wa_data-ernam   = wa_out_list-bill.
  wa_data-aenam   = wa_out_list-rmet.
  wa_data-serge   = wa_out_list-serge.
  wa_data-matnr   = wa_out_list-matnr.
  wa_data-werk    = wa_out_list-b_werk.
  wa_data-lager   = wa_out_list-b_lager.
  wa_data-zz_device_1 = wa_out_list-zz_device_1.
  wa_data-zz_ebeln = wa_out_list-zz_ebeln.
  wa_data-zz_vbeln = wa_out_list-zz_vbeln.
  wa_data-zz_posnr = wa_out_list-zz_posnr.
  wa_data-groes    = wa_out_list-bstkd_e.
  wa_data-kunde    = wa_out_list-vbeln.
  wa_data-eqnum    = wa_out_list-posnr.
  wa_data-sernr    = wa_out_list-matnr1.
  wa_data-warpl    = wa_out_list-werks.
  wa_data-uii_plant = wa_out_list-bukrs_vf.

  APPEND wa_data TO it_data.
  CLEAR wa_out_list.
  CLEAR wa_data.
ENDLOOP.     " LOOP AT G

here i have taken EQUi table to display the output.If some field are not present as required by you then you can get the similar field from teh output table.

like in last line i want to print bukrs_vf(char field) but this field is not present in equi table so i have refered uii_plant (char field) which is similar type of field.

hope this will help you to resolve your query.

Thanks

Tanmaya Gupta

Read only

Former Member
0 Likes
1,060

hi Tanmaya Gupta,

what is your data source in the infoset.

Regards,

Chandan

Read only

0 Likes
1,060

Hi Chandan

you can write your own logic in the infoset in the data read section like we did in the report program.Similarly i have created my own infoset and write my own logic which calls several tables.

In the similar way you can write your logic there

Thanks

Tanmaya