Google Search - Blog...........

Finding Out Duplicate Invoice - ABAP.

REPORT ztest .

TYPES: BEGIN OF ty_bsip,
bukrs LIKE bsip-bukrs,
belnr LIKE bsip-belnr,
gjahr LIKE bsip-gjahr,
END OF ty_bsip.

PARAMETERS: p_bukrs LIKE bsip-bukrs,
p_lifnr LIKE bsip-lifnr,
p_waers LIKE bsip-waers,
p_xblnr LIKE bsip-xblnr,
p_wrbtr LIKE bsip-wrbtr,
p_bldat LIKE bsip-bldat.

DATA: it_bsip TYPE STANDARD TABLE OF ty_bsip WITH HEADER LINE.

TRANSLATE p_xblnr TO UPPER CASE.

IF p_wrbtr LT 0 OR
p_wrbtr GE 0.

SELECT bukrs belnr gjahr FROM bsip
INTO TABLE it_bsip
UP TO 1 ROWS
WHERE bukrs = p_bukrs
AND lifnr = p_lifnr
AND waers = p_waers
AND xblnr = p_xblnr
AND wrbtr = p_wrbtr
AND bldat = p_bldat.

IF sy-subrc EQ 0.
WRITE:/ 'duplicateinvoicefound'.
ENDIF.
ENDIF.

No comments:

Post a Comment