TYPES:BEGIN OF ty_bkpf,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
blart TYPE bkpf-blart,
monat TYPE bkpf-monat,
budat TYPE bkpf-budat,
hkont TYPE bsis-hkont,
END OF ty_bkpf.
TYPES:BEGIN OF ty_output,
bukrs TYPE bkpf-bukrs,
gjahr TYPE bkpf-gjahr,
openbal TYPE bseg-dmbtr,
dttrns TYPE bseg-dmbtr,
* dttrns TYPE bseg-SHKZG,
crtrans TYPE bseg-dmbtr,
* crtrans type bseg-shkzg,
clbal TYPE bseg-dmbtr,
END OF ty_output.
DATA : fcat TYPE slis_t_fieldcat_alv,
lcat TYPE slis_fieldcat_alv,
layout TYPE slis_layout_alv,
fcath TYPE slis_t_add_fieldcat,
lcath TYPE slis_add_fieldcat.
DATA : lt_list_top_of_page TYPE slis_t_listheader.
DATA : cpos TYPE i.
DATA:it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
wa_bkpf TYPE ty_bkpf.
DATA:it_output TYPE STANDARD TABLE OF ty_output,
wa_output TYPE ty_output.
DATA:it_balnce LIKE STANDARD TABLE OF bapi1028_4,
wa_balnce LIKE bapi1028_4.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:pr_bukrs TYPE bkpf-bukrs DEFAULT '1000' OBLIGATORY ,
pr_gjahr TYPE bkpf-gjahr OBLIGATORY .
SELECT-OPTIONS:so_monat FOR bkpf-monat OBLIGATORY.
*& Form f001_get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM f001_get_data .
DATA :tabix LIKE sy-tabix,
w_bal type n.
*GET BELNR.
CLEAR:it_bkpf.
SELECT bukrs belnr gjahr blart monat budat
INTO TABLE it_bkpf
FROM bkpf
WHERE bukrs EQ pr_bukrs
AND gjahr EQ pr_gjahr
AND monat IN so_monat.
l_line-typ = 'S'.
l_line-key = text-007.
WRITE sy-datum TO l_line-info.
l_line-info+11(1) = '/'.
WRITE sy-uzeit TO l_line-info+13.
APPEND l_line TO lt_list_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_list_top_of_page.
ENDFORM. "top_of_page
PS: Credit and Debit is based on the field BSEG-SHKZG (Debit/Credit Indicator). Bust this is commented in ur program.
Make use of this field and go ahead.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.