ABAP program for Creating Extract Dataset
Requirement:
Write a program that lists the Vendors and their Accounting documents. Create extract dataset from KDF logical database. Loop through the dataset to create the required report. Don’t list those vendors which has no documents
ABAP Source Code:
report zfwr0001 no standard page heading.
tables: lfa1, bsik.
field-groups: header, item1, item2.
insert lfa1-lifnr bsik-belnr into header.
insert lfa1-land1 lfa1-name1 into item1.
insert bsik-belnr bsik-budat into item2.
start-of-selection.
get lfa1.
….extract item1.
get bsik.
….extract item2.
end-of-selection.
loop.
….at item1 with item2.
……..skip.
……..write:/ ‘Vendor number:’, 28 ‘Name:’, 56 ‘City:’.
……..write: 16 lfa1-lifnr, 33(20) lfa1-name1, 62(20) lfa1-ort01.
……..write:/ ‘Document no.’, 15 ‘Date’.
….endat.
….at item2.
……..write:/ bsik-belnr, 13 bsik-budat.
….endat.
endloop.
Additional task:
Don’t forget to set the Logical database to KDF on the “Program Attributes” screen.
Result:
Vendor number: 100124 Name:Coca Cola City: New York
Document no. Date
1800000316 01/08/1997
Vendor number: 100126 Name: Universal Studios City: Los Angeles
Document no. Date
1800000109 12/02/1996
1800000341 01/10/1997
1800000321 01/14/1997
Related SAP Tutorials & References
- EXTRACT (ABAP Keyword)EXTRACT (ABAP Keyword) introduction & details EXTRACTBasic formEXTRACT fg.EffectWrites all fields of the field group...
- Reading logical database using ABAP programRequirement: Read a logical database (you must have data in those tables, now LFA1), fill...
- ABAP program for Mass Purchase Order History DisplayThis is a customized ABAP report for mass Purchase Order history display instead of checking...
- ABAP Program to Get Output in EXCELThis source code is an ABAP Program to Get Output in EXCEL REPORT YLMM015AMESSAGE-ID YL.*-----------------------------------------------------------------------**...
- Source Code of ABAP Program to Browse a file on the application serverSource Code of ABAP Program to Browse a file on the application serverREPORT ZBROWSE MESSAGE-ID...
- Source Code for create subscreen in your ABAP Program* Source Code for create subscreen in your ABAP Program * * This report will...
- ABAP Program for Sending SAP MailSample ABAP program to show Sending SAP Mail using ABAP programming.*&---------------------------------------------------------------------**& Form SEND_MAIL*&---------------------------------------------------------------------** send email...
- ABAP program to load a database table from a UNIX fileRequirement: Write a program to load a database table from a UNIX file. ABAP Source...
- SORT ( SAP ABAP Keyword)SORT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax...
- ABAP program for Reading database tables using selectRequirement: Write the a report with a select statement. ABAP Source Code: report zselect1 no...
