Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
monalisa_biswal
Contributor
0 Kudos

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.

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.

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.

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.

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.        

1 Comment
Labels in this area