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

move data from select option to internal table

Former Member
0 Likes
1,388

Hello Experts,

In my selection screen, i have select-option for year-month.i have to move the name of all the selected month in the internal table.for eg. select-options: 200911 to 201002.

Internal table should be filled with Nov, Dec,Jan,Feb

do we hav any table or FM available for the same.

Hello Experts,

In my selection screen, i have select-option for year-month.i have to move the name of all the selected month in the internal table.for eg. select-options: 200911 to 201002.

Internal table should be filled with Nov, Dec,Jan,Feb

do we hav any table or FM available for the same.

6 REPLIES 6
Read only

Sandra_Rossi
Active Contributor
0 Likes
996

If you are just looking for the FM which returns month names, it has been already answered in the forum.

If it's just "is there a FM to do all that", very probably not, and I think you'll code it faster with a little loop than looking for a FM.

Read only

Former Member
0 Likes
996

Hi Suman,

Try this,


        loop at select options table.
            l_month = select option table-date+4(2). 
     *******the following select fetches the month name.       
            select ktx 
               from T247
               into l_month_name
              where mnr = l_month
                 and spras = 'EN'.

           internaltable-field = l_month_name.
  
        endloop.

The above code snippet fulfills ur requirement.

Regards,

Vimal

Read only

Clemenss
Active Contributor
0 Likes
996

Hi Choudhary Suman,

as sandra said: No FM for your specific requirement.

Note that with SELECT-OPTIONS inclusion, exclusion, EQ, NE, BT, GT, GE, LT, LE mus be considered. Better check all months against the range.

The logic should be implemented as

DO 12 times.
  CHECK sy-index IN month selection range.
    convert sy-index to month name.
    append month name to your table.
ENDDO.

Please Post your select-options statement to verify if it can be done that way.

Regards,

Clemens

Read only

Former Member
0 Likes
996

Hello All

The issue is resoled.

In my selection screen, whenver i have different years in select-option_low and select-option_high. I

For eg. if i have select-options: 200911 to 201002.

i break it into 200911 to 200912 and 201001 to 201002 and move it to internal table.And nw i fetch the months from table T247.

Thanks

Suman

Read only

Former Member
0 Likes
996

Hello All

The issue is resoled.

In my selection screen, whenver i have different years in select-option_low and select-option_high. I

For eg. if i have select-options: 200911 to 201002.

i break it into 200911 to 200912 and 201001 to 201002 and move it to internal table.And nw i fetch the months from table T247.

Thanks

Suman

Read only

Former Member
0 Likes
996

use the bellow function module-

"HR_99S_INTERVAL_BETWEEN_DATES" AND INCREMENT MONTH AND YEAR BY 1.YOU WILL GET THE REQUIRED OUTPUT