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

Getting the week bucket using current date -sy-datum

Former Member
0 Likes
2,069

Hello SAP Gurus

Here i got one requirement ,in this i have to calculate OPEN PO Qty based on date(EKPO-AEDAT)

bt the thing is i have to place the quantity (open PO) in the respective week bucket.

see lay out contains

week1 week2 week 3....................up to Week 13.

1.how could i get the the sequence of the weeks by having SY-DATUM as input.

2.How could i place the open PO qty in respevtive week bucket.

similarly i am having OPEN SO,STOCK....firlds

plz help me regarding as it of high priority

points wil be rewarded for usfull answer

thanks and regards

Chakravarthy

Hello SAP Gurus

Here i got one requirement ,in this i have to calculate OPEN PO Qty based on date(EKPO-AEDAT)

bt the thing is i have to place the quantity (open PO) in the respective week bucket.

see lay out contains

week1 week2 week 3....................up to Week 13.

1.how could i get the the sequence of the weeks by having SY-DATUM as input.

2.How could i place the open PO qty in respevtive week bucket.

similarly i am having OPEN SO,STOCK....firlds

plz help me regarding as it of high priority

points wil be rewarded for usfull answer

thanks and regards

Chakravarthy

5 REPLIES 5
Read only

Former Member
0 Likes
1,269

Use FM HRIQ_DATE_GET_WEEK to get the number of a week given the date.

Regards,

John.

Read only

Former Member
0 Likes
1,269

See the FM : TSTR_PERIODS_AMERICAN_WEEKS,TSTR_PERIODS_WEEKS

Read only

0 Likes
1,269

Hi,

For Current week, you can use the function moduel RSVAREXIT_0P_CWEEK in your customer exit and for No of Weeks in a quarter, i hope you can use the function module UMC_FISCPER_TO_CALWEEK which will give your number of weeks for fiscal year.

Assign points if it is helpful

Thanks

Sridhar.

Read only

Azeemquadri
Contributor
0 Likes
1,269

Have columns for each week.

if your week is 7days then first week will be sy-datum + 7.

second week will be first week + 7 and so on .

Get open PO qty for all the weeks from the DB table.

read the PO qty and increment the count by 1 in first week by comparing dates.

repeat for all weeks.

Read only

Former Member
0 Likes
1,269

Hi,

Use this FM GET_WEEK_INFO_BASED_ON_DATE to find the week number in 2008 and this weeks( considering today's date as input date) monday and sunday as the output. Use Monday to Sunday date range for 1 week.

u can further use this FM to find all the weeks. say teh current week as week1 . for this week1use the output of the dates to find the Open PO s and put it in 1 internal table.repeat this to find for diff weeks.

regards,

madhu