0% found this document useful (0 votes)
76 views3 pages

Final Dispatch Report

This document contains an ABAP program for generating a dispatch report. It defines selection options to filter billing documents by fields like sales organization, distribution channel, billing date, and billing number. It joins data from tables VBRK, VBPA, and VBRP to extract relevant fields into a composite structure. On selection screen processing, it validates the billing number. On start of selection, it fetches the joined data into an internal table. On end of selection, it displays the internal table contents. Page headers are also prepared.

Uploaded by

ibrahimos2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views3 pages

Final Dispatch Report

This document contains an ABAP program for generating a dispatch report. It defines selection options to filter billing documents by fields like sales organization, distribution channel, billing date, and billing number. It joins data from tables VBRK, VBPA, and VBRP to extract relevant fields into a composite structure. On selection screen processing, it validates the billing number. On start of selection, it fetches the joined data into an internal table. On end of selection, it displays the internal table contents. Page headers are also prepared.

Uploaded by

ibrahimos2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

REPORT Z_DISPATCH_REPORT.

TABLES :VBRP,VBUK,VBPA,VBRK.
SELECTION-SCREEN:begin of block b1.
SELECT-OPTIONS: s_vkorg FOR VBRK-vkorg ,
s_vtweg FOR VBRK-vtweg,
s_spart FOR VBRK-spart,
s_kunag FOR VBRK-kunag,
s_fkdat FOR VBRK-fkdat,
s_vbeln FOR VBRK-vbeln,
s_fkart FOR VBRK-fkart.
SELECTION-SCREEN:end of block b1.

"
"
"
"
"
"
"

Sales
Distribution Channel
Division
Sold-to Party
Biling Date
Biling Document
Biling Type

*Joining First and Second Table


*---------------------------TYPES : BEGIN OF ty_AllTables,
vbeln TYPE VBRK-vbeln,
belnr TYPE VBRK-belnr,
vkorg TYPE VBRK-vkorg,
vtweg TYPE VBRK-vtweg,
spart TYPE VBRK-spart,
kunag TYPE VBRK-kunag,
fkdat TYPE VBRK-fkdat,
fkart TYPE VBRK-fkart,
netwr TYPE VBRK-netwr,
waerk TYPE VBRK-waerk,
aubel TYPE VBRP-aubel,
posnr TYPE VBPA-posnr,
parvw TYPE VBPA-parvw,
kunnr TYPE VBPA-kunnr,
END OF ty_AllTables.
DATA: it_AllTables TYPE STANDARD TABLE OF ty_AllTables WITH HEADER LINE.

AT SELECTION-SCREEN.
PERFORM validate_vbeln.
START-OF-SELECTION.
PERFORM fetch_AllTables.
END-OF-SELECTION.
PERFORM display_AllTables.
TOP-OF-PAGE.
PERFORM prepare_header.
form validate_vbeln.

DATA: v_vbeln TYPE vbeln.


SELECT SINGLE vbeln INTO v_vbeln FROM VBRK
WHERE vbeln IN s_vbeln.
IF sy-subrc <> 0.
MESSAGE 'no records found for specified key ' TYPE 'E'.
ENDIF.
endform.

form fetch_AllTables.
SELECT VBRK~vbeln VBRK~belnr VBRK~vkorg VBRK~vtweg VBRK~spart VBRK~kunag
VBRK~fkdat
VBRK~fkart VBRK~netwr VBRK~waerk VBRP~aubel VBPA~posnr VBPA~parvw
VBPA~kunnr
INTO TABLE it_AllTables
FROM VBRK INNER JOIN VBPA
ON VBRK~vbeln = VBPA~vbeln
INNER JOIN VBRP
ON VBPA~vbeln = VBRP~vbeln
WHERE VBRK~vbeln IN s_vbeln.
endform.

form display_AllTables.
LOOP AT it_AllTables.
WRITE: /
it_AllTables-vbeln,
it_AllTables-belnr,
it_AllTables-vkorg,
it_AllTables-vtweg,
it_AllTables-spart,
it_AllTables-kunag,
it_AllTables-fkdat,
it_AllTables-fkart,
it_AllTables-netwr,
it_AllTables-waerk,
it_AllTables-aubel,
it_AllTables-posnr,
it_AllTables-parvw,
it_AllTables-kunnr.
ENDLOOP.
endform.
form prepare_header.

WRITE :'Dispatch Report'.


endform.

You might also like