Posted: Sat Oct 06, 2007 10:56 pm Post subject: Report Cleared Customer Documents
Code:
REPORT zfirp001 .
TYPE-POOLS: slis.
TABLES: bsak.
SELECT-OPTIONS: s_bukrs FOR bsak-bukrs,
s_lifnr FOR bsak-lifnr,
s_blart FOR bsak-blart,
s_augdt FOR bsak-augdt,
s_zterm FOR bsak-zterm.
PARAMETERS: s_list AS CHECKBOX,
s_vari LIKE disvariant-variant.
DATA: g_ext_num(24) TYPE c.
DATA: BEGIN OF gt_bsak OCCURS 0,
bukrs LIKE bsak-bukrs,
lifnr LIKE bsak-lifnr,
augdt LIKE bsak-augdt,
gjahr LIKE bsak-gjahr,
belnr LIKE bsak-belnr,
blart LIKE bsak-blart,
zterm LIKE bsak-zterm,
END OF gt_bsak.
DATA: BEGIN OF gt_bseg OCCURS 0,
bukrs LIKE bseg-bukrs,
belnr LIKE bseg-belnr,
gjahr LIKE bseg-gjahr,
wrbtr LIKE bseg-wrbtr,
projk LIKE bseg-projk,
shkzg LIKE bseg-shkzg,
hkont LIKE bseg-hkont,
END OF gt_bseg.
* ALV
DATA: gt_fieldtab TYPE slis_t_fieldcat_alv,
g_save(1) TYPE c,
g_variant LIKE disvariant.
DATA: BEGIN OF gt_result OCCURS 0,
bukrs LIKE bsak-bukrs,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
augdt LIKE bsak-augdt,
gjahr LIKE bsak-gjahr,
belnr LIKE bsak-belnr,
blart LIKE bsak-blart,
zterm LIKE bsak-zterm,
wrbtr LIKE bseg-wrbtr,
waers LIKE bkpf-waers,
ext_num(24) TYPE c,
txt20 LIKE skat-txt20,
usr00 LIKE prps-usr00,
usr01 LIKE prps-usr01,
usr02 LIKE prps-usr02,
usr03 LIKE prps-usr03,
END OF gt_result.
*----------------------------------------------------
CONSTANTS: c_credit(1) TYPE c VALUE 'H',
c_x(1) TYPE c VALUE 'X',
c_en(2) TYPE c VALUE 'EN',
c_mrc(4) TYPE c VALUE 'CA01'.
*====================================================
SELECT bukrs
lifnr
augdt
gjahr
belnr
blart
zterm
INTO TABLE gt_bsak
FROM bsak
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr
AND augdt IN s_augdt
AND blart IN s_blart
AND zterm IN s_zterm.
CHECK NOT gt_bsak[] IS INITIAL.
LOOP AT gt_bsak.
* read WBS items
SELECT bukrs
belnr
gjahr
dmbtr
projk
shkzg
hkont
INTO TABLE gt_bseg
FROM bseg
WHERE bukrs = gt_bsak-bukrs
AND belnr = gt_bsak-belnr
AND gjahr = gt_bsak-gjahr
AND projk > space.
*&--------------------------------------------------------------------*
*& Form initialize_variant
*&--------------------------------------------------------------------*
FORM initialize_variant.
g_save = 'A'.
CLEAR g_variant.
g_variant-report = sy-repid.
IF sy-subrc = 0.
s_vari = g_variant-variant.
ENDIF.
ENDFORM. " INITIALIZE_VARIANT
*&--------------------------------------------------------------------*
*& Form pai_of_selection_screen
*&--------------------------------------------------------------------*
FORM pai_of_selection_screen.
IF NOT s_vari IS INITIAL.
MOVE s_vari TO g_variant-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = g_save
CHANGING
cs_variant = g_variant.
ELSE.
PERFORM initialize_variant.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
*&--------------------------------------------------------------------*
*& Form initialize_fieldcat
*&--------------------------------------------------------------------*
FORM initialize_fieldcat USING p_fieldtab TYPE slis_t_fieldcat_alv.
DATA: l_fieldcat TYPE slis_fieldcat_alv.
CLEAR l_fieldcat.
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.