Documente Academic
Documente Profesional
Documente Cultură
BE A FIXER (/BE-A-FIXER/)
RESOURCES (/RESOURCES/)
ABOUT (/ABOUT/)
LOGIN (HTTP://APP.ERPFIXERS.COM/LOGIN)
(/blog/2016/9/12/using-abap-coding-
in-sap-standard-query) HAVE A SIMILAR
Roberto Caas (/blog/?author=57d6f010b8a79b87928f540a) Tips / How To (/blog/? SAP QUESTION?
category=Tips+%2F+How+To), Modules (/blog/?category=Modules)
POST A REQUEST
(HTTP://APP.ERPFIXERS.COM/POSTAREQUEST)
GET MORE
AWESOME
CONTENT!
Sign up for our newsletter.
First Name
Last Name
Email Address
It is hard to find an easy explanation about ABAP coding in standard queries. In some cases
you cant easily attach additional information to a field in a Query or you need to call and ABAP
SIGN UP
function module to do an specific calculation, then adding coding to a local field may be a
suitable solution. To demonstrate this we are going to make a standard query with one table
using ABAP Coding on it, instead of creating an infoset with three tables (inner join) as usual.
In order to illustrate this Im going to create a query using MARD table (Materials per Plant)
adding names for Plant and Storage Location with ABAP coding. MARD table includes fields
WERKS (Plant) and LGORT (Storage Location) and their names are stored on tables T001W and
T001L respectively. A previous knowledge of standard SAP Query and basic ABAP
programming is needed for plenty understanding of this guide .
Infoset Creation
First we launch SQ02 in SAPs command line to load Infoset Initial Screen:
Then select:
Click on button:
On this screen it is necessary to fill Long text and Header. Field format has to be declared too.
There are two ways declaring field format (using a direct field type or using a text):
As a default first field declared get the first number of Sequence Code. Finally click on button
to save field:
Then we proceed to create the next field STORN using the same process described above
(assigning sequence number 2):
After click on
we have:
In my practice I have found that if you want to include additional coding for each field at every
select iteration code should be written in the last field declared. In this case STORN. It is done
clicking on field STONR and then click on
Here we have an ABAP editor where our coding can be written to find Plant and Storage
Location names:
After coding we need to check syntax code clicking on:
And save:
In order to make our fields and their codes work it is necessary to include Additional Fields to
Storage Location Data for Material Field Group. To do this expand Additional fields and
Storage Location Data for Material:
Then drag fields PLANTN and STORN to group 01 Storage Location Data:
Then we have to generate our infoset clicking on
Click on:
Query Creation
Executing SQ01 we can create our query named ZTEST:
Now click on
Then marking Material Number as unique selection criteria we call Basic List design
In order to test it we click on
Fields Plant and SLoc are key fields from MARD, then Pl and Storage Loc Name are
additional fields.
(/blog/?author=57d6f010b8a79b87928f540a)
Module(s): ABAP, Basis, Controlling, Enterprise Controlling, Financial Accounting, Human Resources,
Logistics Information System, Materials Management, Sales and Distribution
Tagged: ABAP (/blog/?tag=ABAP)
6 Likes Share
you can use simple select and for all entries instead of this long long process
(https://www.facebook.com/ERPfixers/)
(https://twitter.com/ERPfixers)
(https://www.linkedin.com/company/erpfixers?
(https://plus.google.com/u/0/b/113616486343442134301/113616486343442134301)
(http://www.asug.com)