Application Development 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: 

Problem in Defaulting variable to a parameter

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Asha

Have you tried in Initialization Event???

Kind Regards

Eswar

Former Member
0 Kudos

hai ,

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

Regards,

Sree

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

Hey guys problem is solved thanks for your valuable replies