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 statement

Former Member
0 Likes
669

Hi,

I am doing one report. In selection screen i have given the company code , month, year.My requirement is based on the month & year it should display the sales document number generated in that month & year. That means it should generate whole month sales document numbers (ie. starting from 1st to 30 or 31st). Can anyone help me for this. I dont know how to write code for this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
649

HI,

Use this FM 'PERIOD_DAY_DETERMINE' and pass fiscal year, month and period then it will return first day in month and last day in month. Using these both you can find the sales orders.

Rgds,

Bujji

5 REPLIES 5
Read only

Former Member
0 Likes
650

HI,

Use this FM 'PERIOD_DAY_DETERMINE' and pass fiscal year, month and period then it will return first day in month and last day in month. Using these both you can find the sales orders.

Rgds,

Bujji

Read only

0 Likes
649

WHAT WILL PASS IN PERIOD.

Read only

Former Member
0 Likes
649

Hi,

u cannot use it directly in select statement.

check the condition in select...endselect like below.


tables:vbak.
PARAMETERS:mon1(2),year1(4),mon2(2),year2(4).

select * from vbak.
  IF vbak-erdat+4(2) > mon1 and vbak-erdat+4(2) < mon2 and
            vbak-erdat(4) > year1 and vbak-erdat(4) < year2.
"your code    
  ENDIF.
ENDSELECT.

rgds,

bharat.

Read only

Former Member
0 Likes
649

hi use this code:

if u have ccode, month and year field than use this quiry:

select * from vbak into table itab where erdat4(2) eq month and erdat0(4) eq year.

      • if you r giving date as parameter then first u have to get month and year. like this.

month = date+4(2).

year = date+0(2).

now use same query.

reward if useful.

Read only

Former Member
0 Likes
649

Hi Hima ,

can u send me the default date setting u have.

i.e how your date is stored either in ddmmyyy or mmddyy.

or yyyyddmm.

i will send coding if you can send me the details.

Pls reward points if found helpful.

Thanks and regards,

Rajeshwar.