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

Parameters Properties

Former Member
0 Likes
737

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
695

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.

6 REPLIES 6
Read only

Former Member
0 Likes
696

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.

Read only

Former Member
0 Likes
695

Hi,

Please validate in AT SELECTION-SCREEN event so that you can get required output.

Thank U,

Jay....

Read only

Former Member
0 Likes
695

Please SEARCH in SCN before posting

Read only

Former Member
0 Likes
695

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.

Read only

0 Likes
695

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.

Read only

0 Likes
695

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.