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

Abap Query

Former Member
0 Likes
721

Hi all,

Can we create interactive lists using Abap Query?if yes,pls send me the documentation.

Thanks

Naveen Rana

8 REPLIES 8
Read only

Former Member
0 Likes
691

Hi,

Check this link for a sample code.

http://www.erpgenie.com/abap/code/abap47.htm

Thanks.

Read only

0 Likes
691

Thanks Viji,but you did not get my Question.I am talking about

<b>SAP Query..[</b>

Read only

Former Member
0 Likes
691

hi

please check this..

DATA: WA_LFA1 TYPE LFA1,

IT_LFA1 TYPE TABLE OF LFA1,

WA_EKKO TYPE EKKO,

IT_EKKO TYPE TABLE OF EKKO,

WA_EKPO TYPE EKPO,

IT_EKPO TYPE TABLE OF EKPO.

**PARAMETER ORT01 LIKE LFA1-ORT01.

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-101.

PARAMETERS: ORT01 LIKE LFA1-ORT01.

SELECTION-SCREEN END OF BLOCK BLK1.

SELECT-OPTIONS VENMAS FOR WA_LFA1-LIFNR.

START-OF-SELECTION.

SELECT * FROM LFA1 INTO TABLE IT_LFA1 WHERE LIFNR IN VENMAS.

END-OF-SELECTION.

WRITE: /10(150) ' VENDOR MASTER LIST' COLOR COL_HEADING CENTERED.

ULINE.

SKIP 1.

WRITE: /10(20) 'VENDOR NR', 30(25) 'VENDOR NAME', 60(15) 'CITY',

90(12) 'POSTAL CODE', 103(10) 'COUNTRY'.

ULINE.

LOOP AT IT_LFA1 INTO WA_LFA1.

WRITE: /10 WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01,

WA_LFA1-PSTLZ, WA_LFA1-LAND1.

    • <<LIFNR --- VENDOR NR , ORT01 --- CITY, PSTLZ --- POSTAL CODE

    • LAND1 --- COUNTRY >>

HIDE WA_LFA1-LIFNR.

ENDLOOP.

CLEAR WA_LFA1-LIFNR.

AT line-selection.

IF SY-LSIND = 1.

SELECT * FROM EKKO INTO TABLE IT_EKKO WHERE LIFNR = WA_LFA1-LIFNR.

SORT IT_EKKO BY BSART.

WRITE: /10(20) 'PURCHASE NR', 30(20) 'COMPANY CODE',

55(15) 'PURCHASE TYPE', 75(20) 'PURCHASE GROUP'.

ULINE.

LOOP AT IT_EKKO INTO WA_EKKO.

    • << EBELN --- PURCHASE DOCUMENT NR ,BUKRS --- COMPANY CODE

    • BSART --- PURCHASE DOCUMENT TYPE , EKGRP --- PURCHASING GROUP.

WRITE: /10(20) WA_EKKO-EBELN , 30(20) WA_EKKO-BUKRS ,

55(15) WA_EKKO-BSART , 75(20) WA_EKKO-EKGRP.

HIDE WA_EKKO-EBELN.

ENDLOOP.

CLEAR WA_EKKO-EBELN.

ENDIF.

IF SY-LSIND = 2.

SELECT * FROM EKPO INTO TABLE IT_EKPO WHERE EBELN = WA_EKKO-EBELN.

WRITE: /10(20) 'PURCHASE NR', 30(20) 'ITEM NR',

55(15) 'MATERIAL NR', 75(20) 'MATERIAL GROUP'.

ULINE.

LOOP AT IT_EKPO INTO WA_EKPO.

**EBELN --- PURCHASE DOCUMENT NR ,EBELP --- ITEM NR of purchase document

    • MATNR --- MATERIAL NR , MATKL --- MATERIAL GROUP.

WRITE: /10(20) WA_EKPO-EBELN , 30(25) WA_EKPO-EBELP ,

55(15) WA_EKPO-MATNR , 75(20) WA_EKPO-MATKL.

HIDE WA_EKPO-EBELP.

ENDLOOP.

CLEAR WA_EKPO-EBELP.

ENDIF.

IF SY-LSIND = 3.

SET PARAMETER ID 'MAT' FIELD WA_EKPO-MATNR.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ENDIF.

reward if useful

Read only

Former Member
0 Likes
691

Hi

I think we can't create interactive lists using the ABAP query

http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm

http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp

Step-by-step guide for creating ABAP query

http://www.sappoint.com/abap/ab4query.pdf

ABAP query is mostly used by functional consultants.

SAP Query

Purpose

The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.

Features

SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.

All the data required by users for their lists can be selected from any SAP table created by the customer.

To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.

ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.

To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly

use either SQ02 ans SQ01

or SQVI tr code

for more information please go thru this url:

http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp

http://goldenink.com/abap/sap_query.html

Please check this PDF document (starting page 352) perhaps it will help u.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf

check the below link will be helpful for u

once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
691

hi naveen

yes you can very well create a interactive lists..

i think you are new to ABAP..anyways i will send you some documents which gives you the clear picture of interactive list...

<b>http://www.erpgenie.com/abap/ireports.htm</b>

REWARD IF USEFUL.....!!!!!

Read only

0 Likes
691

Thanks Asha.

But Mam I am talking about SAP Query,not Reporting........

Have you ever listened about SAP Query???

Read only

0 Likes
691

You want SAP query or ABAP query. At first you mentioned as ABAP query , Now u mentioned as SAP query. Please revert back with clear information.

Regards,

Kumar

Read only

0 Likes
691

Hi Lakshman..

I want SAP Query....