Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Process on value request

prince_isaac
Active Participant
0 Likes
731

hie guys,

i copied some standard code and made changes to it so that a custom field of mine can have the F4 functionality. the pop up comes but when i select an entry it will not populate my screen filed with the value. the code is as below:

report zelectronic_funds no standard page heading.

*DATA: BEGIN OF itab_eft OCCURS 0,

  • lot LIKE rfkz0-keyz1,

  • doc_type LIKE dfkkzk-blart,

  • currency LIKE dfkkzk-waers,

  • post_date LIKE dfkkzk-budat,

  • doc_date LIKE dfkkzk-bldat,

  • bnk_clearing_ac LIKE dfkkzk-bvrko,

  • value_date LIKE dfkkzk-valut,

  • ccode LIKE dfkkzk-bukrs,

  • lne_layout LIKE rfkz0-anzva,

  • partner LIKE fkkzplst-selw3,

  • cont_object LIKE fkkzplst-selw1,

  • cont_account LIKE fkkzplst-selw2,

    • amount LIKE fkkzplst-betrz,

  • amount(13),

  • bnk_cntry LIKE fkkzplst-banks,

  • bnk_number LIKE fkkzplst-bankl,

  • bnk_account LIKE fkkzplst-bankn,

  • note LIKE fkkzplst-txtvw,

  • post_on_account LIKE dfkkzp-xakon,

  • clarify LIKE dfkkzp-xklae,

  • repayment LIKE rfkz0-xrzal,

  • pay_mthd LIKE dfkkzp-repym,

  • END OF itab_eft.

*

data: l_bnka type bnka,

lt_dynpfields like dynpread occurs 0 with header line.

tables: rfkh2,

t005.

data: begin of itline occurs 0,

line(1000),

end of itline.

selection-screen begin of block bli with frame title text-bli.

parameters: p_file type rlgrap-filename default 'C:/Documents and Settings/ABAP/eft.txt',

bank_num like fkkzplst-bankl.

*

selection-screen end of block bli.

*

*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

*

  • CALL FUNCTION 'F4_FILENAME'

  • EXPORTING

  • field_name = 'p_file'

  • IMPORTING

  • file_name = p_file.

at selection-screen on value-request for bank_num.

refresh: lt_dynpfields.

clear: lt_dynpfields.

lt_dynpfields-fieldname = 'RFKH2-BANKS'.

append lt_dynpfields.

call function 'DYNP_VALUES_READ'

exporting

dyname = 'ZELECTRONIC_FUNDS'

dynumb = '1000'

translate_to_upper = 'X'

tables

dynpfields = lt_dynpfields

exceptions

others = 4.

read table lt_dynpfields with key fieldname = 'RFKH2-BANKS'.

if not lt_dynpfields-fieldvalue is initial.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = lt_dynpfields-fieldvalue

importing

output = rfkh2-banks

exceptions

others = 1.

endif.

call function 'SEARCH_BANK_ADDRESS'

exporting

i_banks = rfkh2-banks

i_more = 'X'

importing

e_bnka = l_bnka.

check not l_bnka is initial.

if t005-land1 <> l_bnka-banks.

select single *

from t005

where land1 = l_bnka-banks.

if sy-subrc eq 0.

exit.

endif.

endif.

refresh: lt_dynpfields.

clear: lt_dynpfields.

lt_dynpfields-fieldname = 'RFKH2-BANKL'.

lt_dynpfields-fieldvalue = l_bnka-bankl.

append lt_dynpfields.

lt_dynpfields-fieldname = 'RFKH2-BANKS'.

lt_dynpfields-fieldvalue = l_bnka-banks.

append lt_dynpfields.

bank_num = l_bnka-bankl.

  • CALL FUNCTION 'DYNP_VALUES_UPDATE'

  • EXPORTING

  • dyname = 'ZELECTRONIC_FUNDS'

  • dynumb = '1000'

  • TABLES

  • dynpfields = lt_dynpfields.

*START-OF-SELECTION.

*

  • CALL FUNCTION 'WS_UPLOAD'

  • EXPORTING

  • filename = p_file

  • TABLES

  • data_tab = itline.

*

  • IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

*

*

  • LOOP AT itline.

  • SPLIT itline AT ',' INTO

  • itab_eft-lot

  • itab_eft-doc_type

  • itab_eft-currency

  • itab_eft-post_date

  • itab_eft-bnk_clearing_ac

  • itab_eft-value_date

  • itab_eft-ccode

  • itab_eft-lne_layout

  • itab_eft-partner

  • itab_eft-cont_object

  • itab_eft-cont_account

  • itab_eft-amount

  • itab_eft-bnk_cntry

  • itab_eft-bnk_number

  • itab_eft-bnk_account

  • itab_eft-note

  • itab_eft-post_on_account

  • itab_eft-clarify

  • itab_eft-repayment

  • itab_eft-pay_mthd.

  • APPEND itab_eft.

  • ENDLOOP.

*

*START-OF-SELECTION.

*

  • PERFORM open_group.

*

  • LOOP AT itab_eft.

*

  • PERFORM bdc_dynpro USING 'SAPLFKZ0' '0100'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=CREA'.

  • PERFORM bdc_field USING 'RFKZ0-KEYZ1'

  • itab_eft-lot.

    • 'PAYMENTLOT12'.

