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

select-options

Former Member
0 Likes
1,300

Dear Experts,

While outputting select-options data, it is displaying data as

IBT2008070120080901

How to supress data and i want to display data as

Purchasing Date: 01.07.2008 - 01.09.2008.

Please provide ur suggestion to solve this issue.

Regards,

Bharat.

13 REPLIES 13
Read only

Former Member
0 Likes
1,276

try this

SELECT-OPTIONS: date FOR sy-datum.

write : 'Purchasing order', date-low, ' - ' , date-high.

Edited by: abap on Feb 5, 2009 8:35 AM

Read only

former_member386202
Active Contributor
0 Likes
1,276

Hi,

Loop on selection table and display the low n high value with write statement .

Regards,

Prashant

Read only

Former Member
0 Likes
1,276

IBT2008070120080901------>

sign = I

option = bt

low = 20080701

high = 20080901

so ur table ,

itab-sign will give i

itab-option will give bt

itab-low = 20080701

itab-high = 20080901

check on date format

Read only

Subhankar
Active Contributor
0 Likes
1,276

Hi ..

Please check the sample code

data: v_date TYPE ERSDA,

v_datelow TYPE char10,

v_datehigh TYPE char10.

SELECT-OPTIONS: s_date FOR v_date.

write: s_date-low to v_datelow mm/dd/yyyy.

write: s_date-high to v_datehigh mm/dd/yyyy.

WRITE: / v_datelow, '-', v_datehigh.

Read only

faisalatsap
Active Contributor
0 Likes
1,276

Hi,

Test the following code hope will solve out you problem,

SELECT-OPTIONS sodate FOR sy-datum.

DATA: test(50).

WRITE: 'Purchasing Order', sodate-low, '-', sodate-high to test.

WRITE: test.

Kind Regards,

Faisal

Read only

MarcinPciak
Active Contributor
0 Likes
1,276

Hi,

You are printing out entire line. As select options simply creates a table with 4 fields with such structure


selection-options date for sy-datum.

"date now has such structure
data begin of date occurs 0,
         sign,
         option,
         low,
         high,
       end of date.

What you do is displaying entrie row of that table.

Do as abap said. Just display particular fields, low (for storing lowest range) and high for storing higest one. sing and options are of no interests here, as long as option = 'BT' (between) is set, you are interested only in date between these two in low and high.

Regards

Marcin

Read only

Former Member
0 Likes
1,276

hi bro...

you can try out following snippet.

data:

w_date1 like sy-datum,

w_date2 like sy-datum.

loop at s_opt.

w_date1 = s_opt-low.

w_date2 = s_opt-high.

write: 'purchase date:' , w_date1,'-',w_date2.

endloop.

regards

Read only

Former Member
0 Likes
1,276

Hi

SELECT-OPTIONS p_date for SY-DATUM.

loop at p_date.

write: / , 'Purchasing Date:' , p_date-low, '-' , p_date-high.

endloop.

Hope this helps

Regards,

Jayanthi.K

Read only

Former Member
0 Likes
1,276

Hi,

select-options :

s_temp for ....

while displaying give s_temp-low - s_temp-high

Read only

faisalatsap
Active Contributor
0 Likes
1,276

Hi,

If you have multiple Dates in Select-Option Than test the following Code hope will help you.

SELECT-OPTIONS sodate FOR sy-datum.
DATA: test(50).
LOOP AT sodate WHERE sign = 'I'. " Use this Condition for only the Included Values.
  IF sodate-high = '00000000'. " Use this Condition when user enter only one Date,
    WRITE: / 'Purchasing Order Date : ', sodate-low TO test.
  ELSE.
    WRITE: / 'Purchasing Order Date : ', sodate-low, '-', sodate-high TO test.
  ENDIF.
  WRITE: test.
  CLEAR: test.
ENDLOOP.

Kind Regards,

Faisal

Read only

Former Member
0 Likes
1,276

Hi ,

You can try the following code---

SELECT-OPTIONS : s_date FOR sy-datum .

AT SELECTION-SCREEN OUTPUT .

s_date-option = 'BT' .

s_date-sign = 'I'.

s_date-low = '20080701'.

s_date-high = '20080901'.

APPEND s_date.

Regards

Pinaki Mukherjee

Read only

Former Member
0 Likes
1,276

Thanks,

My problem got solved

Read only

Former Member
0 Likes
1,276

Hi,

Try this,

'IBT20008070120080901'

Here sign is I

option is BT

low and high values are 20080701 and 20080901

SELECT-OPTIONS :

s_date for sy-datum .

AT SELECTION-SCREEN OUTPUT .

s_date-sign = 'I'.

s_date-option = 'BT' .

s_date-low = '20080701'.

s_date-high = '20080901'.

APPEND s_date.