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

Currency Drop Down List Subset

Former Member
0 Likes
1,063

In my program, how can I have my currency drop down window only show 'US' and 'CAD'?  I have not learned smart forms yet.

I have queried on this unsuccessfully thus far.  I finally came up with an idea but have not been able to figure out how to do it.

My thought is to have my parameter call a temp table that pulls a select statement e.g.

SELECT * from tcurc

INTO CORRESPONDING FIELDS OF TABLE ztcurc

WHERE waers in ('CAD, 'USD').

Then my parameter is something like:

PARAMETERS:  p_curr LIKE ztcurc-waers DEFAULT 'USD' OBLIGATORY.

Now when the user clicks the drop down only USD and CAD are options.

The problem I run into is that I haven't been able to get this result set into my parameter in time and my result shows all tcurc-waers.

After doing some debugging, I think that I need my temp table ztcurc in existence sometime before PAI finishes but not sure.

I am new to programming(1 year) and newer to ABAP.(3 months).  I am running version 4.6C

I don't want to create a permanent table so I am thinking I may be able to add another file like in C++ a .cpp file can have a .h file

associated with it in the project.

This is my first question and I think I have followed procedure correctly. Be gentle .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
816

Hi Doug,

You can set the values for your dropdown list using the function module 'VRM_SET_VALUES'.

For that you have to declare the type-pool 'VRM'.

Try the code given below.

TYPE-POOLS : vrm.
DATA: param  TYPE vrm_id,
      values TYPE vrm_values,
      value  LIKE LINE OF values.

PARAMETERS: p_curr(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.
  param = 'p_curr'.
  value-key = '1'.
  value-text = 'USD'.
  APPEND value TO values.
  value-key = '2'.
  value-text = 'CAD'.
  APPEND value TO values.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = param
      values = values.

Dont be afraid of being a beginner. Everyone started like that only. Even i'm one .

Regards,

Akhil

In my program, how can I have my currency drop down window only show 'US' and 'CAD'?  I have not learned smart forms yet.

I have queried on this unsuccessfully thus far.  I finally came up with an idea but have not been able to figure out how to do it.

My thought is to have my parameter call a temp table that pulls a select statement e.g.

SELECT * from tcurc

INTO CORRESPONDING FIELDS OF TABLE ztcurc

WHERE waers in ('CAD, 'USD').

Then my parameter is something like:

PARAMETERS:  p_curr LIKE ztcurc-waers DEFAULT 'USD' OBLIGATORY.

Now when the user clicks the drop down only USD and CAD are options.

The problem I run into is that I haven't been able to get this result set into my parameter in time and my result shows all tcurc-waers.

After doing some debugging, I think that I need my temp table ztcurc in existence sometime before PAI finishes but not sure.

I am new to programming(1 year) and newer to ABAP.(3 months).  I am running version 4.6C

I don't want to create a permanent table so I am thinking I may be able to add another file like in C++ a .cpp file can have a .h file

associated with it in the project.

This is my first question and I think I have followed procedure correctly. Be gentle .

3 REPLIES 3
Read only

Former Member
0 Likes
817

Hi Doug,

You can set the values for your dropdown list using the function module 'VRM_SET_VALUES'.

For that you have to declare the type-pool 'VRM'.

Try the code given below.

TYPE-POOLS : vrm.
DATA: param  TYPE vrm_id,
      values TYPE vrm_values,
      value  LIKE LINE OF values.

PARAMETERS: p_curr(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.
  param = 'p_curr'.
  value-key = '1'.
  value-text = 'USD'.
  APPEND value TO values.
  value-key = '2'.
  value-text = 'CAD'.
  APPEND value TO values.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = param
      values = values.

Dont be afraid of being a beginner. Everyone started like that only. Even i'm one .

Regards,

Akhil

Read only

0 Likes
816

Hi Doug,

If you are doing this in module pool,

then instead of the event 'AT SELECTION-SCREEN OUTPUT', you can put the code after that under the event 'PROCESS_BEFORE_OUTPUT'.

Hope it helps.

Regards,

Akhil

Read only

0 Likes
816

Hi Akhil,

Thank you very much for your help with this.  I was able to get this to work.

Best regards,

Doug