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

How to make Parameter input field with condition

Former Member
0 Likes
2,353

Hi Experts,

I have a parameter input field

parameters: p_saknr like skb1-saknr obligatory.

Now i want to give the condition it will accept if skb1-mitkz = 'D'. That time only it will accept the input selection. Otherwise i need a error message.

Plz help this issue.

Mohana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,732

Hi,

Try it like this:

At selection-screen on  p_saknr.

   select single  saknr 
      from skb1
      into  w_skb1
   where  saknr  = p_saknr 
      and mitkz  = 'D'.

  check sy-subrc NE 0.
     message 'error....'.

With luck,

Pritam.

Hi Experts,

I have a parameter input field

parameters: p_saknr like skb1-saknr obligatory.

Now i want to give the condition it will accept if skb1-mitkz = 'D'. That time only it will accept the input selection. Otherwise i need a error message.

Plz help this issue.

Mohana

10 REPLIES 10
Read only

Former Member
0 Likes
1,732

hiii

you can use it like below code

AT SELECTION-SCREEN OUTPUT
if skb1-mitkz NE 'D'

 LOOP AT SCREEN.
       IF screen-name CS 'P_NUM'.
        screen-input = 0.
        MESSAGE e398
      WITH 'ENTER CORRECT VALUE..'.
        MODIFY SCREEN.
          ENDIF.
ENDLOOP. 
 
 ELSE.
       perform accepted_value_result.

ENDIF..

regards

twinkal

Read only

Former Member
0 Likes
1,732

hi,

In the initialzation event check this condition

if condition is false the raise error message else allow to display screen.

bcoz the initialization event triggers before the screen display.

othrwise you also use the PBO event

i.e AT SELECTION SCREEN OUTPUT.

here check condition

if it is false then raise error message

else all the screen to enter user input

hope this will help you

Regards

Jagadeesh

Edited by: Jagadeesh on Aug 4, 2008 1:27 PM

Read only

Former Member
0 Likes
1,732

hi,

use at selection-screen on p_saknr.

and write the conditon...

Read only

Former Member
0 Likes
1,732

Mohana,

put check for message in initialzation event or at-selection screen on field.

am not sure about at selection-screen output.

Amit.

Read only

Former Member
0 Likes
1,732

HI,

at selection-screen.

select single * from skb1

into skb1

where mitkz = 'D'..

if sy-subrc ne 0.

message 'Enter valid num' typ 'E'.

endif.

Points if correct.

Read only

Former Member
0 Likes
1,732

Hi,

First disable the p_sankr.

if skb1-mitkz = 'D'.

LOOP AT SCREEN.

IF screen-name = 'p_saknr'.

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

else.

message w888(sabapdocu) with 'Check your input'.

endif.

Regards,

Harish

Read only

Former Member
0 Likes
1,732

parameters: p_saknr like skb1-saknr obligatory.

AT SELECTION-SCREEN on p_saknr.

if p_saknr NE 'D'.

message 'Entser valid input' type 'E'.

endif.

Thanks & Regards,

Rajani MV.

Read only

narin_nandivada3
Active Contributor
0 Likes
1,732

Hi Vijayan,

Please check this snippet..


    AT SELECTION-SCREEN ON P_SAKNR.
          IF skb1-mitkz NE 'D'. 
                MESSAGE 'Error message' TYPE 'E'.
          ELSE.
             Continue. " specify the code to be performed
          ENDIF.

Hope this would help you.

Good luck

Narin

Read only

Former Member
0 Likes
1,732

See it is working code code:

parameters: p_saknr like skb1-saknr obligatory.
AT SELECTION-SCREEN.
if p_saknr ne 'D'.
message.
  endif.

Amit.

Read only

Former Member
0 Likes
1,733

Hi,

Try it like this:

At selection-screen on  p_saknr.

   select single  saknr 
      from skb1
      into  w_skb1
   where  saknr  = p_saknr 
      and mitkz  = 'D'.

  check sy-subrc NE 0.
     message 'error....'.

With luck,

Pritam.