Skip to Content
Author's profile photo Monalisa Biswal

BDC Recording for PU19 Transaction

The document describes a way to create BDC recording for  PU19 transaction.

As sometimes we may need to run PU19 in background, the alternate to this is to call number of function modules which is bit cumbersome.

Issue with BDC in PU19:

If we do a BDC recording on PU19 and execute it,  it doesnt capture the steps on Tax Form tree navigation and gives error when it tries to set fields on screen.

As we can see below  while running BDC the Tax Form Tree navigation does not get highlighted, so it gives error while setting fields.

Tax Reporter BDC1.PNG

Solution :

In PU19 transaction there is an option to open a tax form by default at startup. Go to Tools->Preference on PU19.

Following popup comes up for setting  default Tax form and tabs / screen options.

Tax Reporter BDC2.PNG

So after setting this up, the default form gets highlighted and the tabs remain open when we navigate to PU19.

BDC does not give error if it is run at this stage.

Tax Reporter BDC3.PNG

The next thing was to automate these two steps (1. Set Default Tax Form/Screen option for PU19, 2. Execute PU19 ).

So I recorded two BDCs one for setting up the tax form and another to execute PU19.

And one more thing to consider while calling these two BDCs. They can’t be combined in same session, need to be called one after another.

As the settings for default tax form reflect when you restart the transaction.

On selection screen added a drop down to select tax form for which BDC needs to be run.

Tax Reporter BDC4.PNG

Ran BDC by passing this value for setting up the default tax form and then for executing the tax form.

  • SAMPLE BDC Code for setting up Default Tax form flag:

        FORM SET_TAX_FORM.


  perform open_group.

  perform bdc_dynpro      using ‘SAPMPU19’ ‘2000’.


  perform bdc_field       using ‘BDC_CURSOR’


                                ‘SUB-TAXCP’.


  perform bdc_field       using ‘BDC_OKCODE’


                                ‘=PREF’.


  perform bdc_field       using ‘SUB-TAXCP’


                                P_TXCMP.”‘T108’.


  perform bdc_field       using ‘SUB-UDATE’


                                v_UDATE_dt.”’12/31/2014′.


  perform bdc_field       using ‘SUB-ASOFD’


                                v_asofd_dt.”’02/13/2015′.


  perform bdc_dynpro      using ‘SAPMPU19’ ‘3000’.


  perform bdc_field       using ‘BDC_CURSOR’


                                ‘UP_DEFA_FRCL’.


  perform bdc_field       using ‘BDC_OKCODE’


                                ‘=DCON’.


  perform bdc_field       using ‘UP_DEFA_FRCL’


                                P_TAXREP.”‘Q200’.


  perform bdc_field       using ‘UP_TREE_OPEN’


                                ‘X’.


  perform bdc_field       using ‘QCHK1’


                                ‘X’.


  perform bdc_field       using ‘QCHK2’


                                ‘X’.


  perform bdc_field       using ‘QRAD2’


                                ‘X’.


  perform bdc_field       using ‘QCHK3’


                                ‘X’.

  perform bdc_field       using ‘QCHK4’


                                ‘X’.


  perform bdc_dynpro      using ‘SAPMPU19’ ‘2000’.


  perform bdc_field       using ‘BDC_OKCODE’


                                ‘/EBACK’.


  perform bdc_field       using ‘BDC_CURSOR’


                                ‘SUB-TAXCP’.


  perform bdc_transaction using ‘PU19’.

  perform close_group.

ENDFORM.        

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Great Blog Mona. Keep up the good work...