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

Former Member
0 Likes
684

hi everyone ,

how can ı select only specific data in parameters ?

for example

parameters : p_carrid type sflight-carrid,

p_connid type spfi-connid.

ı wanna get only p_carrid 's connid. thnks

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
610

Or you might want to try a listbox. Enter "AA" and hit enter, the listbox for CONNID will be fill with values.



report zrich_0002 .

type-pools: vrm.

data: ivrm_values type vrm_values.
data: xvrm_values like line of ivrm_values.

parameters: p_carrid type spfli-carrid,
            p_connid type spfli-connid
                as listbox visible length 10.

at selection-screen output.


  data: name type vrm_id.


  name = 'P_CONNID'.

  data: ispfli type table of spfli with header line.

  select * into table ispfli from spfli
             where carrid = p_carrid.
  loop at ispfli.
    xvrm_values-key  = ispfli-connid.
    xvrm_values-text = ispfli-connid.
    append xvrm_values to ivrm_values.
  endloop.


  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = ivrm_values.

Regards,

Rich HEilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
610

Do you mean, that you want to only provide the CONNIDs for the CARRID in the F4 help of the CONNID field? If so, check this program, enter "AA" in CARRID field and do F4 help on the CONNID.



report zrich_0002 .

parameters: p_carrid type spfli-carrid,
            p_connid type spfli-connid.

at selection-screen on value-request for p_connid.


  data: begin of help_item occurs 0,
          carrid type spfli-carrid,
          connid type spfli-connid,
        end of help_item.

  data: dynfields type table of dynpread with header line.


  dynfields-fieldname = 'P_CARRID'.
  append dynfields.

  call function 'DYNP_VALUES_READ'
       exporting
            dyname               = sy-cprog
            dynumb               = sy-dynnr
            translate_to_upper   = 'X'
       tables
            dynpfields           = dynfields
       exceptions
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            invalid_parameter    = 7
            undefind_error       = 8
            double_conversion    = 9
            stepl_not_found      = 10
            others               = 11.


  read table dynfields with key fieldname = 'P_CARRID'.

  p_carrid = dynfields-fieldvalue.


  select carrid connid into table help_item
                  from spfli
                       where carrid = p_carrid.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'CONNID'
            dynprofield = 'P_CONNID'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = help_item.

Regards,

RIch HEilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
611

Or you might want to try a listbox. Enter "AA" and hit enter, the listbox for CONNID will be fill with values.



report zrich_0002 .

type-pools: vrm.

data: ivrm_values type vrm_values.
data: xvrm_values like line of ivrm_values.

parameters: p_carrid type spfli-carrid,
            p_connid type spfli-connid
                as listbox visible length 10.

at selection-screen output.


  data: name type vrm_id.


  name = 'P_CONNID'.

  data: ispfli type table of spfli with header line.

  select * into table ispfli from spfli
             where carrid = p_carrid.
  loop at ispfli.
    xvrm_values-key  = ispfli-connid.
    xvrm_values-text = ispfli-connid.
    append xvrm_values to ivrm_values.
  endloop.


  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = ivrm_values.

Regards,

Rich HEilman