‎2009 Sep 18 11:04 AM
Dear Experts,
Pls go through the fillowing code snippet
PARAMETERS : p_swerk TYPE iloa-swerk,
p_ingpr TYPE afih-ingpr,
p_auart TYPE aufk-auart.
Can I dynamically set the attributes of p_ingpr. I mean Is there any way to make p_ingpr obligatory If user enter 3000 (as per my requirement) in p_swerk.
Regards
Maverick
‎2009 Sep 18 11:05 AM
For this you can use the AT SELECTION-SCREEN event.
AT SELECTION-SCREEN on p_ingri.
if p_werks = '3000' and p_ingri is initial.
Message 'Error'.
endif.
‎2009 Sep 18 11:05 AM
For this you can use the AT SELECTION-SCREEN event.
AT SELECTION-SCREEN on p_ingri.
if p_werks = '3000' and p_ingri is initial.
Message 'Error'.
endif.
‎2009 Sep 18 11:08 AM
Hi,
Please validate in AT SELECTION-SCREEN event so that you can get required output.
Thank U,
Jay....
‎2009 Sep 18 11:11 AM
‎2009 Sep 18 11:22 AM
Hi
use this code to get the values provided by user in selection screen.
at selection-screen on p_ingpr.
refresh dynpvaluetab.
clear dynpvaluetab.
dynpvaluetab-fieldname = 'P_IND'.
get cursor line dynpvaluetab-stepl.
append dynpvaluetab.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-repid "dynpname
dynumb = sy-dynnr "dynpnumb
tables
dynpfields = dynpvaluetab
exceptions
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
others = 01.Then u can easily check the value of required parameter and give the appropriate message.
hope u will get the solution.
Cheers,
Sourabh.
‎2009 Sep 18 11:32 AM
saurabh,
this can be easily done at at selection-screen event itself.
no need to call any FM for this.
parameters: p1 type char10,
p2 type char10.
at selection-screen.
if p1 is not initial and p2 is initial.
message 'Error' type 'E'.
endif.
‎2009 Sep 18 11:45 AM
Hi
yeah it can be handled thrugh At Selection-Screen also in this case.
and tat code is helpful if we don't know tat value '3000' and we have to check that through some table or some where else.
or say if in future hardcoding is to be removed.