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

Re: date declaration format

Former Member
0 Likes
678

Hi Expert,

I have to convert the date format from yyyyymmdd to ddmmyyyyy for that i have written the below code

  data: ersda1 like mara-ersda.
*********** bof date conversion


  move wa_output-ersda to ersda1.
 
  year_frm = ersda1-low+0(4).
  month_frm = ersda1-low+4(2).
  day_frm = ersda1-low+6(2).

concatenate day_frm '.' month_frm '.' year_frm into date_from.


 
i have written the code above but it is giving error like 'THE DATA OBJECT 'ERDAT1' HAS NO STRUCTURE AND THEREFORE NO COMPONENT CALLED LOW.

Any one can suggest me on this

Regards,

Addu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
610

Hi ,

Try this

year_frm = ersda1+0(4).

  month_frm = ersda1+4(2).

  day_frm = ersda1+6(2).

thanks,

Namrata

3 REPLIES 3
Read only

Former Member
0 Likes
611

Hi ,

Try this

year_frm = ersda1+0(4).

  month_frm = ersda1+4(2).

  day_frm = ersda1+6(2).

thanks,

Namrata

Read only

RaymondGiuseppi
Active Contributor
0 Likes
610

Your code is copied from a code designed to work with a SELECT-OPTIONS or a RANGE TYPE. Either use it as it should or remove the -low, or -high, subfields.

Regards,

Raymond

Read only

former_member195270
Active Participant
0 Likes
610

Hi try this,

data: ersda1 like mara-ersda.
*********** bof date conversion


  move wa_output-ersda to ersda1.
 
  year_frm = ersda1+0(4).
  month_frm = ersda1+4(2).
  day_frm = ersda1+6(2).

concatenate day_frm '.' month_frm '.' year_frm into date_from.