0% found this document useful (0 votes)
3 views5 pages

Form Process

The document contains an ABAP program that processes payment data by selecting records from the REGUH table based on specific criteria. It handles different payment methods, such as checks and bank transfers, and constructs output data for display in an ALV grid format. Additionally, it creates a field catalog for the ALV display and manages the output formatting based on the payment type.

Uploaded by

Sârouche Boù
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Form Process

The document contains an ABAP program that processes payment data by selecting records from the REGUH table based on specific criteria. It handles different payment methods, such as checks and bank transfers, and constructs output data for display in an ALV grid format. Additionally, it creates a field catalog for the ALV display and manages the output formatting based on the payment type.

Uploaded by

Sârouche Boù
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

*&---------------------------------------------------------------------*

*& Include ZHRDZ_PAIE_PAYEMENT


*&---------------------------------------------------------------------*

FORM process_payment .

data : ls_banque type PA0009 .


data : ls_virement type REGUH .
data : lt_virement type STANDARD TABLE OF REGUH .
data : ls_nom_1 type PA0002.
data : lv_matricule type LIFNR .
clear lt_virement .
clear IT_OUTPUT_F .

SELECT * INTO CORRESPONDING FIELDS OF table @lt_virement from REGUH


where
LAUFI = @IDF and
ZBUKR = @LV_CODECOMPANY and
LAUFD = @date.

loop at lt_virement into ls_virement .

fs_OUTPUT-Matricule = ls_virement-lifnr .

rp_read_infotype fs_OUTPUT-Matricule 0009 P0009 PYBEGDA PYENDDA .

IF pnp-sw-found EQ '1'.

IF P0009-ZLSCH = 'C' .

fs_OUTPUT-banque = 'Paiement par chèque' .


SELECT NACHN VORNA INTO CORRESPONDING FIELDS OF ls_NOM_1 FROM PA0002 UP TO 1
ROWS where PERNR = fs_OUTPUT-Matricule ORDER BY BEGDA DESCENDING .
ENDSELECT .
concatenate ls_NOM_1-nachn ls_NOM_1-vorna into fs_output-NOM_PERSONNE SEPARATED
BY space .

ELSE .

fs_OUTPUT-RIB = P0009-BANKN .
fs_OUTPUT-CLE_BANK = P0009-BKONT .
fs_OUTPUT-CODE_AG = substring( val = P0009-BANKL off = 0 len = 3 ) .
fs_OUTPUT-CODE_BANK = substring( val = P0009-BANKL off = 3 len = 5 ) .
SELECT single BANKA FROM BNKA into fs_OUTPUT-banque where BANKL = P0009-BANKL
and BANKS = 'DZ' .
fs_output-NOM_PERSONNE = ls_virement-ZNME1 .
fs_output-MONTANT = ls_virement-RBETR * -1 .

if ls_virement-RBETR = 0 .

fs_OUTPUT-NOM_PERSONNE = ' Aucun Virement effectué pour ce matricule'.

clear : lt_virement , ls_virement .


endif .
ENDIF .

ELSE .

fs_OUTPUT-banque = 'Cet Matricule ne possède pas un RIB' .

ENDIF.

Append fs_OUTPUT to it_OUTPUT_f .

clear fs_OUTPUT .

clear ls_virement.

endloop .

if lv_tranche_name = 'LCM' or lv_tranche_name = 'LCO' or lv_tranche_name = 'LLA'


or lv_tranche_name = 'LSA' or lv_tranche_name = 'LS' or lv_tranche_name = 'LBA' .

Loop at it_OUTPUT_f into fs_OUTPUT .

concatenate fs_OUTPUT-CODE_AG fs_OUTPUT-CODE_BANK fs_OUTPUT-RIB fs_OUTPUT-


CLE_BANK into fs_OUTPUT-RIB SEPARATED BY SPACE .

modify it_OUTPUT_f from fs_OUTPUT .

endloop .

elseif lv_tranche_name = 'SAA' or lv_tranche_name = 'CMA' .

Loop at it_OUTPUT_f into fs_OUTPUT .

concatenate fs_OUTPUT-CODE_BANK fs_OUTPUT-RIB fs_OUTPUT-CLE_BANK into fs_OUTPUT-


RIB SEPARATED BY SPACE .

modify it_OUTPUT_f from fs_OUTPUT .

endloop .

endif .

ENDFORM .

*------------- CREER CATALOGUE POUR L'AFFICHAGE ALV ------------------*


FORM create_fcat .
CLEAR : it_fcat[], wa_fcat, number.

"if GLB = 'X' .


number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'MATRICULE' .
wa_fcat-seltext_m = 'Matricule' .
APPEND wa_fcat TO it_fcat.
CLEAR : wa_fcat.
number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'NOM_PERSONNE' .
wa_fcat-seltext_m = 'Bénéficiaire' .
APPEND wa_fcat TO it_fcat.
CLEAR : wa_fcat.

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'BANQUE' .
wa_fcat-seltext_m = 'Banque' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

if ( lv_tranche_name = 'SAA' or lv_tranche_name = 'CMA' ) and bnp = 'X' .

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'CODE_AG' .
wa_fcat-seltext_m = 'Code Banque' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

endif .

if lv_tranche_name = 'CILAS' and sga = 'X' .

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'CODE_AG' .
wa_fcat-seltext_m = 'Code Banque' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'CODE_BANK' .
wa_fcat-seltext_m = 'Code Agence' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'RIB' .
wa_fcat-seltext_m = 'RIB' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'CLE_BANK' .
wa_fcat-seltext_m = 'Clé RIB' .
APPEND wa_fcat TO it_fcat.
CLEAR : wa_fcat.

else .

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'RIB' .
wa_fcat-seltext_m = 'RIB' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

endif.

number = number + 1.
wa_fcat-col_pos = number.
wa_fcat-fieldname = 'MONTANT' .
wa_fcat-seltext_m = 'Montant' .
wa_fcat-datatype = 'DEC' .

APPEND wa_fcat TO it_fcat.


CLEAR : wa_fcat.

ENDFORM .

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

*------------------------ DISPLAY DATA -------------------------------*


FORM display_data .

data : titre type LVC_TITLE .

if ( lv_tranche_name = 'LCM' or lv_tranche_name = 'LCO' or lv_tranche_name = 'LLA'


or lv_tranche_name = 'LSA' or lv_tranche_name = 'LS' or lv_tranche_name = 'LBA')
and citi = 'X' .

titre = 'Virement CITI BANK' .


elseif ( lv_tranche_name = 'SAA' or lv_tranche_name = 'CMA' ) and bnp = 'X' .
titre = 'Virement BNP' .
elseif ( lv_tranche_name = 'CILAS' and sga = 'X' ) .
titre = 'Virement SGA' .
else .
Message ' Choix de la banque incohérent ' type 'E' DISPLAY LIKE 'E' .
endif .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
" i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = titre
is_layout = wa_layout
it_fieldcat = it_fcat
i_default = 'X'
i_save = 'A'
is_variant = wa_variant

TABLES
t_outtab = it_OUTPUT_f .

ENDFORM .

You might also like