Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Application Class

Hi Experts,

I have one application class and two controller class.

1. First I give input to first controller class. My input is Purchase order number.

2. In first contoller based on input PO number i did the select querry and the data's are displayed in Table view. Its working fine.

3. Now my requirement is I need to get the PO number from first contoller to second controller via Application class.

4. For Example,

a) I pass 3000000014 to First Contoller and then Application class

b) In application class consist of PO number value as 3000000014.

<b>c) Through application class How can I get PO number for Second controller class?</b>

Thanks in advance,

Points will be rewarded.

Former Member
Former Member replied


Normally you can reference your application instance from each controller. However, you'll need to cast it to the correct Z class and use methods to store / retrieve data. Also make sure that your application is stateful.

Suppose your application class is ZCL_CRM_BSP_TEST with a global attribute gv_po_number.

Example in controller1:

data: lr_application type ref to zcl_crm_bsp_test.

lr_application ?= application.

lr_application->gv_po_number = '100020'.

Example in controller2:

data: lr_application type ref to zcl_crm_bsp_test.

lr_application ?= application.

lv_po_number = lr_application->gv_po_number.

"here you have your number!

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question