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

Problem in Defaulting variable to a parameter

Former Member
0 Likes
834

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 7

months = 0

signum = '+'

years = 0

importing

calc_date = wa_dates.

I want to default wa_dates to a parameter

like

PARAMETERS p_diff like sy-datum default wa_dates.

7 REPLIES 7
Read only

Former Member
0 Likes
800

u have to make use of Event INITIALIZATION

DATA SBOOK_WA TYPE SBOOK. 
SELECT-OPTIONS FL_DATE FOR SBOOK_WA-FLDATE. 

INITIALIZATION. 

  MOVE: 'I'      TO FL_DATE-SIGN, 
        'EQ'     TO FL_DATE-OPTION, 
        SY-DATUM TO FL_DATE-LOW. 
  APPEND FL_DATE. 

  MOVE: 'BT'       TO FL_DATE-OPTION, 
        '19960101' TO FL_DATE-LOW, 
        '19960630' TO FL_DATE-HIGH. 
  APPEND FL_DATE.

or

data: wa_dates like sy-datum.

PARAMETERS p_diff like sy-datum default wa_dates.

INITIALIZATION.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 7

months = 0

signum = '+'

years = 0

importing

calc_date = wa_dates.

p_diff = wa_dates.

Read only

Former Member
0 Likes
800

Hi Asha

Have you tried in Initialization Event???

Kind Regards

Eswar

Read only

Former Member
0 Likes
800

hai ,

just put ur code in intialization and equate it to the parameter value ur work will be done

Regards,

Sree

Read only

Former Member
0 Likes
800

USE THIS CODE -

PARAMETERS: P_DATES LIKE SY-DATUM.

DATA: WA_DATES LIKE SY-DATUM.

INITIALIZATION.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 7

months = 0

signum = '+'

years = 0

importing

calc_date = wa_dates.

P_DATES = WA_DATES.

REWARD POINT IF SOLVES UR PROBLEM

Read only

Former Member
0 Likes
800

execute the code.

report zex1.
PARAMETERS : p_diff like sy-datum ."default wa_dates.
data : wa_dates like sy-datum.
initialization.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 7
months = 0
signum = '+'
years = 0
importing
calc_date = wa_dates.

p_diff = wa_dates.

regards,

vijay

Read only

Former Member
0 Likes
800

Asha,

u can try the following code.

data : wa_dates type P0001-BEGDA.

PARAMETERS p_diff like sy-datum.

initialization.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 7

months = 0

signum = '+'

years = 0

importing

calc_date = wa_dates.

p_diff = wa_dates.

reward points if this code helps u.

Sujatha.

Read only

0 Likes
800

Hey guys problem is solved thanks for your valuable replies