Sunteți pe pagina 1din 2

*---------------------------------------------------------------------*

*Program Name
: ZSD_R000_SALES_ITEMS_REPORT
*
*Program Type
: Report
*
*Vendor
: IBM
*
*Developer
: Srinivasulu Bandi
*
*---------------------------------------------------------------------*
*TR
| Date
|Developer
| Version
*
*---------------------------------------------------------------------*
*ECCK900016 | 13 Jun 2010 | SIBM046
| Initial
*
*---------------------------------------------------------------------*
*Description : This report is used to display sales item and
*
*
corresponding address details based on the sales
*
*
document number on the selection screen
*
*---------------------------------------------------------------------*
REPORT zsd_r000_sales_items_report MESSAGE-ID zmsg LINE-COUNT 30(3) NO STANDARD
PAGE HEADING.
INCLUDE zsd_r000_sales_items_top .
INCLUDE zsd_r000_sales_items_sel .
INCLUDE zsd_r000_sales_items_form .
INITIALIZATION.
*Intialise the global data
PERFORM f_initialise_data.
AT SELECTION-SCREEN .
*validate the sales document number (VBELN)
PERFORM f_validate_vbeln .
START-OF-SELECTION.
*fetch the records from VBAK
PERFORM f_fetch_vbak CHANGING it_vbak.
*fetch the data from VBAP table
PERFORM f_fetch_vbap USING it_vbak
CHANGING it_vbap.
*fecth the data from kna1
PERFORM f_fetch_kna1 USING
it_vbak
CHANGING it_kna1.
*fetch the data from delivery
PERFORM f_fetch_delivery_items USING it_vbap
CHANGING it_lips.
*fetch the data from LIKP
PERFORM f_fetch_delivery_header USING it_lips
CHANGING it_likp.
*get the delivery address details
PERFORM f_fetch_del_add_details USING it_likp
CHANGING it_kna1.
*Populate the final internal table
PERFORM f_populate_final USING it_vbak
it_vbap
it_kna1
it_likp
it_lips
CHANGING it_final.
*
END-OF-SELECTION.

PERFORM f_display_data USING it_final.


write:/ 'Last page', sy-pagno color COL_NEGATIVE.
TOP-OF-PAGE.
WRITE:/ 'Sales Doc', 'Item Num', 'Material','Customer'.
END-OF-PAGE.
WRITE:/20 'Page Number' , sy-pagno.
at LINE-SELECTION.
data: lv_vbeln type vbeln_va.
data: lv_line type i.
*read line sy-lilli line VALUE INTO lv_line.
*lv_vbeln = lv_line+0(10). "substring operation
*
get cursor line lv_line .
data: lv_fnam type string,
lv_fval TYPE string.
get cursor field lv_fnam VALUE lv_fval.
*
read table it_final into wa_final index lv_line.
if lv_fnam = 'WA_FINAL-VBELN'.
lv_vbeln = lv_fval. "lv_line+0(10). "substring operation
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input
= lv_vbeln
IMPORTING
OUTPUT
= lv_vbeln
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
*
EXPORTING
*
input
= lv_vbeln
*
IMPORTING
*
OUTPUT
= lv_vbeln
.
*
perform f_get_partner USING wa_final-vbeln .
perform f_get_partner USING lv_vbeln .
endif.

S-ar putea să vă placă și