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: 

regarding dates and lenth calculation of a variable

Former Member
0 Kudos

how to check length of a variable .

and another requirement is

i have 2 fields in output.

date and no. of days

for ex.

cosider date as oct 10 and no. of days as 10

i need to generate records b/w oct 1st to oct 10th

Is there any FM for getting oct 1st if we give input as oct 1st and 10 days.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

For checking length of a variable u can use

STRLEN.

e.g

lv_var = strlen(lv_var11).

6 REPLIES 6

Former Member
0 Kudos

HI,

For checking length of a variable u can use

STRLEN.

e.g

lv_var = strlen(lv_var11).

Former Member
0 Kudos

Hi,

your write code,

data2 = date1 - no. of days.

Regards,

Dhanunaya Reddy

former_member188685
Active Contributor
0 Kudos

what records you want..?

if you want some dynamic table creation then it is possible to create the table based on the input number of days.

Former Member
0 Kudos

forget about records.

input:

data : 11 th jan (dynamic)

no. of days : 10 (dynamic)

output :

1st jan (required o/p)

is there any FM which suits above conditions.

Edited by: srinivasa reddy mallidi on Oct 10, 2008 7:03 AM

0 Kudos

Hi,

Try this Function module

HR_JP_MONTH_BEGIN_END_DATE

Regards.

Eshwar.

0 Kudos

Hi ,

Try the Fm DATE_IN_FUTURE, it is useful to calculate future as well as past dates when used like below;

data : lv_days type i,
     lv_date type RM06B-EEIND,
     lv_result(10),
     lv_result1 type sy-datum.
lv_days = -10.
lv_date = '10102008'.

CALL FUNCTION 'DATE_IN_FUTURE'
  EXPORTING
    anzahl_tage                   = lv_days
    import_datum                  = lv_date
 IMPORTING
   EXPORT_DATUM_EXT_FORMAT       = lv_result "output in external format DD.MM.YYYY
   EXPORT_DATUM_INT_FORMAT       = lv_result1. " in system format YYYYMMDD

Regards

Karthik D