0% found this document useful (0 votes)
238 views6 pages

Billing Document Information

This document describes an ALV report to retrieve billing data from SAP for a particular sales organization, date, and customer. It defines the necessary tables and internal tables, builds a field catalog to define the fields and their attributes to display, selects the required data from the tables and appends it to the internal table, and displays the output using the ALV function module.

Uploaded by

Manasa Siri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
238 views6 pages

Billing Document Information

This document describes an ALV report to retrieve billing data from SAP for a particular sales organization, date, and customer. It defines the necessary tables and internal tables, builds a field catalog to define the fields and their attributes to display, selects the required data from the tables and appends it to the internal table, and displays the output using the ALV function module.

Uploaded by

Manasa Siri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

BILLING DOCUMENT INFORMATION

ALV Report to get billing data information for a particular sales org/Date/Customer.
REPORT zkrishna_report1.

TABLES : vbrk,vbrp. "creating the structure. TYPES : BEGIN OF str_bill, aufnr TYPE vbrp-aufnr, "Order Number arktx TYPE vbrp-arktx, "Order Item Number vbeln TYPE vbrk-vbeln, "Billing Document Number posnr TYPE vbrp-posnr, "Billing Document Item Number vkorg TYPE vbrk-vkorg, "Sales Org fkimg TYPE vbrp-fkimg, "Actual Invoiced Quantity waerk TYPE vbrk-waerk, "Currency kunag TYPE vbrk-kunag, "Sold-to-Name1 vgtyp TYPE vbrp-vgtyp, "Document category kunrg TYPE vbrk-kunrg, "Payer Name1 matnr TYPE vbrp-matnr, "Material Number sgtxt TYPE vbrp-sgtxt, "MaterialDescription werks TYPE vbrp-werks, "Plant pstyv TYPE vbrp-pstyv, "Item Category netwr TYPE vbrk-netwr, "net value END OF str_bill. "AVL DECLARATION TYPE-POOLS: slis. "FOR FIELD CATALOG TO GET ALL THE ATTRIBUTES TO FUNCTION MODULE DATA : i_itab_fld TYPE slis_t_fieldcat_alv, wa_itab_fld TYPE slis_fieldcat_alv. "defining the internal table DATA : i_itab TYPE STANDARD TABLE OF str_bill. "defining the work area DATA : wa_itab TYPE str_bill. "selection screen for the user and making few fields manditory SELECT-OPTIONS : v1 FOR vbrk-vkorg OBLIGATORY. SELECT-OPTIONS : v2 FOR vbrp-erdat OBLIGATORY. SELECT-OPTIONS : v3 FOR vbrk-kunag. START-OF-SELECTION. PERFORM get_data. END-OF-SELECTION. PERFORM bld_field.

PERFORM put_data. *&---------------------------------------------------------------------* *& Form GET_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM get_data . "selecting required fields from different tables to get the data. SELECT b~aufnr "Order Number b~arktx "Order Item Number a~vbeln "Billing Document Number b~posnr "Billing Document Item Number a~vkorg "Sales Org b~fkimg "Actual Invoiced Quantity a~waerk "Currency a~kunag "Sold-to-Name1 b~vgtyp "Document category a~kunrg "Payer Name1 b~matnr "Material Number b~sgtxt "MaterialDescription b~werks "Plant b~pstyv "Item Category a~netwr "NET VALUE "getting the data from header and item tables into work area FROM vbrk AS a INNER JOIN vbrp AS b ON a~vbeln = b~vbeln INTO wa_itab. "appending the data into internal table APPEND wa_itab TO i_itab. ENDSELECT. ENDFORM. " GET_DATA *&---------------------------------------------------------------------* *& Form BLD_FIELD *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM bld_field . wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. 1. = 'AUFNR'. "Order Number = 'ORDER NUMBER'. i_itab_fld.

wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld.

2. = 'ARKTX'. "Order Item Number = 'Order Item Number'. i_itab_fld.

3. = 'VBELN'. "Billing Document Number = 'Billing Document Number'. i_itab_fld.

4. = 'POSNR'. "Billing Document Item Number = 'Billing Document Item Number'. i_itab_fld.

5. = 'VKORG'. "Sales Org = 'Sales Org'. i_itab_fld.

6. = 'FKIMG'. "Actual Invoiced Quantity = 'Actual Invoiced Quantity'. i_itab_fld.

7. = 'WAERK'. "Currency = 'Currency'. i_itab_fld.

8. = 'KUNAG'. "Sold-to-Name1 = 'Sold-to-Name1'. i_itab_fld.

9. = 'VGTYP'. "Document category = 'Document category'. i_itab_fld.

wa_itab_fld-col_pos = 10.

wa_itab_fld-fieldname = 'KUNRG'. "Payer Name1 wa_itab_fld-seltext_m = '"Payer Name1'. APPEND wa_itab_fld TO i_itab_fld. CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. wa_itab_fld-col_pos = wa_itab_fld-fieldname wa_itab_fld-seltext_m APPEND wa_itab_fld TO CLEAR wa_itab_fld. 11. = 'MATNR'. "Material Number = '"Material Number'. i_itab_fld.

12. = 'SGTXT'. "MaterialDescription = 'MaterialDescription'. i_itab_fld.

13. = 'WERKS'. "Plant = 'Plant'. i_itab_fld.

14. = 'PSTYV'. "Item Category = '"Item Category'. i_itab_fld.

15. = 'NETWR'. "net value = 'net value'. i_itab_fld.

ENDFORM. " BLD_FIELD *&---------------------------------------------------------------------* *& Form PUT_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM put_data . CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING

i_callback_program i_grid_title it_fieldcat TABLES t_outtab

= 'ZKRISHNA_REPORT1' = 'BILLING DOCUMENT INFORMATION' = i_itab_fld = i_itab

. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF.

ENDFORM.

" PUT_DATA.

Step: 1 On the selection screen we are entering the sales org, doccreated, date, sold-to-party.

Step: 2 output

You might also like