Tuesday, April 15, 2014

Get maximum number of data sets for selection from user-specific configuration

When selecting data from db into internal tables it is often wise to work with an upper limit, like in SE16.

This upper limit can be configured per user: Goto SE16, Settings--> User's Parameters


parameter p_mxsel type tbmaxsel obligatory default '1000'.

initialization.
  select single tbmaxsel 

    from rseumod into p_mxsel 
    where uname sy-uname.

[...]

  select [...]
    up to iv_tbmaxsel rows
    where [...] .

1 comment:

  1. SELECT ...
    UP TO @l_mxsel ROWS
    ...
    " check number of selected lines and show message
    DATA(l_lines) = lines( mt_list ).
    IF l_lines > p_mxsel.
    MESSAGE s016(es) WITH p_mxsel.
    ELSE.
    MESSAGE s007(rj) WITH l_lines.
    ENDIF.

    ReplyDelete

SAP ABAP: Determine Timezone for Plant

    DATA:       lt_tzone TYPE STANDARD TABLE OF tznzone WITH DEFAULT KEY,       l_tzone  TYPE tznzone.     " get time zone for plant   ...