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

How to get Multiple Values for a single Variable in BPS.......

Former Member
0 Likes
551

Hi Gurus:

I have a layout for planning, where I can plan for 5 days of the week. I also have a day column (yesterday) where I have the actual values. Users want to edit/foecast the next 5 days values. I am using a Variable to get the Date column which uses the System Date. However, since I am getting just one date in the Function Module (Code given below), the remaining days are greyed out and I can not enter the forecast values. I would like the same variable to get a series of dates in the same function module. What changes do I nee dto make in the ABAP code so that the remaining columns (Date) becaoe available for editing??

The FM code I have to get "Today's Date" is as follows:

FUNCTION ZCSHFL_GET_TODAY.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_AREA) TYPE UPC_VAR-AREA

*" REFERENCE(I_VARIABLE) TYPE UPC_Y_VARIABLE

*" REFERENCE(I_CHANM) TYPE UPC_Y_CHANM

*" REFERENCE(ITO_CHANM) TYPE UPC_YTO_CHA

*" EXPORTING

*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL

*"----


data: ls_charsel type upc_ys_charsel.

ls_charsel-seqno = 1.

ls_charsel-sign = 'I'.

ls_charsel-opt = 'EQ'.

ls_charsel-CHANM = I_chanm.

ls_charsel-low = sy-datum.

insert ls_Charsel into table eto_charsel.

ENDFUNCTION.

I want to get the Yestarday's Date as weel as dates for next 4 days from Today for this variable which are being used in the layout. Can anyone suggest the code tor this please.

Thanks very much in advance......

Best.... ShruMaa

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
494

Hi,

What I understand you need to return those dates from function module using parameter ETO_CHARSEL , right? If so just use this code:


ls_charsel-seqno = 1.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'BT'.  "we are giving ranges, so days between...
ls_charsel-CHANM = I_chanm.
ls_charsel-low = sy-datum - 1.  "...first day is yesterday
ls_charsel-high = sy-datum + 4. "...and last day is 4 days from today
insert ls_Charsel into table eto_charsel.

This way you provide 5 days starting from yesterday till 4 days from today.

Regards

Marcin

2 REPLIES 2
Read only

MarcinPciak
Active Contributor
0 Likes
495

Hi,

What I understand you need to return those dates from function module using parameter ETO_CHARSEL , right? If so just use this code:


ls_charsel-seqno = 1.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'BT'.  "we are giving ranges, so days between...
ls_charsel-CHANM = I_chanm.
ls_charsel-low = sy-datum - 1.  "...first day is yesterday
ls_charsel-high = sy-datum + 4. "...and last day is 4 days from today
insert ls_Charsel into table eto_charsel.

This way you provide 5 days starting from yesterday till 4 days from today.

Regards

Marcin

Read only

0 Likes
494

Unfortunately it did not work....! It does not bring the date format at all.

I tested the FM entering the Planning Area, Variable, and the Charateristic 0CALDAY and it returns just 1 value but it is not in any date format. The existing code does bring 'Today's date'

Any further suggestions please.....?