Calling SAP Menu Areas From Program

se43
Share on Facebook0Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

Sometime we need to call the SAP Menu Area as per some business requirement especially from CRM Web UI screen. SAP Menu Area are SAP provided Easy Access to different business area. For example transaction VA00 is Menu Area for Sales, VL00 is SAP Easy Access for Shipping. Similarly, VT00 is for Transportation, VS is for Sales Master Data, so on and so forth.

[adToAppearHere]

Examples of Menu Area:

Menu Area for VA00 is shown below. The whole Sales Cycle details are there in this Menu Area.

SAP Menu Area for VL00

Calling these Menu Areas directly from our program is bit tricky. One can wrongly assume that they can do a direct Call Transaction to these T Codes. But we cannot do the Call Transaction directly to these transactions.

Two ways to call the SAP Menu Area from our program:

1) Use Function Module ‘BMENU_START_BROWSER’.

2) Call Transaction ‘SE43’ and give your Menu Area.

You can use any of the above two methods to call your Custom Menu Areas as well, in addition to the standard SAP Menu Areas.

Code Snippet

Method 1: Using Function Module ‘BMENU_START_BROWSER’:

CALL FUNCTION ‘BMENU_START_BROWSER’
EXPORTING
mode = ‘D’
tree_id =
‘VA00’ “Any Menu Area
hide_inconsistent_nodes =
‘X’
EXCEPTIONS
tree_does_not_exist =
1
no_authority =
2
OTHERS = 3.

Method 2: Call Transaction ‘SE43’ and give the required Menu Area:

DATA: i_bdcdata TYPE STANDARD TABLE OF bdcdata,
k_bdcdata
TYPE bdcdata,
k_opt
TYPE ctu_params. “CTU Params

* Populate the screen and field details
PERFORM bdc_dynpro USING ‘SAPLBMEN’ ‘0200’.
PERFORM bdc_field USING ‘BDC_CURSOR’
‘BMENUNAME-ID’.
PERFORM bdc_field USING ‘BDC_OKCODE’
‘=SHOW’.
PERFORM bdc_field USING ‘BMENUNAME-ID’
‘VA00’.

* BDC mode
k_opt-defsize =
‘X’.
k_opt-dismode =
‘E’.
k_opt-updmode =
‘N’.

* Call Transaction SE43
CALL TRANSACTION ‘SE43’ USING i_bdcdata OPTIONS FROM k_opt.

*&———————————————————————*

*& Form bdc_dynpro
*&———————————————————————*
* Get the screen details
*———————————————————————-*
* –>PROGRAM Program Name
* –>DYNPRO Screen No
*———————————————————————-*
FORM bdc_dynpro USING program TYPE any
dynpro TYPE any.
CLEAR k_bdcdata.
k_bdcdata-
program = program.
k_bdcdata-
dynpro = dynpro.
k_bdcdata-dynbegin =
‘X’.
APPEND k_bdcdata TO i_bdcdata.

ENDFORM. ” BDC_DYNPRO

*&———————————————————————*
*& Form bdc_field
*&———————————————————————*
* Populate the field name and value
*———————————————————————-*
* –>FNAM Field Name
* –>FVAL Field Value
*———————————————————————-*
FORM bdc_field USING fnam TYPE any
fval
TYPE any.
CLEAR k_bdcdata.
k_bdcdata-fnam = fnam.
k_bdcdata-fval = fval.
APPEND k_bdcdata TO i_bdcdata.

ENDFORM. ” BDC_FIELD

If you want to get such practical issues and resolutions straight to your inbox, please SUBSCRIBE. We respect your privacy and take protecting it seriously.

If you liked this post, please hit the share button at the left side of your screen.

Thank you very much for your time!!
Image source : www.123rf.com

Share on Facebook0Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

About the Author

SAP Yard
SAP Yard
SAPYard is one stop page for all Technical Folks in SAP. You would find un-conventional explanations, tutorials, and tricks. Please like our Facebook Page and also join our LinkedIn Group.

Be the first to comment on "Calling SAP Menu Areas From Program"

Please help us improve. Please Shout Often & Loud!!