-1

I have a completely customized SAP screen used to create rental agreements. When tax jurisdiction is selected using the Help/Dialog (ie. F4 button) option, it causes the non-editable State and County tax fields to be populated. These two fields are strictly for display so that the user can validate their tax jurisdiction against the actual state and county.

To ensure all fields on the entire screen are valid, the program uses a PAI field chaining as shown below. The issue is that if I manually enter a new value in the tax jurisdiction field and press enter, then unless all other fields in the chain are also valid, then the state and county are not updated.

I manually force the updating of the state and county fields using function module DYNP_VALUES_UPDATE, which works great, except for when one of the other fields in the below is invalid. How can I force the state and county fields to be updated on the screen even when one of the other fields in the chain is invalid? I'm starting to think this is simply not possible.

The tax jurisdiction field is called kna1-txjcd

PROCESS BEFORE OUTPUT.
MODULE status_0100.

MODULE setup_defaults.              

MODULE screen_modify.                 

MODULE ltext_add_comments_0100.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.
MODULE user_command_0100.


FIELD t001-bukrs MODULE check_sales_org.                  "DV1K933404


FIELD kna1-j_3gagext
MODULE check_customer_sales_area.

CHAIN.

FIELD: kna1-j_3gagext
       MODULE check_cust_num.
MODULE verify_recipient.                                "DV1K935780
FIELD: zsd_etm_contract-bill_to_party
       MODULE check_bill_to_party.
FIELD zsd_etm_contract-payer
       MODULE check_payer_number.                       "CHG12588

ENDCHAIN.
CHAIN.
FIELD: kna1-txjcd
       MODULE check_txjcd.                              "DV1K933404

FIELD:  zsd_etm_contract-rig_num,
        zsd_etm_contract-ship_via.

FIELD   zsd_etm_contract-well_name.

FIELD:
       zdls_ls, zdls_sc, zdls_twp, zdls_rg, zdls_m.
FIELD: znts_qtr_unit, znts_unit, znts_block,
       znts_map.
FIELD: zlsd_other.
MODULE check_lsd_num .

FIELD: zsd_etm_contract-contact_tel_num,
       zsd_etm_contract-cus_rep_loc,
       zsd_etm_contract-cus_rep_tel_num,
       zsd_etm_contract-cus_rep_fax_num,
       zsd_etm_contract-cus_rep_email,                  "dv1k931160
       zsd_etm_contract-lrg_contract,                   "DV1K935629
       t001-bukrs,                                      "DV1K935752
       zsd_etm_contract-lrg_camp,                       "DV1K935752
       zsd_etm_contract-customer_contact.               "DV1K931062

FIELD:
     zsd_etm_contract-cus_rep_loc
         MODULE check_cus_rep_loc,
    zsd_etm_contract-afe,
    zsd_etm_contract-po,
    zsd_etm_contract-msa,
    zsd_etm_contract-cost_center,
    zsd_etm_contract-gl
          MODULE check_afe_po_msa_num,
    zsd_etm_contract-invoice_approval
        MODULE check_invoice_approval,
    zsd_etm_contract-usage_type
        MODULE check_usage_type.
FIELD:  zsd_etm_contract-lrg_contract,                  "DV1K935629
        t001-bukrs,                                     "DV1K935752
        zsd_etm_contract-lrg_camp.                      "DV1K935752
MODULE check_lrg_entries.                               "DV1K935752


FIELD:
   zsd_etm_contract-prl_rep
       MODULE check_prl_rep,
   zsd_etm_contract-branch
       MODULE check_branch,
   zsd_etm_contract-bill_region, t001-bukrs
       MODULE check_bill_region,
   zsd_etm_contract-eoj_bill
       MODULE check_eoj_bill,
   zsd_etm_contract-sd_shd_flag,
   zsd_etm_contract-next_set_date
       MODULE check_next_set_date,
   zsd_etm_contract-audit_flag,
   zsd_etm_contract-ratetype. " CHG13225 DV1K939527

ENDCHAIN.


CHAIN.
FIELD: zsd_etm_contract-usage_type,
       zsd_etm_contract-well_type.
MODULE check_well_type.
ENDCHAIN.

FIELD zsd_etm_contract-well_type.
MODULE get_well_type_text.

FIELD zsd_etm_contract-unit_num MODULE check_unit_num.

CHAIN.
FIELD: zsd_etm_contract-afe,
       zsd_etm_contract-po,
       zsd_etm_contract-msa,
       zsd_etm_contract-gl.
MODULE combine_fields.
ENDCHAIN.

MODULE fill_wa_etm_contract.
MODULE check_ltext.

MODULE user_command_create_0100.

PROCESS ON VALUE-REQUEST.
FIELD: kna1-txjcd
      MODULE help_txjcd,
     zsd_etm_contract-prl_rep
      MODULE help_prel_rep,
     zsd_etm_contract-bill_to_party
      MODULE help_bill_to_party.
FIELD: zsd_etm_contract-payer
      MODULE help_payer.
FIELD: zsd_etm_contract-ratetype " CHG13225 DV1K939527
      MODULE help_ratetype.    " CHG13225 DV1K939527

UPDATE Below is a screenshot that shows the screen when I initially provide the Tax Jurisdiction Code using the F4 option. Note that the State, County and City as well as the corresponding taxes are updated.

enter image description here

In the below image I have changed the tax jurisdiction manually by typing in a new value, then pressed ENTER. Note that the State, County and City as well as the corresponding taxes have remained the same. They should have updated to completely different values, but do not appear to be doing so because of the CHAIN issue (i.e. screen updates do not happen because a field is in an invalid state).

enter image description here

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Michael Freake
  • 1,197
  • 2
  • 14
  • 35
  • Could you also post some screenshots that would visually describe the problem you are having. The thing with dynpros is that they are not that easy to be reproduced from the ABAP code, as the screen painter is needed. – Jagger Jul 22 '14 at 19:40
  • 1
    It is much more likely that you'll get a helpful answer if you provide a *MINIMAL* working example. Just dumping half a ton of code is unlikely to make this interesting enough to research, at least for me. – vwegert Jul 23 '14 at 06:15
  • @MichaelFreake Insulting people is a sure way to kill the last bit of interest. – vwegert Jul 23 '14 at 15:49

1 Answers1

-1

You can "HACK" the screen using CALL FUNCTION 'DYNP_VALUES_UPDATE'

Reconsider when and how errors are thrown. To avoid the field module versus chain module issue. eg Issuing an error after all field modules and chain modules

phil soady
  • 11,043
  • 5
  • 50
  • 95
  • -1 The guy mentioned this function module in his question, so I do not understand why you posted it as an answer... – Jagger Jul 23 '14 at 06:20
  • Thats why you reconsider when the error is issue so PAI and PBO run. try WITHOUT the hack and issue error in PAI connected to OKCODE only. I like the fact you explain the downvote. Nice manners are appreciated. – phil soady Jul 23 '14 at 07:08
  • Then write that the call to function `DYNP_VALUES_UPDATE` should be removed. The first sentence is a bit ambiguous, don't you think. I interpret 'You can "HACK"' as 'Try hacking it...'. – Jagger Jul 23 '14 at 07:18
  • @philsoady thanks Phil, but Jagger is correct. The call to `DYNP_VALUES_UPDATE` is ignored. – Michael Freake Jul 23 '14 at 14:19