Application Development 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: 

Parameter problem

Former Member
0 Kudos

I have below parameters defined in report.

******Entry for code*******

Select-options :

s_bukrs for bseg-bukrs memory id buk obligatory.

***Entry for biz area*******

parameters:

p_gjahr like bkpf-gjahr obligatory.

selection-screen skip 1.

select-options:

s_hkont for bseg-hkont

s_gsber for bseg-gsber

*******Entry for display this code in screen*******

parameters :

v_bukrs like t001-bukrs obligatory.

at selection-screen on v_bukrs.

if not v_bukrs in s_bukrs.

message e106.

endif.

Problem here is, User cant select multiple value

at s_bukrs parameter before entering v_bukrs value.

STATUS INFO says we have to first input mandatory fields.

this is uncomfortable for us. how to avoid this.

ambichan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ambi,

you could define obligatory parameters as non-obligatory (that is, remove the "obligatory" clause), and then check them out at the "at selection-screen" or "start-of-selection" events. That is:


start-of-selection.
  if v_bukrs is initial.
    message e037(68).   "for instance
  endif.

Please let me know if it helped. BR,

Alvaro

4 REPLIES 4

Former Member
0 Kudos

Hi ambi,

you could define obligatory parameters as non-obligatory (that is, remove the "obligatory" clause), and then check them out at the "at selection-screen" or "start-of-selection" events. That is:


start-of-selection.
  if v_bukrs is initial.
    message e037(68).   "for instance
  endif.

Please let me know if it helped. BR,

Alvaro

0 Kudos

hey thanks for your reply.

I understood, one more thing is.

I want to check this "V_burks condition" only when i push execute button at background .

Ie. when i click execute button at background it should display me this error.

where should i write this condition.and how.

at selection-screen on v_bukrs.

if not v_bukrs in s_bukrs.

message e106.

endif.

ambichan

0 Kudos

Hi ambi,

first of all, you should declare


tables: sscrfields.

Then you can write:


at selection-screen.
  if sscrfields-ucomm = 'SJOB'.
*   (your check here)
  endif.

I hope it helps. BR,

Alvaro

0 Kudos

Hello Ambichan,

The code given by Alvaro would work, provided the user hits the F9 button / Execute in Background button on the selection-screen.

When you say that the condition has to be checked only in the background, then the above condition does not always get checked. For example, if the user goes to the initial screen of SE38 and follows the menu path Program>Execute>Background, then the condition will never get checked.

So if you think that is a possibility, then I would advise that you rather use the following condition.

tables sscrfields.

at selection-screen.
  if sy-batch = 'X' or sscrfields-ucomm = 'SJOB'.
    message e106.
  endif.

Regards,

Anand Mandalika.

at selection-screen.