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

Date conversion

Former Member
0 Likes
639

dear all,

i have a field coming in from R/3 which is KMONTH datatype NUMC(6) and i want to map it to 0FISCPER datatype NUMC(7)

my data format is 200802 (YEAR/MONTH) and i want to convert it to e.g. 2008002 or 2008011 (YEAR/MONTH)

how can this be done? thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
597

Check this sample

REPORT  Y_TEST.

data: year6(6) type n,
        year7(7) type n.


        year6 = '200802'.

        year7+0(4) = year6+0(4).
        year7+5(2) = year6+4(2).
        write year7.

4 REPLIES 4
Read only

Former Member
0 Likes
597

Hi,

Check this code..

data: v_input(6) value '200802'.
data: v_output(7).
data: v_numc(3) type n.

* Put leading zero.
v_numc = v_input+4(2).

* Concatenate the output.
concatenate v_input(4) v_numc into v_output.

write: / v_output.

Thanks

Naren

Read only

former_member190578
Participant
0 Likes
597

Try this....


Move: KMONTH(4)   to OFISCPER(4),
      KMONTH+4(2) to OFISCPER+5(2). 

Edited by: Jürgen Hartwig on Jul 22, 2008 10:36 PM

Read only

0 Likes
597

i wish i can assign problem solve for everyone. thanks. it did help!

Read only

Former Member
0 Likes
598

Check this sample

REPORT  Y_TEST.

data: year6(6) type n,
        year7(7) type n.


        year6 = '200802'.

        year7+0(4) = year6+0(4).
        year7+5(2) = year6+4(2).
        write year7.