Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using SAP Memory to Pass Screen Variable

Former Member
0 Likes
544

I have created a subscreen. Now I want to pass the screen variable value (field name = ZTAMM_T_0002-ZPROMO_MATNR, field parameter ID = ZPM) from the screen to the BADI method using SAP memory. I did the following:

At the screen PAI:

module set_parameter_id input.

DATA: lv_para TYPE ZTAMM_T_0002-ZPROMO_MATNR.

lv_para = ZTAMM_T_0002-ZPROMO_MATNR.

SET PARAMETER ID 'ZPM' FIELD lv_para.

endmodule.

At BADI implementation method:

method IF_EX_BADI_MATERIAL_OD~MATERIAL_PREPARE_POSTING_OD.

BREAK MYID.

DATA: lv_pvalue TYPE ztamm_t_0002-zpromo_matnr.

GET PARAMETER ID 'ZPM' FIELD lv_pvalue.

endmethod.

With the above, when I debug, I realised ZTAMM_T_0002-ZPROMO_MATNR doesn't contain value. What should be the right way to pass in the value I entered through screen to lv_para?

3 REPLIES 3
Read only

Former Member
0 Likes
495

Hi,

Please check the screen field name and program variable name ( preferrably in TOP include) is same.

if they are same the value transfer takes place automatically.

regards

Ramchander rao.K

Read only

0 Likes
495

My screen field name is ZTAMM_T_0002-ZPROMO_MATNR and my declaration at TOP also ZTAMM_T_0002-ZPROMO_MATNR. Is my coding as posted correct? I still can't figure out why the value is empty.

Read only

0 Likes
495

I just fixed it. The problem was caused by me forgetting to check the GET & SET parameter at Screen Painter. Anyway, thanks for your earlier reply.

Edited by: big mug on Nov 27, 2008 9:53 AM