You want to run a BDC programme to update your material master for selected views. Now every master depending on its creation has got different views maintained, and you want to select only two views i.e. PURCHASING and MRP 1 every time for each material code. If you go statically by giving the index for the views selection screen, then the selection of the views go wrong every time there is a change in the total maintained views for a material.
For example:
Check field MARA-VPSTA. Updated with a character for a specific view.
Think it is like this: 
           'A'.                  " Work scheduling
           'B'.                  " Accounting
           'C'.                  " Classification
           'D'.                  " MRP 1 / 2 / 3 / 4
           'E'.                  " Purchasing/Foreign trade import
           'F'.                  " Production resources / tools
           'G'.                  " Costing
           'K'.                  " Basic Data
           'L'.                  " Plant data - Storage 1 / 2
           'P'.                  " Forecasting
           'Q'.                  " Quality Management
           'S'.                  " Warehouse Management
           'V'.                  " Sales
           'X'.                  " Plant stocks
           'Z'.                  " Storage location stocks
Answer: 
Many Abaper have this problem.  When you record your BDC transaction select the basic data view only.  Then navigate to the views you want using the tabs.  (don't select and use enter).  You will get values like "SP06".  These will take you directly to the screen. 


Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com