*

  • PERFORM bdc_dynpro USING 'SAPLFKZ0' '0200'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '/00'.

  • PERFORM bdc_field USING 'DFKKZK-KEYZ2'

  • itab_eft-lot.

    • 'PAYMENTLOT12'.

  • PERFORM bdc_field USING 'DFKKZK-BLART'

  • itab_eft-doc_type.

    • 'Z2'.

  • PERFORM bdc_field USING 'DFKKZK-BUDAT'

  • itab_eft-post_date.

    • '18.06.2008'.

  • PERFORM bdc_field USING 'DFKKZK-BLDAT'

  • itab_eft-doc_date.

    • '18.06.2008'.

  • PERFORM bdc_field USING 'DFKKZK-FIKEY'

    • itab_eft-recon_key.

  • 'PAYMENTLOT12'.

  • PERFORM bdc_field USING 'DFKKZK-WAERS'

  • itab_eft-currency.

    • 'MUR'.

  • PERFORM bdc_field USING 'DFKKZK-BVRKO'

  • itab_eft-bnk_clearing_ac.

    • '111308'.

  • PERFORM bdc_field USING 'DFKKZK-VALUT'

  • itab_eft-value_date.

    • '18.06.2008'.

  • PERFORM bdc_field USING 'DFKKZK-BUKRS'

  • itab_eft-ccode.

    • 'MRA1'.

  • PERFORM bdc_field USING 'DFKKZK-AUGRD'

  • '01'. "Clearing reason

  • PERFORM bdc_field USING 'DFKKZK-SELT1'

  • 'B'. "BP

  • PERFORM bdc_field USING 'DFKKZK-SELT2'

  • 'C'. "Contract

  • PERFORM bdc_field USING 'DFKKZK-SELT3'

  • 'O'. "Object

  • PERFORM bdc_field USING 'RFKZ0-ANZVA'

  • itab_eft-lne_layout.

    • 'CHK'.

*

  • PERFORM bdc_dynpro USING 'SAPLFKZ0' '0300'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=SEL'.

*

    • loop at itab.

*

  • PERFORM bdc_field USING 'FKKZPLST-BETRZ(01)'

  • itab_eft-amount.

    • ' 1000'.

  • PERFORM bdc_field USING 'FKKZPLST-SELW1(01)'

  • itab_eft-partner.

    • '2000080'.

  • PERFORM bdc_field USING 'FKKZPLST-SELW2(01)'

  • itab_eft-cont_account.

    • '58000200'.

  • PERFORM bdc_field USING 'FKKZPLST-SELW3(01)'

  • itab_eft-cont_object.

    • '2000011'.

  • PERFORM bdc_field USING 'FKKZPLST-BANKS(01)'

  • itab_eft-bnk_cntry.

    • 'mu'.

  • PERFORM bdc_field USING 'FKKZPLST-BANKL(01)'

  • itab_eft-bnk_number.

    • 'BARC-11'.

  • PERFORM bdc_field USING 'FKKZPLST-BANKN(01)'

  • itab_eft-bnk_account.

    • '567567'.

*

**endloop.

*

  • PERFORM bdc_dynpro USING 'SAPLFKZ0' '0500'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=SAVE'.

  • PERFORM bdc_field USING 'DFKKZP-BETRZ'

  • itab_eft-amount.

    • '1.000,00'.

  • PERFORM bdc_field USING 'DFKKZP-WAERS'

  • itab_eft-currency.

    • 'MUR'.

  • PERFORM bdc_field USING 'DFKKZP-BANKL'

  • itab_eft-bnk_number.

    • 'BARC-11'.

  • PERFORM bdc_field USING 'DFKKZP-BANKS'

  • itab_eft-bnk_cntry.

    • 'MU'.

  • PERFORM bdc_field USING 'DFKKZP-BANKN'

  • itab_eft-bnk_account.

    • '567567'.

  • PERFORM bdc_field USING 'DFKKZP-XAKON'

  • itab_eft-post_on_account.

    • 'X'.

*

  • PERFORM bdc_dynpro USING 'SAPLFKZ0' '0100'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=CLOS'. "Close

  • PERFORM bdc_field USING 'RFKZ0-KEYZ1'

  • itab_eft-lot.

    • 'PAYMENTLOT12'. "Lot

*

  • PERFORM bdc_dynpro USING 'SAPLFKZ0' '0100'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=POST'. "Post

  • PERFORM bdc_field USING 'RFKZ0-KEYZ1'

  • itab_eft-lot.

    • 'PAYMENTLOT12'.

*

**schedule the job

  • PERFORM bdc_dynpro USING 'SAPLFKJO_JOB' '0100'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'D100_FIELDS-XIMMEDIATE'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=OK'.

  • PERFORM bdc_field USING 'D100_FIELDS-XONLINE'

  • ''. "Online

  • PERFORM bdc_field USING 'D100_FIELDS-XIMMEDIATE'

  • 'X'. "immediately

  • PERFORM bdc_field USING 'D100_FIELDS-DATUM'

  • '18.06.2008'. "Date

  • PERFORM bdc_field USING 'D100_FIELDS-XTERMIN'

  • ''. "schedule (requires a start time)

*

  • PERFORM bdc_transaction USING 'FP05'.

*

  • ENDLOOP.

*

  • PERFORM close_group.

*

*

*

**Includes used in this program

  • INCLUDE zbdcrecxx.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
618

Hi,

Check the following Standard Program in se38.

demo_selection_screen_f4

Regards,

Raj.

2 REPLIES 2
Read only

Former Member
0 Likes
619

Hi,

Check the following Standard Program in se38.

demo_selection_screen_f4

Regards,

Raj.

Read only

prince_isaac
Active Participant
0 Likes
618

Thanx for your input i managed to get it right.