‎2008 Nov 27 7:18 AM
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?
‎2008 Nov 27 7:21 AM
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
‎2008 Nov 27 7:33 AM
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.
‎2008 Nov 27 8:52 AM
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